W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > March 2009

RE: Feature request: IN operator

From: Toby Inkster <tai@g5n.co.uk>
Date: Thu, 05 Mar 2009 09:22:39 +0000
To: Orri Erling <erling@xs4all.nl>
Cc: 'Bob MacGregor' <bob.macgregor@gmail.com>, 'Simon Gibbs' <simon.gibbs@cantorva.com>, public-rdf-dawg-comments@w3.org
Message-Id: <1236244959.17910.6.camel@ophelia2.g5n.co.uk>
On Thu, 2009-03-05 at 10:10 +0100, Orri Erling wrote:

> variable IN (<expression_list>)

The way I suggested it would be

	variable1 IN variable2

Where variable2 is an rdf:List. In particular, this could be a list
specified as part of the SPARQL query as in my original example:

> PREFIX foaf: <http://xmlns.com/foaf/0.1/>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> SELECT ?thing ?name
> WHERE {
>   ?thing ?p ?name .
>   FILTER (?p IN (foaf:name foaf:nick rdfs:label))
> }

The inner set of brackets there is not part of the IN operator syntax,
but rather builds an rdf:List.

So it can just refer to a list defined in the graph itself:

SELECT ?header
WHERE {
  ?thing a :httpHeader .
  FILTER (?thing IN <#responseHeaders>)
}

-- 
Toby Inkster <tai@g5n.co.uk>
Received on Thursday, 5 March 2009 09:23:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 5 March 2009 09:23:24 GMT