Query multiple GeonameIds in SPARQL query on wikidata

76 Views Asked by At

How can I format this SPARQL query

SELECT ?id WHERE {
   ?id wdt:P1566 "6359304"
}

So that it will accept multiple genome IDs as value.

I tried

SELECT ?id WHERE { ?id wdt:P1566 } VALUES ?id {("6359304"), ("6299427")}

or

SELECT ?id WHERE {
   ?id wdt:P1566
   FILTER (?id IN ("6359304", "6299427")
}

Including a lot of variations of the two above. No luck however.

1

There are 1 best solutions below

0
Stefan - brox IT-Solutions On

As answered by UninformedUser in the comments:

SELECT ?s 
WHERE { 
  VALUES ?id {"6359304" "6299427"} # separated by space, not by comma
  ?s wdt:P1566 ?id . # triple, not tuple
}