def delete(self, uri): globalGraph = ConjunctiveGraph(self.store) globalGraph.remove((uri,None,None)) g = Graph(self.store, uri) g.remove((None,None,None)) g.commit() return Graph()
def create(self, graph): uri = self.create_uri() inputUri = "#" g = Graph(self.store,URIRef(uri)) g.remove((None,None,None)) g += rebase(graph, uri, inputUri) g.add((URIRef(uri),RDF.type,self.cl)) g.add((URIRef(uri), dc.created, Literal(datetime.datetime.now()))) g.commit() o = Graph() o.add((URIRef(inputUri),OWL.sameAs,uri)) return o
def update(self, uri, graph): self.delete(uri) g = Graph(self.store, uri) g += graph g.commit() return g