
    01i,                        S SK Jr  S SKrS SKJrJrJrJrJrJ	r	J
r
JrJrJr  S SKJr  S SKJrJr  S SKJrJrJrJrJr  S SKJrJrJrJrJr  \\\4   r\" S\S	9r       SS
 jr!      SS jr"\      SS j5       r#\      SS j5       r#      SS jr#SS jr$\ S       SS jj5       r%\ S       SS jj5       r% S       S S jjr%      S!S jr&      S"S jr'\" S\\\\5      r(S#S jr)g)$    )annotationsN)
AnyDefaultDict	GeneratorIterableMappingSetTupleTypeVarUnionoverload)EBV)	CompValueExpr)FrozenBindings
FrozenDictNotBoundErrorQueryContextSPARQLError)BNode
IdentifierLiteralURIRefVariable_FrozenDictT)boundc                   ^^ [        5       nU  H1  m[        UU4S jU 5       5      (       d  M   UR                  T5        M3     U$ )Nc              3     >#    U  HB  nTR                  U5      (       + =(       d     [        TTR                  U5      5      (       + v   MD     g 7fN)
compatible_ebvmerge).0yexprxs     Y/home/james-whalen/.local/lib/python3.13/site-packages/rdflib/plugins/sparql/evalutils.py	<genexpr>_diff.<locals>.<genexpr>&   s6     L!Q1<<?"@$tQWWQZ*@&@@!s   A
A)setalladd)abr%   resr&   s     ` @r'   _diffr0       s9     %CL!LLLGGAJ  J    c              #  `   ^#    U  H#  m[        U4S jU 5       5      (       d  M  Tv   M%     g 7f)Nc              3     >#    U  H3  nTR                  U5      (       + =(       d    TR                  U5      v   M5     g 7fr   )r    disjointDomain)r#   r$   r&   s     r'   r(   _minus.<locals>.<genexpr>0   s/     GQALLO#;(8(8(;;Qs   ;>)r+   )r-   r.   r&   s     @r'   _minusr6   ,   s(      GQGGGG s   .	.c                    g r    r-   r.   s     r'   _joinr:   4   s     -0r1   c                    g r   r8   r9   s     r'   r:   r:   :   s     ),r1   c              #     #    U  H7  nU H.  nUR                  U5      (       d  M  UR                  U5      v   M0     M9     g 7fr   )r    r"   )r-   r.   r&   r$   s       r'   r:   r:   @   s6      A||Aggaj   s
   AAc                V    [        U 5      $ ! [         a     Of = f[        U [        5      (       a+   [        U R	                  U5      5      $ ! [         a     gf = f[        U [
        5      (       a  [        SU -  5      e[        U [        5      (       a   [        X   5      $ !    g= fg)z
Return true/false for the given expr
Either the expr is itself true/false
or evaluates to something, with the given ctx

an error is false
Fz1Weird - filter got a CompValue without evalfn! %r)r   r   
isinstancer   evalr   	Exceptionr   )r%   ctxs     r'   r!   r!   I   s    4y $	tyy~&& 		 
D)	$	$KdRSS	D(	#	#	sy>!	s)   
 
A 
AAB# #B'c                    g r   r8   r%   rA   raise_not_bound_errors      r'   _evalrE   f   s    
 !r1   c                    g r   r8   rC   s      r'   rE   rE   n   s    
 "r1   c                   [        U [        [        45      (       a  U $ [        U [        5      (       a  U R	                  U5      $ [        U [
        5      (       a   X   $ [        U [        5      (       a  [        SU -  5      e[        SU < S[        U 5      < S35      e! [         a    U(       a  [        SU -  5      e g f = f)NzVariable %s is not boundz0Weird - _eval got a CompValue without evalfn! %rzCannot eval thing: z ())r>   r   r   r   r?   r   KeyErrorr   r   r@   typerC   s      r'   rE   rE   v   s    
 $&)**$yy~	D(	#	#	9 
D)	$	$JTQRRd4jIJJ  	$#$>$EFF		s   B C ?C c              #  J   #    U  H  n[        X5      (       d  M  Uv   M     g 7fr   )r!   )r-   r%   cs      r'   _filterrM      s      ==G s   #	#c           	   #  t  #    [         R                  " [        5      nU  H  nUu  pEnUR                  U5      nUR                  U5      nUR                  U5      n	[	        X7X45       V
Vs/ s H   u  p[        U
[        5      (       a  X*   OUPM"     snn
u  pxn	Uc  M~  Uc  M  U	c  M  XxU	4v   M     gs  snn
f 7f)z[
For construct/deleteWhere and friends

Fill a triple template with instantiated variables
N)collectionsdefaultdictr   getzipr>   )templatesolutionbnodeMaptspo_s_p_or&   r$   s               r'   _fillTemplater]      s      +6*A*A%*HHa\\!_\\!_\\!_ DGqr,CW
CW41:a//HKQ6CW

 >bn2, 
s$   A(B8*'B2B8B8"B8'B8_ValueTc                    [        U [        5      (       a  SU 4$ [        U [        5      (       a  SU 4$ [        U [        5      (       a  SU 4$ [        U [        5      (       a  SU 4$ g)zutilitity for ordering thingsr            N)r>   r   r   r   r   )vs    r'   _valrd      s_    !X1v	Au		1v	Av		1v	Aw		1v 
 r1   )r-   Iterable[_FrozenDictT]r.   re   returnzSet[_FrozenDictT])r-   re   r.   re   rf   z#Generator[_FrozenDictT, None, None])r-   zIterable[FrozenBindings]r.   )Iterable[Mapping[Identifier, Identifier]]rf   z%Generator[FrozenBindings, None, None])r-   Iterable[FrozenDict]r.   rg   rf   !Generator[FrozenDict, None, None])r%   Union[Literal, Variable, Expr]rA   r   rf   bool).)r%   Union[Literal, URIRef]rA   r   rD   rk   rf   rl   )r%   zUnion[Variable, Expr]rA   r   rD   rk   rf   zUnion[Any, SPARQLError])T)r%   z&Union[Literal, URIRef, Variable, Expr]rA   r   rD   rk   rf   r   )r-   rh   r%   rj   rf   ri   )rS   z3Iterable[Tuple[Identifier, Identifier, Identifier]]rT   _ContextTyperf   z@Generator[Tuple[Identifier, Identifier, Identifier], None, None])rc   r^   rf   zTuple[int, _ValueT])*
__future__r   rO   typingr   r   r   r   r   r	   r
   r   r   r   rdflib.plugins.sparql.operatorsr   !rdflib.plugins.sparql.parserutilsr   r   rdflib.plugins.sparql.sparqlr   r   r   r   r   rdflib.termr   r   r   r   r   rm   r   r0   r6   r:   r!   rE   rM   r]   r^   rd   r8   r1   r'   <module>rt      s   "    0 =  E D^\12~Z8		"8		"8( 
00$M0*0 
0
 
,, I,&, 
,
!! I!&!: 
 #&!
 !	!  ! 	! 
! 
 #&"
"	"  " 	" 
" #'K
0K	K  K 		K.#A&A F6 )Xufg
>	r1   