ONTOTEXT ANSWER:
The dreaded answer to this question is “it depends”. JSON data is really pervasive. Nowadays, the majority of the REST APIs provide JSON outputs or take JSON inputs. JSON has become an industry standard. However, it doesn’t make the cut when it comes to RDF databases.
- JSON can easily be treated as subject-predicate-object data. Each JSON object is treated as a subject. Its fields are the predicates and the values are the objects.
- JSON is machine and human-readable.
- JSON isn’t strict – the JSON object may not have a clear identifier.
- In RDF, the subject and predicate have to be IRIs. JSON enforces no such limitation.
- JSON supports fewer data types than RDF.
Given this, there can’t be a direct one-to-one relationship between RDF and JSON data.
The next best thing depends on how you intend to use it.
The most powerful tool at your disposal is Ontotext Refine. It is a native part of the GraphDB ecosystem based on the open-source OpenRefine. Refine has powerful data cleaning and filtering capabilities. It is suitable when you want to modify your data before ingesting it. Refine works best with large batches of data.
A second option is to use the SPARQL templates capability. Those are templated queries where you can replace the SPARQL variables with fields from your JSON data. The JSON data is not preprocessed and data can be modified only by the query. This is most useful when you can trust the data source to have a consistent format and want to make a change stream of multiple small updates. Even better, this functionality integrates with our Kafka sink.
You can also transform your data to JSON-LD. “LD” here stands for Linked Data. Essentially, this takes a raw JSON input and gives it the context necessary to overcome the limitations of the format. The output is still valid JSON, but can now be processed directly by RDF stores. The easiest way to perform this transformation is to add an “@context” directive.
JSON-LD transformations have two key benefits:
- They are very easy to implement when the data is already well-formatted.
- You can also ingest the data in MongoDB. Graph databases aren’t optimized for document storage, e.g. large textual values like the ones used for text analysis. GraphDB ships with a way to fetch data from MongoDB and integrate it directly into RDF.
Whatever your data format might be, Ontotext has the tool to help you extract valuable insights.

