
    Pil                    &   d Z ddlmZ ddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZmZ ddlmZmZmZmZmZmZmZmZmZmZ ddlmZ ddlmZmZ ddlmZ ddl Z!dd	l!m"Z" dd
l#m$Z$ ddl%m&Z& ddl'm(Z( erddl)m*Z* ddlm+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 g dZ2 G d d          Z3 G d de          Z4 G d dej5                  Z5 G d de5          Z6 G d de5          Z7dde"z  iZ8 G d d e5          Z9 G d! d"e5          Z:	 	 	 	 	 	 d4d5d.Z;d6d3Z<dS )7a;  Parser plugin interface.

This module defines the parser plugin interface and contains other
related parser support code.

The module is mainly useful for those wanting to write a parser that
can plugin to rdflib. If you are wanting to invoke a parser you likely
want to do so through the Graph class parse method.
    )annotationsN)BufferedIOBaseBytesIO	RawIOBaseStringIO
TextIOBaseTextIOWrapper)
IOTYPE_CHECKINGAnyBinaryIOListOptionalTextIOTupleUnioncast)urljoin)Requesturl2pathname)	xmlreader)__version__)_urlopen)	Namespace)URIRef)Message)BufferedReader)
addinfourl)Buffer)Graph)ParserInputSourceStringInputSourceURLInputSourceFileInputSourcePythonInputSourcec                       e Zd ZdZd Zdd	Zd
S )r!    c                    d S Nr(   selfs    a/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/rdflib/parser.py__init__zParser.__init__?           sourcer"   sinkr    returnNonec                    d S r*   r(   )r,   r1   r2   s      r-   parsezParser.parseB   r/   r0   N)r1   r"   r2   r    r3   r4   )__name__
__module____qualname__	__slots__r.   r6   r(   r0   r-   r!   r!   <   s<        I       r0   r!   c                       e Zd ZdZd)d* fdZd Zd Zd Zed+d            Z	ed,d            Z
d,dZd,dZd-d.dZd,dZd/dZd Zd Zd0d1dZd0d1dZd0d1dZd2d Zd2d!Zd3d4d%Zd& Zd/d'Zd( Z xZS )5BytesIOWrapper)wrappedenc_strtext_strencodingencoder	has_read1has_seek_name_fileno_isatty	_leftover_bytes_per_char_text_bytes_offsetutf-8r=    Union[str, StringIO, TextIOBase]c                   t          t          |                                            || _        || _        t          j        | j                  | _        d | _        d | _	        d | _
        d | _        d | _        d | _        d | _        d| _        d| _        |                                                    dd          }|dv r	d| _        d S |dv r	d| _        d S |                    d          s|                    d	          r	d
| _        d S |                    d          s|                    d          r	d| _        d S d
| _        d S )Nr0   r   _-)rJ   utf8u8cp65001   )latin1zlatin-1z
iso-8859-1z	iso8859-1asciizus-asciizutf-16utf16   zutf-32utf32   )superr<   r.   r=   r@   codecs
getencoderrA   r>   r?   rB   rC   rD   rE   rF   rG   rI   lowerreplacerH   
startswith)r,   r=   r@   norm_encoding	__class__s       r-   r.   zBytesIOWrapper.__init__W   s^   nd##,,... (77AE?C)-(,$(
<@=A #'( ((00c::>>>()D    
 
 
 $%D   %%h// 	%=3K3KG3T3T 	%#$D   %%h// 	%=3K3KG3T3T 	%#$D    $%D   r0   c                   d }t          | j        t                    r4|                     | j                  \  }}t	          |          | _        d}nt          | j        t                    rK| j        j        }t          |t                    rt          d          t          t          |          | _        n-t          | j        t          t          f          r| j        | _        | j        | j        }n| j        | j        }nt          d          |	 |j        }n# t           $ r d}Y nw xY wt#          |d          | _        	 |                                | _        n%# t           $ r t#          |d          | _        Y nw xY w|| _        d S )NstringzYBytesIOWrapper cannot be wrapped in TextIOWrapper, then wrapped in another BytesIOWrapperzNo stream to read fromstreamread1seek)
isinstancer=   strrA   r   r>   r	   bufferr<   	Exceptionr   r   r   r   r?   nameAttributeErrorhasattrrB   seekablerC   rD   )r,   rj   bbleninner
use_streams         r-   _initzBytesIOWrapper._init}   s   "dlC(( 	)ll4<00GAt"1::DLDDm44 
	)L'E%00 ;=  
  $NE::z8&<== 	) LDM<#JJ]&JJ4555< !!        W55	8&//11DMM 	8 	8 	8#J77DMMM	8 


s$   D D*)D*E E?>E?c                   | j         | j        |                                  | j         | j         }n| j        | j        }	 |                                | _        d S # t
          $ r}|| _        Y d }~d S d }~wt          $ r d| _        Y d S w xY wN)r>   r?   rr   filenorE   OSErrorrk   r,   rq   es      r-   _check_filenozBytesIOWrapper._check_fileno   s    <DM$9JJLLL<#JJ]&J	%,,..DLLL 	 	 	DLLLLLLL 	 	 	DLLLL	   A 
B&A33B
Bc                   | j         | j        |                                  | j         | j         }n| j        | j        }	 |                                | _        d S # t
          $ r}|| _        Y d }~d S d }~wt          $ r d| _        Y d S w xY wNF)r>   r?   rr   isattyrF   rw   rk   rx   s      r-   _check_isattyzBytesIOWrapper._check_isatty   s    <DM$9JJLLL<#JJ]&J	!%,,..DLLL 	 	 	DLLLLLLL 	! 	! 	! DLLLL	!r{   r3   r   c                F    | j         |                                  | j         S r*   )rD   rr   r+   s    r-   rj   zBytesIOWrapper.name   s    :JJLLLzr0   boolc                    | j         	| j        dS d }| j          	 | j         j        }n9# t          $ r d }Y n+w xY w| j         	 | j        j        }n# t          $ r d }Y nw xY w|dn|S r}   )r>   r?   closedrk   )r,   r   s     r-   r   zBytesIOWrapper.closed   s    <DM$95!%<#,!   ]&-!   uuF2s   ( 77A AAc                    dS )NTr(   r+   s    r-   readablezBytesIOWrapper.readable   s    tr0   c                    dS r}   r(   r+   s    r-   writablezBytesIOWrapper.writable   s    ur0   NsizeOptional[int]intc                     t          d          )Nz!Cannot truncate on BytesIOWrapperNotImplementedErrorr,   r   s     r-   truncatezBytesIOWrapper.truncate   s    !"EFFFr0   c                    | j         |                                  t          | j         t                    r| j         t	          | j                   S r*   )rF   r   rf   BaseExceptionr   r+   s    r-   r~   zBytesIOWrapper.isatty   sH    <   dlM22 	&,%%%r0   c                    | j         |                                  t          | j         t                    r| j         | j         dn| j         S rt   )rE   rz   rf   r   r+   s    r-   rv   zBytesIOWrapper.fileno   sL    <   dlM22 	@,-224<?r0   c                    | j         	| j        d S | j         -	 | j                                          d S # t          $ r Y d S w xY w| j        -	 | j                                         d S # t          $ r Y d S w xY wd S r*   )r>   r?   closerk   r+   s    r-   r   zBytesIOWrapper.close   s    <DM$9F<#""$$$$$!   ]&##%%%%%!    '&s!   4 
AAA( (
A65A6c                    d S r*   r(   r+   s    r-   flushzBytesIOWrapper.flush   s    r0   ru   bytesc                  t           r	| j        J ||dk     rc	 | j                                        }n# t          $ r d}Y nw xY w|                     |          \  }}| j        r| j        |z   }d| _        n]|}nY|t          | j                  k    r| j        }d| _        n1|t          | j                  k     r$| j        d |         }| j        |d          | _        nt          || j                  \  }}t          |          |dk    rdndz   }| j        }	t          |	          |k     rr	 | j                            |          }
n# t          $ r d}
Y nw xY wt          |
          dk     rn0|                     |
          \  }}|	|z  }	t          |	          |k     rt          |	          |k    r
d| _        |	}n|	d |         }|	|d          | _        ~	| xj
        t          |          z  c_
        |S )Nr    r0   rR   )r   r?   readEOFErrorrA   rG   lendivmodrH   r   rI   )r,   r   ret_strret_encodedenc_len	ret_bytesdmget_per_loop	got_bytesgot_strs              r-   _read_bytes_from_text_streamz+BytesIOWrapper._read_bytes_from_text_stream  s0    	-=,,,<4!88#}1133   #'<<#8#8 K~ ( N[8	!$'		S((((I DNNC''''uu-I!^DEE2DNN$ 455DAqq66!a%%QQQ7L#~Ii..4''!#'=#5#5l#C#CGG ! ! ! GGG!w<<!##'+||G'<'<$W[(	 i..4'' 9~~%%!$%		%ete,	!*455!13y>>1s!   4 AA-E EEc                   ||dk    rdS | j         | j        |                                  | j         | j                             |          }n|                     |          }|S )z
        Read at most size bytes, returned as a bytes object.

        If the size argument is negative or omitted read until EOF is reached.
        Return an empty bytes object if already at EOF.
        Nr   r0   )r>   r?   rr   r   r   )r,   r   r   s      r-   r   zBytesIOWrapper.read,  sk     		3<DM$9JJLLL<#))$//II99$??Ir0   c                   | j         | j        | j        |                                  | j        st	                      | j         ;||dk     r| j                                         S | j                             |          S t	          d          )u   
        Read at most size bytes, with at most one call to the underlying raw stream’s
        read() or readinto() method. Returned as a bytes object.

        If the size argument is negative or omitted, read until EOF is reached.
        Return an empty bytes object at EOF.
        Nr   z2read1() not supported for TextIO in BytesIOWrapper)r>   r?   rB   rr   r   rd   r   s     r-   rd   zBytesIOWrapper.read1=  s     L T]%:t~?UJJLLL~ 	(%'''<#|taxx|))+++<%%d+++!"VWWWr0   rn   r   c                  t           rt          |t          t          f          sJ t	          |          dk    rdS | j        | j        |                                  | j        | j                            |          S t	          |          }| 	                    |          }t	          |          }|dk    rdS ||d|<   |S )z
        Read len(b) bytes into buffer b.

        Returns number of bytes read (0 for EOF), or error if the object
        is set not to block and has no data to read.
        r   N)
r   rf   
memoryview	bytearrayr   r>   r?   rr   readintor   )r,   rn   r   	read_dataread_lens        r-   r   zBytesIOWrapper.readintoO  s      	:a*i!899999q66Q;;1<DM$9JJLLL<#<((+++q66D#@@FFI9~~H1}}q$AixiLOr0   c               (   t           rt          |t          t          f          sJ | j        | j        | j        |                                  | j        st                      | j        | j        	                    |          S t          d          )a  
        Read len(b) bytes into buffer b, with at most one call to the underlying raw
        stream's read() or readinto() method.

        Returns number of bytes read (0 for EOF), or error if the object
        is set not to block and has no data to read.
        Nz6readinto1() not supported for TextIO in BytesIOWrapper)
r   rf   r   r   r>   r?   rB   rr   r   	readinto1r,   rn   s     r-   r   zBytesIOWrapper.readinto1g  s      	:a*i!899999L T]%:t~?UJJLLL~ 	(%'''<#<))!,,,!D
 
 	
r0   r   offsetwhencec                  | j         | j         st                      | j        | j        | j         |                                  |dk    st          d          |dk    rt          d          | j        | j                            ||           n"| j        | j                            ||           d| _        d| _        dS )Nr   z,Only SEEK_SET is supported on BytesIOWrapperz3Only seeking to zero is supported on BytesIOWrapperr0   )rC   r   r>   r?   rr   re   rI   rG   )r,   r   r   s      r-   re   zBytesIOWrapper.seek{  s    =$T]$%'''L T]%:t}?TJJLLL{{%&TUUUQ;;%E   <#Lff----]&Mvv..."#qr0   c                b    | j         | j        | j        |                                  | j        S r*   )r>   r?   rC   rr   r+   s    r-   rm   zBytesIOWrapper.seekable  s-    L T]%:t}?TJJLLL}r0   c                    | j         | j         st          d          | j        0	 | j                                        | _        n# t
          $ r Y nw xY w| j        S )Nz/Cannot tell() pos because file is not seekable.)rC   r   r>   tellrI   rk   r+   s    r-   r   zBytesIOWrapper.tell  so    =$T]$%&WXXX<#*.,*;*;*=*=''!   &&s   A 
AAc                    t          d          )Nz Cannot write to a BytesIOWrapperr   r   s     r-   writezBytesIOWrapper.write  s    !"DEEEr0   )rJ   )r=   rK   )r3   r   )r3   r   r*   )r   r   r3   r   )r3   r   )ru   )r   r   r3   r   )rn   r   r3   r   )r   )r   r   r   r   r3   r   )r7   r8   r9   r:   r.   rr   rz   r   propertyrj   r   r   r   r   r~   rv   r   r   r   r   rd   r   r   re   rm   r   r   __classcell__r`   s   @r-   r<   r<   F   s       I $% $% $% $% $% $% $%L# # #J  ! ! !    X
 3 3 3 X3       G G G G G& & & &@ @ @ @    ) ) ) ) )V    "X X X X X$   0
 
 
 
(    (  
' ' ' 'F F F F F F Fr0   r<   c                  $    e Zd ZdZd	d
dZddZdS )r"   z
    TODO:
    N	system_idOptional[str]c                d    t           j                            | |           d | _        d| _        d S )Nr   F)r   r"   r.   content_type
auto_closer,   r   s     r-   r.   zInputSource.__init__  s1    &&ty&AAA+/r0   r3   r4   c                >   |                                  }|r6t          |d          r&	 |                                 n# t          $ r Y nw xY w|                                 }|r8t          |d          r*	 |                                 d S # t          $ r Y d S w xY wd S d S )Nr   )getCharacterStreamrl   r   ri   getByteStream)r,   cfs      r-   r   zInputSource.close  s    ##%% 	G$$ 					      	G$$ 						   	 	 	 	s!   = 
A
	A
4B
 

BBr*   )r   r   r3   r4   )r7   r8   r9   __doc__r.   r   r(   r0   r-   r"   r"     sK                  
     r0   r"   c                  D    e Zd ZdZdddZdd	ZddZddZddZddZ	dS )r&   a  
    Constructs an RDFLib Parser InputSource from a Python data structure,
    for example, loaded from JSON with json.load or json.loads:

    >>> import json
    >>> as_string = """{
    ...   "@context" : {"ex" : "http://example.com/ns#"},
    ...   "@graph": [{"@type": "ex:item", "@id": "#example"}]
    ... }"""
    >>> as_python = json.loads(as_string)
    >>> source = create_input_source(data=as_python)
    >>> isinstance(source, PythonInputSource)
    True
    Ndatar   r   r   c                L    d | _         d| _        d | _        || _        || _        d S r}   )r   r   	public_idr   r   )r,   r   r   s      r-   r.   zPythonInputSource.__init__  s*     (,(1			r0   r3   c                    | j         S r*   r   r+   s    r-   getPublicIdzPythonInputSource.getPublicId  
    ~r0   r   r4   c                    || _         d S r*   r   )r,   r   s     r-   setPublicIdzPythonInputSource.setPublicId      "r0   c                    | j         S r*   r   r+   s    r-   getSystemIdzPythonInputSource.getSystemId  r   r0   c                    || _         d S r*   r   r   s     r-   setSystemIdzPythonInputSource.setSystemId  r   r0   c                    d | _         d S r*   )r   r+   s    r-   r   zPythonInputSource.close  s    			r0   r*   )r   r   r   r   )r3   r   )r   r   r3   r4   )r   r   r3   r4   r   )
r7   r8   r9   r   r.   r   r   r   r   r   r(   r0   r-   r&   r&     s                # # # #   # # # #     r0   r&   c                  *     e Zd ZdZ	 	 dd fd
Z xZS )r#   zO
    Constructs an RDFLib Parser InputSource from a Python String or Bytes
    rJ   NvalueUnion[str, bytes]r@   rg   r   r   c                   t          t          |                               |           t          |t                    r`t          |          }|                     |           |                     |           t          ||          }| 	                    |           d S t          |          }| 	                    |           t          ||          }|                     |           |                     |j                   d S r*   )rY   r#   r.   rf   rg   r   setCharacterStreamsetEncodingr<   setByteStreamr   r	   r@   )r,   r   r@   r   rc   b_streamc_streamr`   s          r-   r.   zStringInputSource.__init__  s     	&&//	:::eS!! 	0e__F##F+++X&&&%eX66Hx(((((U^^Fv&&&$VX66H##H---X./////r0   )rJ   N)r   r   r@   rg   r   r   )r7   r8   r9   r   r.   r   r   s   @r-   r#   r#     sT           #'	0 0 0 0 0 0 0 0 0 0 0r0   r#   z
User-agentz8rdflib-%s (https://rdflib.github.io/; eikeon@eikeon.com)c                  t     e Zd ZU dZded<   edd            Zedd
            ZdddZdd fdZ	ddZ
 xZS )r$   zU
    Constructs an RDFLib Parser InputSource from a URL to read it from the Web.
    	List[str]linksmessager   r3   c                l                                     fd|                                D             S )Nc                J    g | ]\  }}|                                 k    | S r(   )r\   ).0keyvalrj   s      r-   
<listcomp>z8URLInputSource.getallmatchingheaders.<locals>.<listcomp>  s/    KKKSsyy{{d7J7J7J7J7Jr0   )r\   items)clsr   rj   s     `r-   getallmatchingheadersz$URLInputSource.getallmatchingheaders
  s4     zz||KKKKGMMOOKKKKr0   responser   c                    |                      |j        d          }g }|D ];}d |                    d          D             }|D ]}|                    |           <|S )NLinkc                6    g | ]}|                                 S r(   strip)r   linkstrs     r-   r   z,URLInputSource.get_links.<locals>.<listcomp>  s     IIIW]]__IIIr0   ,)r   headerssplitappend)r   r   
linkslinesretarray	linksliner   links          r-   	get_linkszURLInputSource.get_links  s{    ..x/?HH
 # 	& 	&IIIIOOC4H4HIIIE & &%%%%&r0   Ntype_r   c                D   |rd| dnd }d}g }| j         D ]}d |                    d          D             }||vr&|r3||v r.|                    |d                             d                     [|                    |d                             d                     |S )Nztype=""zrel="alternate"c                6    g | ]}|                                 S r(   r   )r   ps     r-   r   z1URLInputSource.get_alternates.<locals>.<listcomp>   s     8881QWWYY888r0   ;r   z<>)r   r   r   r   )r,   r  typestrrelstraltsr  partss          r-   get_alternateszURLInputSource.get_alternates  s    6;!E!2%!2!2!2!2"J 	2 	2D88

3888EU"" 2e##KKat 4 4555E!HNN4001111r0   r   formatc                   t          t          |                               |           || _        t	          t
                    }|dk    rd|d<   n|dk    rd|d<   n|dv rd|d<   n|dk    rd	|d<   n||d
k    rd|d<   np|dk    rd|d<   nd|dk    rd|d<   nXddlm} ddlm	} g } ||          D ]%}d|j
        v r|                    |j
                   &d                    |          |d<   t          |d |          }t          |          }	|	                                | _        |                     |	          | _        |dv rx|                     d          }
|
D ]_}t'          | j        |          }|| j        k    r=||k    r7t          t          |                    }	|	                                | _         n`|                     | j                   |                     |	j        d          }|r|d         nd | _        | j        &| j                            dd          d         | _        |                     |	           |	                                | _        d S )Nxmlzapplication/rdf+xml, */*;q=0.1Acceptn3ztext/n3, */*;q=0.1)turtlettlz,text/turtle, application/x-turtle, */*;q=0.1ntztext/plain, */*;q=0.1trigzapplication/trig, */*;q=0.1trixzapplication/trix, */*;q=0.1json-ldz6application/ld+json, application/json;q=0.9, */*;q=0.1r   )r!   )plugins)kind/z, )r  application/ld+jsonr  )r  zcontent-typer  rR   )rY   r$   r.   urldictr   rdflib.parserr!   rdflib.pluginr  rj   r   joinr   r   geturlr  r   r  r   r   r   r   r   r   inforesponse_info)r,   r   r  	myheadersr!   r  accr  reqr   r  r  	full_linkcontent_typesr`   s                 r-   r.   zURLInputSource.__init__*  s   nd##,,Y777 MM	U??"BIht^^"6Ih((("PIht^^"9Ihv"?Ihv"?Ihy  H h -,,,,,------CW&))) ' '!&==JJqv&&&"&))C..Ihiy11'}}??$$^^H--
777&&-B&CCD  #DHd33	((Y)-C-C'	(:(:;;H'00DHE"""2283C^TT0=GM!,,4( $ 1 7 7Q ? ? BD8$$$%]]__r0   rg   c                    | j         S r*   )r  r+   s    r-   __repr__zURLInputSource.__repr__d  s	    xr0   )r   r   r3   r   )r   r   r3   r   r*   )r  r   r3   r   )NN)r   r   r  r   r3   rg   )r7   r8   r9   r   __annotations__classmethodr   r  r  r.   r+  r   r   s   @r-   r$   r$     s           L L L [L    [    8- 8- 8- 8- 8- 8- 8-t       r0   r$   c                  ,     e Zd Z	 d
d fdZdd	Z xZS )r%   Nr@   r   file>Union[BinaryIO, TextIO, TextIOBase, RawIOBase, BufferedIOBase]c                  t           j                                                                        }t	          t          j        |j                                                                                  |          }t          t          |           	                    |           || _
        t          |t                    r|                     |           |                     |j                   	 |j        }|                     |           d S # t$          t&          f$ r- |                     t)          ||j                             Y d S w xY wt*          rt          |t,                    sJ |                     |           |;|                     |           |                     t/          ||                     d S d S )Nbase)r@   )pathlibPathcwdas_urir   rj   absoluterY   r%   r.   r0  rf   r   r   r   r@   rh   r   rk   LookupErrorr<   r   r   r	   )r,   r0  r@   r4  r   rn   r`   s         r-   r.   zFileInputSource.__init__j  s    |!!((**7<	22;;==DDFFTRRR	ot$$--i888	dJ'' 	##D)))T]+++QK""1%%%%%"K0 Q Q Q"">$#O#O#OPPPPPPQ  8!$77777t$$$#  ***''dX(N(N(NOOOOO s   2D :EEr3   rg   c                *    t          | j                  S r*   )reprr0  r+   s    r-   r+  zFileInputSource.__repr__  s    DIr0   r*   )r@   r   r0  r1  r,  )r7   r8   r9   r.   r+  r   r   s   @r-   r%   r%   i  s[        
 #'	      <       r0   r%   r1   MOptional[Union[IO[bytes], TextIO, InputSource, str, bytes, pathlib.PurePath]]publicIDr   locationr0  !Optional[Union[BinaryIO, TextIO]]r   !Optional[Union[str, bytes, dict]]r  r3   c           	        t          t          d | |||g                    }t          |          dk    rt          d          d}| t          r|J |J |J t          | t                    r| }nt          | t                    r| }nt          | t          j	                  rt          |           }n_t          | t                    r| }nFt          | d          rt          | t                    s| }t                      }t          | d          ry|                    |            |                    | j                   	 | j        }	|                    |	           nA# t$          t&          f$ r |                    |            Y nw xY w|                    |           |t(          j        u r|                    d           nNt          |d          r|                    |j                   n#t1          d	t3          |           d
| d          d}
d}|+t          r|J |J | J t5          ||||          \  }
}}}|"t          r|J |J | J t7          |          }|t          r|J |J | J t          |t8                    rt;          |          }d}nSt          |t          t          t<          f          rt?          |          }d}ntA          dt3          |                     |t1          d          |xj!        |z  c_!        ||"                    |           n+|#                                |"                    |
pd           |S )zR
    Return an appropriate InputSource instance for the given
    parameters.
    c                
    | d uS r*   r(   )vs    r-   <lambda>z%create_input_source.<locals>.<lambda>  s
    atm r0   rR   z;exactly one of source, location, file or data must be givenNr   r@   zfile:///dev/stdinrj   zUnexpected type 'z' for source ''F)r0  r  input_sourcer?  Tz(parse data can only str, or bytes. not: zcould not create InputSourcer   )$listfilterr   
ValueErrorr   rf   r"   rg   r5  PurePathr   rl   r   r   r   r@   rh   r   rk   r:  sysstdinr   rj   ri   type"_create_input_source_from_locationr%   r  r&   r   r#   RuntimeErrorr   r   r   )r1   r>  r?  r0  r   r  non_empty_argumentsrG  r   rn   absolute_locationr   s               r-   create_input_sourcerS    s     ##XtT*	
 	
  1$$I
 
 	
 L 	$<<<<<<###fk** 	!LL&#&& !FG$455 v;;FE** (( FI1N1N *}}6:.. 	2 33F;;; ,,V_===;"M$2215555*K8 ; ; ;$226:::::; !..q111	>> ,,-@AAAAQ'' 5 ,,QV444i>B6llllFFFS   J 	"<<<<<<>>> /%	
 
 
	
  	"###<<<>>>&t,, 	"###<<<>>>dD!! 	X,T22LJJsE9566 	X,T22LJJV$t**VVWWW6777:-$$X....%%''/$$%6%<"===s   	E& &&FFrG  Optional[InputSource]rg   MTuple[URIRef, bool, Optional[Union[BinaryIO, TextIO]], Optional[InputSource]]c                .   t           j                            |          r8t          j        |                                                                          }t          j                                                                        }t          t          j
                            |          |          }|                    d          r4t          |                    dd                    }t          |d          } nt!          ||          }d}||| |fS )Nr3  zfile:///r  rbT)ospathexistsr5  r6  r9  r8  r7  r   rdflibutil_iri2urir^   r   r]   openr$   )r0  r  rG  r?  r4  rR  filenamer   s           r-   rO  rO    s     
w~~h ><))2244;;==<$$&&Dv{33H==DIII##J// A 1 9 9*c J JKKHd##%&7@@J j$<<r0   )NNNNNN)r1   r=  r>  r   r?  r   r0  r@  r   rA  r  r   r3   r"   )
r0  r@  r  r   rG  rT  r?  rg   r3   rU  )=r   
__future__r   rZ   rX  r5  rL  ior   r   r   r   r   r	   typingr
   r   r   r   r   r   r   r   r   r   urllib.parser   urllib.requestr   r   xml.saxr   rdflib.utilr[  r   rdflib._networkingr   rdflib.namespacer   rdflib.termr   email.messager   r   urllib.responser   typing_extensionsr   rdflib.graphr    __all__r!   r<   r"   r&   r#   r   r$   r%   rS  rO  r(   r0   r-   <module>ro     s    # " " " " "  				  



 V V V V V V V V V V V V V V V V                        !           0 0 0 0 0 0 0 0                 ' ' ' ' ' ' & & & & & &       #%%%%%%!!!!!!******((((((""""""         YF YF YF YF YF^ YF YF YFx
    )'   2$ $ $ $ $ $ $ $N0 0 0 0 0 0 0 08 Lc c c c c[ c c cL         k      L 	"".2.2 u u u u up= = = = = =r0   