如何计算 ARC2 中的三胞胎数量 PHP
How to count number of triplets in ARC2 PHP
我在 ARC2 PHP 中创建了一个 CONSTRUCT 查询,但是如何计算我收到了多少个三元组?
$query = '
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
CONSTRUCT { ?c rdfs:label ?name }
WHERE {
?c rdf:type dbpedia-owl:City.
?c rdfs:label ?name .
?c dbpedia-owl:country <http://dbpedia.org/resource/Italy> .
OPTIONAL { ?c dbpedia-owl:areaCode ?areacode }
FILTER ( lang(?name) = "it")
}';
因为现在查询没有写入任何输出。
SELECT (COUNT(*) as ?cnt) WHERE { ?s ?p ?o }
我在 ARC2 PHP 中创建了一个 CONSTRUCT 查询,但是如何计算我收到了多少个三元组?
$query = '
PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
CONSTRUCT { ?c rdfs:label ?name }
WHERE {
?c rdf:type dbpedia-owl:City.
?c rdfs:label ?name .
?c dbpedia-owl:country <http://dbpedia.org/resource/Italy> .
OPTIONAL { ?c dbpedia-owl:areaCode ?areacode }
FILTER ( lang(?name) = "it")
}';
因为现在查询没有写入任何输出。
SELECT (COUNT(*) as ?cnt) WHERE { ?s ?p ?o }