【问题标题】:Sparql- how to get number of triples?Sparql-如何获得三元组的数量?
【发布时间】:2018-07-11 14:29:25
【问题描述】:

我正在做一个关于 sparql 的小练习。使用Dbpedia Endpoint,我需要计算三元组的数量。

这是我的查询

      // Get the number of triples //


    SELECT (COUNT(*) as ?Triples) WHERE { ?s ?p ?o}
-------------------------------------------------------
    OUTPUT:

    ( ?Triples = 1625382483 )

只是想知道查询和结果是否正确? 这就是你获得三元组数量的方式吗?

【问题讨论】:

    标签: sparql jena semantic-web dbpedia


    【解决方案1】:

    您可以通过直接在 SPARQL 端点上执行查询来检查许多事情,而不是通过 Jena 或其他中间客户端。例如,your query on the DBpedia formits results,它们显示了该三元组 (currently 1,625,382,483) 中的所有三元组。

    如果您只希望 DBpedia 命名图 (currently 438,336,517) 中的三元组计数,则需要指定 in the SPARQL form Default Data Set Name (Graph IRI)directly in the query,如 --

    SELECT (COUNT(*) as ?Triples) 
    WHERE 
      { GRAPH <http://dbpedia.org> 
          { ?s ?p ?o } 
      }
    

    -- 或--

    SELECT (COUNT(*) as ?Triples) 
    FROM <http://dbpedia.org> 
    WHERE { ?s ?p ?o } 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-21
      • 1970-01-01
      • 1970-01-01
      • 2021-12-27
      相关资源
      最近更新 更多