Re: RDF/RDFa API: Structuring graph data

On 01/26/2011 08:29 PM, Nathan wrote:
> Manu Sporny wrote:
>> var library = jsonld.toObject(jsonLdText, objectFrame);
> 
> That's very JSON-LD specific, and the problem, as you noted, affects all
> RDF(a).

Yes, but it's only JSON-LD specific because we were talking about
JSON-LD at the time. I believe it's something we can generalize, but
don't quite know the best way to do so at the moment.

> I'd put it simply, that we need to be able to turn a graph, in to a
> tree, or in to a set of objects.

Exactly right.

>  graph.toObjects( bookFilter, myterms ).forEach( function(book) {
>   book.contains.forEach( function(chapter) {
>    console.log("Book: " + book.title + " Chapter: " + chapter.title);
>   });
>  });

This was problematic to our developers. Their challenge was that they
should be able to work with the raw data as an associative array and not
depend on an API that can't be implemented in C++ very easily. That is,
the code above is natural to most JavaScript programmers, but isn't that
natural to C++ or even Python programmers.

Can we do this using only an associative array data structure?

> That said, it may be even easier to take a selector type approach,
> syntax such as:
> 
>   select("Book.title Book.contains.title")

Yes, that would be neat. More about the nuances of object framing, query
by example and pure query languages here:

http://groups.google.com/group/json-ld/browse_frm/thread/7f9c138ab6aa07be/f92e899759570894?tvc=1#f92e899759570894

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: Linked Data in JSON
http://digitalbazaar.com/2010/10/30/json-ld/

Received on Thursday, 27 January 2011 14:09:40 UTC