
    Pi                        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d
S )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                  0    e Zd ZdZddZ	 	 dddZddZdS )r   zBase class for RDF Serializer.

    New Serializer can be registered as plugin as described
    in [`rdflib.plugin`][rdflib.plugin].
    storer   c                0    || _         d| _        d | _        d S )Nzutf-8)r   encodingbase)selfr   s     e/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/rdflib/serializer.py__init__zSerializer.__init__$   s    !
$#'			    Nstream	IO[bytes]r   Optional[str]r   argsr   returnNonec                    dS )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   r   r   r   r   s        r   	serializezSerializer.serialize)   s      r   urir   Union[_StrT, URIRef]c                    | j         }|9|                    |          r$t          |                    |dd                    }|S )N    )r   
startswithr
   replace)r   r!   r   s      r   
relativizezSerializer.relativize<   sB    yt 4 4T2q1122C
r   )r   r   )NN)
r   r   r   r   r   r   r   r   r   r   )r!   r   r   r"   )__name__
__module____qualname____doc__r   r    r(   r   r   r   r   r      sg         ( ( ( ( #"&	    &     r   N)r,   
__future__r   typingr   r   r   r   r   r	   rdflib.termr
   rdflib.graphr   __all__strr   r   r   r   r   <module>r3      s     # " " " " " C C C C C C C C C C C C C C C C       #"""""" .s###$ $ $ $ $ $ $ $ $ $r   