--- a/src/hdalab/management/commands/query_dbpedia.py Wed Jun 25 17:34:54 2014 +0200
+++ b/src/hdalab/management/commands/query_dbpedia.py Thu Jun 26 10:44:05 2014 +0200
@@ -143,8 +143,7 @@
labels = {}
thumbnail = None
with transaction.commit_on_success():
- #endpoint.setQuery("select distinct ?y where {<%s> <http://dbpedia.org/ontology/abstract> ?y}" % (tag.dbpedia_uri))
- endpoint.setQuery("select distinct ?y where {<%s> <%s> ?y}" % (settings.DBPEDIA_URI_TEMPLATE % ( 'ontology', 'abstract' ), tag.dbpedia_uri))
+ endpoint.setQuery("select distinct ?y where {<%s> <http://dbpedia.org/ontology/abstract> ?y}" % (tag.dbpedia_uri))
res_abstracts = endpoint.queryAndConvert()
for _,_,o in res_abstracts.triples((None, URIRef('http://www.w3.org/2005/sparql-results#value'), None)):
abstracts[o.language] = (unicode(o), True)
@@ -154,8 +153,7 @@
for _,_,o in res_labels.triples((None, URIRef('http://www.w3.org/2005/sparql-results#value'), None)):
labels[o.language] = (unicode(o), True)
- #endpoint.setQuery("select distinct ?y where {<%s> <http://dbpedia.org/ontology/thumbnail> ?y} limit 1" % (tag.dbpedia_uri))
- endpoint.setQuery("select distinct ?y where {<%s> <%s> ?y} limit 1" % (settings.DBPEDIA_URI_TEMPLATE % ( 'ontology', 'thumbnail' ), tag.dbpedia_uri))
+ endpoint.setQuery("select distinct ?y where {<%s> <http://dbpedia.org/ontology/thumbnail> ?y} limit 1" % (tag.dbpedia_uri))
res_thumbnails = endpoint.queryAndConvert()
for _,_,o in res_thumbnails.triples((None, URIRef('http://www.w3.org/2005/sparql-results#value'), None)):
thumbnail = unicode(o)