Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/rdflib_jsonld-0.5.0-py3.9.egg-info/PKG-INFO @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
| author | shellac | 
|---|---|
| date | Mon, 22 Mar 2021 18:12:50 +0000 | 
| parents | |
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| -1:000000000000 | 0:4f3585e2f14b | 
|---|---|
| 1 Metadata-Version: 1.2 | |
| 2 Name: rdflib-jsonld | |
| 3 Version: 0.5.0 | |
| 4 Summary: rdflib extension adding JSON-LD parser and serializer | |
| 5 Home-page: https://github.com/RDFLib/rdflib-jsonld | |
| 6 Maintainer: RDFLib Team | |
| 7 Maintainer-email: rdflib-dev@google.com | |
| 8 License: BSD | |
| 9 Description: RDFLib plugin providing JSON-LD parsing and serialization | |
| 10 ========================================================= | |
| 11 | |
| 12 This is an implementation of `JSON-LD <http://www.w3.org/TR/json-ld/>`_ | |
| 13 for `RDFLib <https://github.com/RDFLib/rdflib>`_. | |
| 14 For more information about this technology, see the `JSON-LD website <http://json-ld.org/>`_. | |
| 15 | |
| 16 This implementation will: | |
| 17 | |
| 18 - read in an JSON-LD formatted document and create an RDF graph | |
| 19 - serialize an RDF graph to JSON-LD formatted output | |
| 20 | |
| 21 | |
| 22 Installation | |
| 23 ------------ | |
| 24 | |
| 25 The easiest way to install the RDFLib JSON-LD plugin is directly from PyPi using pip by running the command below: | |
| 26 | |
| 27 .. code-block:: shell | |
| 28 | |
| 29 pip install rdflib-jsonld | |
| 30 | |
| 31 | |
| 32 | |
| 33 Otherwise you can download the source and install it directly by running: | |
| 34 | |
| 35 .. code-block:: shell | |
| 36 | |
| 37 python setup.py install | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 Using the plug-in JSONLD serializer/parser with RDFLib | |
| 43 ------------------------------------------------------ | |
| 44 | |
| 45 The plugin parser and serializer are automatically registered if installed by | |
| 46 setuptools. | |
| 47 | |
| 48 .. code-block:: python | |
| 49 | |
| 50 >>> from rdflib import Graph, plugin | |
| 51 >>> from rdflib.serializer import Serializer | |
| 52 | |
| 53 >>> testrdf = ''' | |
| 54 ... @prefix dc: <http://purl.org/dc/terms/> . | |
| 55 ... <http://example.org/about> | |
| 56 ... dc:title "Someone's Homepage"@en . | |
| 57 ... ''' | |
| 58 | |
| 59 >>> g = Graph().parse(data=testrdf, format='n3') | |
| 60 | |
| 61 >>> print(g.serialize(format='json-ld', indent=4)) | |
| 62 { | |
| 63 "@id": "http://example.org/about", | |
| 64 "http://purl.org/dc/terms/title": [ | |
| 65 { | |
| 66 "@language": "en", | |
| 67 "@value": "Someone's Homepage" | |
| 68 } | |
| 69 ] | |
| 70 } | |
| 71 | |
| 72 >>> context = {"@vocab": "http://purl.org/dc/terms/", "@language": "en"} | |
| 73 >>> print(g.serialize(format='json-ld', context=context, indent=4)) | |
| 74 { | |
| 75 "@context": { | |
| 76 "@language": "en", | |
| 77 "@vocab": "http://purl.org/dc/terms/" | |
| 78 }, | |
| 79 "@id": "http://example.org/about", | |
| 80 "title": "Someone's Homepage" | |
| 81 } | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 Platform: any | |
| 87 Classifier: Programming Language :: Python | |
| 88 Classifier: Programming Language :: Python :: 2 | |
| 89 Classifier: Programming Language :: Python :: 2.7 | |
| 90 Classifier: Programming Language :: Python :: 3 | |
| 91 Classifier: Programming Language :: Python :: 3.3 | |
| 92 Classifier: Programming Language :: Python :: 3.4 | |
| 93 Classifier: Programming Language :: Python :: 3.5 | |
| 94 Classifier: Programming Language :: Python :: 3.6 | |
| 95 Classifier: License :: OSI Approved :: BSD License | |
| 96 Classifier: Topic :: Software Development :: Libraries :: Python Modules | |
| 97 Classifier: Operating System :: OS Independent | |
| 98 Classifier: Natural Language :: English | 
