使用dbpedia-owl:wikiPageRedirect值检索资源的dbpedia-owl:type值? [英] Retrieving dbpedia-owl:type value of resource with dbpedia-owl:wikiPageRedirect value?

查看:98
本文介绍了使用dbpedia-owl:wikiPageRedirect值检索资源的dbpedia-owl:type值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

访问 http://dbpedia.org/resource/Cupertino 显示有关Cupertino的DBpedia RDF信息.如您所见,它具有以下特性和价值:

Visitng http://dbpedia.org/resource/Cupertino shows the DBpedia RDF information about Cupertino. As you can see, it has, among others, the property and value:

dbpedia-owl:type  dbpedia:City

但是,在DBpedia端点上的此查询不返回任何结果:

However, this query on the DBpedia endpoint returns no results:

SELECT ?type  WHERE {
  dbpedia:Cupertino  dbpedia-owl:type ?type
}

为什么我不能检索dbpedia-owl:type属性的值?

Why can't I retrieve the value of the dbpedia-owl:type property?

推荐答案

您面前有一个交互式Web服务,您可以做的最有用的事情之一就是 generalize 查询到一个应该返回您正在寻找的结果的超集的表,作为一种健全性检查.在这种情况下,查看请求 all 属性和值dbpedia:Cupertino会发生什么会很有用.

You've got an interactive webservice in front of you, and one of the most useful things that you can do is generalize your query into one that should return a superset of the results you're looking for, as a sort of sanity check. In this case, it's useful to see what happens if you ask for all properties and values of dbpedia:Cupertino.

select ?p ?o where {
  dbpedia:Cupertino ?p ?o 
}

在这种情况下,dbpedia-owl:wikiPageRedirects非常重要.当您键入dbpedia:Cupertino或完整的URI时, http://dbpedia.org/resource/Cupertino ,然后在网络浏览器中仔细查看最终结果.您最终到达 http://dbpedia.org/page/Cupertino,_California ,这意味着您实际询问的资源是 http://dbpedia.org/resource/Cupertino,_California(在浏览器中检索它们时,会将您从/resource/重定向到/page/,但是命名约定仍然相同.

In this case, that dbpedia-owl:wikiPageRedirects is very important. When you type in dbpedia:Cupertino or the full URI, http://dbpedia.org/resource/Cupertino, into a web browser, look carefully at where you end up. You end up at http://dbpedia.org/page/Cupertino,_California, which means that the resource you're actually asking about is http://dbpedia.org/resource/Cupertino,_California (when you retrieve them in a browser, you're redirected from /resource/ to /page/, but the naming convention is still the same.

要在查询中使用dbpedia:Cupertino,您需要添加重定向信息.因此,您可以使用以下查询来获取所需的结果:

To use dbpedia:Cupertino in a query, you'd need to add the redirect information. Thus, you could use the following query to get the results that you're looking for:

select ?type where {
  dbpedia:Cupertino dbpedia-owl:wikiPageRedirects*/dbpedia-owl:type ?type
}

查看全文

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