antoniogarrote / rdfstore-js

JS RDF store with SPARQL support
MIT License
563 stars 109 forks source link

Question: VALUES keyword #155

Open folkvir opened 6 years ago

folkvir commented 6 years ago

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

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