Hello - I hope this is no stupid question, but I did not find an
answer anywhere - I still kind of hope that I do something wrong
rather than this being a bug.
I have this code (taken partially from the given example) which I
start on an empty store given by the url:
---
from rdfalchemy.sesame2 import SesameGraph
from rdflib import URIRef, Literal, BNode, Namespace
url = "http://...:8080/openrdf-sesame/repositories/testid"
store = SesameGraph(url)
FOAF = Namespace("
http://xmlns.com/foaf/0.1/")
donna = BNode()
print "BNode donna: ", donna
print "Store new BNode donna"
store.add((donna, FOAF["name"], Literal("Donna Fales")))
print "Find this BNode again from the store"
for s, p, o in store.triples((None, FOAF["name"], Literal("Donna
Fales"))):
print s, p, o
print "Store new statement for the just re-found BNode"
store.add((s, FOAF["nick"], Literal("donna", lang="foo")))
print "Contents of store"
for s, p, o in store.triples((None, None, None)):
print s, p, o
---
Now the output is:
BNode donna: FePsOSsW3
Store new BNode donna
Find this BNode again from the store
node13cqu1squx36
http://xmlns.com/foaf/0.1/name Donna Fales
Store new statement for the just re-found BNode
Contents of store
node13cqu1squx36
http://xmlns.com/foaf/0.1/name Donna Fales
node13cqu1squx37
http://xmlns.com/foaf/0.1/nick donna
---
So: a new different BNode was created in the store rather than - as I
was expecting - the same being used as subject for the new statement.
Why is that? Do I do something wrong?
Thanks for any help!
Axel
PS Doing the same on a simple RDFlib Graph() behaves differently and
as I would have expected: the same BNode is used.