Skip to content

Commit

Permalink
Merge pull request #270 from EGA-archive/develop
Browse files Browse the repository at this point in the history
get descendants fixed
  • Loading branch information
costero-e authored Jan 16, 2024
2 parents 4d1a94a + 0c856bb commit df55e1c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions beacon/db/get_descendants.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ def load_ontology(ontology_id: str) -> Optional[owlready2.Ontology]:
urllib.request.urlretrieve(url, path, MyProgressBar())
except HTTPError:
# TODO: Handle error
print("ERROR", HTTPError)
#print("ERROR", HTTPError)
pass
except ValueError:
print("ERROR", ValueError)
#print("ERROR", ValueError)
pass
try:
print (os.stat(path).st_size)
#print (os.stat(path).st_size)
if os.stat(path).st_size == 0:
try:
urllib.request.urlretrieve(url_alt, path, MyProgressBar())
except HTTPError:
# TODO: Handle error
print("ERROR", HTTPError)
#print("ERROR", HTTPError)
pass
except ValueError:
print("ERROR", ValueError)
#print("ERROR", ValueError)
pass
except Exception:
pass
Expand Down Expand Up @@ -127,16 +127,19 @@ def get_descendants_and_similarities(ontology:str):
path = "/beacon/beacon/db/similarities/{}{}{}.txt".format(ontology_list[0],ontology_list[1],'high')
with open(path, 'w') as f:
for item in similarity_high:
print(item)
f.write(item+"\n")
f.close()
path = "/beacon/beacon/db/similarities/{}{}{}.txt".format(ontology_list[0],ontology_list[1],'medium')
with open(path, 'w') as f:
for item in similarity_medium:
print(item)
f.write(item+"\n")
f.close()
path = "/beacon/beacon/db/similarities/{}{}{}.txt".format(ontology_list[0],ontology_list[1],'low')
with open(path, 'w') as f:
for item in similarity_low:
print(item)
f.write(item+"\n")
f.close()

Expand Down

0 comments on commit df55e1c

Please sign in to comment.