Hi Alan,

2015-07-27 1:58 GMT+02:00 Robson, Alan <alan.rob...@viasat.com>:

>  I am in well over my head !
>
>
>
> I can’t speak for the general case, but would a syntax something like…
>
>
>
> *    results=ldp:contains[rdf:about is sys:Pug-2]/{(../rdf:about),
> (cal:dtstart), (cal:dtend)}*
>
>
>
> Have expressed what I wanted per my original schema and grouped it the way
> I wanted ?
>


It would have. And what you are describing is a tree query language :) Just
format it like:

*results=ldp:contains[rdf:about is sys:Pug-2]/{*

*  (**../rdf:about), *

*  (cal:dtstart), *

*  (cal:dtend)*

*}*

and you see what I mean. ;-) Effectively, you are adding variables to be
bound at the end of each of the three leaves. There are a number of
additional problems with such languages (like an combinatorial explosion
when you are trying to enumerate all combinations). It requires some more
thinking to do it properly.

Sebastian




>
>
> Maybe at some point we run out of different types of parentheses ! And
> maybe the ../ construct is playing too fast and loose with the path. Or is
> the problem that somehow ../ is ambiguous in this environment ?
>
>
>
> Many thanks
>
>
>
> Alan
>
> *From:* Sebastian Schaffert [mailto:sebastian.schaff...@gmail.com]
> *Sent:* Friday, July 24, 2015 3:58 AM
> *To:* users@marmotta.apache.org
> *Subject:* Re: LDPath Query
>
>
>
>
>
>
>
> 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
>

Reply via email to