3
‰d“  ã               @   sš   d Z dddddddgZG dd„ deƒZG d	d„ deƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZ	G dd„ deƒZ
dS )z
TODO:
ÚErrorÚTypeCheckErrorÚSubjectTypeErrorÚPredicateTypeErrorÚObjectTypeErrorÚContextTypeErrorÚParserErrorc               @   s   e Zd ZdZddd„ZdS )r   z!Base class for rdflib exceptions.Nc             C   s   t j| |ƒ || _d S )N)Ú	ExceptionÚ__init__Úmsg)Úselfr
   © r   ú3/tmp/pip-build-7vycvbft/rdflib/rdflib/exceptions.pyr	      s    zError.__init__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   r   r   r   r   
   s   c               @   s   e Zd ZdZdd„ ZdS )r   z/Parts of assertions are subject to type checks.c             C   s    t j| |ƒ t|ƒ| _|| _d S )N)r   r	   ÚtypeÚnode)r   r   r   r   r   r	      s    
zTypeCheckError.__init__N)r   r   r   r   r	   r   r   r   r   r      s   c               @   s   e Zd ZdZdd„ ZdS )r   z6Subject of an assertion must be an instance of URIRef.c             C   s"   t j| |ƒ d| j| jf | _d S )Nz3Subject must be instance of URIRef or BNode: %s(%s))r   r	   r   r   r
   )r   r   r   r   r   r	      s    zSubjectTypeError.__init__N)r   r   r   r   r	   r   r   r   r   r      s   c               @   s   e Zd ZdZdd„ ZdS )r   z8Predicate of an assertion must be an instance of URIRef.c             C   s"   t j| |ƒ d| j| jf | _d S )Nz+Predicate must be a URIRef instance: %s(%s))r   r	   r   r   r
   )r   r   r   r   r   r	   '   s    zPredicateTypeError.__init__N)r   r   r   r   r	   r   r   r   r   r   $   s   c               @   s   e Zd ZdZdd„ ZdS )r   zLObject of an assertion must be an instance of URIRef, Literal,
    or BNode.c             C   s"   t j| |ƒ d| j| jf | _d S )Nz<Object must be instance of URIRef, Literal, or BNode: %s(%s))r   r	   r   r   r
   )r   r   r   r   r   r	   1   s    zObjectTypeError.__init__N)r   r   r   r   r	   r   r   r   r   r   -   s   c               @   s   e Zd ZdZdd„ ZdS )r   z6Context of an assertion must be an instance of URIRef.c             C   s"   t j| |ƒ d| j| jf | _d S )Nz3Context must be instance of URIRef or BNode: %s(%s))r   r	   r   r   r
   )r   r   r   r   r   r	   ;   s    zContextTypeError.__init__N)r   r   r   r   r	   r   r   r   r   r   8   s   c               @   s    e Zd ZdZdd„ Zdd„ ZdS )r   zRDF Parser error.c             C   s   t j| |ƒ || _d S )N)r   r	   r
   )r   r
   r   r   r   r	   D   s    zParserError.__init__c             C   s   | j S )N)r
   )r   r   r   r   Ú__str__H   s    zParserError.__str__N)r   r   r   r   r	   r   r   r   r   r   r   A   s   c               @   s   e Zd ZdZdd„ ZdS )ÚUniquenessErrorzEA uniqueness assumption was made in the context, and that is not truec             C   s   t j| d| ƒ d S )Nz?Uniqueness assumption is not fulfilled. Multiple values are: %s)r   r	   )r   Úvaluesr   r   r   r	   O   s    zUniquenessError.__init__N)r   r   r   r   r	   r   r   r   r   r   L   s   r   N)r   Ú__all__r   r   r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s   				