SPARQL-按标签获取属性 [英] SPARQL - get properties by label

查看:54
本文介绍了SPARQL-按标签获取属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我当前的项目,我需要从dbpedia中提取信息.我唯一拥有的信息就是资源的标签.

For my current project I need to extract information from dbpedia. The only information I have is the label of the resource.

举个例子:

我有资源汽车".现在我想得到例如摘要.有没有办法用SPARQL解决这个问题?

I have the resource "car". Now I would like to get e.g. the abstract. Is there a way to solve this with SPARQL?

推荐答案

该其他答案不能使您从DBpedia得到结果,这就是您想要的结果.还不清楚您是否要为标有 includes 您已知字符串或 is 您已知字符串的资源获得结果.

That other answer doesn't get you results from DBpedia, which is what you said you wanted. It's also not clear whether you want results for resources which label includes your known string, or is your known string.

直接联系查询表格和结果的几个示例,假定您只关心英文摘要和标签...

A couple of examples, directly linked to query forms and results, presuming you only care about English abstracts and labels...

PREFIX  rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX   dbo:  <http://dbpedia.org/ontology/>
PREFIX   bif:  <bif:>

SELECT DISTINCT ?itemLabel  
                ?item  
                ?itemDescription 
 WHERE
   {  
     ?item       rdfs:label    ?itemLabel .
     ?itemLabel  bif:contains  "car" .
     ?item       dbo:abstract  ?itemDescription .
     FILTER (lang(?itemDescription) = 'en')
     FILTER (lang(?itemLabel) = 'en')
   }
ORDER BY ?itemLabel

(

这篇关于SPARQL-按标签获取属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆