
    4Ysh                     r    d dl mZmZ d dlZd dlmZmZ d dlmZ d dl	m
Z
 d dlmZ dgZ G d de
      Zd	 Zy)
    )IOOptionalN)ConjunctiveGraphGraph)Literal)
Serializer)_quoteLiteralNQuadsSerializerc                   P     e Zd Zdef fdZ	 	 ddee   dee   dee   fdZ	 xZ
S )r
   storec                 ^    |j                   st        d      t        t        |   |       |  y )Nz?NQuads serialization only makes sense for context-aware stores!)context_aware	Exceptionsuperr
   __init__)selfr   	__class__s     /var/www/sten-cake5-migrate2.hellocrow.space/lexinfo-master/env/lib/python3.12/site-packages/rdflib/plugins/serializers/nquads.pyr   zNQuadsSerializer.__init__   s1    ""T  	.u5    streambaseencodingc                    |t        j                  d       |C|j                         | j                  j                         k7  rt        j                  d|        | j                  }| j                  j                         D ]>  }|D ]7  }|j                  t        ||j                        j                  |d             9 @ |j                  dj                  d             y )Nz'NQuadsSerializer does not support base.zCNQuadsSerializer does not use custom encoding. Given encoding was: replace
zlatin-1)
warningswarnlowerr   r   contextswrite_nq_row
identifierencode)r   r   r   r   argscontexttriples          r   	serializezNQuadsSerializer.serialize   s     MMCDHNN$48K8K8M$MMM''/j2 ==zz**, 	G! FG$6$67>>xS	
 	T[[+,r   )NN)__name__
__module____qualname__r   r   r   bytesr   strr'   __classcell__)r   s   @r   r
   r
      sD    %e % #"&	-5	- sm- 3-	-r   c                 Z   t        | d   t              rJ| d   j                         d| d   j                         dt        | d         d|j                         dS | d   j                         d| d   j                         d| d   j                         d|j                         dS )N   r       z .
)
isinstancer   n3r	   )r&   r%   s     r   r!   r!   .   s    &)W%1ILLN1ILLN&)$JJL	
 	
 1ILLN1ILLN1ILLNJJL	
 	
r   )typingr   r   r   rdflib.graphr   r   rdflib.termr   rdflib.serializerr   rdflib.plugins.serializers.ntr	   __all__r
   r!    r   r   <module>r;      s1      0  ( 7
-z -B
r   