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

some proposed test cases

From: Fred Zemke <fred.zemke@oracle.com>
Date: Tue, 20 Jun 2006 12:36:54 -0700
Message-ID: <44984E56.30904@oracle.com>
To: public-rdf-dawg@w3.org

1. Dataset:

<a> <b> <c1>. <a> <b> <c2> .

query:

SELECT ?x WHERE { ?x <b> _:a }

I believe the solution sequence must contain one row and not two
(because there is only one mapping ?x -> <a> and the number of
ways that _:a can match is immaterial.)

2. Same dataset; query

SELECT ?x ? y WHERE { ?x <b> ?y }

result must have two solutions.  This is no doubt obvious; it is just
proposed for completeness to contrast with #1.

3. Dataset:

<s> <v1> <o1> . <s> <v2> <o2> .

query:

SELECT ?x
WHERE { ?x <v1> _:a . ?x <v2> _:a FILTER (isIRI (?x)) }

no solution, because it is not possible to match _:a to a single node
of the dataset and still satisfy both triple patterns.

3. Same dataset, slightly revised query:

SELECT ?x
WHERE { ?x <v1> _:a . FILTER (isIRI (?x)) ?x <v2> _:a  }

Now there is one solution, ?x -> <s>, because the first triple pattern
can be satisfied by mapping _:a to <o1> and the second triple pattern
can be satisfied by mapping _:a to <o2>.   Since the triple patterns
are separted by a FILTER they are not in the same BlockOfTriples
and the blank node identifier _:a does not need to map to the same thing.

4. same dataset with this query:

SELECT ?x
WHERE { { ?x <v1> _:a } { ?x <v2> _:a  } }

Again, there is one solution, because the two triple patterns are not
in a single BlockOfTriples.

5. any dataset, query:

SELECT ?X ?Y WHERE { }

the point being, what is the solution sequence of an empty pattern?

6. dataset:

<a> <v1> <n1> . <b> <v2> <n2> . <a> <v3> <c> . <a> <v3> <d> .

query:

SELECT  ?x ?y
WHERE { { ?x <v1> <n1> } UNION { ?x <v2> <n2> } OPTIONAL { ?x <v3> ?y } }

7. query:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>

SELECT ?src ?name

FROM NAMED <http://example.org/alice>
FROM NAMED <http://example.org/alice>

WHERE
{ GRAPH ?src { ?x foaf:name ?name } }

the point being, what happens if a graph is named twice?  does it cause
duplicate solutions or not?

Fred
Received on Tuesday, 20 June 2006 19:37:19 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:26 GMT