-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·44 lines (34 loc) · 1.36 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""Setup class for SimPhoNy-catalytic"""
import warnings
from setuptools import setup
setup()
VERSION: str = "v1.0.0"
BASE = "https://raw.githubusercontent.com/simphony/reaxpro-framework-ontology"
URL = f"{BASE}/{VERSION}/reaxpro-inferred.ttl"
CONTENT = f"""identifier: reaxpro
ontology_file: '{URL}'
reference_by_label: True
format: ttl
namespaces:
emmo: http://emmo.info/emmo
crystallography: http://emmo.info/domain-crystallography/crystallography
active_relationships:
- http://emmo.info/emmo#EMMO_8c898653_1118_4682_9bbf_6cc334d16a99
- http://emmo.info/emmo#EMMO_60577dea_9019_4537_ac41_80b0fb563d41
- http://emmo.info/emmo#EMMO_8785be5a_2493_4b12_8f39_31907ab11748
- http://emmo.info/emmo#EMMO_52d08d7d_e9e4_43e5_8508_d353e7e3a23a
default_relationship: http://emmo.info/emmo#EMMO_17e27c22_37e1_468c_9dd7_95e137f73e7f
"""
def install_ontology():
"""Generates and installs the reaxpro ontology."""
from tempfile import NamedTemporaryFile
from osp.core.ontology.installation import OntologyInstallationManager
with NamedTemporaryFile("w", suffix=".yml", delete=False) as yml_file:
yml_file.write(CONTENT)
manager = OntologyInstallationManager()
manager.install_overwrite(yml_file.name)
# install ontology
try:
install_ontology()
except Exception as err:
warnings.warn(f"Ontologies were not properly installed: {err}")