W3C home > Mailing lists > Public > semantic-web@w3.org > October 2010

Predicate trees?

From: Hrvoje Simic <hrvoje.simic@gmail.com>
Date: Mon, 25 Oct 2010 19:17:39 +0200
Message-ID: <AANLkTi=Gds4QoUMyndpg-NydKLQsQAaMn7sD64UxkKTq@mail.gmail.com>
To: semantic-web@w3c.org
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 Monday, 25 October 2010 22:20:25 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:41:24 UTC