diff --git a/atomrdf/network/ontology.py b/atomrdf/network/ontology.py index 46e35d4..4cb2504 100644 --- a/atomrdf/network/ontology.py +++ b/atomrdf/network/ontology.py @@ -84,6 +84,7 @@ def read_ontology(): #CMSO -> PODO IMPURITY combo.add_path(("cmso:Material", "cmso:hasDefect", "podo:SubstitutionalImpurity")) combo.add_path(("cmso:Material", "cmso:hasDefect", "podo:InterstitialImpurity")) + combo.add_path(("podo:InterstitialImpurity", "rdfs:label", "string")) combo.add_path(("cmso:AtomicScaleSample", "podo:hasNumberOfImpurityAtoms", "int")) combo.add_path(("cmso:AtomicScaleSample", "podo:hasImpurityConcentration", "float")) diff --git a/atomrdf/structure.py b/atomrdf/structure.py index 0ca136d..a328569 100644 --- a/atomrdf/structure.py +++ b/atomrdf/structure.py @@ -1065,11 +1065,14 @@ def add_interstitial_impurities( ) json_io.write_file(outfile, datadict) - self.add_triples_for_interstitial_impurities(conc_of_impurities, no_of_impurities=no_of_impurities) + self.add_triples_for_interstitial_impurities(conc_of_impurities, no_of_impurities=no_of_impurities, label=void_type) return sysn - def add_triples_for_interstitial_impurities(self, conc_of_impurities, no_of_impurities=None): - defect = self.graph.create_node(f"{self._name}_InterstitialImpurity", PODO.InterstitialImpurity) + def add_triples_for_interstitial_impurities(self, conc_of_impurities, no_of_impurities=None, label=None): + if label is not None: + defect = self.graph.create_node(f"{self._name}_InterstitialImpurity", PODO.InterstitialImpurity, label=label) + else: + defect = self.graph.create_node(f"{self._name}_InterstitialImpurity", PODO.InterstitialImpurity) self.graph.add((self.material, CMSO.hasDefect, defect)) self.graph.add((self.sample, PODO.hasImpurityConcentration, Literal(conc_of_impurities, datatype=XSD.float))) if no_of_impurities is not None: