o
    mi                     @  sp   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dZG d	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                   @  s4   e Zd ZdZdddZ		ddddZd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                 C  s   || _ d| _d | _d S )Nzutf-8)r   encodingbase)selfr    r   K/home/kim/smarthome/.venv/lib/python3.10/site-packages/rdflib/serializer.py__init__$   s   
zSerializer.__init__Nstream	IO[bytes]r   Optional[str]r   argsr   returnNonec                 K  s   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.
        Nr   )r   r   r   r   r   r   r   r   	serialize)   s    zSerializer.serializeurir   Union[_StrT, URIRef]c                 C  s.   | j }|d ur||rt||dd}|S )N    )r   
startswithr	   replace)r   r   r   r   r   r   
relativize<   s   zSerializer.relativize)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      s    
N)r&   
__future__r   typingr   r   r   r   r   r   Zrdflib.termr	   Zrdflib.graphr
   __all__strr   r   r   r   r   r   <module>   s     