[Mulgara-general] Problem with multiple FILTERs?

Charles Blair chas at uchicago.edu
Thu Jun 25 22:02:47 UTC 2009


The following query, using these RDF content URIs

http://chas.lib.uchicago.edu:1969/spa.rdf
http://chas.lib.uchicago.edu:1969/ita.rdf

with the Redland Rasqal RDF Query Demonstration

returns everything written by Narvaez in the 17th century.

PREFIX chas: <http://www.lib.uchicago.edu/chas/private/elements/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX erc: <http://purl.org/kernel/elements/1.1/>
PREFIX : <http://www.lib.uchicago.edu/chas/private/elements/>
SELECT *
WHERE {
{?item dcterms:creator ?who}  .
{?item dcterms:title ?what}  .
{?item dcterms:created ?when}  .
FILTER regex(?who, "Narvaez")
FILTER regex(?what, "")
FILTER regex(?when, "16..")
}
ORDER BY ?when

The following query in Mulgara gives me everything written in the 17th
century:

PREFIX chas: <http://www.lib.uchicago.edu/chas/private/elements/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX erc: <http://purl.org/kernel/elements/1.1/>
PREFIX : <http://www.lib.uchicago.edu/chas/private/elements/>
SELECT *
FROM <cb:spa>
FROM <cb:ita>     
WHERE {
{?item dcterms:creator ?who}  .
{?item dcterms:title ?what}  .
{?item dcterms:created ?when}  .
FILTER regex(?who, "Narvaez")
FILTER regex(?what, "")
FILTER regex(?when, "16..")
}
ORDER BY ?when

Both queries are working with the same RDF data. 

Now, I'm not seeing examples of multiple uses of FILTER in the SPARQL
spec, but I don't see anything prohibiting them. All I see is, "SPARQL
FILTERs restrict solutions to those for which the filter expression
evaluates to TRUE.". So, is the Redland implementation correct on this
score?



More information about the Mulgara-general mailing list