Re: [json-ld.org] JSON-LD in HTML (#231)

On Mar 22, 2013, at 9:09 AM, Gavin Carothers <gavin@carothers.name> wrote:

> 
> 
> 
> On Fri, Mar 22, 2013 at 8:00 AM, Ivan Herman <ivan@w3.org> wrote:
> 
> On Mar 22, 2013, at 15:49 , Ivan Herman <ivan@w3.org> wrote:
> 
> > I am in favour keeping that remark in.
> >
> > B.t.w., will we also have a TriG in HTML? :-)
> 
> Actually... I wonder. Gregg and I already referred to that at some point: wouldn't it be cleaner to have a separate Working Group *Note* on the inclusion of RDF and Dataset serializations in HTML files via the <script> tag once and for all? After all, the Turtle and the JSON-LD in HTML do exactly the same thing, the only difference is the media type. I would think that TriG in HTML makes sense as well, as well as n triples. We could then remove these sections from the JSON-LD and the Turtle documents where they do not really belong.
> 
> I do not think it would be a huge amount of work writing this down, it is a matter of a 1-2 page note.
> 
> Just an idea...
> 
> I fully and completely endorse this idea! The practice of embedding reusable data in HTML using <script> is wider then JSON-LD, or Turtle. Almost all the issues are the same. Also as this is a new emerging practice it makes sense to be able to rapidly change our advice in the face of implementations. 

Yes, I think this is the way to go as well; I think we were worried about the time left to produce specs would make this challenging. But given that they are informative sections, if there was not change in the actual meaning of extracting RDF, moving this to a note would be more generally useful.

The note would need to consider various combinations of either RDF graphs or RDF datasets. In particular, RDFa already has two graphs: the default graph and the processor graph, but they are not otherwise considered to be in a dataset. if JSON-LD or TriG was included with a dataset, would this dataset also include the processor graph?

In general, I think that the result is the least-common-denominator of data models. If all RDF extracted is of the graph form (e.g, Turtle and classic RDFa), then the result should be the RDF merge of those graphs. If any format encodes datasets, then the result would be the dataset merge of all elements, placing graph-only results in a dataset containing only a default graph.

Unfortunately, the identity of BNodes within each of these would also need to be considered. Given that all graphs are in the same document, is there a common BNode scope; BNode scopes are normally considered to be local to a given document, but given that different serialization formats may impose different meanings, I would say that BNode scopes are not shared among such embedded documents.

My own implementation in my RDFa processor extracts any form detected within the document, either RDFa, microdata, RDF/XML or anything that has a recognized @type in a script file. All data is added to a dataset, but presently only the default graph is returned (or the processor graph, if selected). It could easily return the complete dataset, but this isn't currently defined for RDFa results.

Gregg

> Cheers,
> Gavin
>  
> 
> Ivan
> 
> 
> >
> > Ivan
> >
> > On Mar 22, 2013, at 15:30 , Gregg Kellogg <gregg@greggkellogg.net> wrote:
> >
> >> Looking for comments on the JSON-LD in HTML section. Please chime in if you have an opinion on the behavior of multiple script tags containing JSON-LD, or possibly JSON-LD and Turtle, possibly included in an RDFa document.
> >>
> >> Gregg Kellogg
> >>
> >> Sent from my iPad
> >>
> >> Begin forwarded message:
> >>
> >>> From: Markus Lanthaler <notifications@github.com>
> >>> Date: March 22, 2013, 2:06:56 AM PDT
> >>> To: "json-ld/json-ld.org" <json-ld.org@noreply.github.com>
> >>> Cc: Gregg Kellogg <gregg@greggkellogg.net>
> >>> Subject: Re: [json-ld.org] JSON-LD in HTML (#231)
> >>> Reply-To: "json-ld/json-ld.org" <reply+i-12110895-52c09e5d3a34f703c6719b4aa90283f79295ff6a-46296@reply.github.co>
> >>>
> >>> I did ask this already in c728c6b but would like to record it also here as commit discussions are somewhat difficult to find and I don't wanna forget this.
> >>>
> >>> The section currently says:
> >>>
> >>> If a processor extracts the JSON-LD content into RDF, it should expand the JSON-LD fragment into an RDF dataset using the algorithm defined in JSON-LD-API Convert to RDF Algorithm [JSON-LD-API]. If the HTML file contains multiple JSON-LD script tags, or other RDF statements are extracted, the result is the RDF merge of the datasets.
> >>>
> >>> Other processors implementing this mechanism may choose to return the expanded JSON-LD output.
> >>>
> >>> Markus: Can we drop this part? I think it doesn't add much value but sounds overly complicated for people just wanting to use it as JSON-LD.
> >>>
> >>> Gregg: It's important to give guidance when there are multiple script tags, so that the result is clear. We could say that the result is the merge of all such documents.
> >>>
> >>> When extracting RDF, JSON-LD could be combined with other formats (microdata, RDFa, Turtle in HTML). In this case, it's also necessary to say what the expected result it. Without this statement, it won't be clear what to do.
> >>>
> >>> Markus: I understand where you are coming from, but that’s an orthogonal aspect that is application dependent. In our spec we should define how JSON-LD can be embedded in HTML. How such data is used is beyond the scope of this spec. I would strongly prefer to remove this part.
> >>>
> >>> —
> >>> Reply to this email directly or view it on GitHub.
> >>>
> >
> >
> > ----
> > Ivan Herman, W3C Semantic Web Activity Lead
> > Home: http://www.w3.org/People/Ivan/
> > mobile: +31-641044153
> > FOAF: http://www.ivan-herman.net/foaf.rdf
> >
> >
> >
> >
> >
> 
> 
> ----
> Ivan Herman, W3C Semantic Web Activity Lead
> Home: http://www.w3.org/People/Ivan/
> mobile: +31-641044153
> FOAF: http://www.ivan-herman.net/foaf.rdf
> 
> 
> 
> 
> 
> 
> 

Received on Friday, 22 March 2013 16:26:05 UTC