W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2006

Re: CONSTRUCT operator

From: <jos.deroo@agfa.com>
Date: Wed, 25 Jan 2006 23:31:59 +0100
To: tessaris@inf.unibz.it
Cc: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Message-ID: <OFC75F1722.A38A3B93-ONC1257101.00792E6D-C1257101.007BBBA2@agfa.com>
Hi, Sergio
First of all, thanks for your previous test cases!

> Q1) Build a graph which is graph-equivalent to the Dataset (identity):
>      CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }
> Q2) Build a reification of the Dataset
>      CONSTRUCT { _:s rdf:subject ?s .
>                  _:s rdf:predicate ?p .
>                  _:s rdf:object ?o } WHERE { ?s ?p ?o }
> Assume the following Dataset:
> _:a foaf:name "Alice" .
> _:a foaf:mbox <mailto:alice@example.org> .

Those gave me trouble with a 7 year old bug..
but now, after fixing, I am getting:

_:a_0_ foaf:name "Alice".
_:a_0_ foaf:mbox <mailto:alice@example.org>.

_:e0_ rdf:subject _:a_0_.
_:e1_ rdf:subject _:a_0_.
_:e0_ rdf:predicate foaf:name.
_:e1_ rdf:predicate foaf:mbox.
_:e0_ rdf:object "Alice".
_:e1_ rdf:object <mailto:alice@example.org>.

The trouble was with the latter as a backward chainer
is not easily happy with existentials in the consequent.
It is done with following filter rule:

{?s ?p ?o.
 ?f e:tuple (?s ?p ?o)}
 {?f rdf:subject ?s.
  ?f rdf:predicate ?p.
  ?f rdf:object ?o}.

where e:tuple is a builtin skolem function generator.

Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/
Received on Wednesday, 25 January 2006 22:32:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:00:50 UTC