SPARQL-通过示例学习 [英] SPARQL - learning by example

查看:89
本文介绍了SPARQL-通过示例学习的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简而言之,如果有人指示我获取包括Oracle,Mysql,DB2,MSSQL等的数据库列表,那么我实际上如何确定创建查询所需的字段和信息?我下载了DBpedia并复制了三元组,例如

In short, if someone instructs me, "Get a list of databases which include Oracle, Mysql, DB2, MSSQL, etc.," how can I actually establish which fields and information I need to create the query? I downloaded DBpedia and grepped the triples, e.g.,

$ `grep 'Oracle' * | grep 'Database'
article_categories_en.nt:<http://dbpedia.org/resource/Oracle_Database> <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Relational_database_management_systems> .`

如何根据最初的问题创建SPARQL查询?
使用上面的代码片段,我知道Oracle是一家公司,其产品之一是同名的RDBMS。我尝试了查找工具并在网上搜索,但这样做还不够,需要一些指导。

How do I create a SPARQL query from that initial question? Using that snippet above, I know Oracle is a company and one of its products is an RDBMS by the same name. I tried the lookup tool and searching the web but did not get far enough with this and need some direction.

推荐答案

在这种情况下,我将从访问DBpedia页面开始,该页面与您想在结果中找到的其中一项相对应。一个很好的例子是 http://dbpedia.org/page/MySQL 。在该页面上,您可以开始寻找可以帮助您找到其他相关系统的属性。页面上列出的一个属性是

In this particular case, I'd start by visiting the DBpedia page corresponding to one of the things that you know you'd like in your result. A good instance is http://dbpedia.org/page/MySQL. On that page, you can start to look for properties that might help you find other related systems. One property listed on the page is

dbpedia-owl:genre dbpedia:Relational_database_management_system

然后我要去 DBpedia SPARQL端点,然后尝试搜索具有相同属性和值的其他事物。在这种情况下,我可以运行以下查询:

Then I'd go the DBpedia SPARQL endpoint and try searching for other things that have this same property and value. In this case, I can run the following query:

SELECT * WHERE { 
  ?rdbms dbpedia-owl:genre dbpedia:Relational_database_management_system .
}

SPARQL结果

结果非常有前景;有38个结果。前几个是:

The results are pretty promising; there are 38 results. The first few are:

rdbms
http://dbpedia.org/resource/MySQL_Cluster
http://dbpedia.org/resource/MSQL
http://dbpedia.org/resource/OpenEdge_Advanced_Business_Language
http://dbpedia.org/resource/Adaptive_Server_Enterprise
…

总的来说,我发现在Wikipedia中查找所需内容的实例要容易得多,然后访问相应的DBpedia页面并查看属性,然后根据该属性制定一些探索性查询。

In general, I find it much easier to locate an instance of the sort of thing that I'm looking for in Wikipedia, then visit the corresponding DBpedia page and look at the properties, and then formulate some exploratory queries based on that.

这篇关于SPARQL-通过示例学习的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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