Skip to content

Commit

Permalink
ontology methods acquiring locks (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsavchenko authored Nov 27, 2024
1 parent 0b19422 commit 88cafc2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions nb2workflow/nbadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,27 @@ def get_datatype_restriction(self, param_uri):
def is_ontology_available(self):
# TODO will be developed properly in the ontology_helper
return self._is_ontology_available

def is_optional(self, uri):
self.lock.acquire()
res = super().is_optional(uri)
self.lock.release()
return res

def parse_extra_triples(self, extra_triples, format='n3', parse_oda_annotations = True):
self.lock.acquire()
super().parse_extra_triples(
extra_triples,
format=format,
parse_oda_annotations=parse_oda_annotations)
self.lock.release()

def get_parameter_hierarchy(self, param_uri):
self.lock.acquire()
res = super().get_parameter_hierarchy(param_uri)
self.lock.release()
return res


ontology = ModOntology(oda_ontology_path)
oda_prefix = str([x[1] for x in ontology.g.namespaces() if x[0] == 'oda'][0])
Expand Down

0 comments on commit 88cafc2

Please sign in to comment.