我在sparql上做了一个小练习 . 使用Dbpedia Endpoint,我需要计算三元组的数量 .
这是我的查询
// Get the number of triples //
SELECT (COUNT(*) as ?Triples) WHERE { ?s ?p ?o}
-------------------------------------------------------
OUTPUT:
( ?Triples = 1625382483 )
只是想知道查询和结果对吗?这是你如何得到三元组的数量?
1 回答
您可以通过直接在SPARQL endpoints 上执行查询来检查很多事情,而不是通过Jena或其他中间客户端 . 例如,your query on the DBpedia form和its 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,如 -