How to Convert RDF Turtle to JSON - Step by Step Guide
Input Your RDF Turtle Data
Start by inputting your RDF Turtle data that you want to convert to JSON. Whether you're extracting data from triple stores, working with linked data, or preparing semantic web data for analysis:
Example: Sample RDF Turtle Input
Here's a sample RDF Turtle data representing a person:
@prefix schema: <http://schema.org/> . <http://example.org/person/1> a schema:Person ; schema:name "Dr. Yuki Tanaka" ; schema:email "[email protected]" ; schema:affiliation "MIT" ; schema:jobTitle "Research Scientist" .
Conversion to JSON-LD
As you type, N3.js reads the Turtle and the result appears as JSON in JSON-LD form. Along the way it:
Example: Converted JSON Output
The same data, now in JSON format:
{ "@id": "http://example.org/person/1", "@type": "http://schema.org/Person", "http://schema.org/name": "Dr. Yuki Tanaka", "http://schema.org/email": "[email protected]", "http://schema.org/affiliation": "MIT", "http://schema.org/jobTitle": "Research Scientist" }
Export Your JSON Data
Get your converted JSON data ready for use in web applications, data analysis, or APIs:
Frequently Asked Questions
Why convert RDF Turtle to JSON?
Most web code, APIs and data tools speak JSON, not RDF. Turning Turtle into JSON-LD lets a JavaScript or Python program read linked data with an ordinary JSON parser, while a JSON-LD processor can still turn it back into exactly the same triples.
What does the JSON look like?
Each subject becomes one object with "@id", and rdf:type becomes "@type". Predicates are written as full IRIs (prefixes are expanded, no @context is added). Plain strings stay strings, small whole numbers and true/false stay JSON numbers and booleans, IRIs are written as {"@id": …}, a blank node used once is nested inside the object that uses it, and an RDF list ( … ) becomes {"@list": [ … ]}.
Are numbers, dates and language tags kept exactly?
Yes. A literal that a JSON number would change is written as a value object with its datatype, for example {"@value": "8901240544102066246", "@type": "…XMLSchema#integer"} or {"@value": "14.50", "@type": "…XMLSchema#decimal"}, so no digit is lost or re-spelled. Dates and custom datatypes keep their type the same way, and "Hola"@es becomes {"@value": "Hola", "@language": "es"}.
Which RDF syntaxes does it read?
Turtle, plus N-Triples, N-Quads and TriG, which N3.js reads with the same parser. Named graphs from TriG or N-Quads are written as {"@id": …, "@graph": [ … ]} entries. Quoted triples from RDF-star (<< … >>) and Notation3 rules have no JSON-LD form, so they are reported instead of converted. RDF/XML is not read here; the RDF Format Converter can turn it into Turtle first.
Can I convert back to Turtle?
Yes. The output is JSON-LD, so the JSON-LD to RDF Turtle converter (or any JSON-LD processor) reads it back as the same triples. Blank node labels may change, because they are only local names.
Is my data uploaded anywhere?
No. The Turtle is parsed and converted in your browser and isn't sent to our server. Nothing is kept either: a reload starts with an empty editor. For dumps of hundreds of megabytes, a command-line tool such as Apache Jena's riot will be quicker than a browser tab.
Related pages: the JSON to RDF Turtle converter, the JSON-LD to RDF Turtle converter, the RDF Format Converter and the RDF validator. The Turtle specification and JSON-LD 1.1 describe both formats.
Related Tools
JSON to RDF Turtle
Convert JSON to RDF Turtle format for semantic web applications
JSON-LD Validator
Validate JSON-LD syntax and context resolution
RDF Validator
Validate RDF Turtle syntax and structure
JSON-LD to RDF Turtle
Convert JSON-LD to RDF Turtle format for semantic web applications
RDF Format Converter
Convert between RDF formats (Turtle, N-Triples, RDF/XML, JSON-LD)
N-Triples Formatter
Format and beautify N-Triples RDF data