rdfstore-js icon indicating copy to clipboard operation
rdfstore-js copied to clipboard

Question: VALUES keyword

Open folkvir opened this issue 6 years ago • 0 comments

Is there a support of the VALUES keyword as it is specified in the SPARQL 1.1 spec ?

  • https://www.w3.org/TR/sparql11-query/#inline-data

Example: Data:

@prefix dc:   <http://purl.org/dc/elements/1.1/> .
@prefix :     <http://example.org/book/> .
@prefix ns:   <http://example.org/ns#> .

:book1  dc:title  "SPARQL Tutorial" .
:book1  ns:price  42 .
:book2  dc:title  "The Semantic Web" .
:book2  ns:price  23 .

Query:

PREFIX dc:   <http://purl.org/dc/elements/1.1/> 
PREFIX :     <http://example.org/book/> 
PREFIX ns:   <http://example.org/ns#> 

SELECT ?book ?title ?price
{
   VALUES ?book { :book1 :book3 }
   ?book dc:title ?title ;
         ns:price ?price .
}

Results:

book title price
http://example.org/book/book1 "SPARQL Tutorial" 42

folkvir avatar Mar 07 '18 11:03 folkvir