
    4YshJ                         d 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 dD  cg c]  } e|    	 c} Z	dZ
dZdZi fdZd Zd	 Zed
k(  r e        yyc c} w )z
A commandline tool for drawing RDFS Class diagrams in Graphviz DOT
format

You can draw the graph of an RDFS file directly:

.. code-block: bash

   rdf2dot my_rdfs_file.rdf | dot -Tpng | display
    N)XSDRDFRDFS))anyURIbase64BinarybooleanbytedatedateTimedecimaldoubledurationfloatgDaygMonth	gMonthDaygYear
gYearMonth	hexBinaryIDIDREFIDREFSintintegerlanguagelongNameNCNamenegativeIntegerNMTOKENNMTOKENSnonNegativeIntegernonPositiveIntegernormalizedStringpositiveIntegerQNameshortstringtimetokenunsignedByteunsignedIntunsignedLongunsignedShortblueblackc                    t        j                  t              }i fd}d }|j                  d       | j	                  t
        j                  t        j                        D ]
  } ||      } | j                  t        j                        D ]4  \  }} ||      } ||      }|j                  d|d|dt        d       6 | j	                  t
        j                  t
        j                        D ]  }t        j                  | j                  |t        j                         | j                  |t        j"                              D ]  \  }	}
|
t$        v s|
t        j&                  k(  rB ||
|       }|
t        j&                  k(  rd}| ||	         j)                   |||       |f       c|j                  d ||	      d ||
      dt*        d	 |||       d
	         j-                         D ]o  \  }}|j                  d|d|d       t/        ||         D cg c]  }d|z  	 }}d}|j                  ||t0         |||       dj3                  |      fz         q |j                  d       yc c}w )zT
    Convert the RDFS schema in a graph
    writes the dot output to the stream
    c                 8    | vrdt              z  | <   |    S )Nznode%d)len)ndnodess    u/var/www/sten-cake5-migrate2.hellocrow.space/lexinfo-master/env/lib/python3.12/site-packages/rdflib/tools/rdfs2dot.pynodezrdfs2dot.<locals>.nodeS   s&    U? 3u:-E"IRy    c                     |j                  | t        j                        }|!	 |j                  j	                  |       d   }|S |S #  Y |S xY w)N   )valuer   labelnamespace_managercompute_qname)xxgrflbls      r6   r<   zrdfs2dot.<locals>.labelX   sU    iiDJJ';++99"=a@ 
s

s   A Az/digraph { 
 node [ fontname="DejaVu Sans" ] ; 
	z -> z	 [ color=z ] ;
literalz	, label="z" ];
z#  
z,<tr><td align='left'>%s</td><td>%s</td></tr>z%s [ shape=none, color=%s label=< <table color='#666666' cellborder='0' cellspacing='0' border='1'><tr><td colspan='2' bgcolor='grey'><B>%s</B></td></tr>%s</table> > ] 
 z}
N)collectionsdefaultdictsetwritesubjectsr   typer   Classsubject_objects
subClassOfISACOLORProperty	itertoolsproductobjectsdomainrangeXSDTERMSLiteraladd	EDGECOLORitemssorted	NODECOLORjoin)gstreamoptsfieldsr7   r<   xnyabl_ufopstrr5   s                  @r6   rdfs2dotrl   J   s,    $$S)FE
 LLDEZZ$**- G !!$//2 G1GGaHEFG
 ZZ#,,/ %%IIa%qyyDJJ'?
 	DAq H}T\\ 11a[$"BtAw##U1a["$56 AwQE!QKA	   F1Aq)* F1I&
 ;Q>
 

' 	 	UaE!QKDDEF LL
s   $I:c                  B    t         j                  j                  d       y )Nz
rdfs2dot.py [-f <format>] files...
Read RDF files given on STDOUT, writes a graph of the RDFS schema in
DOT language to stdout
-f specifies parser to use, if not given,

)sysstderrrJ    r8   r6   _helprq      s    JJ	r8   c                  h    t         j                  j                  j                  t        t
               y )N)rdflibextrascmdlineutilsmainrl   rq   rp   r8   r6   rv   rv      s    
MM##He4r8   __main__)__doc__rdflib.extras.cmdlineutilsrs   rn   rR   rG   r   r   r   rW   rZ   r]   rP   rl   rq   rv   __name__)rc   s   0r6   <module>r{      s   	 " 
   " !
*-	 F-^ 		   ?D	5 zF M-s   A