How can I get what a query contains?

20 views
Skip to first unread message

anoga...@gmail.com

unread,
Feb 16, 2015, 3:16:32 PM2/16/15
to rdfli...@googlegroups.com
I need to know what is the answer of the query. I have tried with "bindings" but it does not work here.

sparql = SPARQLWrapper(endpoint)
sparql.setQuery(prefixes + """
SELECT ?term WHERE {
<http://agris.fao.org/aos/records/AU7500003> dct:subject ?term
}
""")

ret = sparql.query()
print ret

I have also tried with convertJSON(ret) and other things but always get an error. Maybe I am managing QueryResult object in the wrong way.
Thanks a lot.

anoga...@gmail.com

unread,
Feb 16, 2015, 3:40:12 PM2/16/15
to rdfli...@googlegroups.com, anoga...@gmail.com
Ok, I have solved it using SPARQLWrapper2. Anyway I could not do it in the other way.
Thanks
Reply all
Reply to author
Forward
0 new messages