Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database SPARQL,dbpedia:检索作为属性链接的资源的值,键入person_Database_Sparql_Dbpedia - Fatal编程技术网

Database SPARQL,dbpedia:检索作为属性链接的资源的值,键入person

Database SPARQL,dbpedia:检索作为属性链接的资源的值,键入person,database,sparql,dbpedia,Database,Sparql,Dbpedia,我需要检索一个人母亲的姓名,但我不知道如何检索 这是我目前正在处理的查询: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX : <http://dbpedia.org/resour

我需要检索一个人母亲的姓名,但我不知道如何检索

这是我目前正在处理的查询:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX foaf: <http://xmlns.com/foaf/0.1/> 
PREFIX : <http://dbpedia.org/resource/> 


SELECT DISTINCT 
    ?resource ?depiction ?label ?parent ?bd 
WHERE { 
    ?resource a dbo:Royalty ; foaf:depiction ?depiction ; rdfs:label ?label;
    dbo:parent ?parent; dbo:birthDate ?bd; 
    dbo:birthPlace ?bp . ?bp dbo:isPartOf :England . 
    FILTER(
        LANGMATCHES(LANG(?label), 'en') && ?bd < '1900-01-01'^^xsd:date)
} 
ORDER BY DESC(?bd)

但我需要:

Princess Elisabeth Albertine of Saxe-Hildburghausen

正如@AKSW所评论的,一个可能不完整的查询(此处格式化以提高清晰度)--

前缀rdfs:
前缀rdf:
前缀foaf:
前缀yago:
前缀:
选择不同的
?资源
?标签
?bd
?描述
父母亲
?家长标签
哪里
{?资源a dbo:版税;
foaf:描述?描述;
rdfs:标签?标签;
dbo:父母?父母;
dbo:出生日期?bd;
dbo:出生地/dbo:位置?/dbo:isPartOf:英格兰。
?父rdfs:标签?父标签。
过滤器(LANGMATCHES(LANG(?parentLabel),“en”)
&&LANGMATCHES(LANG(?标签),“en”)
&&bd<'1900-01-01'^^xsd:日期
)
{?父foaf:gender“female”@en}
联合
{?父母a雅戈:女性109619168}
} 
按描述订购(?bd)
1)您正在做同样的事情,例如,我假设这是一个家庭作业,也许您可以与其他人共享知识2)您只能查询数据集中包含的数据,而数据库pedia afaik中不包含性别。通过在浏览器中打开您感兴趣的资源之一,您可以查看所有可用数据-通过专用的三元组,无性别,或者至少不总是Gilles Antoine在他的链接中指出的那样。DBpedia中的性别:3)另一个问题中建议的解决方法是使用YAGO类型,实际上它是基于维基百科的分类。例如,
http://dbpedia.org/class/yago/Female109619168
可能是您在此处需要的东西类似这样的东西(可能不完整):
选择distinct?resource?label?bd?Description?parent?parentLabel WHERE{资源a dbo:Royalty;foaf:Description?Description;rdfs:label?label;dbo:parent?parent;dbo:birthDate?bd;dbo:BurthPlace/dbo:location?/dbo:isPartOf:England。?父rdfs:label?parentLabel.FILTER(LANGMATCHES(LANG(?parentLabel),'en')&&LANGMATCHES(LANG(?label),'en')&'bd<'1900-01-01^^xsd:date){parent foaf:gender“female”@en}union{parent a}}顺序按DESC(?bd)
http://dbpedia.org/page/Duke_Charles_Louis_Frederick_of_Mecklenburg
Princess Elisabeth Albertine of Saxe-Hildburghausen
PREFIX  rdfs:  <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX   rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX  foaf:  <http://xmlns.com/foaf/0.1/> 
PREFIX  yago:  <http://dbpedia.org/class/yago/>
PREFIX      :  <http://dbpedia.org/resource/> 

SELECT DISTINCT 
  ?resource
  ?label
  ?bd
  ?depiction
  ?parent
  ?parentLabel 
WHERE
  { ?resource  a                                          dbo:Royalty ; 
               foaf:depiction                             ?depiction ; 
               rdfs:label                                 ?label ; 
               dbo:parent                                 ?parent ; 
               dbo:birthDate                              ?bd ; 
               dbo:birthPlace/dbo:location?/dbo:isPartOf  :England . 
    ?parent    rdfs:label                                 ?parentLabel . 
    FILTER     (  LANGMATCHES ( LANG ( ?parentLabel ), 'en' )
               && LANGMATCHES ( LANG ( ?label ), 'en' )
               && ?bd < '1900-01-01'^^xsd:date
               )
    { ?parent  foaf:gender                                "female"@en } 
    UNION 
    { ?parent  a                                          yago:Female109619168 } 
  } 
ORDER BY DESC(?bd)