4.Union Graph Patterns

Data structure

dbpedia:Mount_Etna rdf:type umbel-sc:Volcano ; 
                   rdfs:label "Etna" ; 
                   p:location dbpedia:Italy . 
dbpedia:Mount_Baker rdf:type umbel-sc:Volcano ; 
                    p:location dbpedia:United_States. 
dbpedia:Beerenberg rdf:type umbel-sc:Volcano ;
                   rdfs:label ”Beerenberg“@en ; 
                   p:location dbpedia:Norway 

问题

哪些火山位于挪威或者是意大利

Query

SELECT ?v WHERE {  ?v rdf:type umbel-sc:Volcano .
                 { ?v p:location dbpedia:Italy } 
                 UNION 
                 { ?v p:location dbpedia:Norway }  
}

返回

dbpedia:Mount_Etna,
dbpedia:Beerenberg;

你可能感兴趣的