Counting in SPARQL

前端 未结 1 1893
广开言路
广开言路 2021-02-20 10:50

Ok so i have this query

PREFIX rdfs:  

SELECT DISTINCT (COUNT(?instance) AS ?count) WHERE {
?instance a 

        
相关标签:
1条回答
  • 2021-02-20 11:41

    You might want to try this:

    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
    
    SELECT (COUNT(DISTINCT ?instance) AS ?count) WHERE {
    ?instance a <http://dbpedia.org/ontology/Ambassador>; 
              <http://dbpedia.org/property/name> ?name
    }
    

    It's giving me a result of 283, which might or might not be right :).

    0 讨论(0)
提交回复
热议问题