Re: RDFa + JSON-LD

> I am not sure that is where I am heading at:-) What I am saying is that an HTML+RDFa+JSON-LD content would generate _one_ graph (just as HTML+RDFa generates _one_ graph). The rest could be seen as syntactic sugar, in fact…

Apologies for the heresy. Actually that suggestion is useful. The reason is that the most common environment for consumption of web pages has JSON as its native data syntax. It makes a lot of sense to embed JSON-LD in a web page so that it can be processed with JavaScript without caring about the RDFness of it. Equally it makes sense to be able to interpret it as RDF without caring about the JSONness of it. It all depends on what query you want to do.

> That being said, I am not convinced that it is worth going down that route at the end. Recognizing, however, that a lambda user who may not have a deep understanding of the ins and outs of RDF may find himself/herself puzzled if, say, a namespace declaration in a @vocab element on HTML, or a node identified through _:B1234 is not working properly within the JSON-LD segment.

In some recent work [1], we did something similar. There is a language called Kappa that is good for modelling interactions between biological substances. But we wanted to (1) make statements about the interactions and the substances involved and (2) extract information about these interaction for purposes other than simulation (i.e. visualization). So we ended up stuffing Turtle in comments and defining an interpretation of the Kappa document as RDF. It looks roughly like this:

    #^ @prefix : <https://example.edu/model#>
    #^ @prefix rdfs: <…> etc

    # :A rdfs:label "A protein of some sort".
    %agent: A(u,d)

    # :poly rdfs:label "Spontaneous polymerisation".
    'poly' A(u), A(d) -> A(u!1), A(d!1) @1e-2

There is also some explicitly defined scope management for prefixes — in this case ':' must be defined and it is implicitly prepended to Kappa terms. There is no way to make blank nodes refer across languages. The mapping between Kappa language expressions and sets of RDF statements is defined. The RDF version is the graph union of the Turtle fragments and the transformed Kappa fragments.

The key idea though is that whether or not it makes sense to interpret a Kappa sentence as an RDF graph depends on what computation you want to do with it. 

[1] https://doi.org/10.1093/bioinformatics/btv660

Cheers,

William Waites
Laboratory for Foundations of Computer Science
School of Informatics, University of Edinburgh
Informatics Forum 5.38, 10 Crichton St.
Edinburgh, EH8 9AB, Scotland

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Received on Monday, 23 January 2017 10:33:01 UTC