0

I created different graphs using RDFLib in python which share the same Bnodes. Each BNode has a specific name. I am trying now to store all the graphs in one graph using 4store and http4store. The problem I am facing is that after adding a graph to 4store database the Bnode changed and are assigned different names which is quite a problem since that all graphs share the same Bnodes. So each time I receive a new graph I store it as follow:

self.insert(descriptor,"reference",format="xml")

reference is the name of the graph that i created using: 4s-httpd -p 8000 reference and descriptor is the graph to be added.

#the insert function is as follow
     def insert(self, content, graph, format="xml"):
            r = self.store.append_graph(uri=graph, content=content, content_type=format)
            if not (r.status == 201 or r.status == 200):
                raise TripleStoreInsertException(content)

and then using a SPARQL query I got back the tripled stored which contains different Bnodes names. I tried also to parse each new graph with the older graph to create one single graph using RDFLib parser before storing it but i got the same results where the BNode changed.

My question is: how can i store the graphs with the exact same Bnodes and if it is not possible is there an alternative in RDFLib ?

Also due to the lake of documentation regarding 4store what is the best RDF Triplestores that are python-friendly?

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
TJR
  • 15
  • 5
  • I'm a bit puzzled when you say "Each BNode has a specific name". Well... the all point of Blank Nodes is to have objects in an ontology WITHOUT a specific name (URI). – daxid Nov 24 '16 at 12:04
  • I mean by a specific name a label. For example in RDFLib would be something like this `Bnode(b1)` then the node id will not be a rondom instead it will be b1. I dont know if it is clear or not – TJR Nov 25 '16 at 11:58

0 Answers0