Skip to content

Commit

Permalink
Merge pull request #131 from pyscal/add_angle_to_ldo
Browse files Browse the repository at this point in the history
Add angle to ldo
  • Loading branch information
srmnitc authored Jun 26, 2024
2 parents d8a3d78 + 1c767ff commit 1e238ff
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.0
current_version = 0.9.1
commit = True
tag = False

Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ url: 'https://atomrdf.pyscal.org'
license: "MIT"
repository-code: https://github.com/pyscal/atomRDF
type: software
version: 0.9.0
version: 0.9.1
27 changes: 27 additions & 0 deletions atomrdf/data/ldo.owl
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@



<!-- http://purls.helmholtz-metadaten.de/cdos/ldo/hasCharacterAngle -->

<owl:DatatypeProperty rdf:about="http://purls.helmholtz-metadaten.de/cdos/ldo/hasCharacterAngle">
<rdfs:domain rdf:resource="http://purls.helmholtz-metadaten.de/cdos/ldo/MixedDislocation"/>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#float"/>
</owl:DatatypeProperty>



<!-- http://purls.helmholtz-metadaten.de/cdos/ldo/hasDislocationDensity -->

<owl:DatatypeProperty rdf:about="http://purls.helmholtz-metadaten.de/cdos/ldo/hasDislocationDensity">
Expand Down Expand Up @@ -308,6 +317,7 @@
<!-- http://purls.helmholtz-metadaten.de/cdos/ldo/AngularVector -->

<owl:Class rdf:about="http://purls.helmholtz-metadaten.de/cdos/ldo/AngularVector">
<rdfs:subClassOf rdf:resource="http://purls.helmholtz-metadaten.de/cmso/Vector"/>
<rdfs:label>Angular Vector</rdfs:label>
<skos:altLabel>Frank Vector</skos:altLabel>
</owl:Class>
Expand All @@ -324,6 +334,14 @@



<!-- http://purls.helmholtz-metadaten.de/cdos/ldo/CharacterAngle -->

<owl:Class rdf:about="http://purls.helmholtz-metadaten.de/cdos/ldo/CharacterAngle">
<rdfs:label>Character Angle</rdfs:label>
</owl:Class>



<!-- http://purls.helmholtz-metadaten.de/cdos/ldo/Disclination -->

<owl:Class rdf:about="http://purls.helmholtz-metadaten.de/cdos/ldo/Disclination">
Expand Down Expand Up @@ -467,6 +485,15 @@



<!-- http://purls.helmholtz-metadaten.de/cmso/Angle -->

<owl:Class rdf:about="http://purls.helmholtz-metadaten.de/cmso/Angle">
<obo:IAO_0000115 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">An angle is a measure of the the space (usually in degrees) between two intersecting lines at the point where they meet or vertex.</obo:IAO_0000115>
<rdfs:label>Angle</rdfs:label>
</owl:Class>



<!-- http://purls.helmholtz-metadaten.de/cmso/Vector -->

<owl:Class rdf:about="http://purls.helmholtz-metadaten.de/cmso/Vector">
Expand Down
2 changes: 1 addition & 1 deletion atomrdf/network/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def read_ontology():
pldo = OntologyNetwork(os.path.join(file_location, "data/pldo.owl")) #d15d27712e3f64b405d75c70ad970c9d54ff0b51
podo = OntologyNetwork(os.path.join(file_location, "data/podo.owl")) #6a74d511c5b78042e1cb7a6e76e948fa56de598e
asmo = OntologyNetwork(os.path.join(file_location, "data/asmo.owl")) #c7e2da99b9126844f19f225c6a10cdb01aeb55e6
ldo = OntologyNetwork(os.path.join(file_location, "data/ldo.owl")) #52fc756d2e2f9baedfce478e7f8b790365648cea
ldo = OntologyNetwork(os.path.join(file_location, "data/ldo.owl")) #e23fa9930351787e701347878a3e1a0e3924d084

# combine them
combo = cmso + pldo + podo + asmo + ldo
Expand Down
5 changes: 5 additions & 0 deletions atomrdf/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1973,10 +1973,13 @@ def add_dislocation(self, disl_dict):
angle_deg = disl_dict['DislocationCharacter']
if (np.abs(angle_deg-0) < 1E-3) or (np.abs(angle_deg-180) < 1E-3) or (np.abs(angle_deg-360) < 1E-3):
disl_type = LDO.ScrewDislocation
disl_name = "ScrewDislocation"
elif (np.abs(angle_deg-90) < 1E-3) or (np.abs(angle_deg-270) < 1E-3):
disl_type = LDO.EdgeDislocation
disl_name = "EdgeDislocation"
else:
disl_type = LDO.MixedDislocation
disl_name = "MixedDislocation"

line_defect = self.graph.create_node(f"{self._name}_Dislocation", disl_type)
self.graph.add((self.material, CMSO.hasDefect, line_defect))
Expand All @@ -1993,6 +1996,8 @@ def add_dislocation(self, disl_dict):
self.graph.add((burgers_vector, CMSO.hasComponent_z, Literal(disl_dict['BurgersVector'][2], datatype=XSD.float)))
self.graph.add((line_defect, LDO.hasBurgersVector, burgers_vector))

self.graph.add((line_defect, LDO.hasCharacterAngle, Literal(angle_deg, datatype=XSD.float)))

slip_direction = self.graph.create_node(f"{self._name}_DislocationSlipDirection", LDO.SlipDirection)
self.graph.add((slip_direction, CMSO.hasComponent_x, Literal(disl_dict['SlipDirection'][0], datatype=XSD.float)))
self.graph.add((slip_direction, CMSO.hasComponent_y, Literal(disl_dict['SlipDirection'][1], datatype=XSD.float)))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='atomrdf',
version='0.9.0',
version='0.9.1',
author='Abril Azocar Guzman, Sarath Menon',
author_email='sarath.menon@pyscal.org',
description='Ontology based structural manipulation and quering',
Expand Down

0 comments on commit 1e238ff

Please sign in to comment.