diff --git a/pyscal_rdf/visualize.py b/pyscal_rdf/visualize.py index 102ed01..281bd1c 100644 --- a/pyscal_rdf/visualize.py +++ b/pyscal_rdf/visualize.py @@ -99,9 +99,10 @@ def visualize_graph(g, #we collapse sample information #if cmso.connector is found, only use it is it is cmso.hasCalculated #all sub sample props, indicated by sample_x_jsjsj will be ignored. + green_list = ["hasCalculatedProperty", "wasCalculatedBy", "hasValue"] ssplit = string3.split('.') if (len(ssplit) == 2): - if (ssplit[0] == 'cmso') and (ssplit[1] != "hasCalculatedProperty"): + if (ssplit[0] == 'cmso') and (ssplit[1] not in green_list): plot = False if string3 == 'subClassOf': plot = False diff --git a/pyscal_rdf/workflow/workflow.py b/pyscal_rdf/workflow/workflow.py index 8f6cb8f..936af82 100644 --- a/pyscal_rdf/workflow/workflow.py +++ b/pyscal_rdf/workflow/workflow.py @@ -258,14 +258,13 @@ def add_method(self, ): prop = URIRef(f'{main_id}_{key}') self.kg.add((prop, RDF.type, CMSO.CalculatedProperty)) self.kg.add((prop, RDFS.label, Literal(key))) - self.kg.add((prop, CMSO.hasValue, Literal(val["value"]))) + self.kg.add((prop, ASO.hasValue, Literal(val["value"]))) if "unit" in val.keys(): unit = val['unit'] - self.kg.add((prop, CMSO.hasUnit, URIRef(f'http://qudt.org/vocab/unit/{unit}'))) - + self.kg.add((prop, ASO.hasUnit, URIRef(f'http://qudt.org/vocab/unit/{unit}'))) self.kg.add((prop, CMSO.wasCalculatedBy, activity)) if val['associate_to_sample']: - self.kg.add((sample, CMSO.hasCalculatedProperty, prop)) + self.kg.add((self.sample, CMSO.hasCalculatedProperty, prop)) def to_graph(self, workflow_object): self._prepare_job(workflow_object)