Framing and @graph

Dear lists,

We've been looking at framing as a method to easily arrive at a json
developer friendly serialization for Open Annotation, and other projects,
from a set of triples.

In Open Annotation, currently, we do not push for the use of @graph in the
serialization, and in fact don't even mention it [1].  However framing
seems to always insert the @graph keyword when it wasn't present before
[2].  This means that either every client needs to know that it should look
inside @graph or at the top level for the annotation, or we could simply
specify that @graph must be present for consistency.

The issue that I (at least) have with this is that the JSON-LD docs bury
@graph in a "Named Graph" section rather than being up front and saying
that you need to worry about it all the time, even if you don't have a
named graph.

Or am I missing an option that allows @graph to be omitted?  Equally, not
naming blank nodes would also be another nice output option, rather than
generating explicit bnode names?  Or ... am I missing the point of framing
entirely? :)

(Also many thanks for the work on the list issue!)



Using the pyld implementation:

>>> anno = {
...     "@context": "",
...     "@type": "oa:Annotation",
...     "hasBody": "",
...     "hasTarget": ""
... }
>>> framed = {
...     '@context': '',
...     '@type': 'oa:Annotation'
... }
>>> pprint.pprint(frame(anno,framed))
{'@context': '',
 '@graph': [{'@id': '_:b0',
             '@type': u'oa:Annotation',
             u'hasBody': '',
             u'hasTarget': ''}]}

Received on Wednesday, 31 July 2013 19:45:46 UTC