Comparative Serialisation of RDF in JSON
richardjones - May 4, 2011 in BibServer, Data, inf11, jisc, JISC OpenBib, jiscEXPO, jiscopenbib, model, OKFN Openbiblio, ontology, outputs, progress, progressPosts, rdf, Semantic Web
This is a comparison of RDF-JSON and JSON-LD for serialising bibliographic RDF data. Given that we are also working
with BibServer we have taken a BibJSON document as our source data for
comparison. The objective was to both understand these two JSON
serialisations of RDF and also to look at the BibJSON profile to see how it
fits into such a framework.
Due to limitations of the display of large plain-text code snippets on the site, we have placed the actual content in this text file which you should refer to as we go along.
We used a BibJSON document, which comes from the examples on the
BibJSON homepage.
When converting this into the two RDF serialisations we invent a namespace
http://www.bibkn.org/bibjson/terms/This namespace provisionally holds all predicates/keys that are used by BibJSON and are not immediately clearly available in another ontology. These terms should not under any circumstances be considered definitive or final, only indicative. Now consider the RDF-JSON serialisation Some key things to note about this serialisation:
- There is no explicit shortening of URIs for predicates into CURIEs, all URIs are instead presented in full.
- The subject of each predicate is a JSON object with up to 4 keys (value, type, datatype, lang). This means that it is not easy for the human eye to pick out the value of a particular predicate.
- Of the two RDF serialisations, this is by far the most verbose
- It is relatively difficult for a human to read and write
- It has a clear treatment of namespaces
- It may be slightly inaccurate, as there are some parts of its specification which are ambiguous – feedback welcome
- The object values cannot be taken as the value of the predicate, as they may contain datatype and/or language information in them, or may be surrounded by angled brackets.
- It is relatively easy for a human to read and write