예제 #1
0
 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()
예제 #2
0
    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
예제 #3
0
 def update(self, uri, graph):
     self.delete(uri)
     g = Graph(self.store, uri)
     g += graph
     g.commit()
     return g