3
‰d»  ã               @   sD   d dl mZ d dlmZ ddgZG dd„ deƒZG dd„ deƒZdS )é    )ÚParser)ÚNTriplesParserÚNTSinkÚNTParserc               @   s   e Zd Zdd„ Zdd„ ZdS )r   c             C   s
   || _ d S )N)Úgraph)Úselfr   © r   ú;/tmp/pip-build-7vycvbft/rdflib/rdflib/plugins/parsers/nt.pyÚ__init__   s    zNTSink.__init__c             C   s   | j j|||fƒ d S )N)r   Úadd)r   ÚsÚpÚor   r   r	   Útriple   s    zNTSink.tripleN)Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r	   r      s   c                   s*   e Zd ZdZ‡ fdd„Zddd„Z‡  ZS )r   zyparser for the ntriples format, often stored with the .nt extension

    See http://www.w3.org/TR/rdf-testcases/#ntriplesc                s   t t| ƒjƒ  d S )N)Úsuperr   r
   )r   )Ú	__class__r   r	   r
      s    zNTParser.__init__Nc             C   s*   |j ƒ }tt|ƒƒ}|j|ƒ |jƒ  d S )N)ÚgetByteStreamr   r   ÚparseÚclose)r   ÚsourceZsinkZbaseURIÚfÚparserr   r   r	   r      s    
zNTParser.parse)N)r   r   r   Ú__doc__r
   r   Ú__classcell__r   r   )r   r	   r      s   N)Zrdflib.parserr   Zrdflib.plugins.parsers.ntriplesr   Ú__all__Úobjectr   r   r   r   r   r	   Ú<module>   s   