good evening; > On 2017-05-14, at 19:30, Paul Tyson <[email protected]> wrote: > > Hi Laura, > > On Fri, 2017-05-12 at 09:45 +0200, Laura Morales wrote: >>> I'm not sure I completely understand the use case that this approach is >>> trying to address. But at best, it looks like a nonstandard, >>> application-specific shortcut to produce something like a table with >>> subrows. >> >> >> Right now Jena returns 1 triple per line. For example >> >> - author-1 book-1 >> - author-1 book-2 >> - author-2 book-1 >> .. >> >> instead of >> >> - author-1 >> ---- book-1 >> ---- book-2 >> - author-2 >> ---- book-1 >> >> the nested structure (second one) looks much more natural in the context of >> graphs, like RDF. The first approach instead returns results like any other >> RDBMS. This is a problem because even if it's true that traversing a graph >> with SPARQL is very easy (something that would require a huge number of >> JOINs in SQL), the returned data grows exponentially, in particular if you >> are following several predicate links and want to return properties from >> nodes in between. For every different value a new row is added to the >> results, so the number of results is like "property1 x property2 x property3 >> x ..." > > When you say "looks much more natural", you have a certain display > structure or application use in mind. But what if I wanted it the other > way (books with author subrows), or organized by other properties (say, > year of publication, or number of pages), or multiple properties? How > can the query engine know what semantics you want to apply to organize > the results? And then when your application requirements changed, you > would either have to write extra client-side code to re-organize the > query results, or write an additional query just to get results in a > different format. This is just not a good application architecture.
this concern is addressed by json-ld framing: http://json-ld.org/spec/latest/json-ld-framing/ best regards, from berlin, --- james anderson | [email protected] | http://dydra.com
