In the following DBpedia query, is there a way to consolidate the UNIONs into a single pattern?
PREFIX prop: <http://resedia.org/ontology/>
PREFIX res: <http://resedia.org/resource/>
SELECT DISTINCT ?language ?label
WHERE {
{res:Spain prop:language ?language}
UNION
{res:France prop:language ?language}
UNION
{res:Italy prop:language ?language}
?language rdfs:label ?label .
FILTER langMatches(lang(?label), "en")
}
The SPARQL spec mentions something about RDF collections but I don't really understand what it's describing. It seemed like the following syntax should work, but it didn't.
PREFIX prop: <http://resedia.org/ontology/>
PREFIX res: <http://resedia.org/resource/>
SELECT DISTINCT ?language ?label
WHERE {
(res:Spain res:France res:Italy) prop:language ?language
?language rdfs:label ?label .
FILTER langMatches(lang(?label), "en")
}
Is there a way to define a list (or "multiset", or "bag") of URIs like this inside a SELECT query?