Skip to content

Commit

Permalink
imported capabilities now have "uriReference" Datatype
Browse files Browse the repository at this point in the history
imported capabilities now have no "UnitOfMeasure"
otherinfo id of capabilities is now "SemanticDescription"
  • Loading branch information
ReggaeUlli committed Dec 12, 2023
1 parent 5a7635c commit cb3a3ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions server/OntologyAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ def recursivly_add_subclasses(super_class):
output_obj = {
"name": str(super_class).split(".")[-1],
"otherInformation":[{
"otherInfoID":"OntologyIRI",
"description":["Iri referencing the Ontology Class definition"],
"otherInfoID":"SemanticDescription",
"description":["URI referencing the Ontology Class definition"],
"otherValue":[{
"valueString": super_class.iri,
"dataType":"Text",
"unitOfMeasure":"url",
"dataType":"uriReference",
"key":str(super_class)
}]
}],
Expand Down
2 changes: 1 addition & 1 deletion server/RecipeAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_all_recipe_capabilities(file_content):
continue
for otherInfo in otherInfos:
otherInfoId = otherInfo.find(ns+'OtherInfoID')
if otherInfoId.text == "OntologyIRI":
if otherInfoId.text == "SemanticDescription":
capabilities.append({
"ID": processElement.find(ns+'ID').text,
"IRI":otherInfo.find(ns+'OtherValue').find(ns+'ValueString').text
Expand Down
6 changes: 3 additions & 3 deletions server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from RecipeAPI import recipe_api, get_all_recipe_capabilities
from OntologyAPI import ontology_api
from AasAPI import aas_api, get_all_aasx_capabilities, get_aasx_id
from AasAPI import aas_api, get_all_aasx_capabilities, get_all_aas_capabilities, get_aasx_id

ontologies = {}
aas = {}
Expand Down Expand Up @@ -195,7 +195,7 @@ def check_capabilities_complex():
for element in unique_recipe_capabilities:
for filename in aasx_files:
aasx = aasx_files[filename]
aasx_capabilities = get_all_aasx_capabilities(aasx)
aasx_capabilities = get_all_aas_capabilities(aasx)
unique_aasx_capabilities = set(item['IRI'] for item in aasx_capabilities)
if element in unique_aasx_capabilities:
print("found capability: " + element)
Expand All @@ -218,7 +218,7 @@ def check_capabilities_complex():
else:
string = "There are no Capability IRIS in Recipe that can be realized by an given AAS."
print(string)
return make_response(string, 400)
return make_response(string, 200)



Expand Down

0 comments on commit cb3a3ef

Please sign in to comment.