rdflib-jsonld-0.3/0000755000076500000240000000000012476660447014556 5ustar neuronstaff00000000000000rdflib-jsonld-0.3/docs/0000755000076500000240000000000012476660447015506 5ustar neuronstaff00000000000000rdflib-jsonld-0.3/docs/conf.py0000644000076500000240000001744712011554070016775 0ustar neuronstaff00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # rdflib_jsonld documentation build configuration file, created by # sphinx-quickstart on Fri Jun 15 15:37:07 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'rdflib_jsonld' copyright = '2012, RDFLib Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.1' # The full version, including alpha/beta/rc tags. release = '0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'pyramid' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'rdflib_jsonlddoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'rdflib_jsonld.tex', 'rdflib\\_jsonld Documentation', 'RDFLib Team', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'rdflib_jsonld', 'rdflib_jsonld Documentation', ['RDFLib Team'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'rdflib_jsonld', 'rdflib_jsonld Documentation', 'RDFLib Team', 'rdflib_jsonld', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None} rdflib-jsonld-0.3/docs/index.rst0000644000076500000240000000373212011554070017327 0ustar neuronstaff00000000000000.. rdflib_jsonld documentation master file Welcome to rdflib_jsonld's documentation! ========================================= RDFLib plugin providing JSON-LD parsing and serialization. This parser/serialiser will * read in an JSON-LD formatted document and create an RDF graph * serialize an RDF graph to JSON-LD formatted output JSON-LD is described on the `JSON-LD `_ web site as: JSON-LD (JavaScript Object Notation for Linking Data) is a lightweight Linked Data format that gives your data context. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on the already successful JSON format and provides a way to help JSON data interoperate at Web-scale. If you are already familiar with JSON, writing JSON-LD is very easy. These properties make JSON-LD an ideal Linked Data interchange language for JavaScript environments, Web service, and unstructured databases such as CouchDB and MongoDB. A simple example of a JSON object expressing Linked Data: .. code-block:: js { "@context": "http://json-ld.org/contexts/person", "@id": "http://dbpedia.org/resource/John_Lennon", "name": "John Lennon", "birthday": "10-09", "member": "http://dbpedia.org/resource/The_Beatles" } The example above describes a person whose name is John Lennon. The difference between regular JSON and JSON-LD is that the JSON-LD object above uniquely identifies itself on the Web and can be used, without introducing ambiguity, across every Web site, Web service and JSON-based database in operation today. The secret lies in the ``@context`` which instructs Linked Data-aware processors on how to interpret the JSON object. Contents: .. toctree:: :maxdepth: 2 jsonld-serializer jsonld-parser Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` rdflib-jsonld-0.3/docs/jsonld-parser.rst0000644000076500000240000000311112011554070020772 0ustar neuronstaff00000000000000.. _rdflib_jsonld.jsonld_parser: an RDFLib plugin JSONLD parser =================================== JSONLD parser plug-in for RDFLib =================================== Using the plug-in JSONLD parser with RDFLib --------------------------------------------- The plugin serializer is automatically registered if installed by setuptools, otherwise call ``rdfextras.registerplugins()`` after importing, as shown below. Identify a source of JSON-LD, pass the source to the parser, manipulate the resulting graph. .. code-block:: python >>> from rdflib import Graph, URIRef, Literal >>> from rdflib.parser import Parser >>> import rdfextras >>> rdfextras.registerplugins() # if no setuptools >>> test_json = ''' ... { ... "@context": { ... "dc": "http://purl.org/dc/terms/", ... "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", ... "rdfs": "http://www.w3.org/2000/01/rdf-schema#" ... }, ... "@id": "http://example.org/about", ... "dc:title": { ... "@language": "en", ... "@literal": "Someone's Homepage" ... } ... } ... ''' >>> g = Graph().parse(data=test_json, format='json-ld') >>> list(g) == [(URIRef('http://example.org/about'), ... URIRef('http://purl.org/dc/terms/title'), ... Literal(%(u)s"Someone's Homepage", lang=%(u)s'en'))] True Module contents --------------- .. currentmodule:: rdflib_jsonld.jsonld_parser .. automodule:: rdflib_jsonld.jsonld_parser .. autoclass:: JsonLDParser :members: parse .. autofunction:: to_rdf rdflib-jsonld-0.3/docs/jsonld-serializer.rst0000644000076500000240000000275112011554070021660 0ustar neuronstaff00000000000000.. _rdflib_jsonld.jsonld_serializer: an RDFLib plugin JSONLD serializer ======================================= JSONLD serializer plug-in for RDFLib ======================================= Using the plug-in JSONLD serializer with RDFLib ------------------------------------------------ The plugin serializer is automatically registered if installed by setuptools, otherwise call ``rdfextras.registerplugins()`` after importing, as shown below. Read in an RDFLib Graph and serialize it, specifying ``format='json-ld'``. .. code-block:: python >>> from rdflib import Graph, plugin >>> from rdflib.serializer import Serializer >>> import rdfextras >>> rdfextras.registerplugins() >>> testrdf = ''' ... @prefix dc: . ... ... dc:title "Someone's Homepage"@en . ... ''' >>> g = Graph().parse(data=testrdf, format='n3') >>> print(g.serialize(format='json-ld', indent=4)) { "@context": { "dc": "http://purl.org/dc/terms/", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs": "http://www.w3.org/2000/01/rdf-schema#" }, "@id": "http://example.org/about", "dc:title": { "@language": "en", "@literal": "Someone's Homepage" } } Module contents --------------- .. currentmodule:: rdflib_jsonld.jsonld_serializer .. autoclass:: JsonLDSerializer :members: serialize .. autofunction:: to_tree rdflib-jsonld-0.3/docs/make.bat0000644000076500000240000001176612011554070017101 0ustar neuronstaff00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\rdflib_jsonld.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\rdflib_jsonld.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end rdflib-jsonld-0.3/docs/Makefile0000644000076500000240000001272512011554070017130 0ustar neuronstaff00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/rdflib_jsonld.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/rdflib_jsonld.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/rdflib_jsonld" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/rdflib_jsonld" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." make -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." rdflib-jsonld-0.3/MANIFEST.in0000644000076500000240000000013012011554070016261 0ustar neuronstaff00000000000000include *.md recursive-include rdflib_jsonld *.py include setup.* graft docs graft test rdflib-jsonld-0.3/PKG-INFO0000644000076500000240000000231512476660447015654 0ustar neuronstaff00000000000000Metadata-Version: 1.1 Name: rdflib-jsonld Version: 0.3 Summary: rdflib extension adding JSON-LD parser and serializer Home-page: https://github.com/RDFLib/rdflib-jsonld Author: RDFLib Team Author-email: http://groups.google.com/group/rdflib-dev License: BSD Download-URL: https://github.com/RDFLib/rdflib-jsonld/zipball/master Description: This parser/serialiser will * read in an JSON-LD formatted document and create an RDF graph * serialize an RDF graph to JSON-LD formatted output See: http://json-ld.org/ Platform: any Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: License :: OSI Approved :: BSD License Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Operating System :: OS Independent Classifier: Natural Language :: English rdflib-jsonld-0.3/rdflib_jsonld/0000755000076500000240000000000012476660447017371 5ustar neuronstaff00000000000000rdflib-jsonld-0.3/rdflib_jsonld/__init__.py0000644000076500000240000000003412476660135021471 0ustar neuronstaff00000000000000""" """ __version__ = "0.3" rdflib-jsonld-0.3/rdflib_jsonld/context.py0000644000076500000240000002114412471621414021413 0ustar neuronstaff00000000000000# -*- coding: utf-8 -*- """ Implementation of the JSON-LD Context structure. See: http://json-ld.org/ """ from rdflib.namespace import RDF from .util import source_to_json, urljoin, split_iri, norm_url from .keys import (BASE, CONTAINER, CONTEXT, GRAPH, ID, INDEX, LANG, LIST, REV, SET, TYPE, VALUE, VOCAB) NODE_KEYS = set([LANG, ID, TYPE, VALUE, LIST, SET, REV, GRAPH]) class Defined(int): pass UNDEF = Defined(0) class Context(object): def __init__(self, source=None, base=None): self.language = None self.vocab = None self.base = base self.doc_base = base self.terms = {} self._alias = {} self._lookup = {} self._prefixes = {} self.active = False if source: self.load(source) def load(self, source, base=None): self.active = True inputs = not isinstance(source, list) and [source] or source sources = [] for source in inputs: if isinstance(source, basestring): url = urljoin(base, source) #if url in visited_urls: continue #visited_urls.append(url) source = source_to_json(url) if isinstance(source, dict): if CONTEXT in source: source = source[CONTEXT] if isinstance(source, list): sources.extend(source) else: sources.append(source) for source in sources: self._read_source(source) def subcontext(self, source): # IMPROVE: to optimize, implement SubContext with parent fallback support ctx = Context() ctx.language = self.language ctx.vocab = self.vocab ctx.base = self.base ctx.doc_base = self.doc_base ctx._alias = self._alias.copy() ctx.terms = self.terms.copy() ctx._lookup = self._lookup.copy() ctx._prefixes = self._prefixes.copy() ctx.load(source) return ctx def get_id(self, obj): return self._get(obj, ID) def get_type(self, obj): return self._get(obj, TYPE) def get_language(self, obj): return self._get(obj, LANG) def get_value(self, obj): return self._get(obj, VALUE) def get_graph(self, obj): return self._get(obj, GRAPH) def get_list(self, obj): return self._get(obj, LIST) def get_set(self, obj): return self._get(obj, SET) def get_rev(self, obj): return self._get(obj, REV) def _get(self, obj, key): return obj.get(self._alias.get(key)) or obj.get(key) def get_key(self, key): return self._alias.get(key, key) lang_key = property(lambda self: self.get_key(LANG)) id_key = property(lambda self: self.get_key(ID)) type_key = property(lambda self: self.get_key(TYPE)) value_key = property(lambda self: self.get_key(VALUE)) list_key = property(lambda self: self.get_key(LIST)) rev_key = property(lambda self: self.get_key(REV)) graph_key = property(lambda self: self.get_key(GRAPH)) def add_term(self, name, idref, coercion=UNDEF, container=UNDEF, language=UNDEF, reverse=False): term = Term(idref, name, coercion, container, language, reverse) self.terms[name] = term self._lookup[(idref, coercion or language, container, reverse)] = term self._prefixes[idref] = name def find_term(self, idref, coercion=None, container=UNDEF, language=None, reverse=False): lu = self._lookup if coercion is None: coercion = language if coercion is not UNDEF and container: found = lu.get((idref, coercion, container, reverse)) if found: return found if coercion is not UNDEF: found = lu.get((idref, coercion, UNDEF, reverse)) if found: return found if container: found = lu.get((idref, coercion, container, reverse)) if found: return found elif language: found = lu.get((idref, UNDEF, LANG, reverse)) if found: return found else: found = lu.get((idref, coercion or UNDEF, SET, reverse)) if found: return found return lu.get((idref, UNDEF, UNDEF, reverse)) def resolve(self, curie_or_iri): iri = self.expand(curie_or_iri, False) if iri.startswith('_:'): return iri return self.resolve_iri(iri) def resolve_iri(self, iri): return norm_url(self.base, iri) def expand(self, term_curie_or_iri, use_vocab=True): if use_vocab: term = self.terms.get(term_curie_or_iri) if term: return term.id is_term, pfx, local = self._prep_expand(term_curie_or_iri) if pfx == '_': return term_curie_or_iri if pfx is not None: ns = self.terms.get(pfx) if ns and ns.id: return ns.id + local elif is_term and use_vocab: if self.vocab: return self.vocab + term_curie_or_iri return None return self.resolve_iri(term_curie_or_iri) def shrink_iri(self, iri): ns, name = split_iri(unicode(iri)) pfx = self._prefixes.get(ns) if pfx: return u":".join((pfx, name)) return iri def to_symbol(self, iri): iri = unicode(iri) term = self.find_term(iri) if term: return term.name ns, name = split_iri(iri) if ns == self.vocab: return name pfx = self._prefixes.get(ns) if pfx: return u":".join((pfx, name)) return iri def _read_source(self, source): self.vocab = source.get(VOCAB, self.vocab) for key, value in source.items(): if key == LANG: self.language = value elif key == VOCAB: continue elif key == BASE: # TODO: only base to None if source is embedded #if value is None and remote: # self.base = self.doc_base #else: self.base = value else: self._read_term(source, key, value) def _read_term(self, source, name, dfn): if isinstance(dfn, dict): #term = self._create_term(source, key, value) rev = dfn.get(REV) idref = rev or dfn.get(ID, UNDEF) if idref == TYPE: idref = unicode(RDF.type) elif idref is not UNDEF: idref = self._rec_expand(source, idref) elif ':' in name: idref = self._rec_expand(source, name) elif self.vocab: idref = self.vocab + name coercion = dfn.get(TYPE, UNDEF) if coercion and coercion not in (ID, TYPE, VOCAB): coercion = self._rec_expand(source, coercion) self.add_term(name, idref, coercion, dfn.get(CONTAINER, UNDEF), dfn.get(LANG, UNDEF), bool(rev)) else: idref = self._rec_expand(source, dfn) self.add_term(name, idref) if idref in NODE_KEYS: self._alias[idref] = name def _rec_expand(self, source, expr, prev=None): if expr == prev or expr in NODE_KEYS: return expr is_term, pfx, nxt = self._prep_expand(expr) if pfx: iri = self._get_source_id(source, pfx) or self.expand(pfx) if iri is None: nxt = expr else: nxt = iri + nxt else: nxt = self._get_source_id(source, nxt) or nxt if ':' not in nxt and self.vocab: return self.vocab + nxt return self._rec_expand(source, nxt, expr) def _prep_expand(self, expr): if ':' not in expr: return True, None, expr pfx, local = expr.split(':', 1) if not local.startswith('//'): return False, pfx, local else: return False, None, expr def _get_source_id(self, source, key): # .. from source dict or if already defined term = source.get(key) if term is None: dfn = self.terms.get(key) if dfn: term = dfn.id elif isinstance(term, dict): term = term.get(ID) return term class Term(object): def __init__(self, idref, name, coercion=UNDEF, container=UNDEF, language=UNDEF, reverse=False): self.name = name self.id = idref self.type = coercion self.container = container self.language = language self.reverse = reverse rdflib-jsonld-0.3/rdflib_jsonld/keys.py0000644000076500000240000000035012172076632020702 0ustar neuronstaff00000000000000BASE = u'@base' CONTAINER = u'@container' CONTEXT = u'@context' GRAPH = u'@graph' ID = u'@id' INDEX = u'@index' LANG = u'@language' LIST = u'@list' REV = u'@reverse' SET = u'@set' TYPE = u'@type' VALUE = u'@value' VOCAB = u'@vocab' rdflib-jsonld-0.3/rdflib_jsonld/parser.py0000644000076500000240000002270012476651420021227 0ustar neuronstaff00000000000000# -*- coding: utf-8 -*- """ This parser will interpret a JSON-LD document as an RDF Graph. See: http://json-ld.org/ Example usage:: >>> from rdflib.plugin import register, Parser >>> register('json-ld', Parser, 'rdflib_jsonld.parser', 'JsonLDParser') >>> from rdflib import Graph, URIRef, Literal >>> test_json = ''' ... { ... "@context": { ... "dc": "http://purl.org/dc/terms/", ... "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", ... "rdfs": "http://www.w3.org/2000/01/rdf-schema#" ... }, ... "@id": "http://example.org/about", ... "dc:title": { ... "@language": "en", ... "@value": "Someone's Homepage" ... } ... } ... ''' >>> g = Graph().parse(data=test_json, format='json-ld') >>> list(g) == [(URIRef('http://example.org/about'), ... URIRef('http://purl.org/dc/terms/title'), ... Literal("Someone's Homepage", lang='en'))] True """ # NOTE: This code reads the entire JSON object into memory before parsing, but # we should consider streaming the input to deal with arbitrarily large graphs. import warnings from rdflib.graph import ConjunctiveGraph from rdflib.parser import Parser, URLInputSource from rdflib.namespace import RDF, XSD from rdflib.term import URIRef, BNode, Literal from .context import Context, Term, UNDEF from .util import source_to_json, VOCAB_DELIMS, context_from_urlinputsource from .keys import CONTEXT, GRAPH, ID, INDEX, LANG, LIST, REV, SET, TYPE, VALUE, VOCAB __all__ = ['JsonLDParser', 'to_rdf'] TYPE_TERM = Term(unicode(RDF.type), TYPE, VOCAB) class JsonLDParser(Parser): def __init__(self): super(JsonLDParser, self).__init__() def parse(self, source, sink, **kwargs): # TODO: docstring w. args and return value encoding = kwargs.get('encoding') or 'utf-8' if encoding not in ('utf-8', 'utf-16'): warnings.warn("JSON should be encoded as unicode. " + "Given encoding was: %s" % encoding) base = kwargs.get('base') or sink.absolutize( source.getPublicId() or source.getSystemId() or "") context_data = kwargs.get('context') if not context_data and isinstance(source, URLInputSource): context_data = context_from_urlinputsource(source) produce_generalized_rdf = kwargs.get('produce_generalized_rdf', False) data = source_to_json(source) conj_sink = ConjunctiveGraph( store=sink.store, identifier=sink.identifier) to_rdf(data, conj_sink, base, context_data) generalized_rdf = False def to_rdf(data, graph, base=None, context_data=None, produce_generalized_rdf=False): # TODO: docstring w. args and return value global generalized_rdf # FIXME: not thread-safe and error-prone generalized_rdf = produce_generalized_rdf context = Context(base=base) if context_data: context.load(context_data) topcontext = False if isinstance(data, list): resources = data elif isinstance(data, dict): l_ctx = data.get(CONTEXT) if l_ctx: context.load(l_ctx, base) topcontext = True resources = data if not isinstance(resources, list): resources = [resources] if context.vocab: graph.bind(None, context.vocab) for name, term in context.terms.items(): if term.id and term.id.endswith(VOCAB_DELIMS): graph.bind(name, term.id) for node in resources: _add_to_graph(graph, graph, context, node, topcontext) return graph def _add_to_graph(dataset, graph, context, node, topcontext=False): if not isinstance(node, dict) or context.get_value(node): return if CONTEXT in node and not topcontext: l_ctx = node.get(CONTEXT) if l_ctx: context = context.subcontext(l_ctx) else: context = Context(base=context.doc_base) id_val = context.get_id(node) if isinstance(id_val, basestring): subj = _to_rdf_id(context, id_val) else: subj = BNode() if subj is None: return None for key, obj in node.items(): if key in (CONTEXT, ID, context.get_key(ID)): continue if key in (REV, context.get_key(REV)): for rkey, robj in obj.items(): _key_to_graph(dataset, graph, context, subj, rkey, robj, True) else: _key_to_graph(dataset, graph, context, subj, key, obj) return subj def _key_to_graph(dataset, graph, context, subj, key, obj, reverse=False): if isinstance(obj, list): obj_nodes = obj else: obj_nodes = [obj] term = context.terms.get(key) if term: term_id = term.id if term.container == LIST: obj_nodes = [{LIST: obj_nodes}] elif isinstance(obj, dict): if term.container == INDEX: obj_nodes = [] for values in obj.values(): if not isinstance(values, list): obj_nodes.append(values) else: obj_nodes += values elif term.container == LANG: obj_nodes = [] for lang, values in obj.items(): if not isinstance(values, list): values = [values] for v in values: obj_nodes.append((v, lang)) else: term_id = None if TYPE in (key, term_id): term = TYPE_TERM elif GRAPH in (key, term_id): #assert graph.context_aware subgraph = dataset.get_context(subj) for onode in obj_nodes: _add_to_graph(dataset, subgraph, context, onode) return elif SET in (key, term_id): for onode in obj_nodes: _add_to_graph(dataset, graph, context, onode) return pred_uri = term.id if term else context.expand(key) flattened = [] for obj in obj_nodes: if isinstance(obj, dict): objs = context.get_set(obj) if objs is not None: obj = objs if isinstance(obj, list): flattened += obj continue flattened.append(obj) obj_nodes = flattened if not pred_uri: return if term and term.reverse: reverse = not reverse bid = _get_bnodeid(pred_uri) if bid: if not generalized_rdf: return pred = BNode(bid) else: pred = URIRef(pred_uri) for obj_node in obj_nodes: obj = _to_object(dataset, graph, context, term, obj_node) if obj is None: continue if reverse: graph.add((obj, pred, subj)) else: graph.add((subj, pred, obj)) def _to_object(dataset, graph, context, term, node, inlist=False): if node is None: return if isinstance(node, tuple): value, lang = node if value is None: return return Literal(value, lang=lang) if isinstance(node, dict): node_list = context.get_list(node) if node_list is not None: if inlist: # TODO: and NO_LISTS_OF_LISTS return listref = _add_list(dataset, graph, context, term, node_list) if listref: return listref else: # expand.. if not term or not term.type: if isinstance(node, float): return Literal(node, datatype=XSD.double) if term and term.language is not UNDEF: lang = term.language else: lang = context.language return Literal(node, lang=lang) else: if term.type == ID: node = {ID: context.resolve(node)} elif term.type == VOCAB: node = {ID: context.expand(node) or context.resolve_iri(node)} else: node = {TYPE: term.type, VALUE: node} lang = context.get_language(node) if lang or context.get_key(VALUE) in node or VALUE in node: value = context.get_value(node) if value is None: return None datatype = not lang and context.get_type(node) or None if lang: return Literal(value, lang=lang) elif datatype: return Literal(value, datatype=context.expand(datatype)) else: return Literal(value) else: return _add_to_graph(dataset, graph, context, node) def _to_rdf_id(context, id_val): bid = _get_bnodeid(id_val) if bid: return BNode(bid) else: uri = context.resolve(id_val) if not generalized_rdf and ':' not in uri: return None return URIRef(uri) def _get_bnodeid(ref): if not ref.startswith('_:'): return bid = ref.split('_:', 1)[-1] return bid or None def _add_list(dataset, graph, context, term, node_list): if not isinstance(node_list, list): node_list = [node_list] first_subj = BNode() subj, rest = first_subj, None for node in node_list: if node is None: continue if rest: graph.add((subj, RDF.rest, rest)) subj = rest obj = _to_object(dataset, graph, context, term, node, inlist=True) if obj is None: continue graph.add((subj, RDF.first, obj)) rest = BNode() if rest: graph.add((subj, RDF.rest, RDF.nil)) return first_subj else: return RDF.nil rdflib-jsonld-0.3/rdflib_jsonld/serializer.py0000644000076500000240000002767112471621414022113 0ustar neuronstaff00000000000000# -*- coding: utf-8 -*- """ This serialiser will output an RDF Graph as a JSON-LD formatted document. See: http://json-ld.org/ Example usage:: >>> from rdflib.plugin import register, Serializer >>> register('json-ld', Serializer, 'rdflib_jsonld.serializer', 'JsonLDSerializer') >>> from rdflib import Graph >>> testrdf = ''' ... @prefix dc: . ... ... dc:title "Someone's Homepage"@en . ... ''' >>> g = Graph().parse(data=testrdf, format='n3') >>> print(g.serialize(format='json-ld', indent=4).decode()) [ { "@id": "http://example.org/about", "http://purl.org/dc/terms/title": [ { "@language": "en", "@value": "Someone's Homepage" } ] } ] """ # NOTE: This code writes the entire JSON object into memory before serialising, # but we should consider streaming the output to deal with arbitrarily large # graphs. import warnings from rdflib.serializer import Serializer from rdflib.graph import Graph from rdflib.term import URIRef, Literal, BNode from rdflib.namespace import RDF, XSD from .context import Context, UNDEF from .util import json from .keys import CONTEXT, GRAPH, ID, VOCAB, LIST, SET, LANG __all__ = ['JsonLDSerializer', 'from_rdf'] PLAIN_LITERAL_TYPES = set([XSD.boolean, XSD.integer, XSD.double, XSD.string]) class JsonLDSerializer(Serializer): def __init__(self, store): super(JsonLDSerializer, self).__init__(store) def serialize(self, stream, base=None, encoding=None, **kwargs): # TODO: docstring w. args and return value encoding = encoding or 'utf-8' if encoding not in ('utf-8', 'utf-16'): warnings.warn("JSON should be encoded as unicode. " + "Given encoding was: %s" % encoding) context_data = kwargs.get('context') use_native_types = kwargs.get('use_native_types', False), use_rdf_type = kwargs.get('use_rdf_type', False) auto_compact = kwargs.get('auto_compact', False) indent = kwargs.get('indent', 2) separators = kwargs.get('separators', (',', ': ')) sort_keys = kwargs.get('sort_keys', True) ensure_ascii = kwargs.get('ensure_ascii', False) obj = from_rdf(self.store, context_data, base, use_native_types, use_rdf_type, auto_compact=auto_compact) data = json.dumps(obj, indent=indent, separators=separators, sort_keys=sort_keys, ensure_ascii=ensure_ascii) stream.write(data.encode(encoding, 'replace')) def from_rdf(graph, context_data=None, base=None, use_native_types=False, use_rdf_type=False, auto_compact=False, startnode=None, index=False): # TODO: docstring w. args and return value # TODO: support for index and startnode if not context_data and auto_compact: context_data = dict( (pfx, unicode(ns)) for (pfx, ns) in graph.namespaces() if pfx and unicode(ns) != u"http://www.w3.org/XML/1998/namespace") if isinstance(context_data, Context): context = context_data context_data = context.to_dict() else: context = Context(context_data, base=base) converter = Converter(context, use_native_types, use_rdf_type) result = converter.convert(graph) if converter.context.active: if isinstance(result, list): result = {context.get_key(GRAPH): result} result[CONTEXT] = context_data return result class Converter(object): def __init__(self, context, use_native_types, use_rdf_type): self.context = context self.use_native_types = context.active or use_native_types self.use_rdf_type = use_rdf_type def convert(self, graph): # TODO: bug in rdflib dataset parsing (nquads et al): # plain triples end up in separate unnamed graphs (rdflib issue #436) if graph.context_aware: default_graph = Graph() graphs = [default_graph] for g in graph.contexts(): if isinstance(g.identifier, URIRef): graphs.append(g) else: default_graph += g else: graphs = [graph] context = self.context objs = [] for g in graphs: obj = {} graphname = None if isinstance(g.identifier, URIRef): graphname = context.shrink_iri(g.identifier) obj[context.id_key] = graphname nodes = self.from_graph(g) if not graphname and len(nodes) == 1: obj.update(nodes[0]) else: if not nodes: continue obj[context.graph_key] = nodes if objs and objs[0].get(context.get_key(ID)) == graphname: objs[0].update(obj) else: objs.append(obj) if len(graphs) == 1 and len(objs) == 1 and not self.context.active: default = objs[0] items = default.get(context.graph_key) if len(default) == 1 and items: objs = items elif len(objs) == 1 and self.context.active: objs = objs[0] return objs def from_graph(self, graph): nodemap = {} for s in set(graph.subjects()): ## only iri:s and unreferenced (rest will be promoted to top if needed) if isinstance(s, URIRef) or (isinstance(s, BNode) and not any(graph.subjects(None, s))): self.process_subject(graph, s, nodemap) return nodemap.values() def process_subject(self, graph, s, nodemap): if isinstance(s, URIRef): node_id = self.context.shrink_iri(s) elif isinstance(s, BNode): node_id = s.n3() else: node_id = None #used_as_object = any(graph.subjects(None, s)) if node_id in nodemap: return None node = {} node[self.context.id_key] = node_id nodemap[node_id] = node for p, o in graph.predicate_objects(s): self.add_to_node(graph, s, p, o, node, nodemap) return node def add_to_node(self, graph, s, p, o, s_node, nodemap): context = self.context if isinstance(o, Literal): datatype = unicode(o.datatype) if o.datatype else None language = o.language term = context.find_term(unicode(p), datatype, language=language) else: containers = [LIST, None] if graph.value(o, RDF.first) else [None] for container in containers: for coercion in (ID, VOCAB, UNDEF): term = context.find_term(unicode(p), coercion, container) if term: break if term: break node = None use_set = not context.active if term: p_key = term.name if term.type: node = self.type_coerce(o, term.type) elif term.language and o.language == term.language: node = unicode(o) elif context.language and ( term.language is None and o.language is None): node = unicode(o) if term.container == SET: use_set = True elif term.container == LIST: node = [self.type_coerce(v, term.type) or self.to_raw_value(graph, s, v, nodemap) for v in self.to_collection(graph, o)] elif term.container == LANG and language: value = s_node.setdefault(p_key, {}) values = value.get(language) node = unicode(o) if values: if not isinstance(values, list): value[language] = values = [values] values.append(node) else: value[language] = node return else: p_key = context.to_symbol(p) # TODO: for coercing curies - quite clumsy; unify to_symbol and find_term? key_term = context.terms.get(p_key) if key_term and (key_term.type or key_term.container): p_key = p if not term and p == RDF.type and not self.use_rdf_type: if isinstance(o, URIRef): node = context.to_symbol(o) p_key = context.type_key if node is None: node = self.to_raw_value(graph, s, o, nodemap) value = s_node.get(p_key) if value: if not isinstance(value, list): value = [value] value.append(node) elif use_set: value = [node] else: value = node s_node[p_key] = value def type_coerce(self, o, coerce_type): if coerce_type == ID: if isinstance(o, URIRef): return self.context.shrink_iri(o) elif isinstance(o, BNode): return o.n3() else: return o elif coerce_type == VOCAB and isinstance(o, URIRef): return self.context.to_symbol(o) elif isinstance(o, Literal) and unicode(o.datatype) == coerce_type: return o else: return None def to_raw_value(self, graph, s, o, nodemap): context = self.context coll = self.to_collection(graph, o) if coll is not None: coll = [self.to_raw_value(graph, s, lo, nodemap) for lo in self.to_collection(graph, o)] return {context.list_key: coll} elif isinstance(o, BNode): embed = False # TODO: self.context.active or using startnode and only one ref onode = self.process_subject(graph, o, nodemap) if onode: if embed and not any(s2 for s2 in graph.subjects(None, o) if s2 != s): return onode else: nodemap[onode[context.id_key]] = onode return {context.id_key: o.n3()} elif isinstance(o, URIRef): # TODO: embed if o != startnode (else reverse) return {context.id_key: context.shrink_iri(o)} elif isinstance(o, Literal): # TODO: if compact native = self.use_native_types and o.datatype in PLAIN_LITERAL_TYPES if native: v = o.toPython() else: v = unicode(o) if o.datatype: if native: if self.context.active: return v else: return {context.value_key: v} return {context.type_key: context.to_symbol(o.datatype), context.value_key: v} elif o.language and o.language != context.language: return {context.lang_key: o.language, context.value_key: v} elif not context.active or context.language and not o.language: return {context.value_key: v} else: return v def to_collection(self, graph, l): if l != RDF.nil and not graph.value(l, RDF.first): return None list_nodes = [] chain = set([l]) while l: if l == RDF.nil: return list_nodes if isinstance(l, URIRef): return None first, rest = None, None for p, o in graph.predicate_objects(l): if not first and p == RDF.first: first = o elif not rest and p == RDF.rest: rest = o elif p != RDF.type or o != RDF.List: return None list_nodes.append(first) l = rest if l in chain: return None chain.add(l) rdflib-jsonld-0.3/rdflib_jsonld/util.py0000644000076500000240000000362012474113010020672 0ustar neuronstaff00000000000000try: import json assert json # workaround for pyflakes issue #13 except ImportError: import simplejson as json from rdflib.py3compat import PY3 from os import sep from os.path import normpath if PY3: from urllib.parse import urljoin, urlsplit, urlunsplit else: from urlparse import urljoin, urlsplit, urlunsplit from rdflib.parser import create_input_source if PY3: from io import StringIO def source_to_json(source): # TODO: conneg for JSON (fix support in rdflib's URLInputSource!) source = create_input_source(source, format='json-ld') stream = source.getByteStream() try: if PY3: return json.load(StringIO(stream.read().decode('utf-8'))) else: return json.load(stream) finally: stream.close() VOCAB_DELIMS = ('#', '/', ':') def split_iri(iri): for delim in VOCAB_DELIMS: at = iri.rfind(delim) if at > -1: return iri[:at+1], iri[at+1:] return iri, None def norm_url(base, url): url = urljoin(base, url) parts = urlsplit(url) path = normpath(parts[2]) if sep != '/': path = '/'.join(path.split(sep)) if parts[2].endswith('/') and not path.endswith('/'): path += '/' result = urlunsplit(parts[0:2] + (path,) + parts[3:]) if url.endswith('#') and not result.endswith('#'): result += '#' return result def context_from_urlinputsource(source): if source.content_type == 'application/json': # response_info was added to InputSource in rdflib 4.2 try: links = source.response_info.getallmatchingheaders('Link') except AttributeError: return for link in links: if ' rel="http://www.w3.org/ns/json-ld#context"' in link: i, j = link.index('<'), link.index('>') if i > -1 and j > -1: return urljoin(source.url, link[i+1:j]) rdflib-jsonld-0.3/rdflib_jsonld.egg-info/0000755000076500000240000000000012476660447021063 5ustar neuronstaff00000000000000rdflib-jsonld-0.3/rdflib_jsonld.egg-info/dependency_links.txt0000644000076500000240000000000112476660446025130 0ustar neuronstaff00000000000000 rdflib-jsonld-0.3/rdflib_jsonld.egg-info/entry_points.txt0000644000076500000240000000022012476660446024352 0ustar neuronstaff00000000000000[rdf.plugins.parser] json-ld = rdflib_jsonld.parser:JsonLDParser [rdf.plugins.serializer] json-ld = rdflib_jsonld.serializer:JsonLDSerializer rdflib-jsonld-0.3/rdflib_jsonld.egg-info/PKG-INFO0000644000076500000240000000231512476660446022160 0ustar neuronstaff00000000000000Metadata-Version: 1.1 Name: rdflib-jsonld Version: 0.3 Summary: rdflib extension adding JSON-LD parser and serializer Home-page: https://github.com/RDFLib/rdflib-jsonld Author: RDFLib Team Author-email: http://groups.google.com/group/rdflib-dev License: BSD Download-URL: https://github.com/RDFLib/rdflib-jsonld/zipball/master Description: This parser/serialiser will * read in an JSON-LD formatted document and create an RDF graph * serialize an RDF graph to JSON-LD formatted output See: http://json-ld.org/ Platform: any Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.5 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.2 Classifier: Programming Language :: Python :: 3.3 Classifier: License :: OSI Approved :: BSD License Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Operating System :: OS Independent Classifier: Natural Language :: English rdflib-jsonld-0.3/rdflib_jsonld.egg-info/requires.txt0000644000076500000240000000001312476660446023454 0ustar neuronstaff00000000000000rdflib>=4.2rdflib-jsonld-0.3/rdflib_jsonld.egg-info/SOURCES.txt0000644000076500000240000002755712476660447022767 0ustar neuronstaff00000000000000MANIFEST.in README.md setup.cfg setup.py docs/Makefile docs/conf.py docs/index.rst docs/jsonld-parser.rst docs/jsonld-serializer.rst docs/make.bat rdflib_jsonld/__init__.py rdflib_jsonld/context.py rdflib_jsonld/keys.py rdflib_jsonld/parser.py rdflib_jsonld/serializer.py rdflib_jsonld/util.py rdflib_jsonld.egg-info/PKG-INFO rdflib_jsonld.egg-info/SOURCES.txt rdflib_jsonld.egg-info/dependency_links.txt rdflib_jsonld.egg-info/entry_points.txt rdflib_jsonld.egg-info/requires.txt rdflib_jsonld.egg-info/top_level.txt test/.DS_Store test/README.md test/__init__.py test/__init__.pyc test/earl-context.jsonld test/test_api.py test/test_api.pyc test/test_compaction.py test/test_compaction.pyc test/test_context.rst test/test_testsuite.py test/test_testsuite.pyc test/test-suite/.DS_Store test/test-suite/README test/test-suite/context.jsonld test/test-suite/manifest.jsonld test/test-suite/vocab.jsonld test/test-suite/vocab_context.jsonld test/test-suite/tests/fromRdf-0001-in.nq test/test-suite/tests/fromRdf-0001-out.jsonld test/test-suite/tests/fromRdf-0002-in.nq test/test-suite/tests/fromRdf-0002-out.jsonld test/test-suite/tests/fromRdf-0003-in.nq test/test-suite/tests/fromRdf-0003-out.jsonld test/test-suite/tests/fromRdf-0004-in.nq test/test-suite/tests/fromRdf-0004-out.jsonld test/test-suite/tests/fromRdf-0005-in.nq test/test-suite/tests/fromRdf-0005-out.jsonld test/test-suite/tests/fromRdf-0006-in.nq test/test-suite/tests/fromRdf-0006-out.jsonld test/test-suite/tests/fromRdf-0007-in.nq test/test-suite/tests/fromRdf-0007-out.jsonld test/test-suite/tests/fromRdf-0008-in.nq test/test-suite/tests/fromRdf-0008-out.jsonld test/test-suite/tests/fromRdf-0009-in.nq test/test-suite/tests/fromRdf-0009-out.jsonld test/test-suite/tests/fromRdf-0010-in.nq test/test-suite/tests/fromRdf-0010-out.jsonld test/test-suite/tests/fromRdf-0011-in.nq test/test-suite/tests/fromRdf-0011-out.jsonld test/test-suite/tests/fromRdf-0012-in.nq test/test-suite/tests/fromRdf-0012-out.jsonld test/test-suite/tests/fromRdf-0013-in.nq test/test-suite/tests/fromRdf-0013-out.jsonld test/test-suite/tests/fromRdf-0014-in.nq test/test-suite/tests/fromRdf-0014-out.jsonld test/test-suite/tests/fromRdf-0015-in.nq test/test-suite/tests/fromRdf-0015-out.jsonld test/test-suite/tests/fromRdf-0016-in.nq test/test-suite/tests/fromRdf-0016-out.jsonld test/test-suite/tests/fromRdf-0017-in.nq test/test-suite/tests/fromRdf-0017-out.jsonld test/test-suite/tests/fromRdf-0018-in.nq test/test-suite/tests/fromRdf-0018-out.jsonld test/test-suite/tests/fromRdf-0019-in.nq test/test-suite/tests/fromRdf-0019-out.jsonld test/test-suite/tests/fromRdf-manifest.jsonld test/test-suite/tests/toRdf-0001-in.jsonld test/test-suite/tests/toRdf-0001-out.nq test/test-suite/tests/toRdf-0002-in.jsonld test/test-suite/tests/toRdf-0002-out.nq test/test-suite/tests/toRdf-0003-in.jsonld test/test-suite/tests/toRdf-0003-out.nq test/test-suite/tests/toRdf-0004-in.jsonld test/test-suite/tests/toRdf-0004-out.nq test/test-suite/tests/toRdf-0005-in.jsonld test/test-suite/tests/toRdf-0005-out.nq test/test-suite/tests/toRdf-0006-in.jsonld test/test-suite/tests/toRdf-0006-out.nq test/test-suite/tests/toRdf-0007-in.jsonld test/test-suite/tests/toRdf-0007-out.nq test/test-suite/tests/toRdf-0008-in.jsonld test/test-suite/tests/toRdf-0008-out.nq test/test-suite/tests/toRdf-0009-in.jsonld test/test-suite/tests/toRdf-0009-out.nq test/test-suite/tests/toRdf-0010-in.jsonld test/test-suite/tests/toRdf-0010-out.nq test/test-suite/tests/toRdf-0011-in.jsonld test/test-suite/tests/toRdf-0011-out.nq test/test-suite/tests/toRdf-0012-in.jsonld test/test-suite/tests/toRdf-0012-out.nq test/test-suite/tests/toRdf-0013-in.jsonld test/test-suite/tests/toRdf-0013-out.nq test/test-suite/tests/toRdf-0014-in.jsonld test/test-suite/tests/toRdf-0014-out.nq test/test-suite/tests/toRdf-0015-in.jsonld test/test-suite/tests/toRdf-0015-out.nq test/test-suite/tests/toRdf-0016-in.jsonld test/test-suite/tests/toRdf-0016-out.nq test/test-suite/tests/toRdf-0017-in.jsonld test/test-suite/tests/toRdf-0017-out.nq test/test-suite/tests/toRdf-0018-in.jsonld test/test-suite/tests/toRdf-0018-out.nq test/test-suite/tests/toRdf-0019-in.jsonld test/test-suite/tests/toRdf-0019-out.nq test/test-suite/tests/toRdf-0020-in.jsonld test/test-suite/tests/toRdf-0020-out.nq test/test-suite/tests/toRdf-0022-in.jsonld test/test-suite/tests/toRdf-0022-out.nq test/test-suite/tests/toRdf-0023-in.jsonld test/test-suite/tests/toRdf-0023-out.nq test/test-suite/tests/toRdf-0024-in.jsonld test/test-suite/tests/toRdf-0024-out.nq test/test-suite/tests/toRdf-0025-in.jsonld test/test-suite/tests/toRdf-0025-out.nq test/test-suite/tests/toRdf-0026-in.jsonld test/test-suite/tests/toRdf-0026-out.nq test/test-suite/tests/toRdf-0027-in.jsonld test/test-suite/tests/toRdf-0027-out.nq test/test-suite/tests/toRdf-0028-in.jsonld test/test-suite/tests/toRdf-0028-out.nq test/test-suite/tests/toRdf-0029-in.jsonld test/test-suite/tests/toRdf-0029-out.nq test/test-suite/tests/toRdf-0030-in.jsonld test/test-suite/tests/toRdf-0030-out.nq test/test-suite/tests/toRdf-0031-in.jsonld test/test-suite/tests/toRdf-0031-out.nq test/test-suite/tests/toRdf-0032-in.jsonld test/test-suite/tests/toRdf-0032-out.nq test/test-suite/tests/toRdf-0033-in.jsonld test/test-suite/tests/toRdf-0033-out.nq test/test-suite/tests/toRdf-0034-in.jsonld test/test-suite/tests/toRdf-0034-out.nq test/test-suite/tests/toRdf-0035-in.jsonld test/test-suite/tests/toRdf-0035-out.nq test/test-suite/tests/toRdf-0036-in.jsonld test/test-suite/tests/toRdf-0036-out.nq test/test-suite/tests/toRdf-0041-in.jsonld test/test-suite/tests/toRdf-0041-out.nq test/test-suite/tests/toRdf-0042-in.jsonld test/test-suite/tests/toRdf-0042-out.nq test/test-suite/tests/toRdf-0043-in.jsonld test/test-suite/tests/toRdf-0043-out.nq test/test-suite/tests/toRdf-0044-in.jsonld test/test-suite/tests/toRdf-0044-out.nq test/test-suite/tests/toRdf-0045-in.jsonld test/test-suite/tests/toRdf-0045-out.nq test/test-suite/tests/toRdf-0046-in.jsonld test/test-suite/tests/toRdf-0046-out.nq test/test-suite/tests/toRdf-0047-in.jsonld test/test-suite/tests/toRdf-0047-out.nq test/test-suite/tests/toRdf-0048-in.jsonld test/test-suite/tests/toRdf-0048-out.nq test/test-suite/tests/toRdf-0049-in.jsonld test/test-suite/tests/toRdf-0049-out.nq test/test-suite/tests/toRdf-0050-in.jsonld test/test-suite/tests/toRdf-0050-out.nq test/test-suite/tests/toRdf-0051-in.jsonld test/test-suite/tests/toRdf-0051-out.nq test/test-suite/tests/toRdf-0052-in.jsonld test/test-suite/tests/toRdf-0052-out.nq test/test-suite/tests/toRdf-0053-in.jsonld test/test-suite/tests/toRdf-0053-out.nq test/test-suite/tests/toRdf-0054-in.jsonld test/test-suite/tests/toRdf-0054-out.nq test/test-suite/tests/toRdf-0055-in.jsonld test/test-suite/tests/toRdf-0055-out.nq test/test-suite/tests/toRdf-0056-in.jsonld test/test-suite/tests/toRdf-0056-out.nq test/test-suite/tests/toRdf-0057-in.jsonld test/test-suite/tests/toRdf-0057-out.nq test/test-suite/tests/toRdf-0058-in.jsonld test/test-suite/tests/toRdf-0058-out.nq test/test-suite/tests/toRdf-0059-in.jsonld test/test-suite/tests/toRdf-0059-out.nq test/test-suite/tests/toRdf-0060-in.jsonld test/test-suite/tests/toRdf-0060-out.nq test/test-suite/tests/toRdf-0061-in.jsonld test/test-suite/tests/toRdf-0061-out.nq test/test-suite/tests/toRdf-0062-in.jsonld test/test-suite/tests/toRdf-0062-out.nq test/test-suite/tests/toRdf-0063-in.jsonld test/test-suite/tests/toRdf-0063-out.nq test/test-suite/tests/toRdf-0064-in.jsonld test/test-suite/tests/toRdf-0064-out.nq test/test-suite/tests/toRdf-0065-in.jsonld test/test-suite/tests/toRdf-0065-out.nq test/test-suite/tests/toRdf-0066-in.jsonld test/test-suite/tests/toRdf-0066-out.nq test/test-suite/tests/toRdf-0067-in.jsonld test/test-suite/tests/toRdf-0067-out.nq test/test-suite/tests/toRdf-0068-in.jsonld test/test-suite/tests/toRdf-0068-out.nq test/test-suite/tests/toRdf-0069-in.jsonld test/test-suite/tests/toRdf-0069-out.nq test/test-suite/tests/toRdf-0070-in.jsonld test/test-suite/tests/toRdf-0070-out.nq test/test-suite/tests/toRdf-0071-in.jsonld test/test-suite/tests/toRdf-0071-out.nq test/test-suite/tests/toRdf-0072-in.jsonld test/test-suite/tests/toRdf-0072-out.nq test/test-suite/tests/toRdf-0073-in.jsonld test/test-suite/tests/toRdf-0073-out.nq test/test-suite/tests/toRdf-0074-in.jsonld test/test-suite/tests/toRdf-0074-out.nq test/test-suite/tests/toRdf-0075-in.jsonld test/test-suite/tests/toRdf-0075-out.nq test/test-suite/tests/toRdf-0076-in.jsonld test/test-suite/tests/toRdf-0076-out.nq test/test-suite/tests/toRdf-0077-in.jsonld test/test-suite/tests/toRdf-0077-out.nq test/test-suite/tests/toRdf-0078-in.jsonld test/test-suite/tests/toRdf-0078-out.nq test/test-suite/tests/toRdf-0079-in.jsonld test/test-suite/tests/toRdf-0079-out.nq test/test-suite/tests/toRdf-0080-in.jsonld test/test-suite/tests/toRdf-0080-out.nq test/test-suite/tests/toRdf-0081-in.jsonld test/test-suite/tests/toRdf-0081-out.nq test/test-suite/tests/toRdf-0082-in.jsonld test/test-suite/tests/toRdf-0082-out.nq test/test-suite/tests/toRdf-0083-in.jsonld test/test-suite/tests/toRdf-0083-out.nq test/test-suite/tests/toRdf-0084-in.jsonld test/test-suite/tests/toRdf-0084-out.nq test/test-suite/tests/toRdf-0085-in.jsonld test/test-suite/tests/toRdf-0085-out.nq test/test-suite/tests/toRdf-0086-in.jsonld test/test-suite/tests/toRdf-0086-out.nq test/test-suite/tests/toRdf-0087-in.jsonld test/test-suite/tests/toRdf-0087-out.nq test/test-suite/tests/toRdf-0088-in.jsonld test/test-suite/tests/toRdf-0088-out.nq test/test-suite/tests/toRdf-0089-in.jsonld test/test-suite/tests/toRdf-0089-out.nq test/test-suite/tests/toRdf-0090-in.jsonld test/test-suite/tests/toRdf-0090-out.nq test/test-suite/tests/toRdf-0091-in.jsonld test/test-suite/tests/toRdf-0091-out.nq test/test-suite/tests/toRdf-0092-in.jsonld test/test-suite/tests/toRdf-0092-out.nq test/test-suite/tests/toRdf-0093-in.jsonld test/test-suite/tests/toRdf-0093-out.nq test/test-suite/tests/toRdf-0094-in.jsonld test/test-suite/tests/toRdf-0094-out.nq test/test-suite/tests/toRdf-0095-in.jsonld test/test-suite/tests/toRdf-0095-out.nq test/test-suite/tests/toRdf-0096-in.jsonld test/test-suite/tests/toRdf-0096-out.nq test/test-suite/tests/toRdf-0097-in.jsonld test/test-suite/tests/toRdf-0097-out.nq test/test-suite/tests/toRdf-0098-in.jsonld test/test-suite/tests/toRdf-0098-out.nq test/test-suite/tests/toRdf-0099-in.jsonld test/test-suite/tests/toRdf-0099-out.nq test/test-suite/tests/toRdf-0100-in.jsonld test/test-suite/tests/toRdf-0100-out.nq test/test-suite/tests/toRdf-0101-in.jsonld test/test-suite/tests/toRdf-0101-out.nq test/test-suite/tests/toRdf-0102-in.jsonld test/test-suite/tests/toRdf-0102-out.nq test/test-suite/tests/toRdf-0103-in.jsonld test/test-suite/tests/toRdf-0103-out.nq test/test-suite/tests/toRdf-0104-in.jsonld test/test-suite/tests/toRdf-0104-out.nq test/test-suite/tests/toRdf-0105-in.jsonld test/test-suite/tests/toRdf-0105-out.nq test/test-suite/tests/toRdf-0106-in.jsonld test/test-suite/tests/toRdf-0106-out.nq test/test-suite/tests/toRdf-0107-in.jsonld test/test-suite/tests/toRdf-0107-out.nq test/test-suite/tests/toRdf-0108-in.jsonld test/test-suite/tests/toRdf-0108-out.nq test/test-suite/tests/toRdf-0109-in.jsonld test/test-suite/tests/toRdf-0109-out.nq test/test-suite/tests/toRdf-0110-in.jsonld test/test-suite/tests/toRdf-0110-out.nq test/test-suite/tests/toRdf-0111-in.jsonld test/test-suite/tests/toRdf-0111-out.nq test/test-suite/tests/toRdf-0112-in.jsonld test/test-suite/tests/toRdf-0112-out.nq test/test-suite/tests/toRdf-0113-in.jsonld test/test-suite/tests/toRdf-0113-out.nq test/test-suite/tests/toRdf-0114-in.jsonld test/test-suite/tests/toRdf-0114-out.nq test/test-suite/tests/toRdf-0115-in.jsonld test/test-suite/tests/toRdf-0115-out.nq test/test-suite/tests/toRdf-0116-in.jsonld test/test-suite/tests/toRdf-0116-out.nq test/test-suite/tests/toRdf-0117-in.jsonld test/test-suite/tests/toRdf-0117-out.nq test/test-suite/tests/toRdf-0118-in.jsonld test/test-suite/tests/toRdf-0118-out.nq test/test-suite/tests/toRdf-0119-in.jsonld test/test-suite/tests/toRdf-0119-out.nq test/test-suite/tests/toRdf-manifest.jsonldrdflib-jsonld-0.3/rdflib_jsonld.egg-info/top_level.txt0000644000076500000240000000001612476660446023611 0ustar neuronstaff00000000000000rdflib_jsonld rdflib-jsonld-0.3/README.md0000644000076500000240000000376212434406614016031 0ustar neuronstaff00000000000000RDFLib plugin providing JSON-LD parsing and serialization ========================================================= This is an implementation of [JSON-LD](http://www.w3.org/TR/json-ld/) for [RDFLib](https://github.com/RDFLib/rdflib). For more information about this technology, see the [JSON-LD website](http://json-ld.org/). This implementation will: * read in an JSON-LD formatted document and create an RDF graph * serialize an RDF graph to JSON-LD formatted output Using the plug-in JSONLD serializer/parser with RDFLib ------------------------------------------------------ The plugin parser and serializer are automatically registered if installed by setuptools. >>> from rdflib import Graph, plugin >>> from rdflib.serializer import Serializer >>> testrdf = ''' ... @prefix dc: . ... ... dc:title "Someone's Homepage"@en . ... ''' >>> g = Graph().parse(data=testrdf, format='n3') >>> print(g.serialize(format='json-ld', indent=4)) { "@id": "http://example.org/about", "http://purl.org/dc/terms/title": [ { "@language": "en", "@value": "Someone's Homepage" } ] } >>> context = {"@vocab": "http://purl.org/dc/terms/", "@language": "en"} >>> print(g.serialize(format='json-ld', context=context, indent=4)) { "@context": { "@language": "en", "@vocab": "http://purl.org/dc/terms/" }, "@id": "http://example.org/about", "title": "Someone's Homepage" } Building the Sphinx documentation --------------------------------- If Sphinx is installed, Sphinx documentation can be generated with:: $ python setup.py build_sphinx The documentation will be created in ./build/sphinx. Continuous integration tests ---------------------------- [![Build Status](https://travis-ci.org/RDFLib/rdflib-jsonld.png?branch=master)](https://travis-ci.org/RDFLib/rdflib-jsonld) rdflib-jsonld-0.3/setup.cfg0000644000076500000240000000017312476660447016400 0ustar neuronstaff00000000000000[nosetests] attr = !known_issue verbosity = 1 with-doctest = 1 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 rdflib-jsonld-0.3/setup.py0000644000076500000240000000674512471622301016262 0ustar neuronstaff00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re # Ridiculous as it may seem, we need to import multiprocessing and logging here # in order to get tests to pass smoothly on python 2.7. try: import multiprocessing import logging except: pass def setup_python3(): # Taken from "distribute" setup.py from distutils.filelist import FileList from distutils import dir_util, file_util, util, log from os.path import join tmp_src = join("build", "src") log.set_verbosity(1) fl = FileList() for line in open("MANIFEST.in"): if not line.strip(): continue fl.process_template_line(line) dir_util.create_tree(tmp_src, fl.files) outfiles_2to3 = [] for f in fl.files: outf, copied = file_util.copy_file(f, join(tmp_src, f), update=1) if copied and outf.endswith(".py"): outfiles_2to3.append(outf) util.run_2to3(outfiles_2to3) # arrange setup to use the copy sys.path.insert(0, tmp_src) return tmp_src # Find version. We have to do this because we can't import it in Python 3 until # its been automatically converted in the setup process. def find_version(filename): _version_re = re.compile(r'__version__ = "(.*)"') for line in open(filename): version_match = _version_re.match(line) if version_match: return version_match.group(1) __version__ = find_version('rdflib_jsonld/__init__.py') install_requires = ["rdflib>=4.0", ] if sys.version_info[:2] < (2, 6): install_requires += ["simplejson"] config = dict( name = 'rdflib-jsonld', description = "rdflib extension adding JSON-LD parser and serializer", maintainer = "RDFLib Team", maintainer_email = "http://groups.google.com/group/rdflib-dev", url = "https://github.com/RDFLib/rdflib-jsonld", version = __version__, download_url = "https://github.com/RDFLib/rdflib-jsonld/zipball/master", license = "BSD", platforms = ["any"], long_description = \ """ This parser/serialiser will * read in an JSON-LD formatted document and create an RDF graph * serialize an RDF graph to JSON-LD formatted output See: http://json-ld.org/ """, classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries :: Python Modules", "Operating System :: OS Independent", "Natural Language :: English", ], packages = ["rdflib_jsonld"], test_suite = "test", install_requires = ["rdflib>=4.2"], entry_points = { 'rdf.plugins.parser': [ 'json-ld = rdflib_jsonld.parser:JsonLDParser', ], 'rdf.plugins.serializer': [ 'json-ld = rdflib_jsonld.serializer:JsonLDSerializer', ], } ) if sys.version_info[0] >= 3: from setuptools import setup config.update({'use_2to3': True}) config.update({'src_root': setup_python3()}) else: try: from setuptools import setup config.update({'test_suite' : "nose.collector"}) except ImportError: from distutils.core import setup setup(**config) rdflib-jsonld-0.3/test/0000755000076500000240000000000012476660447015535 5ustar neuronstaff00000000000000rdflib-jsonld-0.3/test/.DS_Store0000644000076500000240000001400412225072416017200 0ustar neuronstaff00000000000000Bud1-suite test-suitebwspblob°bplist00Ö  \WindowBounds[ShowSidebar]ShowStatusBar[ShowPathbar[ShowToolbar\SidebarWidth_{{1132, 247}, {770, 438}}  ­".s  rdflib-jsonld-0.3/test/earl-context.jsonld0000644000076500000240000000164212360244472021344 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://www.w3.org/ns/earl#", "dc": "http://purl.org/dc/terms/", "foaf": "http://xmlns.com/foaf/0.1/", "doap": "http://usefulinc.com/ns/doap#", "xsd": "http://www.w3.org/2001/XMLSchema#", "Project": {"@id": "doap:Project"}, "projectpage": {"@id": "doap:homepage", "@type": "@id"}, "projectName": {"@id": "doap:name"}, "projectTitle": {"@id": "doap:title"}, "programmingLanguage": {"@id": "doap:programming-language"}, "homepage": {"@id": "foaf:homepage", "@type": "@id"}, "name": {"@id": "foaf:name"}, "outcome": {"@type": "@id"}, "test": {"@type": "@id"}, "assertedBy": {"@type": "@id"}, "license": {"@id": "doap:license", "@type": "@id"}, "creator": {"@id": "dc:creator", "@type": "@id"}, "mode": {"@type": "@vocab"}, "date": {"@id": "dc:date", "@type": "xsd:dateTime"}, "subjectOf": {"@reverse": "earl:subject" } } } rdflib-jsonld-0.3/test/README.md0000644000076500000240000000121212172076631016775 0ustar neuronstaff00000000000000The `test-suite` directory is a partial *copy* of the official test suite available at . Do *not* add tests directly there, but follow the instructions provided at the preceding location. To update this copy, first obtain a local copy of the json-ld-tests test-suite. Then copy the relevants parts of that directory into this test directory. You can do so by first defining a `$JSONLD_TESTSUITE` environment variable set to the local copy of the test-suite directory. Then run: $ cp $JSONLD_TESTSUITE/*.jsonld test/test-suite/ $ cp $JSONLD_TESTSUITE/tests/{toRdf,fromRdf}-*.* test/test-suite/tests/ rdflib-jsonld-0.3/test/test-suite/0000755000076500000240000000000012476660447017643 5ustar neuronstaff00000000000000rdflib-jsonld-0.3/test/test-suite/.DS_Store0000644000076500000240000001400412226041414021301 0ustar neuronstaff00000000000000Bud1%  @€ @€ @€ @ E%DSDB`€ @€ @€ @rdflib-jsonld-0.3/test/test-suite/context.jsonld0000644000076500000240000000252512231436177022534 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://json-ld.org/test-suite/vocab#", "dc": "http://purl.org/dc/terms/", "jld": "http://json-ld.org/test-suite/vocab#", "mf": "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "xsd": "http://www.w3.org/2001/XMLSchema#", "context": { "@id": "input", "@type": "@id" }, "expect": { "@id": "mf:result", "@type": "@id" }, "frame": { "@id": "input", "@type": "@id" }, "input": { "@id": "mf:action", "@type": "@id" }, "option": { "@type": "@id"}, "sequence": { "@id": "mf:entries", "@type": "@id", "@container": "@list" }, "redirectTo": { "@type": "@id"}, "name": "mf:name", "purpose": "rdfs:comment", "description": "rdfs:comment", "base": { "@type": "@id" }, "compactArrays": { "@type": "xsd:boolean" }, "documentLoader": { "@type": "xsd:string" }, "expandContext": { "@type": "xsd:string" }, "processingMode": { "@type": "xsd:string" }, "produceGeneralizedRdf":{ "@type": "xsd:boolean" }, "useNativeTypes": { "@type": "xsd:boolean" }, "httpStatus": { "@type": "xsd:integer"}, "httpLink": { "@container": "@set"} } } rdflib-jsonld-0.3/test/test-suite/manifest.jsonld0000644000076500000240000000110012231436177022642 0ustar neuronstaff00000000000000{ "@context": "http://json-ld.org/test-suite/context.jsonld", "@id": "", "@type": "mf:Manifest", "description": "This manifest loads additional manifests for specific behavior tests", "name": "JSON-LD Test Suite", "sequence": [ "tests/compact-manifest.jsonld", "tests/error-manifest.jsonld", "tests/expand-manifest.jsonld", "tests/flatten-manifest.jsonld", "tests/frame-manifest.jsonld", "tests/fromRdf-manifest.jsonld", "tests/normalize-manifest.jsonld", "tests/remote-doc-manifest.jsonld", "tests/toRdf-manifest.jsonld" ] } rdflib-jsonld-0.3/test/test-suite/README0000644000076500000240000000564612011554070020511 0ustar neuronstaff00000000000000Introduction ------------ The JSON-LD Test Suite is a set of tests that can be used to verify JSON-LD Processor conformance to the set of specifications that constitute JSON-LD. The goal of the suite is to provide an easy and comprehensive JSON-LD testing solution for developers creating JSON-LD Processors. Design ------ Tests are defined into _compact_, _expand_, _frame_, _normalize_, and _rdf_ sections: * _compact_ tests have _input_, _expected_ and _context_ documents. The _expected_ results can be compared using JSON object comparison with the processor output. * _expand_ tests have _input_ and _expected_ documents. The _expected_ results can be compared using JSON object comparison with the processor output. * _frame_ tests have _input_, _frame_ and _expected_ documents. The _expected_ results can be compared using JSON object comparison with the processor output. * _normalize_ tests have _input_ and _expected_ documents. The _expected_ results can be compared using string comparison with the processor output. * _rdf_ tests have _input_ and _sparql_ documents. The results are tested by performing the RDF conversion and using this as the default document for an `ASK` query contained within the _sparql_ document using a SPARQL endpoint. The end result is a yes/no on whether the expected triples were extracted by the JSON-LD processor. Contributing ------------ If you would like to contribute a new test or a fix to an existing test, please follow these steps: 1. Notify the JSON-LD mailing list, public-linked-json@w3.org, that you will be creating a new test or fix and the purpose of the change. 2. Clone the git repository: git://github.com/json-ld/json-ld.org.git 3. Make your changes and submit them via github, or via a 'git format-patch' to the [JSON-LD mailing list](mailto:public-linked-json@w3.org). Optionally, you can ask for direct access to the repository and may make changes directly to the JSON-LD Test Suite source code. All updates to the test suite go live on Digital Bazaar's JSON-LD Test Suite site within seconds of committing changes to github via a WebHook call. How to Add a Unit Test ---------------------- In order to add a unit test, you must follow these steps: 1. Pick a new unit test number. For example - 250. To be consistent, please use the next available unit test number. 2. Create a markup file in the tests/ directory with a .jsonld extension. For example: tests/rdf-250.jsonld 3. Create a SPARQL query file in the tests/ directory with a .jsonld or .sparql extension. For example: tests/rdf-250.sparql 4. Add your test to manifest.jsonld. The test suite is designed to empower JSON-LD processor maintainers to create and add tests as they see fit. This may mean that the test suite may become unstable from time to time, but this approach has been taken so that the long-term goal of having a comprehensive test suite for JSON-LD can be achieved by the JSON-LD community. rdflib-jsonld-0.3/test/test-suite/tests/0000755000076500000240000000000012476660447021005 5ustar neuronstaff00000000000000rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0001-in.nq0000644000076500000240000000065612231436223023713 0ustar neuronstaff00000000000000 . . "Plain" . "2012-05-12"^^ . "English"@en . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0001-out.jsonld0000644000076500000240000000054712231436223024766 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/Subj1", "@type": ["http://example.com/Type"], "http://example.com/prop1": [{"@id": "http://example.com/Obj1"}], "http://example.com/prop2": [ {"@value": "Plain"}, {"@value": "2012-05-12", "@type": "http://www.w3.org/2001/XMLSchema#date"}, {"@value": "English", "@language": "en"} ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0002-in.nq0000644000076500000240000000102012231436223023676 0ustar neuronstaff00000000000000 "true"^^ . "false"^^ . "1"^^ . "1.1"^^ . "1.1E-1"^^ . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0002-out.jsonld0000644000076500000240000000113212231436223024756 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/Subj1", "http://example.com/prop": [ { "@value": "true", "@type": "http://www.w3.org/2001/XMLSchema#boolean" }, { "@value": "false", "@type": "http://www.w3.org/2001/XMLSchema#boolean" }, { "@value": "1", "@type": "http://www.w3.org/2001/XMLSchema#integer" }, { "@value": "1.1", "@type": "http://www.w3.org/2001/XMLSchema#decimal" }, { "@value": "1.1E-1", "@type": "http://www.w3.org/2001/XMLSchema#double" } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0003-in.nq0000644000076500000240000000100312231436223023700 0ustar neuronstaff00000000000000 . _:a . _:a . . . . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0003-out.jsonld0000644000076500000240000000065012231436223024763 0ustar neuronstaff00000000000000[ { "@id": "_:a", "@type": ["http://example.com/SubType"] }, { "@id": "http://example.com/Subj1", "@type": ["http://example.com/Type"], "http://example.com/ref": [ {"@id": "_:a"}, {"@id": "http://example.com/Subj2"} ] }, { "@id": "http://example.com/Subj2", "@type": ["http://example.com/Type"], "http://example.com/ref": [{"@id": "http://example.com/Subj1"}] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0004-in.nq0000644000076500000240000000147212231436223023713 0ustar neuronstaff00000000000000 . _:a "apple" . _:a _:b . _:b "bananna" . _:b . _:a . . _:c . _:c . _:c . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0004-out.jsonld0000644000076500000240000000060212231436223024761 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/Subj1", "@type": ["http://example.com/Type"], "http://example.com/literalList": [{ "@list": [ {"@value": "apple"}, {"@value": "bananna"} ] }], "http://example.com/emptyList": [{ "@list": [] }], "http://example.com/iriList": [{ "@list": [{"@id": "http://example.com/iri"}] }] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0005-in.nq0000644000076500000240000000152212231436223023710 0ustar neuronstaff00000000000000 . . _:a "a" . _:a _:b . _:b "b" . _:b . _:a . . "Graph" . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0005-out.jsonld0000644000076500000240000000073712231436223024773 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/U", "@graph": [ { "@id": "http://example.com/Subj1", "@type": ["http://example.com/Type"], "http://example.com/ref": [{"@id": "http://example.com/U"}], "http://example.com/list": [{ "@list": [ {"@value": "a"}, {"@value": "b"} ] }] } ], "@type": ["http://example.com/Graph"], "http://example.com/name": [{"@value": "Graph"}] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0006-in.nq0000644000076500000240000000254312231436223023715 0ustar neuronstaff00000000000000 . . _:a . _:a "a" . _:a _:b . _:b "b" . _:b . . . _:c . _:c "c" . _:c _:d . _:d "d" . _:d . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0006-out.jsonld0000644000076500000240000000137212231436223024770 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/U", "@graph": [ { "@id": "http://example.com/Subj1", "@type": ["http://example.com/Type"], "http://example.com/ref": [{"@id": "http://example.com/U"}], "http://example.com/list": [{ "@list": [ {"@value": "a"}, {"@value": "b"} ] }] } ] }, { "@id": "http://example.com/V", "@graph": [ { "@id": "http://example.com/Subj1", "@type": ["http://example.com/Type2"], "http://example.com/ref": [{"@id": "http://example.com/V"}], "http://example.com/list": [{ "@list": [ {"@value": "c"}, {"@value": "d"} ] }] } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0007-in.nq0000644000076500000240000000145412231436223023716 0ustar neuronstaff00000000000000 . "http://gregkellogg.net/foaf#me" . . "http://www.statistik-berlin-brandenburg.de/" . "3499879"^^ . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0007-out.jsonld0000644000076500000240000000146512231436223024774 0ustar neuronstaff00000000000000[ { "@id": "http://data.wikipedia.org/snaks/Assertions", "@type": ["http://data.wikipedia.org/vocab#SnakSet"], "http://data.wikipedia.org/vocab#assertedBy": [{"@value": "http://gregkellogg.net/foaf#me"} ], "@graph": [ { "@id": "http://data.wikipedia.org/snaks/BerlinFact", "@type": ["http://data.wikipedia.org/vocab#Snak"], "http://data.wikipedia.org/vocab#assertedBy": [{"@value": "http://www.statistik-berlin-brandenburg.de/"}] } ] }, { "@id": "http://data.wikipedia.org/snaks/BerlinFact", "@graph": [ { "@id": "http://en.wikipedia.org/wiki/Berlin", "http://data.wikipedia.org/vocab#population": [{ "@value": "3499879", "@type": "http://www.w3.org/2001/XMLSchema#integer" }] } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0008-in.nq0000644000076500000240000000334712231436223023722 0ustar neuronstaff00000000000000 _:outerlist . _:outerlist _:lista . _:outerlist _:b0 . _:lista "a1" . _:lista _:a2 . _:a2 "a2" . _:a2 _:a3 . _:a3 "a3" . _:a3 . _:c0 _:c1 . _:c0 . _:c1 "c1" . _:c1 _:c2 . _:c2 "c2" . _:c2 _:c3 . _:c3 "c3" . _:c3 . _:b0 _:b1 . _:b0 _:c0 . _:b1 "b1" . _:b1 _:b2 . _:b2 "b2" . _:b2 _:b3 . _:b3 "b3" . _:b3 . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0008-out.jsonld0000644000076500000240000000203212231436223024764 0ustar neuronstaff00000000000000[ { "@id": "_:b1", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b1" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@list": [ { "@value": "b2" }, { "@value": "b3" } ] } ] }, { "@id": "_:c1", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "c1" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@list": [ { "@value": "c2" }, { "@value": "c3" } ] } ] }, { "@id": "_:lista", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a1" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@list": [ { "@value": "a2" }, { "@value": "a3" } ] } ] }, { "@id": "http://example.com", "http://example.com/property": [ { "@list": [ { "@id": "_:lista" }, { "@id": "_:b1" }, { "@id": "_:c1" } ] } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0009-in.nq0000644000076500000240000000102312231436223023710 0ustar neuronstaff00000000000000 . "a" . _:b . _:b "b" . _:b _:c . _:c "c" . _:c . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0009-out.jsonld0000644000076500000240000000063412231436223024773 0ustar neuronstaff00000000000000[ { "@id": "http://example.com", "http://example.com/property": [ { "@id": "http://example.com/list" } ] }, { "@id": "http://example.com/list", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@list": [ { "@value": "b" }, { "@value": "c" } ] } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0010-in.nq0000644000076500000240000000055012231436223023704 0ustar neuronstaff00000000000000 _:a . _:a "a" . _:a _:b . _:b "b" . _:b _:c . _:c "c" . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0010-out.jsonld0000644000076500000240000000107512231436223024763 0ustar neuronstaff00000000000000[ { "@id": "_:a", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@id": "_:b" } ] }, { "@id": "_:b", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@id": "_:c" } ] }, { "@id": "_:c", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "c" } ] }, { "@id": "http://example.com", "http://example.com/property": [ { "@id": "_:a" } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0011-in.nq0000644000076500000240000000110212231436223023677 0ustar neuronstaff00000000000000 _:a . _:a "a" . _:a _:b . _:b "b" . _:b "This list node has also properties other than rdf:first and rdf:rest" . _:b _:c . _:c "c" . _:c . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0011-out.jsonld0000644000076500000240000000123212231436223024757 0ustar neuronstaff00000000000000[ { "@id": "_:a", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@id": "_:b" } ] }, { "@id": "_:b", "http://example.com/other-property": [ { "@value": "This list node has also properties other than rdf:first and rdf:rest" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@list": [ { "@value": "c" } ] } ] }, { "@id": "http://example.com", "http://example.com/property": [ { "@id": "_:a" } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0012-in.nq0000644000076500000240000000064412231436223023712 0ustar neuronstaff00000000000000 _:a . _:a "a" . _:a _:b . _:b "b" . _:b _:c . _:c "c" . _:c _:b . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0012-out.jsonld0000644000076500000240000000121312231436223024757 0ustar neuronstaff00000000000000[ { "@id": "_:a", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@id": "_:b" } ] }, { "@id": "_:b", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@id": "_:c" } ] }, { "@id": "_:c", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "c" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@id": "_:b" } ] }, { "@id": "http://example.com", "http://example.com/property": [ { "@id": "_:a" } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0013-in.nq0000644000076500000240000000102012231436223023700 0ustar neuronstaff00000000000000 _:a . _:a "a" . _:a _:b . _:b "b1" . _:b "b2" . _:b _:c . _:c "c" . _:c . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0013-out.jsonld0000644000076500000240000000111012231436223024754 0ustar neuronstaff00000000000000[ { "@id": "_:a", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@id": "_:b" } ] }, { "@id": "_:b", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b1" }, { "@value": "b2" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@list": [ { "@value": "c" } ] } ] }, { "@id": "http://example.com", "http://example.com/property": [ { "@id": "_:a" } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0014-in.nq0000644000076500000240000000126312231436223023712 0ustar neuronstaff00000000000000 _:a . _:a "a" . _:a _:b . _:b "b" . _:b _:c . _:b _:d . _:c "c" . _:c . _:d "d" . _:d . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0014-out.jsonld0000644000076500000240000000102712231436223024764 0ustar neuronstaff00000000000000[ { "@id": "_:a", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@id": "_:b" } ] }, { "@id": "_:b", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "b" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@list": [ { "@value": "c" } ] }, { "@list": [ { "@value": "d" } ] } ] }, { "@id": "http://example.com", "http://example.com/property": [ { "@id": "_:a" } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0015-in.nq0000644000076500000240000000026212231436223023711 0ustar neuronstaff00000000000000 _:a . _:a "a" . _:a "b" . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0015-out.jsonld0000644000076500000240000000043612231436223024770 0ustar neuronstaff00000000000000[ { "@id": "_:a", "http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [ { "@value": "a" } ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [ { "@value": "b" } ] }, { "@id": "http://example.com", "http://example.com/property": [ { "@id": "_:a" } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0016-in.nq0000644000076500000240000000160312231436223023712 0ustar neuronstaff00000000000000 _:b0 . _:b0 . _:b0 "A" . _:b0 _:b1 . _:b1 "B" . _:b1 _:b2 . _:b1 . _:b1 . _:b1 . _:b2 "C" . _:b2 . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0016-out.jsonld0000644000076500000240000000043212231436223024765 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/", "http://example.com/list": [ { "@list": [ { "@value": "A" }, { "@value": "B" }, { "@value": "C" } ] } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0017-in.nq0000644000076500000240000000147612231436223023723 0ustar neuronstaff00000000000000 "1" . "1" . "2"^^ . "2"^^ . . . . . . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0017-out.jsonld0000644000076500000240000000046412231436223024773 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/nodeA", "http://example.com/property": [ { "@value": "1" }, { "@value": "2", "@type": "http://www.w3.org/2001/XMLSchema#integer" }, { "@id": "http://example.com/nodeB" } ], "@type": [ "http://example.com/TypeA" ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0018-in.nq0000644000076500000240000000102012231436223023705 0ustar neuronstaff00000000000000 "true"^^ . "false"^^ . "1"^^ . "1.1"^^ . "1.1E-1"^^ . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0018-out.jsonld0000644000076500000240000000041612231436223024771 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/Subj1", "http://example.com/prop": [ { "@value": true }, { "@value": false }, { "@value": 1 }, { "@value": "1.1", "@type": "http://www.w3.org/2001/XMLSchema#decimal"}, { "@value": 0.11 } ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0019-in.nq0000644000076500000240000000065612231436223023724 0ustar neuronstaff00000000000000 . . "Plain" . "2012-05-12"^^ . "English"@en . rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-0019-out.jsonld0000644000076500000240000000064612231436223024777 0ustar neuronstaff00000000000000[ { "@id": "http://example.com/Subj1", "http://example.com/prop1": [{"@id": "http://example.com/Obj1"}], "http://example.com/prop2": [ {"@value": "Plain"}, {"@value": "2012-05-12", "@type": "http://www.w3.org/2001/XMLSchema#date"}, {"@value": "English", "@language": "en"} ], "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ {"@id": "http://example.com/Type"} ] } ] rdflib-jsonld-0.3/test/test-suite/tests/fromRdf-manifest.jsonld0000644000076500000240000001430412231436223025403 0ustar neuronstaff00000000000000{ "@context": "http://json-ld.org/test-suite/context.jsonld", "@id": "", "@type": "mf:Manifest", "name": "Transform RDF to JSON-LD", "description": "Transform RDF to JSON-LD tests take N-Quads input and use object comparison.", "baseIri": "http://json-ld.org/test-suite/tests/", "sequence": [ { "@id": "#t0001", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "Object Lists", "purpose": "Tests generation using different types of objects.", "input": "fromRdf-0001-in.nq", "expect": "fromRdf-0001-out.jsonld" }, { "@id": "#t0002", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "Native Types", "purpose": "Do not use native datatypes for xsd:boolean, xsd:integer, and xsd:double by default.", "input": "fromRdf-0002-in.nq", "expect": "fromRdf-0002-out.jsonld" }, { "@id": "#t0003", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "BNodes and references", "purpose": "BNode name generation and references between resources.", "input": "fromRdf-0003-in.nq", "expect": "fromRdf-0003-out.jsonld" }, { "@id": "#t0004", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "Lists", "purpose": "Multiple lists with different types of element.", "input": "fromRdf-0004-in.nq", "expect": "fromRdf-0004-out.jsonld" }, { "@id": "#t0005", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "Document with list", "purpose": "Uses a named graph containing a list.", "input": "fromRdf-0005-in.nq", "expect": "fromRdf-0005-out.jsonld" }, { "@id": "#t0006", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "Two graphs having same subject but different values", "purpose": "Ensure that properties and list elements aren't confused between graphs.", "input": "fromRdf-0006-in.nq", "expect": "fromRdf-0006-out.jsonld" }, { "@id": "#t0007", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "Graph with multiple named graphs", "purpose": "Testing @graph recursion.", "input": "fromRdf-0007-in.nq", "expect": "fromRdf-0007-out.jsonld" }, { "@id": "#t0008", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List conversion", "purpose": "Conversion of lists of lists (the triples in the input are only partially ordered on purpose", "input": "fromRdf-0008-in.nq", "expect": "fromRdf-0008-out.jsonld" }, { "@id": "#t0009", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List conversion with IRI nodes", "purpose": "Preserve IRI list nodes (i.e., not blank nodes) when converting to @list", "input": "fromRdf-0009-in.nq", "expect": "fromRdf-0009-out.jsonld" }, { "@id": "#t0010", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List pattern without rdf:nil", "purpose": "Do not convert lists that are not terminated by rdf:nil to @list.", "input": "fromRdf-0010-in.nq", "expect": "fromRdf-0010-out.jsonld" }, { "@id": "#t0011", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List pattern with extra properties", "purpose": "If additional properties are associated to a list node, the list is only partially converted to @list.", "input": "fromRdf-0011-in.nq", "expect": "fromRdf-0011-out.jsonld" }, { "@id": "#t0012", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List pattern with cycles", "purpose": "Detect lists containing cycles and do not convert them to @list.", "input": "fromRdf-0012-in.nq", "expect": "fromRdf-0012-out.jsonld" }, { "@id": "#t0013", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List pattern with multiple values of rdf:first", "purpose": "Do not convert list nodes to @list if nodes contain more than one value for rdf:first.", "input": "fromRdf-0013-in.nq", "expect": "fromRdf-0013-out.jsonld" }, { "@id": "#t0014", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List pattern with multiple values of rdf:rest", "purpose": "Do not convert list nodes to @list if nodes contain more than one value for rdf:rest.", "input": "fromRdf-0014-in.nq", "expect": "fromRdf-0014-out.jsonld" }, { "@id": "#t0015", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List pattern with IRI rdf:rest", "purpose": "Do not convert lists to @list if a list node's rdf:rest is an IRI.", "input": "fromRdf-0015-in.nq", "expect": "fromRdf-0015-out.jsonld" }, { "@id": "#t0016", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "List pattern with type rdf:List", "purpose": "List nodes may have a rdf:type rdf:List.", "input": "fromRdf-0016-in.nq", "expect": "fromRdf-0016-out.jsonld" }, { "@id": "#t0017", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "Remove duplicate triples", "purpose": "Equivalent triples are used only once", "input": "fromRdf-0017-in.nq", "expect": "fromRdf-0017-out.jsonld" }, { "@id": "#t0018", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "use native types flag set to true", "purpose": "Literals with datatype xsd:boolean, xsd:integer, and xsd:double are serialized using native scalar values", "option": { "useNativeTypes": true }, "input": "fromRdf-0018-in.nq", "expect": "fromRdf-0018-out.jsonld" }, { "@id": "#t0019", "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"], "name": "use rdf:type flag set to false", "purpose": "Setting useRdfType to true causes an rdf:type predicate to be treated like a normal property, not @type", "option": { "useRdfType": true }, "input": "fromRdf-0019-in.nq", "expect": "fromRdf-0019-out.jsonld" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0001-in.jsonld0000644000076500000240000000014312231436223024234 0ustar neuronstaff00000000000000{ "@id": "http://greggkellogg.net/foaf#me", "http://xmlns.com/foaf/0.1/name": "Gregg Kellogg" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0001-out.nq0000644000076500000240000000012512231436223023562 0ustar neuronstaff00000000000000 "Gregg Kellogg" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0002-in.jsonld0000644000076500000240000000020412231436223024233 0ustar neuronstaff00000000000000{ "@context": {"foaf": "http://xmlns.com/foaf/0.1/"}, "@id": "http://greggkellogg.net/foaf#me", "foaf:name": "Gregg Kellogg" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0002-out.nq0000644000076500000240000000012512231436223023563 0ustar neuronstaff00000000000000 "Gregg Kellogg" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0003-in.jsonld0000644000076500000240000000012212231436223024233 0ustar neuronstaff00000000000000{ "@context": {"foaf": "http://xmlns.com/foaf/0.1/"}, "@type": "foaf:Person" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0003-out.nq0000644000076500000240000000013412231436223023564 0ustar neuronstaff00000000000000_:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0004-in.jsonld0000644000076500000240000000020412231436223024235 0ustar neuronstaff00000000000000{ "http://www.w3.org/2000/01/rdf-schema#label": { "@value": "A plain literal with a lang tag.", "@language": "en-us" } }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0004-out.nq0000644000076500000240000000013512231436223023566 0ustar neuronstaff00000000000000_:b0 "A plain literal with a lang tag."@en-us . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0005-in.jsonld0000644000076500000240000000025712231436223024246 0ustar neuronstaff00000000000000{ "@id": "http://greggkellogg.net/foaf#me", "http://xmlns.com/foaf/0.1/knows": { "http://xmlns.com/foaf/0.1/name": {"@value": "Herman Iván", "@language": "hu"} } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0005-out.nq0000644000076500000240000000020512231436223023565 0ustar neuronstaff00000000000000 _:b0 . _:b0 "Herman Iván"@hu . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0006-in.jsonld0000644000076500000240000000025712231436223024247 0ustar neuronstaff00000000000000{ "@id": "http://greggkellogg.net/foaf#me", "http://purl.org/dc/terms/created": { "@value": "1957-02-27", "@type": "http://www.w3.org/2001/XMLSchema#date" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0006-out.nq0000644000076500000240000000017512231436223023574 0ustar neuronstaff00000000000000 "1957-02-27"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0007-in.jsonld0000644000076500000240000000013512231436223024243 0ustar neuronstaff00000000000000{ "@id": "http://greggkellogg.net/foaf#me", "@type": "http://xmlns.com/foaf/0.1/Person" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0007-out.nq0000644000076500000240000000017112231436223023571 0ustar neuronstaff00000000000000 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0008-in.jsonld0000644000076500000240000000011112231436223024236 0ustar neuronstaff00000000000000{ "@context": {"d": "http://example.com/default#"}, "d:foo": "bar" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0008-out.nq0000644000076500000240000000005612231436223023574 0ustar neuronstaff00000000000000_:b0 "bar" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0009-in.jsonld0000644000076500000240000000011212231436223024240 0ustar neuronstaff00000000000000{ "@context": {"foo": "http://example.com/default#"}, "foo:": "bar" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0009-out.nq0000644000076500000240000000005312231436223023572 0ustar neuronstaff00000000000000_:b0 "bar" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0010-in.jsonld0000644000076500000240000000030412231436223024233 0ustar neuronstaff00000000000000{ "@context": {"foaf": "http://xmlns.com/foaf/0.1/"}, "@id": "http://greggkellogg.net/foaf#me", "foaf:knows": { "@id": "http://manu.sporny.org/#me", "foaf:name": "Manu Sporny" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0010-out.nq0000644000076500000240000000026112231436223023563 0ustar neuronstaff00000000000000 . "Manu Sporny" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0011-in.jsonld0000644000076500000240000000024412231436223024237 0ustar neuronstaff00000000000000{ "@context": { "foaf": "http://xmlns.com/foaf/0.1/" }, "@id": "http://greggkellogg.net/foaf#me", "foaf:knows": { "foaf:name": "Dave Longley" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0011-out.nq0000644000076500000240000000020212231436223023557 0ustar neuronstaff00000000000000 _:b0 . _:b0 "Dave Longley" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0012-in.jsonld0000644000076500000240000000023512231436223024240 0ustar neuronstaff00000000000000{ "@context": { "foaf": "http://xmlns.com/foaf/0.1/" }, "@id": "http://greggkellogg.net/foaf#me", "foaf:knows": ["Manu Sporny", "Dave Longley"] }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0012-out.nq0000644000076500000240000000025112231436223023564 0ustar neuronstaff00000000000000 "Dave Longley" . "Manu Sporny" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0013-in.jsonld0000644000076500000240000000021412231436223024236 0ustar neuronstaff00000000000000{ "@context": { "foaf": "http://xmlns.com/foaf/0.1/" }, "@id": "http://greggkellogg.net/foaf#me", "foaf:knows": {"@list": []} } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0013-out.nq0000644000076500000240000000016712231436223023573 0ustar neuronstaff00000000000000 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0014-in.jsonld0000644000076500000240000000023112231436223024236 0ustar neuronstaff00000000000000{ "@context": { "foaf": "http://xmlns.com/foaf/0.1/" }, "@id": "http://greggkellogg.net/foaf#me", "foaf:knows": {"@list": ["Manu Sporny"]} } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0014-out.nq0000644000076500000240000000037512231436223023575 0ustar neuronstaff00000000000000 _:b0 . _:b0 "Manu Sporny" . _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0015-in.jsonld0000644000076500000240000000025112231436223024241 0ustar neuronstaff00000000000000{ "@context": { "foaf": "http://xmlns.com/foaf/0.1/" }, "@id": "http://greggkellogg.net/foaf#me", "foaf:knows": {"@list": ["Manu Sporny", "Dave Longley"]} } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0015-out.nq0000644000076500000240000000060412231436223023571 0ustar neuronstaff00000000000000 _:b0 . _:b0 "Manu Sporny" . _:b0 _:b1 . _:b1 "Dave Longley" . _:b1 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0016-in.jsonld0000644000076500000240000000011312231436223024237 0ustar neuronstaff00000000000000{ "@id": "", "@type": "http://www.w3.org/2000/01/rdf-schema#Resource" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0016-out.nq0000644000076500000240000000023712231436223023574 0ustar neuronstaff00000000000000 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0017-in.jsonld0000644000076500000240000000011612231436223024243 0ustar neuronstaff00000000000000{ "@id": "a/b", "@type": "http://www.w3.org/2000/01/rdf-schema#Resource" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0017-out.nq0000644000076500000240000000021612231436223023572 0ustar neuronstaff00000000000000 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0018-in.jsonld0000644000076500000240000000012012231436223024237 0ustar neuronstaff00000000000000{ "@id": "#frag", "@type": "http://www.w3.org/2000/01/rdf-schema#Resource" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0018-out.nq0000644000076500000240000000024412231436223023574 0ustar neuronstaff00000000000000 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0019-in.jsonld0000644000076500000240000000034312231436223024247 0ustar neuronstaff00000000000000{ "@context": { "foaf": "http://xmlns.com/foaf/0.1/", "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id"} }, "@id": "http://greggkellogg.net/foaf#me", "knows": "http://manu.sporny.org/#me" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0019-out.nq0000644000076500000240000000014312231436223023573 0ustar neuronstaff00000000000000 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0020-in.jsonld0000644000076500000240000000034112231436223024235 0ustar neuronstaff00000000000000{ "@context": { "xsd": "http://www.w3.org/2001/XMLSchema#", "created": {"@id": "http://purl.org/dc/terms/created", "@type": "xsd:date"} }, "@id": "http://greggkellogg.net/foaf#me", "created": "1957-02-27" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0020-out.nq0000644000076500000240000000017512231436223023570 0ustar neuronstaff00000000000000 "1957-02-27"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0022-in.jsonld0000644000076500000240000000012112231436223024233 0ustar neuronstaff00000000000000{ "@context": { "measure": "http://example/measure#"}, "measure:cups": 5.3 } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0022-out.nq0000644000076500000240000000013012231436223023561 0ustar neuronstaff00000000000000_:b0 "5.3E0"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0023-in.jsonld0000644000076500000240000000011112231436223024233 0ustar neuronstaff00000000000000{ "@context": { "chem": "http://example/chem#"}, "chem:protons": 12 }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0023-out.nq0000644000076500000240000000012612231436223023567 0ustar neuronstaff00000000000000_:b0 "12"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0024-in.jsonld0000644000076500000240000000012012231436223024234 0ustar neuronstaff00000000000000{ "@context": { "sensor": "http://example/sensor#"}, "sensor:active": true }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0024-out.nq0000644000076500000240000000013112231436223023564 0ustar neuronstaff00000000000000_:b0 "true"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0025-in.jsonld0000644000076500000240000000025712231436223024250 0ustar neuronstaff00000000000000{ "@context": { "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@container": "@list"} }, "@id": "http://greggkellogg.net/foaf#me", "knows": ["Manu Sporny"] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0025-out.nq0000644000076500000240000000037512231436223023577 0ustar neuronstaff00000000000000 _:b0 . _:b0 "Manu Sporny" . _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0026-in.jsonld0000644000076500000240000000016012231436223024242 0ustar neuronstaff00000000000000{ "@context": {"rdfs": "http://www.w3.org/2000/01/rdf-schema#"}, "@type": ["rdfs:Resource", "rdfs:Class"] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0026-out.nq0000644000076500000240000000031712231436223023574 0ustar neuronstaff00000000000000_:b0 . _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0027-in.jsonld0000644000076500000240000000162612231436223024253 0ustar neuronstaff00000000000000{ "@context": { "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "ex": "http://example.org/", "xsd": "http://www.w3.org/2001/XMLSchema#", "ex:locatedIn": {"@type": "@id"}, "ex:hasPopulaton": {"@type": "xsd:integer"}, "ex:hasReference": {"@type": "@id"} }, "@graph": [ { "@id": "http://example.org/ParisFact1", "@type": "rdf:Graph", "@graph": { "@id": "http://example.org/location/Paris#this", "ex:locatedIn": "http://example.org/location/France#this" }, "ex:hasReference": ["http://www.britannica.com/", "http://www.wikipedia.org/", "http://www.brockhaus.de/"] }, { "@id": "http://example.org/ParisFact2", "@type": "rdf:Graph", "@graph": { "@id": "http://example.org/location/Paris#this", "ex:hasPopulation": 7000000 }, "ex:hasReference": "http://www.wikipedia.org/" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0027-out.nq0000644000076500000240000000170612231436223023600 0ustar neuronstaff00000000000000 . . . . . . "7000000"^^ . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0028-in.jsonld0000644000076500000240000000120312231436223024243 0ustar neuronstaff00000000000000{ "@context": { "sec": "http://purl.org/security#", "xsd": "http://www.w3.org/2001/XMLSchema#", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "dc": "http://purl.org/dc/terms/", "sec:signer": {"@type": "@id"}, "dc:created": {"@type": "xsd:dateTime"} }, "@id": "http://example.org/sig1", "@type": ["rdf:Graph", "sec:SignedGraph"], "dc:created": "2011-09-23T20:21:34Z", "sec:signer": "http://payswarm.example.com/i/john/keys/5", "sec:signatureValue": "OGQzNGVkMzVm4NTIyZTkZDYMmMzQzNmExMgoYzI43Q3ODIyOWM32NjI=", "@graph": { "@id": "http://example.org/fact1", "dc:title": "Hello World!" } }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0028-out.nq0000644000076500000240000000131312231436223023573 0ustar neuronstaff00000000000000 "Hello World!" . "2011-09-23T20:21:34Z"^^ . "OGQzNGVkMzVm4NTIyZTkZDYMmMzQzNmExMgoYzI43Q3ODIyOWM32NjI=" . . . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0029-in.jsonld0000644000076500000240000000065312231436223024254 0ustar neuronstaff00000000000000{ "@context": { "wd": "http://data.wikipedia.org/vocab#", "ws": "http://data.wikipedia.org/snaks/", "wp": "http://en.wikipedia.org/wiki/" }, "@id": "ws:Assertions", "@type": "wd:SnakSet", "@graph": { "@id": "ws:BerlinFact", "@type": "wd:Snak", "@graph": { "@id": "wp:Berlin", "wd:population": 3499879 }, "wd:assertedBy": "http://www.statistik-berlin-brandenburg.de/" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0029-out.nq0000644000076500000240000000125712231436223023603 0ustar neuronstaff00000000000000 . "http://www.statistik-berlin-brandenburg.de/" . . "3499879"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0030-in.jsonld0000644000076500000240000000133312231436223024240 0ustar neuronstaff00000000000000{ "@context": { "xsd": "http://www.w3.org/2001/XMLSchema#", "knows": "http://xmlns.com/foaf/0.1/knows", "name": "http://xmlns.com/foaf/0.1/name", "asOf": "http://example.org/asOf" }, "@id": "http://example.org/linked-data-graph", "asOf": {"@value": "2012-04-09", "@type": "xsd:date"}, "@graph": [ { "@id": "http://manu.sporny.org/i/public", "@type": "foaf:Person", "name": "Manu Sporny", "knows": "http://greggkellogg.net/foaf#me" }, { "@id": "http://greggkellogg.net/foaf#me", "@type": "foaf:Person", "name": "Gregg Kellogg", "knows": "http://manu.sporny.org/i/public" }, { "@id": "http://www.markus-lanthaler.com/" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0030-out.nq0000644000076500000240000000164312231436223023572 0ustar neuronstaff00000000000000 "2012-04-09"^^ . . "http://manu.sporny.org/i/public" . "Gregg Kellogg" . . "http://greggkellogg.net/foaf#me" . "Manu Sporny" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0031-in.jsonld0000644000076500000240000000050712231436223024243 0ustar neuronstaff00000000000000{ "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "defines": { "@reverse": "rdfs:definedBy" }, "label": "rdfs:label" }, "@id": "http://example.com/vocab", "label": "My vocabulary", "defines": [ { "@id": "http://example.com/vocab#property", "label": "A property" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0031-out.nq0000644000076500000240000000045412231436223023572 0ustar neuronstaff00000000000000 . "A property" . "My vocabulary" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0032-in.jsonld0000644000076500000240000000053412231436223024244 0ustar neuronstaff00000000000000{ "@id": "ex:node1", "owl:sameAs": { "@id": "ex:node2", "rdfs:label": "Node 2", "link": "ex:node3", "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#" } }, "@context": { "ex": "http://example.org/", "owl": "http://www.w3.org/2002/07/owl#", "link": { "@id": "ex:link", "@type": "@id" } } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0032-out.nq0000644000076500000240000000040412231436223023566 0ustar neuronstaff00000000000000 . . "Node 2" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0033-in.jsonld0000644000076500000240000000055412231436223024247 0ustar neuronstaff00000000000000{ "@context": { "ex": "http://example.org/", "owl": "http://www.w3.org/2002/07/owl#", "link": { "@id": "ex:link", "@type": "@id" } }, "owl:sameAs": { "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#" }, "rdfs:label": "Node 2", "link": "ex:node3", "@id": "ex:node2" }, "@id": "ex:node1" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0033-out.nq0000644000076500000240000000040412231436223023567 0ustar neuronstaff00000000000000 . . "Node 2" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0034-in.jsonld0000644000076500000240000000053412231436223024246 0ustar neuronstaff00000000000000{ "@context": { "link": { "@id": "ex:link", "@type": "@id" }, "ex": "http://example.org/", "owl": "http://www.w3.org/2002/07/owl#" }, "@id": "ex:node1", "owl:sameAs": { "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#" }, "@id": "ex:node2", "rdfs:label": "Node 2", "link": "ex:node3" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0034-out.nq0000644000076500000240000000040412231436223023570 0ustar neuronstaff00000000000000 . . "Node 2" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0035-in.jsonld0000644000076500000240000000047512231436223024253 0ustar neuronstaff00000000000000{ "@context": { "double": { "@id": "http://example.com/double", "@type": "http://www.w3.org/2001/XMLSchema#double" }, "integer": { "@id": "http://example.com/integer", "@type": "http://www.w3.org/2001/XMLSchema#integer" } }, "double": [1, 2.2 ], "integer": [8, 9.9 ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0035-out.nq0000644000076500000240000000053012231436223023571 0ustar neuronstaff00000000000000_:b0 "1.0E0"^^ . _:b0 "2.2E0"^^ . _:b0 "8"^^ . _:b0 "9.9E0"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0036-in.jsonld0000644000076500000240000000021712231436223024246 0ustar neuronstaff00000000000000{ "@id": "http://example.com/", "ex:prop1": { "@list": [ { "@id": "_:x1" }, { "@id": "_:x2" } ] }, "ex:prop2": { "@id": "_:x3" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0036-out.nq0000644000076500000240000000056612231436223023603 0ustar neuronstaff00000000000000 _:b3 . _:b2 . _:b3 _:b0 . _:b3 _:b4 . _:b4 _:b1 . _:b4 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0041-in.jsonld0000644000076500000240000000005212231436223024237 0ustar neuronstaff00000000000000{"@id": "http://example.org/test#example"}rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0041-out.nq0000644000076500000240000000000012231436223023556 0ustar neuronstaff00000000000000rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0042-in.jsonld0000644000076500000240000000075612231436223024253 0ustar neuronstaff00000000000000{ "@context": { "t1": "http://example.com/t1", "t2": "http://example.com/t2", "term1": "http://example.com/term1", "term2": "http://example.com/term2", "term3": "http://example.com/term3", "term4": "http://example.com/term4", "term5": "http://example.com/term5" }, "@id": "http://example.com/id1", "@type": "t1", "term1": "v1", "term2": {"@value": "v2", "@type": "t2"}, "term3": {"@value": "v3", "@language": "en"}, "term4": 4, "term5": [50, 51] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0042-out.nq0000644000076500000240000000114612231436223023573 0ustar neuronstaff00000000000000 "v1" . "v2"^^ . "v3"@en . "4"^^ . "50"^^ . "51"^^ . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0043-in.jsonld0000644000076500000240000000030512231436223024242 0ustar neuronstaff00000000000000{ "@id": "http://example.org/id", "http://example.org/property": null, "regularJson": { "nonJsonLd": "property", "deep": [{ "foo": "bar" }, { "bar": "foo" }] } }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0043-out.nq0000644000076500000240000000000012231436223023560 0ustar neuronstaff00000000000000rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0044-in.jsonld0000644000076500000240000000152512231436223024250 0ustar neuronstaff00000000000000{ "@context": { "mylist1": {"@id": "http://example.com/mylist1", "@container": "@list"}, "mylist2": {"@id": "http://example.com/mylist2", "@container": "@list"}, "myset2": {"@id": "http://example.com/myset2", "@container": "@set"}, "myset3": {"@id": "http://example.com/myset3", "@container": "@set"} }, "@id": "http://example.org/id", "mylist1": { "@list": [ ] }, "mylist2": "one item", "myset2": { "@set": [ ] }, "myset3": [ "v1" ], "http://example.org/list1": { "@list": [ null ] }, "http://example.org/list2": { "@list": [ {"@value": null} ] }, "http://example.org/set1": { "@set": [ ] }, "http://example.org/set1": { "@set": [ null ] }, "http://example.org/set3": [ ], "http://example.org/set4": [ null ], "http://example.org/set5": "one item", "http://example.org/property": { "@list": "one item" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0044-out.nq0000644000076500000240000000160512231436223023575 0ustar neuronstaff00000000000000 . _:b0 . "v1" . . . _:b1 . "one item" . _:b0 "one item" . _:b0 . _:b1 "one item" . _:b1 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0045-in.jsonld0000644000076500000240000000076712231436223024260 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@id" }, "know": "http://xmlns.com/foaf/0.1/knows", "@iri": "@id" }, "@id": "#me", "know": [ { "@id": "http://example.com/bob#me", "name": "Bob", "homepage": "http://example.com/bob" }, { "@id": "http://example.com/alice#me", "name": "Alice", "homepage": "http://example.com/alice" } ] }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0045-out.nq0000644000076500000240000000111012231436223023565 0ustar neuronstaff00000000000000 . "Alice" . . "Bob" . . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0046-in.jsonld0000644000076500000240000000102712231436223024247 0ustar neuronstaff00000000000000{ "@context": { "http://example.org/test#property1": { "@type": "@id" }, "http://example.org/test#property2": { "@type": "@id" }, "uri": "@id" }, "http://example.org/test#property1": { "http://example.org/test#property4": "foo", "uri": "http://example.org/test#example2" }, "http://example.org/test#property2": "http://example.org/test#example3", "http://example.org/test#property3": { "uri": "http://example.org/test#example4" }, "uri": "http://example.org/test#example1" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0046-out.nq0000644000076500000240000000062312231436223023576 0ustar neuronstaff00000000000000 . . . "foo" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0047-in.jsonld0000644000076500000240000000063412231436223024253 0ustar neuronstaff00000000000000{ "@context": { "ex": "http://example.org/vocab#", "ex:date": { "@type": "xsd:dateTime" }, "ex:parent": { "@type": "@id" }, "xsd": "http://www.w3.org/2001/XMLSchema#" }, "@id": "http://example.org/test#example1", "ex:date": "2011-01-25T00:00:00Z", "ex:embed": { "@id": "http://example.org/test#example2", "ex:parent": "http://example.org/test#example1" } }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0047-out.nq0000644000076500000240000000053412231436223023600 0ustar neuronstaff00000000000000 "2011-01-25T00:00:00Z"^^ . . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0048-in.jsonld0000644000076500000240000000037312231436223024254 0ustar neuronstaff00000000000000{ "@context": { "ex": "http://example.org/vocab#" }, "@id": "http://example.org/test", "ex:test": { "@value": "test", "@language": "en" }, "ex:drop-lang-only": { "@language": "en" }, "ex:keep-full-value": { "@value": "only value" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0048-out.nq0000644000076500000240000000023212231436223023574 0ustar neuronstaff00000000000000 "only value" . "test"@en . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0049-in.jsonld0000644000076500000240000000205112231436223024250 0ustar neuronstaff00000000000000{ "@context": { "authored": { "@id": "http://example.org/vocab#authored", "@type": "@id" }, "contains": { "@id": "http://example.org/vocab#contains", "@type": "@id" }, "contributor": "http://purl.org/dc/elements/1.1/contributor", "description": "http://purl.org/dc/elements/1.1/description", "name": "http://xmlns.com/foaf/0.1/name", "title": { "@id": "http://purl.org/dc/elements/1.1/title" } }, "@graph": [ { "@id": "http://example.org/test#chapter", "description": "Fun", "title": "Chapter One" }, { "@id": "http://example.org/test#jane", "authored": "http://example.org/test#chapter", "name": "Jane" }, { "@id": "http://example.org/test#john", "name": "John" }, { "@id": "http://example.org/test#library", "contains": { "@id": "http://example.org/test#book", "contains": "http://example.org/test#chapter", "contributor": "Writer", "title": "My Book" } } ] }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0049-out.nq0000644000076500000240000000144412231436223023603 0ustar neuronstaff00000000000000 . "Writer" . "My Book" . "Fun" . "Chapter One" . . "Jane" . "John" . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0050-in.jsonld0000644000076500000240000000040612231436223024242 0ustar neuronstaff00000000000000{ "@context": { "d": "http://purl.org/dc/elements/1.1/", "e": "http://example.org/vocab#", "f": "http://xmlns.com/foaf/0.1/", "xsd": "http://www.w3.org/2001/XMLSchema#" }, "@id": "http://example.org/test", "e:bool": true, "e:int": 123 }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0050-out.nq0000644000076500000240000000033412231436223023570 0ustar neuronstaff00000000000000 "true"^^ . "123"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0051-in.jsonld0000644000076500000240000000050012231436223024236 0ustar neuronstaff00000000000000{ "@context": { "dc": "http://purl.org/dc/elements/1.1/", "ex": "http://example.org/vocab#", "ex:contains": { "@type": "@id" }, "xsd": "http://www.w3.org/2001/XMLSchema#" }, "@id": "http://example.org/test#book", "dc:title": "Title", "ex:contains": "http://example.org/test#chapter" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0051-out.nq0000644000076500000240000000027012231436223023570 0ustar neuronstaff00000000000000 . "Title" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0052-in.jsonld0000644000076500000240000000163412231436223024250 0ustar neuronstaff00000000000000{ "@context": { "dc": "http://purl.org/dc/elements/1.1/", "ex": "http://example.org/vocab#", "ex:authored": { "@type": "@id" }, "ex:contains": { "@type": "@id" }, "foaf": "http://xmlns.com/foaf/0.1/", "xsd": "http://www.w3.org/2001/XMLSchema#" }, "@graph": [ { "@id": "http://example.org/test#chapter", "dc:description": "Fun", "dc:title": "Chapter One" }, { "@id": "http://example.org/test#jane", "ex:authored": "http://example.org/test#chapter", "foaf:name": "Jane" }, { "@id": "http://example.org/test#john", "foaf:name": "John" }, { "@id": "http://example.org/test#library", "ex:contains": { "@id": "http://example.org/test#book", "dc:contributor": "Writer", "dc:title": "My Book", "ex:contains": "http://example.org/test#chapter" } } ] }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0052-out.nq0000644000076500000240000000144412231436223023575 0ustar neuronstaff00000000000000 . "Writer" . "My Book" . "Fun" . "Chapter One" . . "Jane" . "John" . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0053-in.jsonld0000644000076500000240000000052712231436223024251 0ustar neuronstaff00000000000000[{ "@id": "http://example.com/id1", "@type": ["http://example.com/t1"], "http://example.com/term1": ["v1"], "http://example.com/term2": [{"@value": "v2", "@type": "http://example.com/t2"}], "http://example.com/term3": [{"@value": "v3", "@language": "en"}], "http://example.com/term4": [4], "http://example.com/term5": [50, 51] }]rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0053-out.nq0000644000076500000240000000114612231436223023575 0ustar neuronstaff00000000000000 "v1" . "v2"^^ . "v3"@en . "4"^^ . "50"^^ . "51"^^ . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0054-in.jsonld0000644000076500000240000000174312231436223024253 0ustar neuronstaff00000000000000{ "@context": { "ex": "http://example.org/test#", "property1": { "@id": "http://example.org/test#property1", "@type": "@id" }, "property2": { "@id": "ex:property2", "@type": "@id" }, "uri": "@id", "set": "@set", "value": "@value", "type": "@type", "xsd": { "@id": "http://www.w3.org/2001/XMLSchema#" } }, "property1": { "uri": "ex:example2", "http://example.org/test#property4": "foo" }, "property2": "http://example.org/test#example3", "http://example.org/test#property3": { "uri": "http://example.org/test#example4" }, "ex:property4": { "uri": "ex:example4", "ex:property5": [ { "set": [ { "value": "2012-03-31", "type": "xsd:date" } ] } ] }, "ex:property6": [ { "set": [ { "value": null, "type": "xsd:date" } ] } ], "uri": "http://example.org/test#example1" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0054-out.nq0000644000076500000240000000117612231436223023601 0ustar neuronstaff00000000000000 . . . . "foo" . "2012-03-31"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0055-in.jsonld0000644000076500000240000000120112231436223024241 0ustar neuronstaff00000000000000{ "@context": { "mylist1": {"@id": "http://example.com/mylist1", "@container": "@list"}, "mylist2": {"@id": "http://example.com/mylist2", "@container": "@list"}, "myset1": {"@id": "http://example.com/myset1", "@container": "@set" }, "myset2": {"@id": "http://example.com/myset2", "@container": "@set" }, "myset3": {"@id": "http://example.com/myset3", "@container": "@set" } }, "@id": "http://example.org/id", "mylist1": [], "myset1": { "@set": [] }, "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ], "myset3": [ { "@set": [ "hello", "this" ] }, "will", { "@set": [ "be", "collapsed" ] } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0055-out.nq0000644000076500000240000000063512231436223023601 0ustar neuronstaff00000000000000 . "be" . "collapsed" . "hello" . "this" . "will" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0056-in.jsonld0000644000076500000240000000202312231436223024245 0ustar neuronstaff00000000000000{ "@context": { "myproperty": { "@id": "http://example.com/myproperty" }, "mylist1": {"@id": "http://example.com/mylist1", "@container": "@list"}, "mylist2": {"@id": "http://example.com/mylist2", "@container": "@list"}, "myset1": {"@id": "http://example.com/myset1", "@container": "@set" }, "myset2": {"@id": "http://example.com/myset2", "@container": "@set" } }, "@id": "http://example.org/id1", "mylist1": [], "mylist2": [ 2, "hi" ], "myset1": { "@set": [] }, "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ], "myproperty": { "@context": null, "@id": "http://example.org/id2", "mylist1": [], "mylist2": [ 2, "hi" ], "myset1": { "@set": [] }, "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ], "http://example.org/myproperty2": "ok" }, "http://example.com/emptyobj": { "@context": null, "mylist1": [], "mylist2": [ 2, "hi" ], "myset1": { "@set": [] }, "myset2": [ { "@set": [] }, [], { "@set": [ null ] }, [ null ] ] } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0056-out.nq0000644000076500000240000000131212231436223023573 0ustar neuronstaff00000000000000 _:b0 . . _:b1 . . "ok" . _:b1 "2"^^ . _:b1 _:b2 . _:b2 "hi" . _:b2 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0057-in.jsonld0000644000076500000240000000211412231436223024247 0ustar neuronstaff00000000000000{ "@context": { "authored": { "@id": "http://example.org/vocab#authored", "@type": "@id" }, "contains": { "@id": "http://example.org/vocab#contains", "@type": "@id" }, "contributor": "http://purl.org/dc/elements/1.1/contributor", "description": "http://purl.org/dc/elements/1.1/description", "name": "http://xmlns.com/foaf/0.1/name", "title": { "@id": "http://purl.org/dc/elements/1.1/title" }, "id": "@id", "data": "@graph" }, "data": [ { "id": "http://example.org/test#chapter", "description": "Fun", "title": "Chapter One" }, { "@id": "http://example.org/test#jane", "authored": "http://example.org/test#chapter", "name": "Jane" }, { "id": "http://example.org/test#john", "name": "John" }, { "id": "http://example.org/test#library", "contains": { "@id": "http://example.org/test#book", "contains": "http://example.org/test#chapter", "contributor": "Writer", "title": "My Book" } } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0057-out.nq0000644000076500000240000000144412231436223023602 0ustar neuronstaff00000000000000 . "Writer" . "My Book" . "Fun" . "Chapter One" . . "Jane" . "John" . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0058-in.jsonld0000644000076500000240000000060312231436223024251 0ustar neuronstaff00000000000000{ "@context": { "ex": "http://example.org/vocab#", "@language": "en", "de": { "@id": "ex:german", "@language": "de" }, "nolang": { "@id": "ex:nolang", "@language": null } }, "@id": "http://example.org/test", "ex:test-default": [ "hello", 1, true ], "de": [ "hallo", 2, true ], "nolang": [ "no language", 3, false ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0058-out.nq0000644000076500000240000000161612231436223023604 0ustar neuronstaff00000000000000 "2"^^ . "hallo"@de . "true"^^ . "3"^^ . "false"^^ . "no language" . "1"^^ . "hello"@en . "true"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0059-in.jsonld0000644000076500000240000000015712231436223024256 0ustar neuronstaff00000000000000{ "@context": { "myproperty": "http://example.com/myproperty" }, "myproperty": { "@value" : null } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0059-out.nq0000644000076500000240000000000012231436223023567 0ustar neuronstaff00000000000000rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0060-in.jsonld0000644000076500000240000000235012231436223024243 0ustar neuronstaff00000000000000{ "@context": { "authored": { "@id": "http://example.org/vocab#authored", "@type": "@id" }, "contains": { "@id": "http://example.org/vocab#contains", "@type": "@id" }, "contributor": "http://purl.org/dc/elements/1.1/contributor", "description": "http://purl.org/dc/elements/1.1/description", "name": "http://xmlns.com/foaf/0.1/name", "title": { "@id": "http://purl.org/dc/elements/1.1/title" } }, "@graph": [ { "@id": "http://example.org/test#jane", "name": "Jane", "authored": { "@graph": [ { "@id": "http://example.org/test#chapter1", "description": "Fun", "title": "Chapter One" }, { "@id": "http://example.org/test#chapter2", "description": "More fun", "title": "Chapter Two" } ] } }, { "@id": "http://example.org/test#john", "name": "John" }, { "@id": "http://example.org/test#library", "contains": { "@id": "http://example.org/test#book", "contains": "http://example.org/test#chapter", "contributor": "Writer", "title": "My Book" } } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0060-out.nq0000644000076500000240000000172612231436223023577 0ustar neuronstaff00000000000000 . "Writer" . "My Book" . "Fun" _:b0 . "Chapter One" _:b0 . "More fun" _:b0 . "Chapter Two" _:b0 . _:b0 . "Jane" . "John" . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0061-in.jsonld0000644000076500000240000000257212231436223024252 0ustar neuronstaff00000000000000{ "@context": { "authored": { "@id": "http://example.org/vocab#authored", "@type": "@id" }, "contains": { "@id": "http://example.org/vocab#contains", "@type": "@id" }, "contributor": "http://purl.org/dc/elements/1.1/contributor", "description": "http://purl.org/dc/elements/1.1/description", "name": "http://xmlns.com/foaf/0.1/name", "title": { "@id": "http://purl.org/dc/elements/1.1/title" } }, "title": "My first graph", "@graph": [ { "@id": "http://example.org/test#jane", "name": "Jane", "authored": { "@graph": [ { "@id": "http://example.org/test#chapter1", "description": "Fun", "title": "Chapter One" }, { "@id": "http://example.org/test#chapter2", "description": "More fun", "title": "Chapter Two" }, { "@id": "http://example.org/test#chapter3", "title": "Chapter Three" } ] } }, { "@id": "http://example.org/test#john", "name": "John" }, { "@id": "http://example.org/test#library", "contains": { "@id": "http://example.org/test#book", "contains": "http://example.org/test#chapter", "contributor": "Writer", "title": "My Book" } } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0061-out.nq0000644000076500000240000000223312231436223023572 0ustar neuronstaff00000000000000 _:b0 . "Writer" _:b0 . "My Book" _:b0 . "Fun" _:b1 . "Chapter One" _:b1 . "More fun" _:b1 . "Chapter Two" _:b1 . "Chapter Three" _:b1 . _:b1 _:b0 . "Jane" _:b0 . "John" _:b0 . _:b0 . _:b0 "My first graph" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0062-in.jsonld0000644000076500000240000000014312231436223024243 0ustar neuronstaff00000000000000{ "@context": { "term": "http://example.com/term", "@language": "en" }, "term": "v" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0062-out.nq0000644000076500000240000000005012231436223023566 0ustar neuronstaff00000000000000_:b0 "v"@en . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0063-in.jsonld0000644000076500000240000000204712231436223024251 0ustar neuronstaff00000000000000{ "@context": { "xsd": "http://www.w3.org/2001/XMLSchema#", "idlist": {"@id": "http://example.com/idlist", "@container": "@list", "@type": "@id"}, "datelist": {"@id": "http://example.com/datelist", "@container": "@list", "@type": "xsd:date"}, "idset": {"@id": "http://example.com/idset", "@container": "@set", "@type": "@id"}, "dateset": {"@id": "http://example.com/dateset", "@container": "@set", "@type": "xsd:date"}, "idprop": {"@id": "http://example.com/idprop", "@type": "@id" }, "dateprop": {"@id": "http://example.com/dateprop", "@type": "xsd:date" }, "idprop2": {"@id": "http://example.com/idprop2", "@type": "@id" }, "dateprop2": {"@id": "http://example.com/dateprop2", "@type": "xsd:date" } }, "idlist": ["http://example.org/id"], "datelist": ["2012-04-12"], "idprop": {"@list": ["http://example.org/id"]}, "dateprop": {"@list": ["2012-04-12"]}, "idset": ["http://example.org/id"], "dateset": ["2012-04-12"], "idprop2": {"@set": ["http://example.org/id"]}, "dateprop2": {"@set": ["2012-04-12"]} } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0063-out.nq0000644000076500000240000000237412231436223023602 0ustar neuronstaff00000000000000_:b0 _:b1 . _:b0 "2012-04-12"^^ . _:b0 _:b2 . _:b0 "2012-04-12"^^ . _:b0 _:b3 . _:b0 . _:b0 _:b4 . _:b0 . _:b1 "2012-04-12"^^ . _:b1 . _:b2 "2012-04-12"^^ . _:b2 . _:b3 . _:b3 . _:b4 . _:b4 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0064-in.jsonld0000644000076500000240000000063112231436223024247 0ustar neuronstaff00000000000000{ "@context": [ { "name": "http://xmlns.com/foaf/0.1/name", "homepage": {"@id": "http://xmlns.com/foaf/0.1/homepage","@type": "@id"} }, {"ical": "http://www.w3.org/2002/12/cal/ical#"} ], "@id": "http://example.com/speakers#Alice", "name": "Alice", "homepage": "http://xkcd.com/177/", "ical:summary": "Alice Talk", "ical:location": "Lyon Convention Centre, Lyon, France" }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0064-out.nq0000644000076500000240000000061412231436223023576 0ustar neuronstaff00000000000000 "Lyon Convention Centre, Lyon, France" . "Alice Talk" . . "Alice" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0065-in.jsonld0000644000076500000240000000034612231436223024253 0ustar neuronstaff00000000000000{ "@context": { "foo": "http://example.com/foo/", "foo:bar": "http://example.com/bar", "bar": {"@id": "foo:bar", "@type": "@id"}, "_": "http://example.com/underscore/" }, "@type": [ "foo", "foo:bar", "_" ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0065-out.nq0000644000076500000240000000037712231436223023605 0ustar neuronstaff00000000000000_:b0 . _:b0 . _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0066-in.jsonld0000644000076500000240000000106212231436223024250 0ustar neuronstaff00000000000000{ "@context": { "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": {"@id": "@type", "@type": "@id"} }, "@graph": [ { "@id": "http://example.com/a", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://example.com/b" }, { "@id": "http://example.com/c", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ "http://example.com/d", "http://example.com/e" ] }, { "@id": "http://example.com/f", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": "http://example.com/g" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0066-out.nq0000644000076500000240000000061012231436223023574 0ustar neuronstaff00000000000000 . . . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0067-in.jsonld0000644000076500000240000000037712231436223024261 0ustar neuronstaff00000000000000{ "@context": { "mylist": {"@id": "http://example.com/mylist", "@container": "@list"}, "myset": {"@id": "http://example.com/myset", "@container": "@set"} }, "@id": "http://example.org/id", "mylist": [1, 2, 2, 3], "myset": [1, 2, 2, 3] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0067-out.nq0000644000076500000240000000206612231436223023604 0ustar neuronstaff00000000000000 _:b0 . "1"^^ . "2"^^ . "3"^^ . _:b0 "1"^^ . _:b0 _:b1 . _:b1 "2"^^ . _:b1 _:b2 . _:b2 "2"^^ . _:b2 _:b3 . _:b3 "3"^^ . _:b3 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0068-in.jsonld0000644000076500000240000000045012231436223024252 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://example.org/vocab#", "date": { "@type": "dateTime" } }, "@id": "example1", "@type": "test", "date": "2011-01-25T00:00:00Z", "embed": { "@id": "example2", "expandedDate": { "@value": "2012-08-01T00:00:00Z", "@type": "dateTime" } } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0068-out.nq0000644000076500000240000000104612231436223023602 0ustar neuronstaff00000000000000 "2011-01-25T00:00:00Z"^^ . . . "2012-08-01T00:00:00Z"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0069-in.jsonld0000644000076500000240000000127312231436223024257 0ustar neuronstaff00000000000000{ "@context": { "links": { "@id": "http://www.example.com/link", "@type": "@id", "@container": "@list" } }, "@id": "relativeIris", "@type": [ "link", "#fragment-works", "?query=works", "./", "../", "../parent", "../../parent-parent-eq-root", "../../../../../still-root", "../.././.././../../too-many-dots", "/absolute", "//example.org/scheme-relative" ], "links": [ "link", "#fragment-works", "?query=works", "./", "../", "../parent", "../../parent-parent-eq-root", "./../../../useless/../../../still-root", "../.././.././../../too-many-dots", "/absolute", "//example.org/scheme-relative" ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0069-out.nq0000644000076500000240000000672412231436223023613 0ustar neuronstaff00000000000000 _:b0 . . . . . . . . . . . . _:b0 . _:b0 _:b1 . _:b1 . _:b1 _:b2 . _:b10 . _:b10 . _:b2 . _:b2 _:b3 . _:b3 . _:b3 _:b4 . _:b4 . _:b4 _:b5 . _:b5 . _:b5 _:b6 . _:b6 . _:b6 _:b7 . _:b7 . _:b7 _:b8 . _:b8 . _:b8 _:b9 . _:b9 . _:b9 _:b10 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0070-in.jsonld0000644000076500000240000000042012231436223024240 0ustar neuronstaff00000000000000{ "@context": { "vocab": "http://example.com/vocab/", "label": { "@id": "vocab:label", "@container": "@language" } }, "@id": "http://example.com/queen", "label": { "en": "The Queen", "de": [ "Die Königin", "Ihre Majestät" ] } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0070-out.nq0000644000076500000240000000035712231436223023577 0ustar neuronstaff00000000000000 "Die Königin"@de . "Ihre Majestät"@de . "The Queen"@en . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0071-in.jsonld0000644000076500000240000000054312231436223024247 0ustar neuronstaff00000000000000{ "@context": { "ex": "http://example.org/vocab#", "xsd": "http://www.w3.org/2001/XMLSchema#", "ex:integer": { "@type": "xsd:integer" }, "ex:double": { "@type": "xsd:double" }, "ex:boolean": { "@type": "xsd:boolean" } }, "@id": "http://example.org/test#example1", "ex:integer": 1, "ex:double": 123.45, "ex:boolean": true } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0071-out.nq0000644000076500000240000000056012231436223023574 0ustar neuronstaff00000000000000 "true"^^ . "1.2345E2"^^ . "1"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0072-in.jsonld0000644000076500000240000000036012231436223024245 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://xmlns.com/foaf/0.1/", "from": null, "university": { "@id": null } }, "@id": "http://me.markus-lanthaler.com/", "name": "Markus Lanthaler", "from": "Italy", "university": "TU Graz" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0072-out.nq0000644000076500000240000000013012231436223023566 0ustar neuronstaff00000000000000 "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0073-in.jsonld0000644000076500000240000000046012231436223024247 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://example.com/vocab#", "homepage": { "@type": "@id" }, "created_at": { "@type": "http://www.w3.org/2001/XMLSchema#date" } }, "name": "Markus Lanthaler", "homepage": "http://www.markus-lanthaler.com/", "created_at": "2012-10-28" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0073-out.nq0000644000076500000240000000035312231436223023576 0ustar neuronstaff00000000000000_:b0 "2012-10-28"^^ . _:b0 . _:b0 "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0074-in.jsonld0000644000076500000240000000046112231436223024251 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://example.com/vocab/", "colliding": "http://example.com/vocab/collidingTerm" }, "@id": "http://example.com/IriCollissions", "colliding": [ "value 1", 2 ], "collidingTerm": [ 3, "four" ], "http://example.com/vocab/collidingTerm": 5 } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0074-out.nq0000644000076500000240000000105412231436223023576 0ustar neuronstaff00000000000000 "2"^^ . "3"^^ . "5"^^ . "four" . "value 1" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0075-in.jsonld0000644000076500000240000000056412231436223024256 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://example.com/vocab/", "@language": "it", "label": { "@container": "@language" } }, "@id": "http://example.com/queen", "label": { "en": "The Queen", "de": [ "Die Königin", "Ihre Majestät" ] }, "http://example.com/vocab/label": [ "Il re", { "@value": "The king", "@language": "en" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0075-out.nq0000644000076500000240000000060412231436223023577 0ustar neuronstaff00000000000000 "Die Königin"@de . "Ihre Majestät"@de . "Il re"@it . "The Queen"@en . "The king"@en . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0076-in.jsonld0000644000076500000240000000352712231436223024261 0ustar neuronstaff00000000000000{ "@context": { "property": "http://example.com/property", "indexContainer": { "@id": "http://example.com/container", "@container": "@index" } }, "@id": "http://example.org/indexTest", "indexContainer": { "A": [ { "@id": "http://example.org/nodeWithoutIndexA" }, { "@id": "http://example.org/nodeWithIndexA", "@index": "this overrides the 'A' index from the container" }, 1, true, false, null, "simple string A", { "@value": "typed literal A", "@type": "http://example.org/type" }, { "@value": "language-tagged string A", "@language": "en" } ], "B": "simple string B", "C": [ { "@id": "http://example.org/nodeWithoutIndexC" }, { "@id": "http://example.org/nodeWithIndexC", "@index": "this overrides the 'C' index from the container" }, 3, true, false, null, "simple string C", { "@value": "typed literal C", "@type": "http://example.org/type" }, { "@value": "language-tagged string C", "@language": "en" } ] }, "property": [ { "@id": "http://example.org/nodeWithoutIndexProp" }, { "@id": "http://example.org/nodeWithIndexProp", "@index": "prop" }, { "@value": 3, "@index": "prop" }, { "@value": true, "@index": "prop" }, { "@value": false, "@index": "prop" }, { "@value": null, "@index": "prop" }, "simple string no index", { "@value": "typed literal Prop", "@type": "http://example.org/type", "@index": "prop" }, { "@value": "language-tagged string Prop", "@language": "en", "@index": "prop" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0076-out.nq0000644000076500000240000000503212231436223023600 0ustar neuronstaff00000000000000 "1"^^ . "3"^^ . "false"^^ . "false"^^ . "language-tagged string A"@en . "language-tagged string C"@en . "simple string A" . "simple string B" . "simple string C" . "true"^^ . "true"^^ . "typed literal A"^^ . "typed literal C"^^ . . . . . "3"^^ . "false"^^ . "language-tagged string Prop"@en . "simple string no index" . "true"^^ . "typed literal Prop"^^ . . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0077-in.jsonld0000644000076500000240000000044012231436223024251 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name" }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "@reverse": { "http://xmlns.com/foaf/0.1/knows": { "@id": "http://example.com/people/dave", "name": "Dave Longley" } } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0077-out.nq0000644000076500000240000000042412231436223023601 0ustar neuronstaff00000000000000 . "Dave Longley" . "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0078-in.jsonld0000644000076500000240000000107112231436223024253 0ustar neuronstaff00000000000000{ "@context": { "term": "_:term", "termId": { "@id": "term", "@type": "@id" } }, "@id": "_:term", "@type": "_:term", "term": [ { "@id": "_:term", "@type": "term" }, { "@id": "_:Bx", "term": "term" }, "plain value", { "@id": "_:term" } ], "termId": [ { "@id": "_:term", "@type": "term" }, { "@id": "_:Cx", "term": "termId" }, "term:AppendedToBlankNode", "_:termAppendedToBlankNode", "relativeIri", { "@id": "_:term" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0078-out.nq0000644000076500000240000000007612231436223023605 0ustar neuronstaff00000000000000_:b0 _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0079-in.jsonld0000644000076500000240000000046612231436223024263 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "knows": "http://xmlns.com/foaf/0.1/knows" }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "@reverse": { "knows": { "@id": "http://example.com/people/dave", "name": "Dave Longley" } } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0079-out.nq0000644000076500000240000000042412231436223023603 0ustar neuronstaff00000000000000 . "Dave Longley" . "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0080-in.jsonld0000644000076500000240000000060212231436223024243 0ustar neuronstaff00000000000000{ "@context": { "vocab": "http://example.com/vocab/", "label": { "@id": "vocab:label", "@container": "@language" }, "indexes": { "@id": "vocab:index", "@container": "@index" } }, "@id": "http://example.com/queen", "label": [ "The Queen" ], "indexes": [ "No", "indexes", { "@id": "asTheValueIsntAnObject" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0080-out.nq0000644000076500000240000000052012231436223023570 0ustar neuronstaff00000000000000 "No" . "indexes" . . "The Queen" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0081-in.jsonld0000644000076500000240000000043212231436223024245 0ustar neuronstaff00000000000000{ "@context": { "property": "http://example.com/property", "nested": "http://example.com/nested", "@language": "en" }, "property": "this is English", "nested": { "@context": { "@language": null }, "property": "and this is a plain string" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0081-out.nq0000644000076500000240000000024412231436223023574 0ustar neuronstaff00000000000000_:b0 _:b1 . _:b0 "this is English"@en . _:b1 "and this is a plain string" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0082-in.jsonld0000644000076500000240000000046212231436223024251 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "isKnownBy": { "@reverse": "http://xmlns.com/foaf/0.1/knows" } }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "isKnownBy": { "@id": "http://example.com/people/dave", "name": "Dave Longley" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0082-out.nq0000644000076500000240000000042412231436223023575 0ustar neuronstaff00000000000000 . "Dave Longley" . "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0083-in.jsonld0000644000076500000240000000070512231436223024252 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "isKnownBy": { "@reverse": "http://xmlns.com/foaf/0.1/knows" } }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "@reverse": { "isKnownBy": [ { "@id": "http://example.com/people/dave", "name": "Dave Longley" }, { "@id": "http://example.com/people/gregg", "name": "Gregg Kellogg" } ] } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0083-out.nq0000644000076500000240000000072212231436223023577 0ustar neuronstaff00000000000000 "Dave Longley" . "Gregg Kellogg" . . . "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0084-in.jsonld0000644000076500000240000000067012231436223024254 0ustar neuronstaff00000000000000{ "@context": { "property": { "@id": "http://example.com/vocab/property", "@language": "de" }, "indexMap": { "@id": "http://example.com/vocab/indexMap", "@language": "en", "@container": "@index" } }, "@id": "http://example.com/node", "property": [ { "@id": "http://example.com/propertyValueNode", "indexMap": { "expands to english string": "simple string" } }, "einfacher String" ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0084-out.nq0000644000076500000240000000043512231436223023601 0ustar neuronstaff00000000000000 "einfacher String"@de . . "simple string"@en . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0085-in.jsonld0000644000076500000240000000005012231436223024245 0ustar neuronstaff00000000000000{ "@value": "free-floating value" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0085-out.nq0000644000076500000240000000000012231436223023566 0ustar neuronstaff00000000000000rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0086-in.jsonld0000644000076500000240000000065012231436223024254 0ustar neuronstaff00000000000000{ "@graph": [ { "@id": "http://example.com/free-floating-node" }, { "@value": "free-floating value object" }, { "@value": "free-floating value language-tagged string", "@language": "en" }, { "@value": "free-floating value typed value", "@type": "http://example.com/type" }, "free-floating plain string", true, false, null, 1, 1.5 ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0086-out.nq0000644000076500000240000000000012231436223023567 0ustar neuronstaff00000000000000rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0087-in.jsonld0000644000076500000240000000161412231436223024256 0ustar neuronstaff00000000000000{ "@context": { "property": "http://example.com/property" }, "@graph": [ { "@set": [ "free-floating strings in set objects are removed", { "@id": "http://example.com/free-floating-node" }, { "@id": "http://example.com/node", "property": "nodes with properties are not removed" } ] }, { "@list": [ "lists are removed even though they represent an invisible linked structure, they have no real meaning", { "@id": "http://example.com/node-in-free-floating-list", "property": "everything inside a free-floating list is removed with the list; also nodes with properties" } ] } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0087-out.nq0000644000076500000240000000014212231436223023577 0ustar neuronstaff00000000000000 "nodes with properties are not removed" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0088-in.jsonld0000644000076500000240000000106712231436223024261 0ustar neuronstaff00000000000000{ "@context": { "term": "http://example.com/terms-are-not-considered-in-id", "compact-iris": "http://example.com/compact-iris-", "property": "http://example.com/property", "@vocab": "http://example.org/vocab-is-not-considered-for-id" }, "@id": "term", "property": [ { "@id": "compact-iris:are-considered", "property": "@id supports the following values: relative, absolute, and compact IRIs" }, { "@id": "../parent-node", "property": "relative IRIs get resolved against the document's base IRI" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0088-out.nq0000644000076500000240000000102712231436223023603 0ustar neuronstaff00000000000000 "@id supports the following values: relative, absolute, and compact IRIs" . "relative IRIs get resolved against the document's base IRI" . . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0089-in.jsonld0000644000076500000240000000050612231436223024257 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "isKnownBy": { "@reverse": "http://xmlns.com/foaf/0.1/knows", "@type": "@id" } }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "isKnownBy": [ "http://example.com/people/dave", "http://example.com/people/gregg" ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0089-out.nq0000644000076500000240000000045212231436223023605 0ustar neuronstaff00000000000000 . . "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0090-in.jsonld0000644000076500000240000000030112231436223024240 0ustar neuronstaff00000000000000{ "@context": { "issue": { "@id": "http://example.com/issue/", "@type": "@id" }, "issue:raisedBy": { "@container": "@set" } }, "issue": "/issue/1", "issue:raisedBy": "Markus" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0090-out.nq0000644000076500000240000000016412231436223023575 0ustar neuronstaff00000000000000_:b0 . _:b0 "Markus" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0091-in.jsonld0000644000076500000240000000017512231436223024252 0ustar neuronstaff00000000000000{ "@context": [ { "id": "@id" }, { "url": "id" } ], "url": "/issue/1", "http://example.com/property": "ok" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0091-out.nq0000644000076500000240000000010212231436223023566 0ustar neuronstaff00000000000000 "ok" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0092-in.jsonld0000644000076500000240000000032512231436223024250 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://example.org/", "property": "vocabRelativeProperty" }, "property": "must expand to http://example.org/vocabRelativeProperty", "http://example.org/property": "ok" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0092-out.nq0000644000076500000240000000022612231436223023576 0ustar neuronstaff00000000000000_:b0 "ok" . _:b0 "must expand to http://example.org/vocabRelativeProperty" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0093-in.jsonld0000644000076500000240000000017712231436223024256 0ustar neuronstaff00000000000000{ "@context": { "term": {"@id": "http://example.org/term", "@type": "@vocab"} }, "term": "http://example.org/enum" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0093-out.nq0000644000076500000240000000007312231436223023577 0ustar neuronstaff00000000000000_:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0094-in.jsonld0000644000076500000240000000023412231436223024251 0ustar neuronstaff00000000000000{ "@context": { "term": {"@id": "http://example.org/term", "@type": "@vocab"}, "enum": {"@id": "http://example.org/enum"} }, "term": "enum" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0094-out.nq0000644000076500000240000000007312231436223023600 0ustar neuronstaff00000000000000_:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0095-in.jsonld0000644000076500000240000000022112231436223024246 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://example.org/", "term": {"@id": "http://example.org/term", "@type": "@vocab"} }, "term": "enum" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0095-out.nq0000644000076500000240000000007312231436223023601 0ustar neuronstaff00000000000000_:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0096-in.jsonld0000644000076500000240000000074212231436223024257 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "homepage": { "@id": "http://xmlns.com/foaf/0.1/homepage", "@type": "@vocab" }, "link": { "@id": "http://example.com/link", "@type": "@id" }, "MarkusHomepage": "http://www.markus-lanthaler.com/", "relative-iri": "http://example.com/error-if-this-is-used-for-link" }, "@id": "http://me.markus-lanthaler.com/", "name": "Markus Lanthaler", "homepage": "MarkusHomepage", "link": "relative-iri" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0096-out.nq0000644000076500000240000000046512231436223023607 0ustar neuronstaff00000000000000 . . "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0097-in.jsonld0000644000076500000240000000021012231436223024246 0ustar neuronstaff00000000000000{ "@context": { "term": { "@id": "http://example.org/term", "@type": "@vocab" } }, "term": "not-a-term-thus-a-relative-IRI" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0097-out.nq0000644000076500000240000000014612231436223023604 0ustar neuronstaff00000000000000_:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0098-in.jsonld0000644000076500000240000000024212231436223024254 0ustar neuronstaff00000000000000{ "@context": { "term": { "@id": "http://example.org/term", "@type": "@vocab" }, "prefix": "http://example.com/vocab#" }, "term": "prefix:suffix" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0098-out.nq0000644000076500000240000000010312231436223023576 0ustar neuronstaff00000000000000_:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0099-in.jsonld0000644000076500000240000000055312231436223024262 0ustar neuronstaff00000000000000{ "@context": { "@vocab": "http://example.org/vocab#" }, "@id": "example-with-vocab", "@type": "vocab-prefixed", "property": "property expanded using @vocab", "embed": { "@context": { "@vocab": null }, "@id": "example-vocab-reset", "@type": "document-relative", "property": "@vocab reset, property will be dropped" } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0099-out.nq0000644000076500000240000000112312231436223023602 0ustar neuronstaff00000000000000 . . "property expanded using @vocab" . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0100-in.jsonld0000644000076500000240000000131612231436223024237 0ustar neuronstaff00000000000000{ "@context": { "property": "http://example.com/vocab#property" }, "@id": "../document-relative", "@type": "#document-relative", "property": { "@context": { "@base": "http://example.org/test/" }, "@id": "../document-base-overwritten", "@type": "#document-base-overwritten", "property": [ { "@context": null, "@id": "../document-relative", "@type": "#document-relative", "property": "context completely reset, drops property" }, { "@context": { "@base": null }, "@id": "../document-relative", "@type": "#document-relative", "property": "@base is set to none" } ] } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0100-out.nq0000644000076500000240000000113112231436223023560 0ustar neuronstaff00000000000000 . . . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0101-in.jsonld0000644000076500000240000000026012231436223024235 0ustar neuronstaff00000000000000{ "@context": { "property": { "@id": "http://example.com/property", "@type": "http://example.com/datatype" } }, "property": [ 1, true, false, 5.1 ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0101-out.nq0000644000076500000240000000045312231436223023567 0ustar neuronstaff00000000000000_:b0 "1"^^ . _:b0 "5.1E0"^^ . _:b0 "false"^^ . _:b0 "true"^^ . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0102-in.jsonld0000644000076500000240000000154012231436223024240 0ustar neuronstaff00000000000000{ "@context": { "@base": "http://example.com/some/deep/directory/and/file#with-a-fragment", "links": { "@id": "http://www.example.com/link", "@type": "@id", "@container": "@list" } }, "@id": "relativeIris", "@type": [ "link", "#fragment-works", "?query=works", "./", "../", "../parent", "../../parent-parent-eq-root", "../../../../../still-root", "../.././.././../../too-many-dots", "/absolute", "//example.org/scheme-relative" ], "links": [ "link", "#fragment-works", "?query=works", "./", "../", "../parent", "../../parent-parent-eq-root", "./../../../../../still-root", "../.././.././../../too-many-dots", "/absolute", "//example.org/scheme-relative", "//example.org/../scheme-relative", "//example.org/.././useless/../../scheme-relative" ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0102-out.nq0000644000076500000240000000763012231436223023574 0ustar neuronstaff00000000000000 _:b0 . . . . . . . . . . . . _:b0 . _:b0 _:b1 . _:b1 . _:b1 _:b2 . _:b10 . _:b10 _:b11 . _:b11 . _:b11 _:b12 . _:b12 . _:b12 . _:b2 . _:b2 _:b3 . _:b3 . _:b3 _:b4 . _:b4 . _:b4 _:b5 . _:b5 . _:b5 _:b6 . _:b6 . _:b6 _:b7 . _:b7 . _:b7 _:b8 . _:b8 . _:b8 _:b9 . _:b9 . _:b9 _:b10 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0103-in.jsonld0000644000076500000240000000070612231436223024244 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "isKnownBy": { "@reverse": "http://xmlns.com/foaf/0.1/knows", "@container": "@index" } }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "isKnownBy": { "Dave": { "@id": "http://example.com/people/dave", "name": "Dave Longley" }, "Gregg": { "@id": "http://example.com/people/gregg", "name": "Gregg Kellogg" } } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0103-out.nq0000644000076500000240000000072212231436223023570 0ustar neuronstaff00000000000000 . "Dave Longley" . . "Gregg Kellogg" . "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0104-in.jsonld0000644000076500000240000000047612231436223024251 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "isKnownBy": { "@reverse": "http://xmlns.com/foaf/0.1/knows" } }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "isKnownBy": [ { "name": "Dave Longley" }, { "name": "Gregg Kellogg" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0104-out.nq0000644000076500000240000000054012231436223023567 0ustar neuronstaff00000000000000 "Markus Lanthaler" . _:b0 . _:b0 "Dave Longley" . _:b1 . _:b1 "Gregg Kellogg" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0105-in.jsonld0000644000076500000240000000070112231436223024241 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "knows": "http://xmlns.com/foaf/0.1/knows" }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "@reverse": { "knows": { "@id": "http://example.com/people/dave", "name": "Dave Longley" }, "relative-iri": { "@id": "relative-node", "name": "Keys that are not mapped to an IRI in a reverse-map are dropped" } } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0105-out.nq0000644000076500000240000000042412231436223023571 0ustar neuronstaff00000000000000 . "Dave Longley" . "Markus Lanthaler" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0106-in.jsonld0000644000076500000240000000070012231436223024241 0ustar neuronstaff00000000000000{ "@context": { "name": "http://xmlns.com/foaf/0.1/name", "knows": "http://xmlns.com/foaf/0.1/knows", "@vocab": "http://example.com/vocab/" }, "@id": "http://example.com/people/markus", "name": "Markus Lanthaler", "@reverse": { "knows": { "@id": "http://example.com/people/dave", "name": "Dave Longley" }, "noTerm": { "@id": "relative-node", "name": "Compact keys using @vocab" } } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0106-out.nq0000644000076500000240000000100212231436223023563 0ustar neuronstaff00000000000000 . "Dave Longley" . "Markus Lanthaler" . . "Compact keys using @vocab" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0107-in.jsonld0000644000076500000240000000044012231436223024243 0ustar neuronstaff00000000000000{ "@context": { "http": "http://example.com/this-prefix-would-overwrite-all-http-iris" }, "@id": "http://example.org/node1", "@type": "http://example.org/type", "http://example.org/property": "all these IRIs remain unchanged because they are interpreted as absolute IRIs" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0107-out.nq0000644000076500000240000000036412231436223023576 0ustar neuronstaff00000000000000 "all these IRIs remain unchanged because they are interpreted as absolute IRIs" . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0108-in.jsonld0000644000076500000240000000040012231436223024240 0ustar neuronstaff00000000000000{ "@context": { "_": "http://example.com/this-prefix-would-overwrite-all-blank-node-identifiers" }, "@id": "_:node1", "@type": "_:type", "_:property": "all these IRIs remain unchanged because they are interpreted as blank node identifiers" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0108-out.nq0000644000076500000240000000007612231436223023577 0ustar neuronstaff00000000000000_:b1 _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0109-in.jsonld0000644000076500000240000000042512231436223024250 0ustar neuronstaff00000000000000{ "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "rdfs:subClassOf": { "@id": "rdfs:subClassOf", "@type": "@id" } }, "@id": "http://example.com/vocab#class", "@type": "rdfs:Class", "rdfs:subClassOf": "http://example.com/vocab#someOtherClass" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0109-out.nq0000644000076500000240000000040112231436223023570 0ustar neuronstaff00000000000000 . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0110-in.jsonld0000644000076500000240000000030012231436223024230 0ustar neuronstaff00000000000000{ "@context": { "prefix": "http://www.example.org/vocab#", "prefix:foo": "prefix:foo" }, "@id": "http://example.com/vocab#id", "@type": "prefix:Class", "prefix:foo": "bar" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0110-out.nq0000644000076500000240000000030012231436223023556 0ustar neuronstaff00000000000000 "bar" . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0111-in.jsonld0000644000076500000240000000046112231436223024241 0ustar neuronstaff00000000000000{ "@context": [ { "v": "http://example.com/vocab#", "v:term": "v:somethingElse", "v:termId": { "@id": "v:somethingElseId" } }, { "v:term": "v:term", "v:termId": { "@id": "v:termId" } } ], "v:term": "value of v:term", "v:termId": "value of v:termId" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0111-out.nq0000644000076500000240000000016612231436223023571 0ustar neuronstaff00000000000000_:b0 "value of v:term" . _:b0 "value of v:termId" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0112-in.jsonld0000644000076500000240000000033512234172453024247 0ustar neuronstaff00000000000000{ "@context": [ { "v": "http://example.com/vocab#", "term": "v:somethingElse" }, { "@vocab": "http://example.com/anotherVocab#", "term": "term" } ], "term": "value of term" } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0112-out.nq0000644000076500000240000000007612231436223023572 0ustar neuronstaff00000000000000_:b0 "value of term" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0113-in.jsonld0000644000076500000240000000020512231436223024237 0ustar neuronstaff00000000000000{ "@id": "http://example/g", "@graph": { "@id": "http://example/s", "http://example/p": {"@id": "http://example/o"} } }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0113-out.nq0000644000076500000240000000011612231436223023566 0ustar neuronstaff00000000000000 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0114-in.jsonld0000644000076500000240000000017012231436223024241 0ustar neuronstaff00000000000000{ "@id": "_:g", "@graph": { "@id": "http://example/s", "http://example/p": {"@id": "http://example/o"} } }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0114-out.nq0000644000076500000240000000010012231436223023560 0ustar neuronstaff00000000000000 _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0115-in.jsonld0000644000076500000240000000062012231436223024242 0ustar neuronstaff00000000000000{ "@graph": [{ "@id": "http://example/s0", "http://example/p0": {"@id": "http://example/o0"} }, { "@id": "http://example/g", "@graph": { "@id": "http://example/s1", "http://example/p1": {"@id": "http://example/o1"} } }, { "@id": "_:g", "@graph": { "@id": "http://example/s2", "http://example/p2": {"@id": "http://example/o2"} } }] }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0115-out.nq0000644000076500000240000000032212231436223023567 0ustar neuronstaff00000000000000 . . _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0116-in.jsonld0000644000076500000240000000027612231436223024252 0ustar neuronstaff00000000000000{ "@id": "http://example/s0", "http://example/p0": {"@id": "http://example/o0"}, "@graph": { "@id": "http://example/s1", "http://example/p1": {"@id": "http://example/o1"} } }rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0116-out.nq0000644000076500000240000000022012231436223023565 0ustar neuronstaff00000000000000 . . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0117-in.jsonld0000644000076500000240000000024112231436223024243 0ustar neuronstaff00000000000000{ "http://example/p0": {"@id": "http://example/o0"}, "@graph": { "@id": "http://example/s1", "http://example/p1": {"@id": "http://example/o1"} } } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0117-out.nq0000644000076500000240000000016212231436223023573 0ustar neuronstaff00000000000000 _:b0 . _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0118-in.jsonld0000644000076500000240000000107112231436223024246 0ustar neuronstaff00000000000000{ "@context": { "term": "_:term", "termId": { "@id": "term", "@type": "@id" } }, "@id": "_:term", "@type": "_:term", "term": [ { "@id": "_:term", "@type": "term" }, { "@id": "_:Bx", "term": "term" }, "plain value", { "@id": "_:term" } ], "termId": [ { "@id": "_:term", "@type": "term" }, { "@id": "_:Cx", "term": "termId" }, "term:AppendedToBlankNode", "_:termAppendedToBlankNode", "relativeIri", { "@id": "_:term" } ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0118-out.nq0000644000076500000240000000044412474112340023577 0ustar neuronstaff00000000000000_:term _:term . _:term _:term "plain value" . _:term _:term . _:term _:term _:term . _:term _:term _:Bx . _:term _:term _:Cx . _:term _:term _:b3 . _:Bx _:term "term" . _:Cx _:term "termId" . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0119-in.jsonld0000644000076500000240000000030312231436223024244 0ustar neuronstaff00000000000000{ "@context": { "foo": "http://example.org/foo", "bar": { "@reverse": "http://example.org/bar", "@type": "@id" } }, "foo": "Foo", "bar": [ "http://example.org/origin", "_:b0" ] } rdflib-jsonld-0.3/test/test-suite/tests/toRdf-0119-out.nq0000644000076500000240000000020712231436223023575 0ustar neuronstaff00000000000000 _:b0 . _:b0 "Foo" . _:b1 _:b0 . rdflib-jsonld-0.3/test/test-suite/tests/toRdf-manifest.jsonld0000644000076500000240000010017612231436223025065 0ustar neuronstaff00000000000000{ "@context": "http://json-ld.org/test-suite/context.jsonld", "@id": "", "@type": "mf:Manifest", "name": "Transform JSON-LD to RDF", "description": "JSON-LD to RDF tests generate N-Quads output and use string comparison.", "baseIri": "http://json-ld.org/test-suite/tests/", "sequence": [ { "@id": "#t0001", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Plain literal with URIs", "purpose": "Tests generation of a triple using full URIs and a plain literal.", "input": "toRdf-0001-in.jsonld", "expect": "toRdf-0001-out.nq" }, { "@id": "#t0002", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Plain literal with CURIE from default context", "purpose": "Tests generation of a triple using a CURIE defined in the default context.", "input": "toRdf-0002-in.jsonld", "expect": "toRdf-0002-out.nq" }, { "@id": "#t0003", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Default subject is BNode", "purpose": "Tests that a BNode is created if no explicit subject is set.", "input": "toRdf-0003-in.jsonld", "expect": "toRdf-0003-out.nq" }, { "@id": "#t0004", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Literal with language tag", "purpose": "Tests that a plain literal is created with a language tag.", "input": "toRdf-0004-in.jsonld", "expect": "toRdf-0004-out.nq" }, { "@id": "#t0005", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Extended character set literal", "purpose": "Tests that a literal may be created using extended characters.", "input": "toRdf-0005-in.jsonld", "expect": "toRdf-0005-out.nq" }, { "@id": "#t0006", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Typed literal", "purpose": "Tests creation of a literal with a datatype.", "input": "toRdf-0006-in.jsonld", "expect": "toRdf-0006-out.nq" }, { "@id": "#t0007", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Tests 'a' generates rdf:type and object is implicit IRI", "purpose": "Verify that 'a' is an alias for rdf:type, and the object is created as an IRI.", "input": "toRdf-0007-in.jsonld", "expect": "toRdf-0007-out.nq" }, { "@id": "#t0008", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test prefix defined in @context", "purpose": "Generate an IRI using a prefix defined within an @context.", "input": "toRdf-0008-in.jsonld", "expect": "toRdf-0008-out.nq" }, { "@id": "#t0009", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test using an empty suffix", "purpose": "An empty suffix may be used.", "input": "toRdf-0009-in.jsonld", "expect": "toRdf-0009-out.nq" }, { "@id": "#t0010", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test object processing defines object", "purpose": "A property referencing an associative array gets object from subject of array.", "input": "toRdf-0010-in.jsonld", "expect": "toRdf-0010-out.nq" }, { "@id": "#t0011", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test object processing defines object with implicit BNode", "purpose": "If no @ is specified, a BNode is created, and will be used as the object of an enclosing property.", "input": "toRdf-0011-in.jsonld", "expect": "toRdf-0011-out.nq" }, { "@id": "#t0012", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Multiple Objects for a Single Property", "purpose": "Tests that Multiple Objects are for a Single Property using array syntax.", "input": "toRdf-0012-in.jsonld", "expect": "toRdf-0012-out.nq" }, { "@id": "#t0013", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Creation of an empty list", "purpose": "Tests that @list: [] generates an empty list.", "input": "toRdf-0013-in.jsonld", "expect": "toRdf-0013-out.nq" }, { "@id": "#t0014", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Creation of a list with single element", "purpose": "Tests that @list generates a list.", "input": "toRdf-0014-in.jsonld", "expect": "toRdf-0014-out.nq" }, { "@id": "#t0015", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Creation of a list with multiple elements", "purpose": "Tests that list with multiple elements.", "input": "toRdf-0015-in.jsonld", "expect": "toRdf-0015-out.nq" }, { "@id": "#t0016", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Empty IRI expands to resource location", "purpose": "Expanding an empty IRI uses the test file location.", "input": "toRdf-0016-in.jsonld", "expect": "toRdf-0016-out.nq" }, { "@id": "#t0017", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Relative IRI expands relative resource location", "purpose": "Expanding a relative IRI uses the test file location.", "input": "toRdf-0017-in.jsonld", "expect": "toRdf-0017-out.nq" }, { "@id": "#t0018", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Frag ID expands relative resource location", "purpose": "Expanding a fragment uses the test file location.", "input": "toRdf-0018-in.jsonld", "expect": "toRdf-0018-out.nq" }, { "@id": "#t0019", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test type coercion to anyURI", "purpose": "Tests coercion of object to anyURI when specified.", "input": "toRdf-0019-in.jsonld", "expect": "toRdf-0019-out.nq" }, { "@id": "#t0020", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test type coercion to typed literal", "purpose": "Tests coercion of object to a typed literal when specified.", "input": "toRdf-0020-in.jsonld", "expect": "toRdf-0020-out.nq" }, { "@id": "#t0022", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test coercion of double value", "purpose": "Tests that a decimal value generates a xsd:double typed literal;.", "input": "toRdf-0022-in.jsonld", "expect": "toRdf-0022-out.nq" }, { "@id": "#t0023", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test coercion of integer value", "purpose": "Tests that a decimal value generates a xsd:integer typed literal.", "input": "toRdf-0023-in.jsonld", "expect": "toRdf-0023-out.nq" }, { "@id": "#t0024", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test coercion of boolean value", "purpose": "Tests that a decimal value generates a xsd:boolean typed literal.", "input": "toRdf-0024-in.jsonld", "expect": "toRdf-0024-out.nq" }, { "@id": "#t0025", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test list coercion with single element", "purpose": "Tests that an array with a single element on a property with @list coercion creates an RDF Collection.", "input": "toRdf-0025-in.jsonld", "expect": "toRdf-0025-out.nq" }, { "@id": "#t0026", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Test creation of multiple types", "purpose": "Tests that @type with an array of types creates multiple types.", "input": "toRdf-0026-in.jsonld", "expect": "toRdf-0026-out.nq" }, { "@id": "#t0027", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Simple named graph (Wikidata)", "purpose": "Using @graph with other keys places triples in a named graph.", "input": "toRdf-0027-in.jsonld", "expect": "toRdf-0027-out.nq" }, { "@id": "#t0028", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Simple named graph", "purpose": "Signing a graph.", "input": "toRdf-0028-in.jsonld", "expect": "toRdf-0028-out.nq" }, { "@id": "#t0029", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "named graph with embedded named graph", "purpose": "Tests that named graphs containing named graphs flatten to single level of graph naming.", "input": "toRdf-0029-in.jsonld", "expect": "toRdf-0029-out.nq" }, { "@id": "#t0030", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "top-level graph with string subject reference", "purpose": "Tests graphs containing subject references as strings.", "input": "toRdf-0030-in.jsonld", "expect": "toRdf-0030-out.nq" }, { "@id": "#t0031", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Reverse property", "purpose": "Tests conversion of reverse properties.", "input": "toRdf-0031-in.jsonld", "expect": "toRdf-0031-out.nq" }, { "@id": "#t0032", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "@context reordering", "purpose": "Tests that generated triples do not depend on order of @context.", "input": "toRdf-0032-in.jsonld", "expect": "toRdf-0032-out.nq" }, { "@id": "#t0033", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "@id reordering", "purpose": "Tests that generated triples do not depend on order of @id.", "input": "toRdf-0033-in.jsonld", "expect": "toRdf-0033-out.nq" }, { "@id": "#t0034", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "context properties reordering", "purpose": "Tests that generated triples do not depend on order of properties inside @context.", "input": "toRdf-0034-in.jsonld", "expect": "toRdf-0034-out.nq" }, { "@id": "#t0035", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "non-fractional numbers converted to xsd:double", "purpose": "xsd:double's canonical lexical is used when converting numbers without fraction that are coerced to xsd:double", "input": "toRdf-0035-in.jsonld", "expect": "toRdf-0035-out.nq" }, { "@id": "#t0036", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Use nodeMapGeneration bnode labels", "purpose": "The toRDF algorithm does not relabel blank nodes; it reuses the counter from the nodeMapGeneration to generate new ones", "input": "toRdf-0036-in.jsonld", "expect": "toRdf-0036-out.nq" }, { "@id": "#t0041", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "drop free-floating nodes", "purpose": "Free-floating nodes do not generate RDF triples", "input": "toRdf-0041-in.jsonld", "expect": "toRdf-0041-out.nq" }, { "@id": "#t0042", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "basic", "purpose": "Basic RDF conversion", "input": "toRdf-0042-in.jsonld", "expect": "toRdf-0042-out.nq" }, { "@id": "#t0043", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "drop null and unmapped properties", "purpose": "Properties mapped to null or which are never mapped are dropped", "input": "toRdf-0043-in.jsonld", "expect": "toRdf-0043-out.nq" }, { "@id": "#t0044", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "optimize @set, keep empty arrays", "purpose": "RDF version of expand-0004", "input": "toRdf-0044-in.jsonld", "expect": "toRdf-0044-out.nq" }, { "@id": "#t0045", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "do not expand aliased @id/@type", "purpose": "RDF version of expand-0005", "input": "toRdf-0045-in.jsonld", "expect": "toRdf-0045-out.nq" }, { "@id": "#t0046", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "alias keywords", "purpose": "RDF version of expand-0006", "input": "toRdf-0046-in.jsonld", "expect": "toRdf-0046-out.nq" }, { "@id": "#t0047", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "date type-coercion", "purpose": "Type-coerced dates generate typed literals", "input": "toRdf-0047-in.jsonld", "expect": "toRdf-0047-out.nq" }, { "@id": "#t0048", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "@value with @language", "purpose": "RDF version of expand-0008", "input": "toRdf-0048-in.jsonld", "expect": "toRdf-0048-out.nq" }, { "@id": "#t0049", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "@graph with terms", "purpose": "RDF version of expand-0009", "input": "toRdf-0049-in.jsonld", "expect": "toRdf-0049-out.nq" }, { "@id": "#t0050", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "native types", "purpose": "Native types generate typed literals", "input": "toRdf-0050-in.jsonld", "expect": "toRdf-0050-out.nq" }, { "@id": "#t0051", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "coerced @id", "purpose": "RDF version of expand-0011", "input": "toRdf-0051-in.jsonld", "expect": "toRdf-0051-out.nq" }, { "@id": "#t0052", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "@graph with embed", "purpose": "RDF version of expand-0012", "input": "toRdf-0052-in.jsonld", "expect": "toRdf-0052-out.nq" }, { "@id": "#t0053", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "expand already expanded", "purpose": "RDF version of expand-0013", "input": "toRdf-0053-in.jsonld", "expect": "toRdf-0053-out.nq" }, { "@id": "#t0054", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "@set of @value objects with keyword aliases", "purpose": "RDF version of expand-0014", "input": "toRdf-0054-in.jsonld", "expect": "toRdf-0054-out.nq" }, { "@id": "#t0055", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "collapse set of sets, keep empty lists", "purpose": "RDF version of expand-0015", "input": "toRdf-0055-in.jsonld", "expect": "toRdf-0055-out.nq" }, { "@id": "#t0056", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "context reset", "purpose": "RDF version of expand-0016", "input": "toRdf-0056-in.jsonld", "expect": "toRdf-0056-out.nq" }, { "@id": "#t0057", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "@graph and @id aliased", "purpose": "RDF version of expand-0017", "input": "toRdf-0057-in.jsonld", "expect": "toRdf-0057-out.nq" }, { "@id": "#t0058", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "override default @language", "purpose": "RDF version of expand-0018", "input": "toRdf-0058-in.jsonld", "expect": "toRdf-0058-out.nq" }, { "@id": "#t0059", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "remove @value = null", "purpose": "RDF version of expand-0019", "input": "toRdf-0059-in.jsonld", "expect": "toRdf-0059-out.nq" }, { "@id": "#t0060", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "do not remove @graph if not at top-level", "purpose": "Embedded @graph without @id creates BNode-labeled named graph", "input": "toRdf-0060-in.jsonld", "expect": "toRdf-0060-out.nq" }, { "@id": "#t0061", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "do not remove @graph at top-level if not only property", "purpose": "RDF version of expand-0021", "input": "toRdf-0061-in.jsonld", "expect": "toRdf-0061-out.nq" }, { "@id": "#t0062", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "expand value with default language", "purpose": "RDF version of expand-0022", "input": "toRdf-0062-in.jsonld", "expect": "toRdf-0062-out.nq" }, { "@id": "#t0063", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Lists and sets of properties with list/set coercion", "purpose": "RDF version of expand-0023", "input": "toRdf-0063-in.jsonld", "expect": "toRdf-0063-out.nq" }, { "@id": "#t0064", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Multiple contexts", "purpose": "RDF version of expand-0024", "input": "toRdf-0064-in.jsonld", "expect": "toRdf-0064-out.nq" }, { "@id": "#t0065", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Problematic IRI expansion tests", "purpose": "RDF version of expand-0025", "input": "toRdf-0065-in.jsonld", "expect": "toRdf-0065-out.nq" }, { "@id": "#t0066", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expanding term mapping to @type uses @type syntax", "purpose": "RDF version of expand-0026", "input": "toRdf-0066-in.jsonld", "expect": "toRdf-0066-out.nq" }, { "@id": "#t0067", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Keep duplicate values in @list and @set", "purpose": "RDF version of expand-0027", "input": "toRdf-0067-in.jsonld", "expect": "toRdf-0067-out.nq" }, { "@id": "#t0068", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Use @vocab in properties and @type but not in @id", "purpose": "RDF version of expand-0028", "input": "toRdf-0068-in.jsonld", "expect": "toRdf-0068-out.nq" }, { "@id": "#t0069", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Relative IRIs", "purpose": "RDF version of expand-0029", "input": "toRdf-0069-in.jsonld", "expect": "toRdf-0069-out.nq" }, { "@id": "#t0070", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Language maps", "purpose": "RDF version of expand-0030", "input": "toRdf-0070-in.jsonld", "expect": "toRdf-0070-out.nq" }, { "@id": "#t0071", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "type-coercion of native types", "purpose": "RDF version of expand-0031", "input": "toRdf-0071-in.jsonld", "expect": "toRdf-0071-out.nq" }, { "@id": "#t0072", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Mapping a term to null decouples it from @vocab", "purpose": "RDF version of expand-0032", "input": "toRdf-0072-in.jsonld", "expect": "toRdf-0072-out.nq" }, { "@id": "#t0073", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Using @vocab with with type-coercion", "purpose": "RDF version of expand-0033", "input": "toRdf-0073-in.jsonld", "expect": "toRdf-0073-out.nq" }, { "@id": "#t0074", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Multiple properties expanding to the same IRI", "purpose": "RDF version of expand-0034", "input": "toRdf-0074-in.jsonld", "expect": "toRdf-0074-out.nq" }, { "@id": "#t0075", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Language maps with @vocab, default language, and colliding property", "purpose": "RDF version of expand-0035", "input": "toRdf-0075-in.jsonld", "expect": "toRdf-0075-out.nq" }, { "@id": "#t0076", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expanding @index", "purpose": "RDF version of expand-0036", "input": "toRdf-0076-in.jsonld", "expect": "toRdf-0076-out.nq" }, { "@id": "#t0077", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expanding @reverse", "purpose": "RDF version of expand-0037", "input": "toRdf-0077-in.jsonld", "expect": "toRdf-0077-out.nq" }, { "@id": "#t0078", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Drop blank node predicates by default", "purpose": "Triples with blank node predicates are dropped by default.", "input": "toRdf-0078-in.jsonld", "expect": "toRdf-0078-out.nq" }, { "@id": "#t0079", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Using terms in a reverse-maps", "purpose": "RDF version of expand-0039", "input": "toRdf-0079-in.jsonld", "expect": "toRdf-0079-out.nq" }, { "@id": "#t0080", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "language and index expansion on non-objects", "purpose": "RDF version of expand-0040", "input": "toRdf-0080-in.jsonld", "expect": "toRdf-0080-out.nq" }, { "@id": "#t0081", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Reset the default language", "purpose": "RDF version of expand-0041", "input": "toRdf-0081-in.jsonld", "expect": "toRdf-0081-out.nq" }, { "@id": "#t0082", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expanding reverse properties", "purpose": "RDF version of expand-0042", "input": "toRdf-0082-in.jsonld", "expect": "toRdf-0082-out.nq" }, { "@id": "#t0083", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Using reverse properties inside a @reverse-container", "purpose": "RDF version of expand-0043", "input": "toRdf-0083-in.jsonld", "expect": "toRdf-0083-out.nq" }, { "@id": "#t0084", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Ensure index maps use language mapping", "purpose": "RDF version of expand-0044", "input": "toRdf-0084-in.jsonld", "expect": "toRdf-0084-out.nq" }, { "@id": "#t0085", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Top-level value objects are removed", "purpose": "RDF version of expand-0045", "input": "toRdf-0085-in.jsonld", "expect": "toRdf-0085-out.nq" }, { "@id": "#t0086", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Free-floating nodes are removed", "purpose": "RDF version of expand-0046", "input": "toRdf-0086-in.jsonld", "expect": "toRdf-0086-out.nq" }, { "@id": "#t0087", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Remove free-floating set values and lists", "purpose": "RDF version of expand-0047", "input": "toRdf-0087-in.jsonld", "expect": "toRdf-0087-out.nq" }, { "@id": "#t0088", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Terms are ignored in @id", "purpose": "RDF version of expand-0048", "input": "toRdf-0088-in.jsonld", "expect": "toRdf-0088-out.nq" }, { "@id": "#t0089", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Using strings as value of a reverse property", "purpose": "RDF version of expand-0049", "input": "toRdf-0089-in.jsonld", "expect": "toRdf-0089-out.nq" }, { "@id": "#t0090", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Term definitions with prefix separate from prefix definitions", "purpose": "RDF version of expand-0050", "input": "toRdf-0090-in.jsonld", "expect": "toRdf-0090-out.nq" }, { "@id": "#t0091", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expansion of keyword aliases in term definitions", "purpose": "RDF version of expand-0051", "input": "toRdf-0091-in.jsonld", "expect": "toRdf-0091-out.nq" }, { "@id": "#t0092", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "@vocab-relative IRIs in term definitions", "purpose": "RDF version of expand-0052", "input": "toRdf-0092-in.jsonld", "expect": "toRdf-0092-out.nq" }, { "@id": "#t0093", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expand absolute IRI with @type: @vocab", "purpose": "RDF version of expand-0053", "input": "toRdf-0093-in.jsonld", "expect": "toRdf-0093-out.nq" }, { "@id": "#t0094", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expand term with @type: @vocab", "purpose": "RDF version of expand-0054", "input": "toRdf-0094-in.jsonld", "expect": "toRdf-0094-out.nq" }, { "@id": "#t0095", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expand @vocab-relative term with @type: @vocab", "purpose": "RDF version of expand-0055", "input": "toRdf-0095-in.jsonld", "expect": "toRdf-0095-out.nq" }, { "@id": "#t0096", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Use terms with @type: @vocab but not with @type: @id", "purpose": "RDF version of expand-0056", "input": "toRdf-0096-in.jsonld", "expect": "toRdf-0096-out.nq" }, { "@id": "#t0097", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expand relative IRI with @type: @vocab", "purpose": "RDF version of expand-0057", "input": "toRdf-0097-in.jsonld", "expect": "toRdf-0097-out.nq" }, { "@id": "#t0098", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expand compact IRI with @type: @vocab", "purpose": "RDF version of expand-0058", "input": "toRdf-0098-in.jsonld", "expect": "toRdf-0098-out.nq" }, { "@id": "#t0099", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Reset @vocab by setting it to null", "purpose": "RDF version of expand-0059", "input": "toRdf-0099-in.jsonld", "expect": "toRdf-0099-out.nq" }, { "@id": "#t0100", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Overwrite document base with @base and reset it again", "purpose": "RDF version of expand-0060", "input": "toRdf-0100-in.jsonld", "expect": "toRdf-0100-out.nq" }, { "@id": "#t0101", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Coercing native types to arbitrary datatypes", "purpose": "RDF version of expand-0061", "input": "toRdf-0101-in.jsonld", "expect": "toRdf-0101-out.nq" }, { "@id": "#t0102", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Various relative IRIs with with @base", "purpose": "RDF version of expand-0062", "input": "toRdf-0102-in.jsonld", "expect": "toRdf-0102-out.nq" }, { "@id": "#t0103", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expand a reverse property with an index-container", "purpose": "RDF version of expand-0063", "input": "toRdf-0103-in.jsonld", "expect": "toRdf-0103-out.nq" }, { "@id": "#t0104", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Expand reverse property whose values are unlabeled blank nodes", "purpose": "RDF version of expand-0064", "input": "toRdf-0104-in.jsonld", "expect": "toRdf-0104-out.nq" }, { "@id": "#t0105", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Keys that are not mapped to an IRI in a reverse-map are dropped", "purpose": "RDF version of expand-0065", "input": "toRdf-0105-in.jsonld", "expect": "toRdf-0105-out.nq" }, { "@id": "#t0106", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Use @vocab to expand keys in reverse-maps", "purpose": "RDF version of expand-0066", "input": "toRdf-0106-in.jsonld", "expect": "toRdf-0106-out.nq" }, { "@id": "#t0107", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "prefix:://sufffix not a compact IRI", "purpose": "RDF version of expand-0067", "input": "toRdf-0107-in.jsonld", "expect": "toRdf-0107-out.nq" }, { "@id": "#t0108", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "_::sufffix not a compact IRI", "purpose": "RDF version of expand-0068", "input": "toRdf-0108-in.jsonld", "expect": "toRdf-0108-out.nq" }, { "@id": "#t0109", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Compact IRI as term with type mapping", "purpose": "RDF version of expand-0069", "input": "toRdf-0109-in.jsonld", "expect": "toRdf-0109-out.nq" }, { "@id": "#t0110", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Redefine compact IRI with itself", "purpose": "RDF version of expand-0070", "input": "toRdf-0110-in.jsonld", "expect": "toRdf-0110-out.nq" }, { "@id": "#t0111", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Redefine terms looking like compact IRIs", "purpose": "RDF version of expand-0071", "input": "toRdf-0111-in.jsonld", "expect": "toRdf-0111-out.nq" }, { "@id": "#t0112", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Redefine term using @vocab, not itself", "purpose": "RDF version of expand-0072", "input": "toRdf-0112-in.jsonld", "expect": "toRdf-0112-out.nq" }, { "@id": "#t0113", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Dataset with a IRI named graph", "purpose": "Basic use of creating a named graph using an IRI name", "input": "toRdf-0113-in.jsonld", "expect": "toRdf-0113-out.nq" }, { "@id": "#t0114", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Dataset with a IRI named graph", "purpose": "Basic use of creating a named graph using a BNode name", "input": "toRdf-0114-in.jsonld", "expect": "toRdf-0114-out.nq" }, { "@id": "#t0115", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Dataset with a default and two named graphs", "purpose": "Dataset with a default and two named graphs (IRI and BNode)", "input": "toRdf-0115-in.jsonld", "expect": "toRdf-0115-out.nq" }, { "@id": "#t0116", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Dataset from node with embedded named graph", "purpose": "Embedding @graph in a node creates a named graph", "input": "toRdf-0116-in.jsonld", "expect": "toRdf-0116-out.nq" }, { "@id": "#t0117", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Dataset from node with embedded named graph (bnode)", "purpose": "Embedding @graph in a node creates a named graph. Graph name is created if there is no subject", "input": "toRdf-0117-in.jsonld", "expect": "toRdf-0117-out.nq" }, { "@id": "#t0118", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "produce generalized RDF flag", "purpose": "Triples with blank node predicates are not dropped if the produce generalized RDF flag is true.", "option": { "produceGeneralizedRdf": true }, "input": "toRdf-0118-in.jsonld", "expect": "toRdf-0118-out.nq" }, { "@id": "#t0119", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], "name": "Blank nodes with reverse properties", "purpose": "Proper (re-)labeling of blank nodes if used with reverse properties.", "input": "toRdf-0119-in.jsonld", "expect": "toRdf-0119-out.nq" } ] } rdflib-jsonld-0.3/test/test-suite/vocab.jsonld0000644000076500000240000003415112231436177022142 0ustar neuronstaff00000000000000{ "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "dc": "http://purl.org/dc/elements/1.1/", "mf": "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", "xsd": "http://www.w3.org/2001/XMLSchema#", "jld": "http://json-ld.org/test-suite/vocab#", "jld:Test": { "@type": "@id" }, "dc:identifier": { "@type": "@id" }, "rdfs:subClassOf": { "@type": "@id" }, "rdfs:domain": { "@type": "@id" }, "rdfs:range": { "@type": "@id" } }, "@graph": [ { "@id": "http://json-ld.org/test-suite/vocab#", "dc:creator": "Gregg Kellogg", "dc:date": "2013-09-23", "dc:description": "Test case manifest vocabulary extensions", "dc:identifier": "http://json-ld.org/test-suite/vocab#", "dc:publisher": "W3C Linked JSON Community Group", "dc:title": "Test case manifest vocabulary extensions", "rdfs:comment": "Manifest vocabulary for JSON-LD test cases" }, { "@id": "jld:CompactTest", "@type": "rdfs:Class", "rdfs:comment": "A `CompactTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the [compact](http://json-ld.org/spec/latest/json-ld-api/index.html#widl-JsonLdProcessor-compact-Promise-any-input-JsonLdContext-context-JsonLdOptions-options) method with the input argument from `mf:action` (aliased as \"input\" in test manifest) referencing a JSON-LD file in expanded form, context from `:input` (aliased as \"context\" in the test manifest) and optional options from `:option`. The expected results for a `PositiveEvaluationTest` MUST be compared using JSON object comparison with the processor output.", "rdfs:label": "Compact Evaluation Test" }, { "@id": "jld:ExpandTest", "@type": "rdfs:Class", "rdfs:comment": "A `ExpandTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the [expand](http://json-ld.org/spec/latest/json-ld-api/index.html#widl-JsonLdProcessor-expand-Promise-any-input-JsonLdOptions-options) method with the input argument from `mf:action` (aliased as \"input\" in test manifest) referencing a JSON-LD file, and optional options from `:option`. The expected results for a `PositiveEvaluationTest` MUST be compared using JSON object comparison with the processor output.", "rdfs:label": "Expand Evaluation Test" }, { "@id": "jld:FlattenTest", "@type": "rdfs:Class", "rdfs:comment": "A `FlattenTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the [flatten](http://json-ld.org/spec/latest/json-ld-api/index.html#widl-JsonLdProcessor-flatten-Promise-any-input-JsonLdContext-context-JsonLdOptions-options) method with the input argument from `mf:action` (aliased as \"input\" in test manifest) referencing a JSON-LD file, optional context from `:input` (aliased as \"context\" in the test manifest) and optional options from `:option`. The expected results for a `PositiveEvaluationTest` MUST be compared using JSON object comparison with the processor output.", "rdfs:label": "Flatten Evaluation Test" }, { "@id": "jld:FrameTest", "@type": "rdfs:Class", "rdfs:comment": "A `FrameTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the [frame](http://json-ld.org/spec/latest/json-ld-framing/#widl-JsonLdProcessor-frame-void-object-or-object---or-IRI-input-object-or-IRI-frame-JsonLdCallback-callback-JsonLdOptions-options) method with the input argument from `mf:action` (aliased as \"input\" in test manifest) referencing a JSON-LD file, frame from `:input` (aliased as \"frame\" in the test manifest) and optional options from `:option`. The expected results for a `PositiveEvaluationTest` MUST be compared using JSON object comparison with the processor output.", "rdfs:label": "Frame Evaluation Test" }, { "@id": "jld:FromRDFTest", "@type": "rdfs:Class", "rdfs:comment": "A `FromRDFTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the [RDF to Object Conversion](http://json-ld.org/spec/latest/json-ld-api/index.html#rdf-to-object-conversion) algorithm with the input argument from `mf:action` (aliased as \"input\" in test manifest) referencing an N-Quads file and optional options from `:option`. The expected results for a `PositiveEvaluationTest` MUST be compared using JSON object comparison with the processor output.", "rdfs:label": "From RDF Evaluation Test" }, { "@id": "jld:NegativeEvaluationTest", "@type": "rdfs:Class", "rdfs:comment": "A Negative Evaluation test is successful when the result of processing the input file specified as `mf:action` (aliased as \"input\" in test manifest) results in the error identified by the literal value of `mf:result` (aliased as \"expect\" in test manifest). The specifics of invoking test, including the interpretation of options (`:option`) and other input files are specified through another class.", "rdfs:label": "Positive Evaluation Test", "rdfs:subClassOf": "jld:Test" }, { "@id": "jld:NegativeSyntaxTest", "@type": "rdfs:Class", "rdfs:comment": "A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action. Negative syntax tests are tests of which the result should be a parser error.", "rdfs:label": "Negative Syntax Test", "rdfs:subClassOf": "jld:Test" }, { "@id": "jld:NormalizeTest", "@type": "rdfs:Class", "rdfs:comment": "A `NormalizeTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the [Normalization](http://json-ld.org/spec/latest/rdf-graph-normalization/#normalization-algorithm) algorithmwith the input argument from `mf:action` (aliased as \"input\" in test manifest) referencing an JSON-LD file and optional options from `:option`. The expected results for a PositiveEvaluationTest are N-Quads serialized in lexographical order and MUST be compared using string comparison.", "rdfs:label": "Normalization Evaluation Test" }, { "@id": "jld:Option", "@type": "rdfs:Class", "rdfs:comment": "Options passed to the test runner to affect invocation of the appropriate API method.", "rdfs:label": "Processor Options" }, { "@id": "jld:PositiveEvaluationTest", "@type": "rdfs:Class", "rdfs:comment": "A Positive Evaluation test is successful when the result of processing the input file specified as `mf:action` (aliased as \"input\" in test manifest) exactly matches the output file specified as `mf:result` (aliased as \"expect\" in test manifest) using the comparison defined in another class. The specifics of invoking test, including the interpretation of options (`:option`) and other input files are specified through another class.", "rdfs:label": "Positive Evaluation Test", "rdfs:subClassOf": "jld:Test" }, { "@id": "jld:PositiveSyntaxTest", "@type": "rdfs:Class", "rdfs:comment": "A type of test specifically for syntax testing. Syntax tests are not required to have an associated result, only an action.", "rdfs:label": "Positive Syntax Test", "rdfs:subClassOf": "jld:Test" }, { "@id": "jld:Test", "@type": "rdfs:Class", "rdfs:comment": "All JSON-LD tests have an input file referenced using `mf:action` (aliased as \"input\" in test manifest). Positive and Negative Evaluation Tests also have a result file referenced using `mf:result` (aliased as \"expect\" in test manifest). Other tests may take different inputs and options as defined for each test class. Tests should be run with the processingMode option set to \"json-ld-1.0\", unless specified explicitly as a test option.", "rdfs:label": "Superclass of all JSON-LD tests" }, { "@id": "jld:ToRDFTest", "@type": "rdfs:Class", "rdfs:comment": "A `ToRDFTest` modifies either a `PositiveEvaluationTest`, `NegativeEvaluationTest`, `PositiveSyntaxTest` or `NegativeSyntaxTest`. Tests are run using the [Deserialize JSON-LD to RDF algorithm](http://json-ld.org/spec/latest/json-ld-api/index.html#deserialize-json-ld-to-rdf-algorithm) with the input argument from `mf:action` (aliased as \"input\" in test manifest) referencing an JSON-LD file and optional options from `:option`. The expected results for a `PositiveEvaluationTest` are N-Quads serialized in lexographical order and MUST be compared either string comparison or Dataset as defined in [RDF11-CONCEPTS](http://www.w3.org/TR/rdf11-concepts/#section-dataset-isomorphism).", "rdfs:label": "To RDF Evaluation Test" }, { "@id": "jld:base", "@type": "rdfs:Property", "rdfs:comment": "The base IRI to use when expanding or compacting the document. If set, this overrides the input document's IRI.", "rdfs:domain": "jld:Test", "rdfs:label": "base", "rdfs:range": "rdfs:Resource" }, { "@id": "jld:compactArrays", "@type": "rdfs:Property", "rdfs:comment": "If set to `true`, the JSON-LD processor replaces arrays with just one element with that element during compaction. If set to false, all arrays will remain arrays even if they have just one element.", "rdfs:domain": "jld:Test", "rdfs:label": "compact arrays", "rdfs:range": "xsd:boolean" }, { "@id": "jld:contentType", "@type": "rdfs:Property", "rdfs:comment": "The HTTP Content-Type used for the input file, in case it is a non-registered type.", "rdfs:domain": "jld:Test", "rdfs:label": "content type", "rdfs:range": "xsd:boolean" }, { "@id": "jld:expandContext", "@type": "rdfs:Property", "rdfs:comment": "A context that is used to initialize the active context when expanding a document.", "rdfs:domain": "jld:Test", "rdfs:label": "expand context", "rdfs:range": "rdfs:Resource" }, { "@id": "jld:httpLink", "@type": "rdfs:Property", "rdfs:comment": "An HTTP Link header to be added to the result of requesting the input file.", "rdfs:domain": "jld:Test", "rdfs:label": "HTTP link", "rdfs:range": "xsd:boolean" }, { "@id": "jld:httpStatus", "@type": "rdfs:Property", "rdfs:comment": "The HTTP status code that must be returned when the input file is requested. This is typically used along with the `redirectTo` property.", "rdfs:domain": "jld:Test", "rdfs:label": "HTTP status", "rdfs:range": "xsd:boolean" }, { "@id": "jld:input", "@type": "rdfs:Property", "rdfs:comment": "Secondary input file", "rdfs:domain": "jld:Test", "rdfs:label": "input", "rdfs:range": "rdfs:Resource" }, { "@id": "jld:option", "@type": "rdfs:Property", "rdfs:comment": "Options affecting processing", "rdfs:domain": "jld:Test", "rdfs:label": "option", "rdfs:range": "jld:Option" }, { "@id": "jld:processingMode", "@type": "rdfs:Property", "rdfs:comment": "If set to \"json-ld-1.0\", the JSON-LD processor must produce exactly the same results as the algorithms defined in this specification. If set to another value, the JSON-LD processor is allowed to extend or modify the algorithms defined in this specification to enable application-specific optimizations. The definition of such optimizations is beyond the scope of this specification and thus not defined. Consequently, different implementations may implement different optimizations. Developers must not define modes beginning with json-ld as they are reserved for future versions of this specification.", "rdfs:domain": "jld:Test", "rdfs:label": "processing mode", "rdfs:range": "xsd:string" }, { "@id": "jld:produceGeneralizedRdf", "@type": "rdfs:Property", "rdfs:comment": "Unless the produce generalized RDF flag is set to true, RDF triples containing a blank node predicate are excluded from output.", "rdfs:domain": "jld:ToRDFTest", "rdfs:label": "produce generalized RDF", "rdfs:range": "xsd:boolean" }, { "@id": "jld:redirectTo", "@type": "rdfs:Property", "rdfs:comment": "The location of a URL for redirection. A request made of the input file must be redirected to the designated URL.", "rdfs:domain": "jld:Test", "rdfs:label": "redirect to", "rdfs:range": "xsd:boolean" }, { "@id": "jld:useDocumentLoader", "@type": "rdfs:Property", "rdfs:comment": "Test runners must implement a callback method with a method signature as defined in [LoadDocumentCallback](http://json-ld.org/spec/latest/json-ld-api/index.html#idl-def-LoadDocumentCallback). Specifying this option requires the test runner to provide this callback to the appropriate API method using the `documentLoader` option.", "rdfs:domain": "jld:Test", "rdfs:label": "use document loader", "rdfs:range": "xsd:boolean" }, { "@id": "jld:useNativeTypes", "@type": "rdfs:Property", "rdfs:comment": "If the _use native types_ flag is set to `true`, RDF literals with a datatype IRI that equal `xsd:integer` or `xsd:double` are converted to a JSON numbers and RDF literals with a datatype IRI that equals `xsd:boolean` are converted to `true` or `false` based on their lexical form.", "rdfs:domain": "jld:FromRDFTest", "rdfs:label": "use native types", "rdfs:range": "xsd:boolean" }, { "@id": "jld:useRdfType", "@type": "rdfs:Property", "rdfs:comment": "If the _use rdf type_ flag is set to `true`, statements with an `rdf:type` predicate will not use `@type`, but will be transformed as a normal property.", "rdfs:domain": "jld:FromRDFTest", "rdfs:label": "use RDF types", "rdfs:range": "xsd:boolean" } ] }rdflib-jsonld-0.3/test/test-suite/vocab_context.jsonld0000644000076500000240000000103012231436177023674 0ustar neuronstaff00000000000000{ "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "dc": "http://purl.org/dc/elements/1.1/", "mf": "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#", "xsd": "http://www.w3.org/2001/XMLSchema#", "jld": "http://json-ld.org/test-suite/vocab#", "jld:Test": {"@type": "@id"}, "dc:identifier": {"@type": "@id"}, "rdfs:subClassOf": {"@type": "@id"}, "rdfs:domain": {"@type": "@id"}, "rdfs:range": {"@type": "@id"} } }rdflib-jsonld-0.3/test/test_api.py0000644000076500000240000000156612223353775017720 0ustar neuronstaff00000000000000from rdflib.plugin import register, Parser, Serializer register('json-ld', Parser, 'rdflib_jsonld.parser', 'JsonLDParser') register('json-ld', Serializer, 'rdflib_jsonld.serializer', 'JsonLDSerializer') from rdflib import Graph, Literal, URIRef def test_parse(): test_json = ''' { "@context": { "dc": "http://purl.org/dc/terms/", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs": "http://www.w3.org/2000/01/rdf-schema#" }, "@id": "http://example.org/about", "dc:title": { "@language": "en", "@value": "Someone's Homepage" } } ''' g = Graph().parse(data=test_json, format='json-ld') assert list(g) == [( URIRef('http://example.org/about'), URIRef('http://purl.org/dc/terms/title'), Literal("Someone's Homepage", lang='en'))] rdflib-jsonld-0.3/test/test_api.pyc0000644000076500000240000000263212223364262020047 0ustar neuronstaff00000000000000³ò ý×MRc@skddklZlZlZededdƒededdƒddklZlZlZd„Zd S( iÿÿÿÿ(tregistertParsert Serializersjson-ldsrdflib_jsonld.parsert JsonLDParsersrdflib_jsonld.serializertJsonLDSerializer(tGraphtLiteraltURIRefcCscd}tƒid|ddƒ}t|ƒtdƒtdƒtddd ƒfgjpt‚dS( Nst { "@context": { "dc": "http://purl.org/dc/terms/", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs": "http://www.w3.org/2000/01/rdf-schema#" }, "@id": "http://example.org/about", "dc:title": { "@language": "en", "@value": "Someone's Homepage" } } tdatatformatsjson-ldshttp://example.org/aboutshttp://purl.org/dc/terms/titlesSomeone's Homepagetlangten(RtparsetlistRRtAssertionError(t test_jsontg((sh/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_api.pyt test_parses    N( t rdflib.pluginRRRtrdflibRRRR(((sh/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_api.pyssrdflib-jsonld-0.3/test/test_compaction.py0000644000076500000240000001101412471621414021261 0ustar neuronstaff00000000000000# -*- coding: UTF-8 -*- from __future__ import unicode_literals import re import json import itertools from rdflib import Graph from rdflib.serializer import Serializer cases = [] def case(*args): cases.append(args) case(""" @prefix dc: . dc:title "Homepage"@en . """, { "@context": {"@vocab": "http://purl.org/dc/terms/", "@language": "en"}, "@id": "http://example.org/", "title": "Homepage" } ) case(""" @prefix dc: . dc:title "Homepage"@en, "Hemsida"@sv . """, { "@context": {"@vocab": "http://purl.org/dc/terms/", "title": {"@container": "@language"}}, "@id": "http://example.org/", "title": {"en": "Homepage", "sv": "Hemsida"} } ) case(""" @prefix dc: . dc:title "Homepage"@en, "Hemsida"@sv . """, { "@context": { "@vocab": "http://purl.org/dc/terms/", "@language": "sv", "title_en": {"@id": "title", "@language": "en"} }, "@id": "http://example.org/", "title_en": "Homepage", "title": "Hemsida" } ) # .. Requires set values to be sorted to be predicatble #case(""" #@prefix dc: . # # dc:title "Homepage"@en, "Home Page"@en, "Home Page"@en-GB, "Hemsida"@sv . #""", #{ # "@context": "-||-", # "@id": "http://example.org/", # "title_en": ["Homepage", "Home Page"], # "title": [{"@language": "en-GB", "@value": "Home Page"}, "Hemsida"] #} #) case(""" @prefix dc: . dc:title "PÃ¥skön"@sv . """, { "@context": {"@vocab": "http://purl.org/dc/terms/", "@language": "sv"}, "@id": "http://example.org/easter_island", "title": "PÃ¥skön" } ) case(""" @prefix : . :has _:blank-1 . """, { "@context": {"has": {"@type": "@id", "@id": "http://example.org/ns#has"}}, "@id": "http://example.org/", "has": "_:blank-1" } ) case(""" @prefix rdfs: . @prefix : . :Something rdfs:subClassOf :Thing . """, { "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "v": "http://example.org/ns#", "rdfs:subClassOf": {"@container": "@set"} }, "@id": "v:Something", "rdfs:subClassOf": [{"@id": "v:Thing"}] } ) case(""" @prefix rdfs: . @prefix : . :Something rdfs:subClassOf :Thing . """, { "@context": { "rdfs": "http://www.w3.org/2000/01/rdf-schema#", "v": "http://example.org/ns#", "subClassOf": {"@id": "rdfs:subClassOf", "@type": "@id", "@container": "@set"} }, "@id": "v:Something", "subClassOf": ["v:Thing"] } ) case(""" @prefix owl: . @prefix : . :World owl:unionOf (:Everyhing :Nothing) . """, { "@context": { "owl": "http://www.w3.org/2002/07/owl#", "v": "http://example.org/ns#" }, "@id": "v:World", "owl:unionOf": {"@list": [{"@id": "v:Everyhing"}, {"@id": "v:Nothing"}]} } ) case(""" @prefix owl: . @prefix : . :World owl:unionOf (:Everyhing :Nothing) . """, { "@context": { "owl": "http://www.w3.org/2002/07/owl#", "v": "http://example.org/ns#", "unionOf": {"@id": "owl:unionOf", "@container": "@list"} }, "@id": "v:World", "unionOf": [{"@id": "v:Everyhing"}, {"@id": "v:Nothing"}] } ) case(""" @prefix owl: . @prefix : . :World owl:unionOf (:Everyhing :Nothing) . """, { "@context": { "owl": "http://www.w3.org/2002/07/owl#", "v": "http://example.org/ns#", "unionOf": {"@id": "owl:unionOf", "@type": "@id", "@container": "@list"} }, "@id": "v:World", "unionOf": ["v:Everyhing", "v:Nothing"] } ) json_kwargs = dict(indent=2, separators=(',', ': '), sort_keys=True, ensure_ascii=False) def run(data, expected): context = expected['@context'] g = Graph().parse(data=data, format='turtle') result = g.serialize(format='json-ld', context=context, **json_kwargs).decode('utf-8') incr = itertools.count(1) result = re.sub(r'"_:[^"]+"', lambda m: '"_:blank-%s"' % incr.next(), result) expected = json.dumps(expected, **json_kwargs) assert result == expected def test_cases(): for data, expected in cases: yield run, data, expected rdflib-jsonld-0.3/test/test_compaction.pyc0000644000076500000240000000326612332001353021424 0ustar neuronstaff00000000000000³ò ܸfSc @s&ddklZlZddklZgZd„Zedhdd<dd . dc:title "Homepage"@en . shttp://purl.org/dc/terms/s@vocabtens @languagesb { "@context": "/context.jsonld", "@id": "http://example.org/", "title": "Homepage" } sk@prefix dc: . dc:title "Homepage"@en, "Hemsida"@sv . s @containerttitles‘ { "@context": "/context.jsonld", "@id": "http://example.org/", "title": { "en": "Homepage", "sv": "Hemsida" } } tsvs@idttitle_ens} { "@context": "/context.jsonld", "@id": "http://example.org/", "title_en": "Homepage", "title": "Hemsida" } t__main__tdatatformattn3sjson-ldtcontexttindentiN(trdflibRRtrdflib.serializerRRRt__name__R Rtoutputtparsetgt serialize(((so/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_compaction.pyss(  0 rdflib-jsonld-0.3/test/test_context.rst0000644000076500000240000000537712173740533021013 0ustar neuronstaff00000000000000 Context Spec: >>> from rdflib_jsonld.context import Context, Term >>> ctx = Context() >>> ctx.add_term(u'label', u'http://example.org/ns/label') >>> term = ctx.terms.get(u'label') >>> term.name u'label' >>> ctx.find_term(u'http://example.org/ns/label') is term True Selecting term based on value characteristics: >>> ctx.add_term(u'updated', u'http://example.org/ns/updated') >>> ctx.add_term(u'updatedDate', u'http://example.org/ns/updated', ... coercion=u'http://www.w3.org/2001/XMLSchema#date') >>> ctx.find_term(u'http://example.org/ns/updated').name u'updated' >>> ctx.find_term(u'http://example.org/ns/updated', ... coercion=u'http://www.w3.org/2001/XMLSchema#date').name u'updatedDate' >>> ctx.find_term(u'http://example.org/ns/title_sv', language=u'sv') >>> >>> ctx.find_term(u'http://example.org/ns/authorList', container=u'@set') >>> >>> ctx.find_term(u'http://example.org/ns/creator', reverse=True) >>> Getting keyword values from nodes: >>> ctx.get_id({u'@id': u'urn:x:1'}) u'urn:x:1' >>> ctx.get_language({u'@language': u'en'}) u'en' Parsing a context expands prefixes: >>> ctx = Context({ ... u'@vocab': u'http://example.org/ns/', ... u'x': u'http://example.org/ns/', ... u'label': u'x:label', ... u'x:updated': {u'@type': u'x:date'}}) >>> term = ctx.terms.get(u'label') >>> term.id u'http://example.org/ns/label' >>> term = ctx.terms.get(u'x:updated') >>> term.id u'http://example.org/ns/updated' >>> term.type u'http://example.org/ns/date' Expanding terms: >>> ctx.expand(u'term') u'http://example.org/ns/term' >>> ctx.expand(u'x:term') u'http://example.org/ns/term' Shrinking IRIs: >>> ctx.shrink_iri(u'http://example.org/ns/term') u'x:term' >>> ctx.to_symbol(u'http://example.org/ns/term') u'term' Resolving IRIs: >>> ctx = Context({u'@base': u'http://example.org/path/leaf'}) >>> ctx.resolve(u'/') u'http://example.org/' >>> ctx.resolve(u'/trail') u'http://example.org/trail' >>> ctx.resolve(u'../') u'http://example.org/' >>> ctx.resolve(u'../../') u'http://example.org/' Accessing keyword values by alias: >>> ctx = Context({u'iri': u'@id', u'lang': u'@language'}) >>> ctx.get_id({u'iri': u'urn:x:1'}) u'urn:x:1' >>> ctx.get_language({u'lang': u'en'}) u'en' Standard keywords still work: >>> ctx.get_id({u'@id': u'urn:x:1'}) u'urn:x:1' Representing keywords by alias: >>> ctx.id_key u'iri' >>> ctx.lang_key u'lang' Creating a subcontext: >>> ctx4 = ctx.subcontext({u'lang': u'@language'}) #doctest: +ELLIPSIS >>> ctx4.get_language({u'lang': u'en'}) u'en' rdflib-jsonld-0.3/test/test_testsuite.py0000644000076500000240000002107512434366547021202 0ustar neuronstaff00000000000000from __future__ import with_statement from os import environ, chdir, path as p try: import json assert json except ImportError: import simplejson as json from rdflib import ConjunctiveGraph, Graph, Literal, URIRef from rdflib.compare import isomorphic from rdflib.py3compat import PY3 from rdflib_jsonld.parser import to_rdf from rdflib_jsonld.serializer import from_rdf from rdflib_jsonld.keys import CONTEXT, GRAPH # monkey-patch NTriplesParser to keep source bnode id:s .. from rdflib.plugins.parsers.ntriples import NTriplesParser, r_nodeid, bNode def _preserving_nodeid(self): if not self.peek('_'): return False return bNode(self.eat(r_nodeid).group(1)) NTriplesParser.nodeid = _preserving_nodeid # .. and accept bnodes everywhere _uriref = NTriplesParser.uriref def _uriref_or_nodeid(self): return _uriref(self) or self.nodeid() NTriplesParser.uriref = _uriref_or_nodeid unsupported_tests = ("frame", "normalize") unsupported_tests += ("error", "remote",) unsupported_tests += ("flatten", "compact", "expand") known_bugs = ( # invalid nquads (bnode as predicate) #"toRdf-0078-in", "toRdf-0108-in", # TODO: Literal doesn't preserve representations "fromRdf-0002-in", "toRdf-0035-in", "toRdf-0101-in", "fromRdf-0008-in", # TODO: needs to disallow outer lists-of-lists #"toRdf-0091-in", # TODO: multiple aliases version? ) import sys if sys.version_info[:2] < (2, 6): # Fails on bug in older urlparse.urljoin; ignoring.. known_bugs += ('toRdf-0069-in','toRdf-0102-in') TC_BASE = "http://json-ld.org/test-suite/tests/" testsuite_dir = environ.get("JSONLD_TESTSUITE") or p.join( p.abspath(p.dirname(__file__)), "test-suite") test_dir = p.join(testsuite_dir, "tests") def read_manifest(skiptests): f = open(p.join(testsuite_dir, "manifest.jsonld"), 'r') manifestdata = json.load(f) f.close() # context = manifestdata.get('context') for m in manifestdata.get('sequence'): if any(token in m for token in unsupported_tests): continue f = open(p.join(testsuite_dir, m), 'r') md = json.load(f) f.close() for test in md.get('sequence'): parts = test.get(u'input', '').split('.')[0].split('-') category, testnum, direction = parts if test.get(u'input', '').split('.')[0] in skiptests \ or category in skiptests: pass else: inputpath = test.get(u'input') expectedpath = test.get(u'expect') context = test.get(u'context', False) options = test.get(u'option') or {} yield category, testnum, inputpath, expectedpath, context, options def test_suite(skip_known_bugs=True): skiptests = unsupported_tests if skip_known_bugs: skiptests += known_bugs chdir(test_dir) for cat, num, inputpath, expectedpath, context, options in read_manifest(skiptests): if inputpath.endswith(".jsonld"): # toRdf if expectedpath.endswith(".jsonld"): # compact/expand/flatten func = _test_json else: # toRdf func = _test_parser else: # fromRdf func = _test_serializer #func.description = "%s-%s-%s" % (group, case) yield func, cat, num, inputpath, expectedpath, context, options def _test_json(cat, num, inputpath, expectedpath, context, options): base = TC_BASE + inputpath input_obj = _load_json(inputpath) input_graph = ConjunctiveGraph() to_rdf(input_obj, input_graph, base=base, context_data=context, produce_generalized_rdf=True) expected_json = _load_json(expectedpath) use_native_types = True # CONTEXT in input_obj result_json = from_rdf(input_graph, context, base=TC_BASE + inputpath, use_native_types=options.get('useNativeTypes', use_native_types), use_rdf_type=options.get('useRdfType', False)) def _prune_json(data): if CONTEXT in data: data.pop(CONTEXT) if GRAPH in data: data = data[GRAPH] #def _remove_empty_sets(obj): return data expected_json = _prune_json(expected_json) result_json = _prune_json(result_json) _compare_json(expected_json, result_json) def _test_parser(cat, num, inputpath, expectedpath, context, options): input_obj = _load_json(inputpath) expected_graph = _load_nquads(expectedpath) base = TC_BASE + inputpath result_graph = ConjunctiveGraph() to_rdf(input_obj, result_graph, base=base, context_data=context, produce_generalized_rdf = options.get('produceGeneralizedRdf', False)) assert isomorphic( result_graph, expected_graph), "Expected:\n%s\nGot:\n%s" % ( expected_graph.serialize(format='turtle'), result_graph.serialize(format='turtle')) def _test_serializer(cat, num, inputpath, expectedpath, context, options): input_graph = _load_nquads(inputpath) expected_json = _load_json(expectedpath) result_json = from_rdf(input_graph, context, base=TC_BASE + inputpath, use_native_types=options.get('useNativeTypes', False), use_rdf_type=options.get('useRdfType', False)) _compare_json(expected_json, result_json) def _load_nquads(source): graph = ConjunctiveGraph() with open(source) as f: if PY3: data = f.read() else: data = f.read().decode('utf-8') graph.parse(data=data, format='nquads') return graph def _load_json(source): with open(source) as f: return json.load(f) def _to_ordered(obj): if isinstance(obj, list): # NOTE: use type in key to handle mixed # lists of e.g. bool, int, float. return sorted((_to_ordered(lv) for lv in obj), key=lambda x: (_ord_key(x), type(x).__name__)) if not isinstance(obj, dict): return obj return sorted((k, _to_ordered(v)) for k, v in obj.items()) def _ord_key(x): if isinstance(x, dict) and '@id' in x: return x['@id'] else: return x def _dump_json(obj): return json.dumps(obj, indent=4, separators=(',', ': '), sort_keys=True, check_circular=True) def _compare_json(expected, result): expected = json.loads(_dump_json(expected)) result = json.loads(_dump_json(result)) assert _to_ordered(expected) == _to_ordered(result), \ "Expected JSON:\n%s\nGot:\n%s" % ( _dump_json(expected), _dump_json(result)) if __name__ == '__main__': import sys from rdflib import * from datetime import datetime EARL = Namespace("http://www.w3.org/ns/earl#") DC = Namespace("http://purl.org/dc/terms/") FOAF = Namespace("http://xmlns.com/foaf/0.1/") DOAP = Namespace("http://usefulinc.com/ns/doap#") rdflib_jsonld_page = "https://github.com/RDFLib/rdflib-jsonld" rdflib_jsonld = URIRef(rdflib_jsonld_page + "#it") args = sys.argv[1:] asserter = URIRef(args.pop(0)) if args else None asserter_name = Literal(args.pop(0)) if args else None graph = Graph() graph.parse(data=""" @prefix earl: <{EARL}> . @prefix dc: <{DC}> . @prefix foaf: <{FOAF}> . @prefix doap: <{DOAP}> . <{rdflib_jsonld}> a doap:Project, earl:TestSubject, earl:Software ; doap:homepage <{rdflib_jsonld_page}> ; doap:name "RDFLib-JSONLD" ; doap:programming-language "Python" ; doap:title "RDFLib plugin for JSON-LD " . """.format(**vars()), format='turtle') if asserter_name: graph.add((asserter, RDF.type, FOAF.Person)) graph.add((asserter, FOAF.name, asserter_name)) graph.add((rdflib_jsonld, DOAP.developer, asserter)) for args in test_suite(skip_known_bugs=False): try: args[0](*args[1:]) success = True except AssertionError: success = False assertion = graph.resource(BNode()) assertion.add(RDF.type, EARL.Assertion) assertion.add(EARL.mode, EARL.automatic) if asserter: assertion.add(EARL.assertedBy, asserter) assertion.add(EARL.subject, rdflib_jsonld) assertion.add(EARL.test, URIRef( "http://json-ld.org/test-suite/tests/{1}-manifest.jsonld#t{2}".format(*args))) result = graph.resource(BNode()) assertion.add(EARL.result, result) result.add(RDF.type, EARL.TestResult) result.add(DC.date, Literal(datetime.utcnow())) result.add(EARL.outcome, EARL.passed if success else EARL.failed) graph.serialize(sys.stdout, format='turtle') rdflib-jsonld-0.3/test/test_testsuite.pyc0000644000076500000240000002610312332001353021314 0ustar neuronstaff00000000000000³ò ³hSc@€sÿddklZddklZlZlZyddkZept‚Wne j oddk ZnXddk l Z l Z lZlZddklZddklZddklZddklZdd klZlZdd klZlZlZd „Zee_ ei!Z"d „Z#e#e_!d<Z$e$d=7Z$e$d>7Z$d?Z%ddk&Z&e&i'd d@joe%dA7Z%ndZ(ei)dƒp"ei*ei+ei,e-ƒƒdƒZ.ei*e.dƒZ/d „Z0e1d!„Z2d"„Z3d#„Z4d$„Z5d%„Z6d&„Z7d'„Z8d(„Z9d)„Z:d*„Z;e<d+joÁddk&Z&dd,k Tdd-k=l=Z=e>d.ƒZ?e>d/ƒZ@e>d0ƒZAe>d1ƒZBd2ZCeeCd3ƒZDe&iEd4ZFeFoeeFiGd5ƒƒndZIeFoeeFiGd5ƒƒndZJe ƒZKeKiLd6d7iMeNƒd8d9ƒeJoReKiOeIePiQeAiRfƒeKiOeIeAiSeJfƒeKiOeDeBiTeIfƒnxae2d:eUƒD]PZFyeFd5eFd4Œe1ZVWnej o eUZVnXeKiWeXƒƒZYeYiOePiQe?iZƒeYiOe?i[e?i\ƒeIoeYiOe?i]eIƒneYiOe?i^eDƒeYiOe?i_ed;iMeFŒƒƒeKiWeXƒƒZ`eYiOe?i`e`ƒe`iOePiQe?iaƒe`iOe@ibee=icƒƒƒe`iOe?ideVo e?iene?ifƒqWeKige&ihd8d9ƒndS(Biÿÿÿÿ(twith_statement(tenvirontchdirtpathN(tConjunctiveGraphtGraphtLiteraltURIRef(t isomorphic(tPY3(tto_rdf(tfrom_rdf(tCONTEXTtGRAPH(tNTriplesParsertr_nodeidtbNodecC€s4|idƒptSnt|itƒidƒƒS(Nt_i(tpeektFalseRteatRtgroup(tself((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyt_preserving_nodeidscC€st|ƒp |iƒS(N(t_urireftnodeid(R((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyt_uriref_or_nodeidstframet normalizeterrortremotetflattentcompacttexpandsfromRdf-0002-ins toRdf-0035-ins toRdf-0101-insfromRdf-0008-iniis toRdf-0069-ins toRdf-0102-ins$http://json-ld.org/test-suite/tests/tJSONLD_TESTSUITEs test-suitettestsc #€sttitdƒdƒ}ti|ƒ}|iƒxT|idƒD]C‰t‡fd†t DƒƒoqDnttitˆƒdƒ}ti|ƒ}|iƒxâ|idƒD]Ñ}|iddƒi dƒdi d ƒ}|\}}}|iddƒi dƒd|jp ||joq²|idƒ} |id ƒ} |id t ƒ} |id ƒph} ||| | | | fVq²WqDWdS( Nsmanifest.jsonldtrtsequencec3€sx|]}|ˆjVqWdS(N((t.0ttoken(tm(sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pys >s uinputtt.it-uexpectucontextuoption( topentptjoint testsuite_dirtjsontloadtclosetgettanytunsupported_teststsplitR( t skipteststft manifestdatatmdttesttpartstcategoryttestnumt directiont inputpatht expectedpathtcontexttoptions((R(sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyt read_manifest8s,  (& c c€s¦t}|o|t7}nttƒxzt|ƒD]l\}}}}}}|idƒo$|idƒo t}q„t}nt}|||||||fVq2WdS(Ns.jsonld( R5t known_bugsRttest_dirRDtendswitht _test_jsont _test_parsert_test_serializer( tskip_known_bugsR7tcattnumR@RARBRCtfunc((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyt test_suiteQs    c C€s¿t|}t|ƒ}tƒ}t||d|d|dtƒt|ƒ} t} t||dt|d|id| ƒd|idtƒƒ} d„} | | ƒ} | | ƒ} t| | ƒdS( Ntbaset context_datatproduce_generalized_rdftuse_native_typestuseNativeTypest use_rdf_typet useRdfTypecS€s=t|jo|itƒnt|jo|t}n|S(N(R tpopR (tdata((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyt _prune_jsonns   ( tTC_BASEt _load_jsonRR tTrueR R3Rt _compare_json( RLRMR@RARBRCRPt input_objt input_grapht expected_jsonRSt result_jsonRY((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyRHbs       c C€s–t|ƒ}t|ƒ}t|}tƒ} t|| d|d|d|idtƒƒt| |ƒp,td|i ddƒ| i ddƒf‚dS(NRPRQRRtproduceGeneralizedRdfsExpected: %s Got: %stformattturtle( R[t _load_nquadsRZRR R3RRtAssertionErrort serialize( RLRMR@RARBRCR^texpected_graphRPt result_graph((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyRI|s    c C€sft|ƒ}t|ƒ}t||dt|d|idtƒd|idtƒƒ}t||ƒdS(NRPRSRTRURV(ReR[R RZR3RR]( RLRMR@RARBRCR_R`Ra((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyRJ‰s   cC€s€tƒ}t|ƒi}iƒ}z9|~}to|iƒ}n|iƒidƒ}Wd|~QX|id|ddƒ|S(Nsutf-8RXRctnquads(RR,t__exit__t __enter__R treadtdecodetparse(tsourcetgrapht_[1]t_[2]R8RX((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyRe’s %!cC€sBt|ƒi}iƒ}z|~}ti|ƒSWd|~QXdS(N(R,RkRlR0R1(RpRrRsR8((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyR[s%cC€sct|tƒo!td„|Dƒdd„ƒSnt|tƒp|Sntd„|iƒDƒƒS(Ncs€sx|]}t|ƒVqWdS(N(t _to_ordered(R&tlv((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pys ¦s tkeycS€st|ƒt|ƒifS((t_ord_keyttypet__name__(tx((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyt§scs€s+x$|]\}}|t|ƒfVqWdS(N(Rt(R&tktv((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pys ªs (t isinstancetlisttsortedtdicttitems(tobj((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyRt¢s cC€s1t|tƒod|jo |dSn|SdS(Ns@id(R~R(Rz((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyRw®s c C€s%ti|dddddtdtƒS( Ntindentit separatorst,s: t sort_keystcheck_circular(R†s: (R0tdumpsR\(Rƒ((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyt _dump_jsonµs  cC€sgtit|ƒƒ}tit|ƒƒ}t|ƒt|ƒjp tdt|ƒt|ƒf‚dS(NsExpected JSON: %s Got: %s(R0tloadsRŠRtRf(texpectedtresult((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyR]»s t__main__(t*(tdatetimeshttp://www.w3.org/ns/earl#shttp://purl.org/dc/terms/shttp://xmlns.com/foaf/0.1/shttp://usefulinc.com/ns/doap#s'https://github.com/RDFLib/rdflib-jsonlds#itiiRXs” @prefix earl: <{EARL}> . @prefix dc: <{DC}> . @prefix foaf: <{FOAF}> . @prefix doap: <{DOAP}> . <{rdflib_jsonld}> a doap:Project, earl:TestSubject, earl:Software ; doap:homepage <{rdflib_jsonld_page}> ; doap:name "RDFLib-JSONLD" ; doap:programming-language "Python" ; doap:title "RDFLib plugin for JSON-LD " . RcRdRKs<http://json-ld.org/test-suite/tests/{1}-manifest.jsonld#t{2}(sframes normalize(serrorR(sflattenR sexpand(sfromRdf-0002-ins toRdf-0035-ins toRdf-0101-insfromRdf-0008-in(ii(s toRdf-0069-ins toRdf-0102-in(it __future__RtosRRRR-R0Rft ImportErrort simplejsontrdflibRRRRtrdflib.compareRtrdflib.py3compatR trdflib_jsonld.parserR trdflib_jsonld.serializerR trdflib_jsonld.keysR R trdflib.plugins.parsers.ntriplesRRRRRturirefRRR5REtsyst version_infoRZR3R.tabspathtdirnamet__file__R/RFRDR\RORHRIRJReR[RtRwRŠR]RyRt NamespacetEARLtDCtFOAFtDOAPtrdflib_jsonld_paget rdflib_jsonldtargvtargsRWtNonetassertert asserter_nameRqRoRctvarstaddtRDFRxtPersontnamet developerRtsuccesstresourcetBNodet assertiont Assertiontmodet automatict assertedBytsubjectR;Rt TestResulttdatetutcnowtoutcometpassedtfailedRgtstdout(((sn/Users/neuron/Documents/development/projects/contrib/rdflib_contrib/repos/rdflib-jsonld/test/test_testsuite.pyss¤ "                       ##    +