I'm trying to execute this Sparql query on the DBPedia but it seems to ignore the DISTINCT:
SELECT DISTINCT ?source ?title ?content ?topic
WHERE {
?source rdfs:label ?title ;
<http://dbpedia.org/ontology/abstract> ?content ;
foaf:isPrimaryTopicOf ?topic .
?title bif:contains "php" .
}
In fact if you try to run the query the result is something like this:
I am running the query from a python file with this code returning a json:
query_rdf = ""
query_rdf += '''
SELECT DISTINCT ?source ?title ?content ?topic
WHERE {
?source rdfs:label ?title ;
<http://dbpedia.org/ontology/abstract> ?content ;
foaf:isPrimaryTopicOf ?topic .
?title bif:contains "php" .
}
'''
__3store = "http://dbpedia.org/sparql"
sparql = SPARQLWrapper (__3store,returnFormat="json")
sparql.setQuery(query_rdf)
result = sparql.query().convert()
print json.dumps(result, separators=(',',':'))