
    #HJj                    ~    d Z ddlmZ ddlmZmZmZmZmZm	Z	 ddl
mZ erddlmZ dgZ ede      Z G d	 d      Zy
)a  Serializer plugin interface.

The RDF serialization plugins used during
[RDFlib's common serialization of a graph][rdflib.graph.Graph.serialize]
is described in this module.

TODO: info for how to write a serializer that can plugin to rdflib.
See also [`rdflib.plugin`][rdflib.plugin]

All builtin RDF Serializer are listed
under [`rdflib.plugins.serializers`][rdflib.plugins.serializers].
    )annotations)IOTYPE_CHECKINGAnyOptionalTypeVarUnion)URIRef)Graph
Serializer_StrT)boundc                  @    e Zd ZdZddZ	 	 d	 	 	 	 	 	 	 	 	 ddZd	dZy)
r   zBase class for RDF Serializer.

    New Serializer can be registered as plugin as described
    in [`rdflib.plugin`][rdflib.plugin].
    c                .    || _         d| _        d | _        y )Nzutf-8)storeencodingbase)selfr   s     [/Users/ahmed/devFolder/claude-voice/.venv/lib/python3.12/site-packages/rdflib/serializer.py__init__zSerializer.__init__$   s    !
$#'	    Nc                     y)a  Abstract method. Print [Graph][rdflib.graph.Graph].
        Used in [Graph.serialize][rdflib.graph.Graph.serialize]

        Serialize Graph

        Args:
            stream: The destination to serialize the graph to.
            base: The base IRI for formats that support it.
            encoding: Encoding of output.
            args: Additional arguments to pass to the Serializer that will be used.
        N )r   streamr   r   argss        r   	serializezSerializer.serialize)   s    r   c                |    | j                   }|-|j                  |      rt        |j                  |dd            }|S )N    )r   
startswithr
   replace)r   urir   s      r   
relativizezSerializer.relativize<   s8    yyt 4T2q12C
r   )r   r   )NN)
r   z	IO[bytes]r   Optional[str]r   r$   r   r   returnNone)r"   r   r%   zUnion[_StrT, URIRef])__name__
__module____qualname____doc__r   r   r#   r   r   r   r   r      sN    ( #"&	   	
  
&r   N)r*   
__future__r   typingr   r   r   r   r   r	   rdflib.termr
   rdflib.graphr   __all__strr   r   r   r   r   <module>r1      s=    # C C " .s#$ $r   