
    mBNj                     $    d Z dZdZ G d d      Zy)z	DB.LABELSzDB.PROPERTYKEYSzDB.RELATIONSHIPTYPESc                   t    e Zd ZdZd Zd ZddZddZddZd	e	ddfd
Z
de	defdZde	defdZde	defdZy)GraphSchemaz`
    The graph schema.
    Maintains the labels, properties and relationships of the graph.
    c                 2    || _         | j                          y)z
        Initialize the graph schema.

        Args:
            graph (Graph): The graph.

        Returns:
           GraphSchema: The graph schema.
        N)graphclear)selfr   s     n/Users/ahmed/devFolder/Ultron/claude-voice/.venv/lib/python3.12/site-packages/falkordb/asyncio/graph_schema.py__init__zGraphSchema.__init__   s     


    c                 <    d| _         g | _        g | _        g | _        y)zM
        Clear the graph schema.

        Returns:
            None

            N)versionlabels
propertiesrelationships)r   s    r   r   zGraphSchema.clear   s!     r
   returnNc                    K   | j                   j                  t               d{   j                  }|D cg c]  }|d   	 c}| _        y7 'c c}w w)zE
        Refresh labels.

        Returns:
            None

        Nr   )r   call_procedure	DB_LABELS
result_setr   )r   r   labels      r   refresh_labelszGraphSchema.refresh_labels)   sH      !JJ55i@@LL
-78ZEuQxZ8 A8    #AAAA
AAc                    K   | j                   j                  t               d{   j                  }|D cg c]  }|d   	 c}| _        y7 'c c}w w)zQ
        Refresh relationship types.

        Returns:
            None

        Nr   )r   r   DB_RELATIONSHIPTYPESr   r   )r   r   rs      r   refresh_relationszGraphSchema.refresh_relations5   sJ      !JJ556JKKWW
,67JqadJ7 L7r   c                    K   | j                   j                  t               d{   j                  }|D cg c]  }|d   	 c}| _        y7 'c c}w w)zL
        Refresh property keys.

        Returns:
            None

        Nr   )r   r   DB_PROPERTYKEYSr   r   )r   r   ps      r   refresh_propertieszGraphSchema.refresh_propertiesA   sH      !JJ55oFFRR
)34A1Q44 G4r   r   c                    K   | j                          || _        | j                          d{    | j                          d{    | j	                          d{    y7 57 7 	w)z
        Refresh the graph schema.

        Args:
            version (int): The version of the graph schema.

        Returns:
            None

        N)r   r   r   r   r    )r   r   s     r   refreshzGraphSchema.refreshM   s[      	

!!###$$&&&%%''' 	$&'s3   +A)A#A)A%A)A'A)%A)'A)idxc                    K   	 | j                   |   }|S # t        $ r, | j                          d{  7   | j                   |   }Y |S w xY ww)z
        Returns a label by its index.

        Args:
            idx (int): The index of the label.

        Returns:
            str: The label.

        N)r   
IndexErrorr   )r   r#   r   s      r   	get_labelzGraphSchema.get_label_   sU     	%KK$E
 	  	%%%'''KK$E		%.   A AA
4A
A	A

Ac                    K   	 | j                   |   }|S # t        $ r, | j                          d{  7   | j                   |   }Y |S w xY ww)z
        Returns a relationship type by its index.

        Args:
            idx (int): The index of the relation.

        Returns:
            str: The relationship type.

        N)r   r%   r   )r   r#   r   s      r   get_relationzGraphSchema.get_relations   sY     	(""3'A
 	  	(((***""3'A		(r'   c                    K   	 | j                   |   }|S # t        $ r, | j                          d{  7   | j                   |   }Y |S w xY ww)z
        Returns a property by its index.

        Args:
            idx (int): The index of the property.

        Returns:
            str: The property.

        N)r   r%   r    )r   r#   r   s      r   get_propertyzGraphSchema.get_property   sU     	%$A
 	  	%))+++$A		%r'   )r   N)__name__
__module____qualname____doc__r	   r   r   r   r    intr"   strr&   r)   r+    r
   r   r   r      sl    
 
9
8
5(S (T ($3 3 (c c (c c r
   r   N)r   r   r   r   r2   r
   r   <module>r3      s!   	#- R Rr
   