a
    %#`(                     @   s^   d dl mZmZ d dlT d dlmZmZ ededd dZedZ	d	d
 Z
dd Zdd ZdS )    )unicode_literalsprint_function)*)registerParserapplication/ld+jsonzrdflib_jsonld.parserJsonLDParsera  
{
    "@context": {"@vocab": "http://schema.org/"},
    "@graph": [
        { "@id": "http://example.org/data#jdoe",
          "name": "John"
        },
        { "@id": "http://example.org/data#janedoe",
          "name": "Jane"
        },
        { "@id": "http://example.org/data#metadata",
          "@graph": [
              { "@id": "http://example.org/data",
                "creator": "http://example.org/data#janedoe"
              }
          ]
        }
    ]
}
z http://example.org/data#metadatac                  C   s(   t  } | jtdd t| dks$J d S )Nr   dataformat   )Graphparser
   len)g r   ?/Users/nick/Work/rdflib/rdflib-jsonld/test/test_named_graphs.py
test_graph   s    r   c                  C   s   t  } | jjtdd t| dks&J td| jt| jf  |  D ]}td|jt|f  qFt| jdkstJ tt|  dksJ d S )Nr   r	      3default graph (%s) contains %s triples (expected 2)z$named graph (%s) contains %s triplesr   )	ConjunctiveGraphdefault_contextr   r
   r   print
identifiercontextslist)cgctxr   r   r   test_conjunctive_graph%   s    r   c                  C   s   t  } | jjtdd t| dks&J t| jdks8J td| jt| jf  tdd |  D }t|dksvJ t|	t
dksJ tt| d	 dksJ d S )
Nr   r	   r   r   r   c                 s   s   | ]}|j |fV  qd S )N)r   ).0r   r   r   r   	<genexpr>>       ztest_dataset.<locals>.<genexpr>   r   )Datasetr   r   r
   r   r   r   dictr   popmeta_ctxr   values)Zdsr   r   r   r   test_dataset4   s    r(   N)
__future__r   r   rdflibZrdflib.pluginr   r   r
   URIRefr&   r   r   r(   r   r   r   r   <module>   s   