Re: Predicate trees?

Thanks. I've looked into RDF path languages before. I have also
implemented a simple DSL in Scardf [1][2].

However, predicate trees are designed to be a basic subgraph
extraction pattern: you give them a node in the graph and they span a
subgraph around it. Property paths are more about chaining segments to
extract information at the final node. So I haven't been able to match
them to my use case.

But there is a lot of literature on this topic so I cannot say I have
given up on them yet :)

Hrvoje

[1] http://code.google.com/p/scardf/wiki/Nodebags
[2] http://code.google.com/p/scardf/wiki/Converters


On Tue, Oct 26, 2010 at 08:19, Jakub Kotowski <jakubkotowski@gmx.net> wrote:
> Hi Hrvoje,
>
> try to look at RDF path languages, this paper may be a good start:
>
> The Perfect Match: RPL and RDF Rule Languages
> http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.149.865
>
> Also Gremlin, a general graph-based programming language, may be
> interesting for you:
>
> http://github.com/tinkerpop/gremlin/wiki
>
> Cheers,
> Jakub
>
>
> On 25.10.2010 19:17, Hrvoje Simic wrote:
>> In Scardf (my RDF library for Scala) [1] there is a construct I call a
>> "predicate tree" [2]. The idea is to list URI references in a tree
>> structure. Given a graph and a single node included in it, a subgraph
>> which this tree "spans" can be constructed automatically, using either
>> a graph traversal API or by executing a SPARQL CONSTRUCT statement.
>>
>> For example, a predicate tree written in Scardf like this (this is an
>> actual Scala expression):
>>
>>   name~( given, family? )
>>
>> would have an effect equivalent to this CONSTRUCT statement, where the
>> ?X variable is fixed to a "root" node.
>>
>> CONSTRUCT {
>>   ?X :name ?v2 .
>>   ?v2 :given ?v3 .
>>   ?v2 :family ?v4 .
>> }
>> WHERE {
>>   ?X :name ?v2 .
>>   ?v2 :given ?v3 .
>>   OPTIONAL {
>>     ?v2 :family ?v4 .
>>   }
>> }
>>
>> This is an abstract, concise and composable way to describe the scope
>> of triples for a specific root node. Although its nowhere as powerful
>> as a full SPARQL expression, I find it to be very practical.
>>
>> Does anybody know of an equivalent or similar construct described or
>> implemented elsewhere in the SemWeb community? I remember seeing a
>> similar idea in another library, only there all "branches" were
>> optional, but now I can't find it anymore. I'm especially interested
>> in any prior theoretical work covering this, or at least related to
>> it.
>>
>> Cheers,
>> Hrvoje Simic
>>
>> [1] http://code.google.com/p/scardf/wiki/ApiOverview
>> [2] http://code.google.com/p/scardf/wiki/PredicateTrees
>>
>>
>>
>
>

Received on Wednesday, 27 October 2010 15:51:04 UTC