执行SPARQL查询:BaseKB

时间:2013-02-03 15:20:01

标签: sparql freebase virtuoso

我已加载:Virtuoso中的BaseKB Lite(Windows)。

我应该在Vitruoso SPARQL端点(http:/ comphost:8890 / sparql)中使用什么SPARQL语句来获取所有主题名称及其与Freebase'Sports'域(英文)相关的所有别名,除了Person?

在Freebase中有一个'/ sports'主题,其中包含'/ sports / sports_league_season'等所有子主题。 到目前为止,我无法找到它如何映射到BaseKB模式((

结果示例:

 .......

 Manchester United F.C.|Manchester United FC|The Red Devils|Manch Untd|Manchester United Football Club
 London 2012|London 2012 Olympic Games| XXX Olympic games

 ........

注意:此列表中没有运动员(没有Maria Sharapova,Victoria Azarenka等)

1 个答案:

答案 0 :(得分:0)

以下SPARQL返回“Manchester United F.C”的所有别名

     prefix basekb: <http://rdf.basekb.com/ns/>
     prefix public: <http://rdf.basekb.com/public/>
     prefix fbase: <http://rdf.freebase.com/ns/>
     prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
     prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
     prefix dbpedia: <http://dbpedia.org/resource/>
      select ?label ?alias{
                 basekb:m.050fh <http://rdf.basekb.com/ns/m.01gr> ?alias ; 
                                                       rdfs:label ?label.
      filter(lang(?label) = 'en').
      } limit 100

    Output:
      label     alias
      "Manchester United F.C."@en   "United"@en
      "Manchester United F.C."@en   "Manchester United"@en
      "Manchester United F.C."@en   "Red Devils"@en
      "Manchester United F.C."@en   "The Red Devils"@en
      "Manchester United F.C."@en   "Manchester United Football Club"@en
      "Manchester United F.C."@en   "Manchester United FC"@en
      "Manchester United F.C."@en   "Man United"@en