From f70380efd23e61c9dec0b071f9fdafd04f4b6a7a Mon Sep 17 00:00:00 2001 From: Sarath Date: Tue, 25 Jun 2024 14:43:12 +0200 Subject: [PATCH] fix bug with dislocation triples --- atomrdf/structure.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/atomrdf/structure.py b/atomrdf/structure.py index 737330f..c135527 100644 --- a/atomrdf/structure.py +++ b/atomrdf/structure.py @@ -1998,10 +1998,12 @@ def add_dislocation(self, disl_dict): self.graph.add((slip_direction, CMSO.hasComponent_y, Literal(disl_dict['SlipDirection'][1], datatype=XSD.float))) self.graph.add((slip_direction, CMSO.hasComponent_z, Literal(disl_dict['SlipDirection'][2], datatype=XSD.float))) - slip_plane = self.graph.create_node(f"{self._name}_DislocationSlipPlane", LDO.NormalVector) - self.graph.add((slip_plane, CMSO.hasComponent_x, Literal(disl_dict['SlipPlane'][0], datatype=XSD.float))) - self.graph.add((slip_plane, CMSO.hasComponent_y, Literal(disl_dict['SlipPlane'][1], datatype=XSD.float))) - self.graph.add((slip_plane, CMSO.hasComponent_z, Literal(disl_dict['SlipPlane'][2], datatype=XSD.float))) + slip_plane = self.graph.create_node(f"{self._name}_DislocationSlipPlane", LDO.SlipPlane) + normal_vector = self.graph.create_node(f"{self._name}_DislocationNormalVector", LDO.NormalVector) + self.graph.add((normal_vector, CMSO.hasComponent_x, Literal(disl_dict['SlipPlane'][0], datatype=XSD.float))) + self.graph.add((normal_vector, CMSO.hasComponent_y, Literal(disl_dict['SlipPlane'][1], datatype=XSD.float))) + self.graph.add((normal_vector, CMSO.hasComponent_z, Literal(disl_dict['SlipPlane'][2], datatype=XSD.float))) + self.graph.add((slip_plane, LDO.hasNormalVector, normal_vector)) slip_system = self.graph.create_node(f"{self._name}_DislocationSlipSystem", LDO.SlipSystem) self.graph.add((slip_direction, LDO.belongsToSystem, slip_system))