Description
This is an implementation of JSON-LD for RDFLib. For more information about this technology, see the JSON-LD website.
RDFLib plugin providing JSON-LD parsing and serialization alternatives and similar packages
Based on the "Serialization" category.
Alternatively, view RDFLib plugin providing JSON-LD parsing and serialization alternatives based on common mentions on social networks and blogs.
-
marshmallow
A lightweight library for converting complex objects to and from simple Python datatypes. -
ultrajson
Ultra fast JSON decoder and encoder written in C with Python bindings -
serpy
ridiculously fast object serialization -
PyLD
JSON-LD processor written in Python -
cattrs
Complex custom class converters for attrs. -
pysimdjson
Python bindings for the simdjson project. -
mashumaro (マシュマロ)
Fast and well tested serialization framework on top of dataclasses -
python-rapidjson
Python wrapper around rapidjson -
Fast JSON schema for Python
Fast JSON schema validator for Python. -
jsonschema-rs
JSON Schema validation library -
jsons
🐍 A Python lib for (de)serializing Python objects to/from JSON -
pySHACL
A Python validator for SHACL -
Trafaret
Ultimate transformation library that supports validation, contexts and aiohttp. -
hjson-py
Hjson for Python -
lupin is a Python JSON object mapper
0.9 2.1 RDFLib plugin providing JSON-LD parsing and serialization VS lupin is a Python JSON object mapperPython document object mapper (load python object from JSON and vice-versa) -
PyValico
Small python wrapper around https://github.com/rustless/valico -
py-object-factory
objectfactory is a python package to easily implement the factory design pattern for object creation, serialization, and polymorphism
Write Clean Python Code. Always.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of RDFLib plugin providing JSON-LD parsing and serialization or a related project?
Popular Comparisons
-
RDFLib plugin providing JSON-LD parsing and serializationvsPyLD
-
RDFLib plugin providing JSON-LD parsing and serializationvsmarshmallow
-
RDFLib plugin providing JSON-LD parsing and serializationvshjson-py
-
RDFLib plugin providing JSON-LD parsing and serializationvsjsons
-
RDFLib plugin providing JSON-LD parsing and serializationvsultrajson
README
RDFLib plugin providing JSON-LD parsing and serialization
This is an implementation of JSON-LD for RDFLib. For more information about this technology, see the JSON-LD website.
This implementation will:
- read in an JSON-LD formatted document and create an RDF graph
- serialize an RDF graph to JSON-LD formatted output
Installation
The easiest way to install the RDFLib JSON-LD plugin is directly from PyPi using pip by running the command below:
pip install rdflib-jsonld
Otherwise you can download the source and install it directly by running:
python setup.py install
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: <http://purl.org/dc/terms/> .
... <http://example.org/about>
... 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"
}
<!-- CUT HERE --> <!-- Text after this comment won't appear on PyPI -->
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.