- From: Seaborne, Andy <andy.seaborne@hp.com>
- Date: Mon, 05 Jun 2006 09:56:07 +0100
- To: RDF Data Access Working Group <public-rdf-dawg@w3.org>
<AndyS_> ACTION: AndyS to contribute a couple tests for
computed-properties/virtual-prop/builtin. one using lists, and one not using lists
http://www.w3.org/2006/05/09-dawg-minutes.html#action08
Tests checked into
http://www.w3.org/2001/sw/DataAccess/tests/data/BuiltInProperties/
One test to get the members, one to test for membership for bags and collections.
Notes:
1/ Because there is no standard property of list:member, I had to use an ARQ
one. c.f. cwm's list:in which is the other way round to rdfs:member.
2/ There is no guarantees on the order of results.
3/ seq-1.rq is over the top. A user wanted elements in order.
This was what emerged.
==== container-1.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example/>
SELECT ?x ?m
{ ?x ?p ?bag .
?bag a rdf:Bag .
?bag rdfs:member ?m
}
==== container-2.rq
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example/>
SELECT ?x
{ ?x ?p ?any .
?any rdfs:member 2
}
==== list-1.rq
PREFIX list: <http://jena.hpl.hp.com/ARQ/list#>
PREFIX : <http://example.org/>
SELECT ?x ?member
{ ?x :p ?list .
?list list:member ?member .
}
==== list-2.rq
PREFIX list: <http://jena.hpl.hp.com/ARQ/list#>
PREFIX : <http://example.org/>
SELECT ?x
{ ?x :p ?list .
?list list:member 1 .
}
==== seq-1.rq
# Sequence in order
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX jfn: <java:com.hp.hpl.jena.query.function.library.>
SELECT ?p ?member WHERE
{
?x :seq ?seq .
?seq ?p ?member .
FILTER ( regex (str(?p), "#_\\d+$") )
}
ORDER BY xsd:integer(
jfn:substring(
str(?p),
jfn:strlen(str(rdf:)) + 1 # The number after "_"
))
Received on Monday, 5 June 2006 09:28:13 UTC