{"id":8584,"library":"rdflib-jsonld","title":"rdflib-jsonld (Deprecated)","description":"rdflib-jsonld was a plugin for RDFLib that provided JSON-LD 1.0 parsing and serialization capabilities. As of RDFLib 6.0.1 (released September 2021), JSON-LD handling has been integrated directly into the core RDFLib library. The rdflib-jsonld library itself is now 'tombstoned', with version 0.6.2 being the final release that removes all core functionality, leaving only a deprecation warning. It is considered abandoned.","status":"abandoned","version":"0.6.2","language":"en","source_language":"en","source_url":"https://github.com/RDFLib/rdflib-jsonld","tags":["rdf","json-ld","linked-data","deprecated","semantic-web","parser","serializer"],"install":[{"cmd":"pip install rdflib-jsonld","lang":"bash","label":"Original Installation (now deprecated)"},{"cmd":"pip install rdflib>=6.0.1","lang":"bash","label":"Recommended for JSON-LD support"}],"dependencies":[{"reason":"Historically, rdflib-jsonld extended rdflib. JSON-LD functionality is now part of rdflib core (>=6.0.1), making rdflib-jsonld obsolete.","package":"rdflib","optional":false}],"imports":[{"note":"Direct imports from `rdflib_jsonld` are no longer functional or necessary, as JSON-LD capabilities are integrated into `rdflib.Graph` methods like `parse()` and `serialize()`.","wrong":"from rdflib_jsonld import JSONLDPlugin","symbol":"Graph","correct":"from rdflib import Graph"}],"quickstart":{"code":"from rdflib import Graph\n\njson_ld_data = '''\n{\n  \"@context\": \"http://schema.org/\",\n  \"@type\": \"Person\",\n  \"name\": \"Jane Doe\",\n  \"jobTitle\": \"Professor\",\n  \"telephone\": \"(425) 123-4567\",\n  \"url\": \"http://www.janedoe.com\"\n}\n'''\n\n# Create a graph and parse JSON-LD data\ng = Graph().parse(data=json_ld_data, format='json-ld')\n\nprint(\"Graph contains %d triples.\" % len(g))\n\n# Serialize the graph back to JSON-LD\nserialized_json_ld = g.serialize(format='json-ld', indent=4)\nprint(\"\\nSerialized JSON-LD:\")\nprint(serialized_json_ld)\n\n# Example of querying a triple\nfrom rdflib import URIRef, Literal, Namespace\nfrom rdflib.namespace import RDF\n\nschema = Namespace(\"http://schema.org/\")\n\nfor s, p, o in g.triples((None, schema.name, None)):\n    print(f\"Found name: {o}\")","lang":"python","description":"This quickstart demonstrates how to parse and serialize JSON-LD data using the core `rdflib` library (version 6.0.1 or newer). The `rdflib-jsonld` package is no longer required for this functionality."},"warnings":[{"fix":"Uninstall `rdflib-jsonld` and ensure you are using `rdflib>=6.0.1`. JSON-LD capabilities are now built directly into `rdflib`.","message":"The `rdflib-jsonld` package is deprecated and 'tombstoned'. Version 0.6.2 (the final release) removes all JSON-LD parsing and serialization functionality, instead printing a deprecation warning.","severity":"breaking","affected_versions":">=0.6.2"},{"fix":"Upgrade `rdflib` to version 6.0.1 or higher and remove `rdflib-jsonld` from your project's dependencies.","message":"For all Python versions above 3.6, the functionality previously provided by `rdflib-jsonld` has been integrated into `rdflib` itself since version 6.0.1. Continuing to install `rdflib-jsonld` is unnecessary and may lead to warnings or unexpected behavior.","severity":"deprecated","affected_versions":"<6.0.1 of rdflib (where rdflib-jsonld was needed), >6.0.1 of rdflib (where rdflib-jsonld is obsolete)"},{"fix":"The best fix is to upgrade your Python environment to 3.7+ and use `rdflib>=6.0.1`.","message":"If you are forced to use Python <= 3.6, you will need to rely on older, unsupported versions of `rdflib-jsonld` (<=0.5.0) with `rdflib 5.0.0`. This setup is not recommended or maintained.","severity":"gotcha","affected_versions":"All versions on Python <= 3.6"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Remove `rdflib-jsonld` from your environment: `pip uninstall rdflib-jsonld`. Ensure your `rdflib` version is 6.0.1 or newer.","cause":"You have both `rdflib-jsonld` and `rdflib>=6.0.1` installed. The `rdflib-jsonld` package is now obsolete and its presence triggers this warning.","error":"DeprecationWarning: The rdflib-jsonld package has been integrated into rdflib as of rdflib==6.0.1. Please remove rdflib-jsonld from your project's dependencies."},{"fix":"Stop importing directly from `rdflib_jsonld`. JSON-LD functionality is now automatically available when using `rdflib.Graph().parse(format='json-ld')` or `rdflib.Graph().serialize(format='json-ld')` with `rdflib>=6.0.1`.","cause":"You are trying to import specific components from `rdflib-jsonld` version 0.6.2 or newer, but its functionality has been deliberately removed. The `__init__.py` file for these versions does not expose any functional modules.","error":"from rdflib_jsonld import ... ImportError: cannot import name 'JSONLDPlugin' from 'rdflib_jsonld' (.../rdflib_jsonld/__init__.py)"},{"fix":"Uninstall `rdflib-jsonld` (if installed). Ensure you are using `rdflib>=6.0.1`. The core `rdflib` library now handles JSON-LD parsing and serialization natively.","cause":"When trying to parse JSON-LD data after installing `rdflib-jsonld` version 0.6.2, no triples are added to the graph because the functionality was removed in this 'tombstoning' release.","error":"Graph contains 0 triples."}]}