Skip to content
SPARQL for JSON: Turn JSON into RDF using SPARQL syntax
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Build Status


SPARQL construct queries on JSON files

JARQL allows to execute SPARQL Construct Queries against JSON files. The project was inspired by Tarql which provides similar functionality for CSV files. With JARQL you can easily transform JSON Documents to RDF.


Instead of building yourself you can download it from the release page.

In order to create an executable .jar containing all the dependencies just run:

mvn package -Pexecutable


java -jar jarql-<version>.jar <JSON-File> <Query-File>

For example if you have a file called paperino.json with the following content:

        "parent": [{
                "name": "Paperino",
                "children": ["Qui", "Quo", "Qua"],
                "fiance": {"name": "Paperina"}
        }, {
                "name": "Topolino",
                "children": ["Tip", "Tap", "Top"],
                "fiance": {"name": "Minnie"}

And a file called paperino.query with the following content:

PREFIX jarql: <>

    ?p :name ?n; 
       :child [:name ?cn].
    jarql:root jarql:parent ?p.
    ?p jarql:name ?n.
    ?p jarql:children ?cn.

Invoking jarql-1.0-pre1.jar as follows:

java -jar jarql-1.0-pre1.jar paperino.json paperino.query

will output the following RDF:

[ <>  [ <>
                    "Qui"^^<> ] ;
  <>  [ <>
                    "Qua"^^<> ] ;
  <>  [ <>
                    "Quo"^^<> ] ;
  <>   "Paperino"^^<>
] .

[ <>  [ <>
                    "Top"^^<> ] ;
  <>  [ <>
                    "Tap"^^<> ] ;
  <>  [ <>
                    "Tip"^^<> ] ;
  <>   "Topolino"^^<>
] .

Advanced usage

Add all metadata you want using BIND combined with SPARQL 1.1 functions!

Create URI...

BIND (URI(CONCAT('', ?var)) AS ?uri)

...add language tags...

BIND (STRLANG(?string, 'en') AS ?with_language_tag)

...or datatypes!

BIND (STRDT(?num, xsd:integer) AS ?int)

Current limitations

  • Nested arrays in JSON are not supported
  • The order of JSon Arrays is irrelevant

Similar Projects

  • JSON2RDF provides streaming conversion from JSON to RDF.
You can’t perform that action at this time.