def _RDFGraph(self): # expensive to recompute graph = Graph() for URL, obj in self._pypeObjects.iteritems(): for s, p, o in obj._RDFGraph: graph.add((s, p, o)) return graph
def _RDFGraph(self): # expensive to recompute graph = Graph() for URL, obj in self._pypeObjects.iteritems(): for s,p,o in obj._RDFGraph: graph.add( (s,p,o) ) return graph
def _RDFGraph(self): graph = Graph() for k,v in self.__dict__.iteritems(): if k == "URL": continue if k[0] == "_": continue if k in ["inputDataObjs", "outputDataObjs", "mutableDataObjs", "parameters"]: if k == "inputDataObjs": for ft, f in v.iteritems(): graph.add( (URIRef(self.URL), pypeNS["prereq"], URIRef(f.URL) ) ) elif k == "outputDataObjs": for ft, f in v.iteritems(): graph.add( (URIRef(f.URL), pypeNS["prereq"], URIRef(self.URL) ) ) elif k == "mutableDataObjs": for ft, f in v.iteritems(): graph.add( (URIRef(self.URL), pypeNS["hasMutable"], URIRef(f.URL) ) ) elif k == "parameters": graph.add( (URIRef(self.URL), pypeNS["hasParameters"], Literal(json.dumps(v)) ) ) continue if k in self.inputDataObjs: graph.add( ( URIRef(self.URL), pypeNS["inputDataObject"], URIRef(v.URL) ) ) continue if k in self.outputDataObjs: graph.add( ( URIRef(self.URL), pypeNS["outputDataObject"], URIRef(v.URL) ) ) continue if k in self.mutableDataObjs: graph.add( ( URIRef(self.URL), pypeNS["mutableDataObject"], URIRef(v.URL) ) ) continue if hasattr(v, "URL"): graph.add( ( URIRef(self.URL), pypeNS[k], URIRef(v.URL) ) ) graph.add( ( URIRef(self.URL), pypeNS["codeMD5digest"], Literal(self._codeMD5digest) ) ) graph.add( ( URIRef(self.URL), pypeNS["parameterMD5digest"], Literal(self._paramMD5digest) ) ) return graph
def _RDFGraph(self): graph = Graph() for k, v in self.__dict__.iteritems(): if k == "URL": continue if k[0] == "_": continue if k in [ "inputDataObjs", "outputDataObjs", "mutableDataObjs", "parameters" ]: if k == "inputDataObjs": for ft, f in v.iteritems(): graph.add((URIRef(self.URL), pypeNS["prereq"], URIRef(f.URL))) elif k == "outputDataObjs": for ft, f in v.iteritems(): graph.add((URIRef(f.URL), pypeNS["prereq"], URIRef(self.URL))) elif k == "mutableDataObjs": for ft, f in v.iteritems(): graph.add((URIRef(self.URL), pypeNS["hasMutable"], URIRef(f.URL))) elif k == "parameters": graph.add((URIRef(self.URL), pypeNS["hasParameters"], Literal(json.dumps(v)))) continue if k in self.inputDataObjs: graph.add((URIRef(self.URL), pypeNS["inputDataObject"], URIRef(v.URL))) continue if k in self.outputDataObjs: graph.add((URIRef(self.URL), pypeNS["outputDataObject"], URIRef(v.URL))) continue if k in self.mutableDataObjs: graph.add((URIRef(self.URL), pypeNS["mutableDataObject"], URIRef(v.URL))) continue if hasattr(v, "URL"): graph.add((URIRef(self.URL), pypeNS[k], URIRef(v.URL))) graph.add((URIRef(self.URL), pypeNS["codeMD5digest"], Literal(self._codeMD5digest))) graph.add((URIRef(self.URL), pypeNS["parameterMD5digest"], Literal(self._paramMD5digest))) return graph