Hi,

I am trying to get the following query to work, but am facing the following
issues:

1) I get repeated results.
2) for a search like "Taco" i got a single odd result like "Korean taco" and
dont get the pages for "Taco" and say "Taco Bell"
3) My results vary for the same query in SPARQL Explorer (
http://dbpedia.org/snorql/?) and when I run it in an app I have written

Query:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbpedia-owl: <http://dbpedia.org/ontology#>
SELECT ?label ?descrip ?thumbnail
WHERE {
?uri rdfs:label ?label;
<http://dbpedia.org/ontology/abstract> ?descrip;
<http://dbpedia.org/ontology/thumbnail> ?thumbnail.
?label bif:contains "Taco".
FILTER (lang(?label) = "en")
}


Python code to display results:
print '\n\n*** JSON Example'
    sparql.setReturnFormat(JSON)
    results = sparql.query().convert()
    sresult_list = []
    print results
    for result in results["results"]["bindings"]:
     res = SearchResult
     abs_language = ''
     abs_language = result["descrip"]["xml:lang"]
     print abs_language
     #print res.label
     #print res.abstract
     if abs_language=='en':
        print "found an english entry"
        res.label=result["label"]["value"]
        res.abstract=result["descrip"]["value"]
        if result["thumbnail"]["value"] != '':
          res.thumbnailurl=result["thumbnail"]["value"]
        sresult_list.append(res)
    return render_to_response('polls/index.html', {'sresult_list':
sresult_list})


Your help is very appreciated.

thanks,
Aj
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to