Loading JSON to Jelly-RDF Converter...
Please wait a moment

How to Convert JSON to Jelly-RDF

Step 1

Paste or upload your JSON

Paste JSON or JSON-LD into the left editor, upload a .json or .jsonld file, or click Sample to load a small JSON-LD graph. JSON-LD with an @context gives you real vocabulary IRIs such as schema:name; plain JSON still converts, with each key placed under http://example.org/.

Example: Sample JSON-LD Input

Here's a sample JSON-LD data representing semantic web information:

{
  "@context": {
    "schema": "http://schema.org/"
  },
  "@graph": [
    {
      "@id": "http://example.org/person/1",
      "@type": "schema:Person",
      "schema:name": "Dr. Yuki Tanaka",
      "schema:email": "y.tanaka@university.edu"
    }
  ]
}
Step 2

Check the Jelly-text

The page turns your JSON into RDF triples and encodes them as one Jelly-RDF frame. The right panel shows that frame as Jelly-text: lookup entries for IRI prefixes, names and datatypes, followed by triples that point at them by number. The format is described in the Jelly specification.

Example: Jelly-text for the Step 1 input

The first part of what the page writes for the JSON-LD above. The email triple follows the same pattern.

# Jelly-text (protobuf text format of one RdfStreamFrame, Jelly-RDF 1.0)
# 3 triples; the .jelly download is this frame in binary (287 bytes)
rows {
  options {
    physical_type: PHYSICAL_STREAM_TYPE_TRIPLES
    max_name_table_size: 8
    max_prefix_table_size: 3
    logical_type: LOGICAL_STREAM_TYPE_FLAT_TRIPLES
    version: 1
  }
}
rows {
  prefix {
    id: 1
    value: "http://example.org/person/"
  }
}
rows {
  name {
    id: 1
    value: "1"
  }
}
rows {
  prefix {
    id: 2
    value: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  }
}
rows {
  name {
    id: 2
    value: "type"
  }
}
rows {
  prefix {
    id: 3
    value: "http://schema.org/"
  }
}
rows {
  name {
    id: 3
    value: "Person"
  }
}
rows {
  triple {
    s_iri {
      prefix_id: 1
      name_id: 1
    }
    p_iri {
      prefix_id: 2
      name_id: 2
    }
    o_iri {
      prefix_id: 3
      name_id: 3
    }
  }
}
rows {
  name {
    id: 4
    value: "name"
  }
}
rows {
  triple {
    s_iri {
      prefix_id: 1
      name_id: 1
    }
    p_iri {
      prefix_id: 3
      name_id: 4
    }
    o_literal {
      lex: "Dr. Yuki Tanaka"
    }
  }
}
Step 3

Download the .jelly file

Download .jelly saves the binary stream that Jelly readers expect. Copy gives you the Jelly-text instead, which is handy for reading or pasting into an issue.

# Python: pip install pyjelly rdflib
from rdflib import Graph
g = Graph()
g.parse("output.jelly", format="jelly")
print(len(g), "triples")

Frequently Asked Questions

What is Jelly-RDF?

Jelly is a binary format for RDF built on Protocol Buffers. A Jelly stream is a series of frames, and each frame is a list of rows: stream options, entries that give IRI prefixes, local names and datatypes a small number, and triples that refer to those numbers. Because a repeated IRI is written once and then referenced, Jelly files are compact and quick to parse. Jelly-JVM (for Apache Jena and RDF4J) and pyjelly (for rdflib) can read it.

Is the download a real Jelly file?

Yes. Download .jelly saves a Jelly-RDF 1.0 stream with one length-delimited RdfStreamFrame, the same layout other Jelly writers produce. In Python, for example, Graph().parse("output.jelly", format="jelly") with rdflib and pyjelly installed loads it straight away. The editor shows the identical frame as Jelly-text (protobuf text format) so you can see what was written; Copy copies that text, not the binary.

How is my JSON turned into RDF triples?

Prefixes and terms in @context are expanded, @id becomes the subject IRI (relative ids are resolved against http://example.org/), @type becomes rdf:type, nested objects become linked nodes (blank nodes when they have no @id), and every item of an array becomes its own triple. Value objects with @value and @language or @type keep their language tag or datatype, and null values are left out. Plain JSON without @context works too: each key becomes an IRI under http://example.org/. This is not a full JSON-LD processor, so remote contexts are not fetched and @list or @reverse are not expanded.

Are long numbers kept exactly?

Yes. Numbers are read from the text you typed, never through a JavaScript double, so 8901240544102066246 becomes an xsd:integer with every digit, 14.50 an xsd:decimal written as 14.50, and 1e3 an xsd:double. A quoted "00501" stays a plain string, and true or false become xsd:boolean.

Can I turn Jelly back into JSON or Turtle?

This page only writes Jelly. If you want Turtle from the same JSON-LD, the JSON-LD to Turtle converter does that, and the RDF Format Converter moves between Turtle, N-Triples, N-Quads, JSON-LD and RDF/XML. To read an existing .jelly file, use a Jelly library such as pyjelly or the jelly-cli command-line tool.

Is my JSON uploaded anywhere?

No. The conversion runs in your browser, your JSON is not sent to our server, and nothing is kept: reloading the page starts with an empty editor.

Other RDF tools on this site: JSON-LD to Turtle, JSON to RDF Turtle, the RDF Format Converter, the RDF Turtle to JSON converter and the JSON-LD validator.