2015-07-23 10:06 GMT+02:00 Sergio Fernández <wik...@apache.org>: > Hi Alan > > On Wed, Jul 22, 2015 at 9:16 AM, Robson, Alan <alan.rob...@viasat.com> > wrote: >> >> I’d like a single query to return all the freezes for a system specified >> by its fqdn in one shot (ie. if possible not have to query to collect the >> resources with that fqdn (eg sys:Pug-2) followed by a separate query to get >> the freezes that are rdf:about sys:Pug-2) >> > > First of all LDPath is a resource-centered query language: you start with > a context resource and then you follow paths. For such kind of queries > " return all the freezes for a system" maybe SPARQL would give your better > expressiveness. Check it out in Marmotta, please. > > > >> I have two questions… >> >> 1) How can I select cal:dtstart and cal:dtend times for freezes >> belonging to the freeze matching rdf:about[crtv:fqdn is "pug.local"] ? I >> can see how I can select rdf:about, but not the other fields in the freeze >> record >> > Because at that point you already walked the path, you're already in the > rdf:about, and you can' t go back to the parent. > > Jakob, do we have any trick for such construction? >
This would require a *tree* query language, while LDPath is a *path* query language. I was discussing the change to a tree language once with Jakob. It's what I did more than 10 years ago for my PhD, so the algorithms are available. It would, however, make the language syntax more complex because you'd need to introduce variables that you bind, and your results would be result sets with grouped variable bindings. A trick that can be used is a concatenation of two subpaths using a function that takes multiple arguments. > > 2) How can I group the results together ? If I mess with it I can >> get a list of start times, a list of end times or even a big list of start >> and end times mixed together, but I can’t figure a way to get a list of >> pairs of start and end times that go together, one for each “Freeze”. Maybe >> I have just structured the data wrongly. >> > This is actually the same question as 1, and the same answer.... ;-) Sebastian