Hi. I am trying to write a SPARQL query to retrieve all the categories that have people in them. I am getting the categories with people but the count is wrong. Can you please help me figure out why.
I also tried to use ?person foaf:name ?name ?person dbo:birthDate ?birth
but that didn't help much. Please let me know what do i need to add to make sure its a person.
Thanks in advance!
Yanz; This is really difficult to say without knowing what is in your data. Currently the query looks for all members of the dbpedia-owl:Person class that have a skos:subject property that is a skos:Concept. Membership in skos:Concept is entailed in the skos:broader relationship, so it's unclear whether the UNION is needed. If you have SPARQL 1.1, the UNION pattern you have can be expressed in a property path:
But in the end no one could tell why your ?person count is incorrect without some knowledge of he data and how the count may fail (too many, too few, what is the difference between those that should and should not be in the count, etc.).
answered 06 Oct '11, 12:06