Skip to content

Commit

Permalink
bug fix for property creation
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Sep 21, 2024
1 parent 850e65f commit 242239c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion atomrdf/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ def add_calculated_quantity(self, sample, propertyname, value, unit=None):
>>> sample = graph.create_node("Sample1", CMSO.Sample)
>>> graph.add_calculated_quantity(sample, "energy", "10.5", "eV")
"""
prop = self.create_node(propertyname, CMSO.CalculatedProperty)

prop = self.create_node(f"{sample}_{propertyname}", CMSO.CalculatedProperty)
self.add((sample, CMSO.hasCalculatedProperty, prop))
self.add((prop, RDFS.label, Literal(propertyname)))
self.add((prop, ASMO.hasValue, Literal(value)))
Expand Down

0 comments on commit 242239c

Please sign in to comment.