semantics - Counting in SPARQL -


ok have query

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>   select distinct (count(?instance) ?count) { ?instance <http://dbpedia.org/ontology/ambassador> .  } 

and result 286. cool. want number of ambassadors have http://dbpedia.org/property/name property. but

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>   select distinct (count(?instance) ?count) { ?instance <http://dbpedia.org/ontology/ambassador> .  ?instance <http://dbpedia.org/property/name> ?name } 

results in 533 :(. counting more because there people have property 1 or more times. how number of ambassadors have property regardless of how many times have it. can in single query?

thanks.

you might want try this:

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>   select (count(distinct ?instance) ?count) { ?instance <http://dbpedia.org/ontology/ambassador>;            <http://dbpedia.org/property/name> ?name } 

it's giving me result of 283, might or might not right :).


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -