简体   繁体   English

在 Sparql 中查询以获取人员的数据

[英]Query in Sparql to get data of a person

I would like to have a list of all mountains names of the "dbo:firstAscentPerson" property of Lionel Terray (dbpedia: http://dbpedia.org/page/Lionel_Terray ).我想列出 Lionel Terray 的“dbo:firstAscentPerson”属性的所有山脉名称(dbpedia: http ://dbpedia.org/page/Lionel_Terray)。

在此处输入图像描述

This below is what I have so far以下是我到目前为止所拥有的

select ?person ?firstAscentPerson  where {
?person foaf:name "Lionel Terray"@en.
dbo:firstAscentPerson  rdfs:label ?firstAscentPerson.

} LIMIT 100

The following query does what you need:以下查询可以满足您的需要:

SELECT ?mountain ?mountainName ?person2 ?person2Name {
    VALUES ?person1Name {"Lionel Terray"@en}

    ?mountain dbo:firstAscentPerson ?person1, ?person2 .
    ?mountain rdfs:label ?mountainName .
    ?person1 foaf:name ?person1Name .
    FILTER (lang(?mountainName) = "en")
    OPTIONAL {?person2 foaf:name ?person2Name . FILTER (lang(?person2Name) = 'en')}

} 

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

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