简体   繁体   English

在SPARQL中选择嵌套位置

[英]Selecting nested locations in SPARQL

I'm using the below demonstration: 我正在使用以下演示:

SELECT ?performer ?prefLabel ?date ?location WHERE    
{    
?art rdf:type etree:Concert.    
?art rdf:type mo:Performance.    
?art mo:performer ?performer.    
?art skos:prefLabel ?prefLabel.    
?art etree:date ?date.    
?art event:place ?location.    
}     
LIMIT 2

However I also wish to select the values of a named attribute '?place', for which there is a value contained in each entry of '?location', how do I adjust my query to do this? 但是,我也希望选择一个命名属性“?place”的值,在“?location”的每个条目中都包含一个值,我该如何调整查询来做到这一点?

I'm not sure I understand correctly what you mean in this phrase: 我不确定我是否正确理解您在这句话中的意思:

named attribute '?place', for which there is a value contained in each entry of '?location' 命名属性“?place”,在“?location”的每个条目中都包含一个值

I guess you are looking for something like this : 我猜你正在寻找的东西像这样

PREFIX mo: <http://purl.org/ontology/mo/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX etree: <http://etree.linkedmusic.org/vocab/>
PREFIX event: <http://purl.org/NET/c4dm/event.owl#>

SELECT ?performer ?prefLabel ?date ?location ?place WHERE 
{    
    ?art a etree:Concert, mo:Performance ;   
         mo:performer ?performer ;    
         skos:prefLabel ?prefLabel ;    
         etree:date ?date ;    
         event:place ?location . 
    ?location etree:location ?place .   
} LIMIT 2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM