test cases for SPARQL CONSTRUCT

making use of the excellent service at
http://sparql.org/query.html

I asked

1/

PREFIX dc:      <http://purl.org/dc/elements/1.1/>
PREFIX owl:     <http://www.w3.org/2002/07/owl#>
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
CONSTRUCT ($book rdf:type owl:Nothing) WHERE ($book dc:title $title)


and got result graph

@prefix dc:      <http://purl.org/dc/elements/1.1/> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .

<http://example.org/book/book2>
      a       owl:Nothing .

<http://example.org/book/book4>
      a       owl:Nothing .

<http://example.org/book/book1>
      a       owl:Nothing .

<http://example.org/book/book5>
      a       owl:Nothing .

<http://example.org/book/book3>
      a       owl:Nothing .


which is inconsistent and that is because the query
(when seen as rule) is inconsistent.


2/

PREFIX dc:      <http://purl.org/dc/elements/1.1/>
PREFIX owl:     <http://www.w3.org/2002/07/owl#>
PREFIX rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
CONSTRUCT ($book dc:title $test) WHERE ($book dc:title $title)


and got empty result graph

My implementation actually returns
:Paper :authorName ?test.

which is because we made it so to return
substitution results (constructed as RDF graph)
for unbound variables (e.g. in the case of OR
or OPTIONAL)

But I can understand the returning of the empty graph
as it is according to my understanding that the proof
result atoms should be in the Herbrand base of the
query formula.

(Herbrand Base is the set of all ground atoms that can
be formed from predicate symbols from a clause in Skolemized
form S and terms from the Herbrand universe H of S.
Herbrand universe of S is the set of all closed terms
constructed from the constant and function symbols of S)


-- 
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/

Received on Thursday, 11 November 2004 14:56:45 UTC