It was not exactly that (I omitted the unnecessary mess), but the flow is the 
same:

import rdflib


graph = rdflib.Graph()

person_ns = rdflib.URIRef('http://dbpedia.org/ontology/Person')
object_ns = rdflib.URIRef('http://dbpedia.org/ontology/Place')
organisation_ns = rdflib.URIRef('http://dbpedia.org/ontology/Organisation')
resource = rdflib.URIRef("http://dbpedia.org/resource/Adam Małysz")

graph.value(resource, rdflib.RDFS.label)
graph.load(resource) # << error here

for subject, predicate, object_ in graph:
    if subject == resource and object_ in [person_ns, object_ns, 
organisation_ns]:
        response += [
            {
                'serie': serie,
                'subject': u''.join(subject).encode('utf-8'),
                'predicate': u''.join(predicate).encode('utf-8'),
                'type': u''.join(object_).encode('utf-8')
            }
        ]
        break

return response

Later, the sparql.setQuery(..) way worked for my friend.

-- 
http://github.com/RDFLib
--- 
You received this message because you are subscribed to the Google Groups 
"rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rdflib-dev/1225137d-9c98-4114-9220-9c396eb3a683%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to