Skip to content

Commit

Permalink
fix added quantities
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Apr 11, 2024
1 parent 1a41ffa commit bb14da3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pyscal_rdf/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions pyscal_rdf/workflow/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bb14da3

Please sign in to comment.