Exemple #1
0
 def closureGraph(self,sourceGraph,readOnly=True,store=None):
     if readOnly:
         if store is None and not sourceGraph:
             store = Graph().store
         store = store is None and sourceGraph.store or store
         roGraph=ReadOnlyGraphAggregate([sourceGraph,self.inferredFacts],
                                        store=store)
         roGraph.namespace_manager = NamespaceManager(roGraph)
         for srcGraph in [sourceGraph,self.inferredFacts]:
             for prefix,uri in srcGraph.namespaces():
                 roGraph.namespace_manager.bind(prefix,uri)
         return roGraph
     else:
         cg=ConjunctiveGraph()
         cg+=sourceGraph
         cg+=self.inferredFacts
         return cg