Skip to content

Commit

Permalink
added some iof dev ontologies for bettr lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Hanke committed Jan 31, 2024
1 parent 8bf6b94 commit 7348f66
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions maptomethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ def dict_constructor(loader, node):
BFO = Namespace("http://purl.obolibrary.org/obo/")
BFO_URL = "http://purl.obolibrary.org/obo/bfo.owl"
IOF_URL = "./ontologies/iof.rdf"
IOF = Namespace("https://spec.industrialontologies.org/ontology/core/Core/")
IOF_QUAL_URL = "https://github.com/iofoundry/ontology/raw/'qualities'/qualities/qualities.rdf"
IOF_QUAL = Namespace("https://spec.industrialontologies.org/ontology/qualities/")
IOF_MAT_URL = "https://github.com/iofoundry/ontology/raw/materials/materials/Materials.rdf"
IOF_MAT = Namespace("https://spec.industrialontologies.org/ontology/materials/Materials/")

OA = Namespace("http://www.w3.org/ns/oa#")
OA_URL = "http://www.w3.org/ns/oa.ttl"
IOF = Namespace("https://spec.industrialontologies.org/ontology/core/Core/")


def strip_namespace(term: URIRef) -> str:
Expand Down Expand Up @@ -76,6 +81,15 @@ def get_rdflib_Namespaces() -> dict:
pass
return class_dict

ontologies = get_rdflib_Namespaces()
ontologies["BFO"] = {"uri": str(BFO), "src": BFO_URL}
ontologies["OA"] = {"uri": str(OA), "src": OA_URL}
ontologies["CSVW"]["src"] = "https://www.w3.org/ns/csvw.ttl"
ontologies["IOF"] = {"uri": str(IOF), "src": IOF_URL}
ontologies["IOF-MAT"] = {"uri": str(IOF_MAT), "src": IOF_MAT_URL}
ontologies["IOF-QUAL"] = {"uri": str(IOF_QUAL), "src": IOF_QUAL_URL}


def open_file(uri: AnyUrl,authorization= None) -> Tuple["filedata": str, "filename": str]:
try:
uri_parsed = urlparse(uri)
Expand Down Expand Up @@ -127,7 +141,7 @@ def get_all_sub_classes(superclass: URIRef, authorization=None) -> List[URIRef]:
for key, item in ontologies.items()
if ontology_url in item["uri"]
]
# print(ontology_url,result)
#print(ontology_url,result)
if result:
ontology_url = result[0][1]
logging.info(
Expand Down Expand Up @@ -181,12 +195,6 @@ def get_methods() -> Dict:
return methods


ontologies = get_rdflib_Namespaces()
ontologies["BFO"] = {"uri": str(BFO), "src": BFO_URL}
ontologies["OA"] = {"uri": str(OA), "src": OA_URL}
ontologies["CSVW"]["src"] = "https://www.w3.org/ns/csvw.ttl"
ontologies["IOF"] = {"uri": str(IOF), "src": IOF_URL}


# InformtionContentEntity = CCO.InformationContentEntity
InformtionContentEntity = IOF.InformationContentEntity
Expand Down

0 comments on commit 7348f66

Please sign in to comment.