See for example here:
|
def class_assertion(pattern, ontology): |
|
''' |
|
TODO: Actually write these |
|
''' |
|
|
|
# Existing classes |
|
classes = [*ontology.classes] |
|
individuals = [*ontology.individuals] |
|
|
|
class_name = pattern[1][0].name |
|
individual = pattern[1][0].variables[0] |
|
|
|
# Create any missing classes found in the pattern |
|
if class_name not in classes: |
|
ontology.declare_class(class_name) |
|
classes.append(class_name) |
|
|
|
if individual not in individuals: |
|
ontology.declare_individual(individual) |
|
individuals.append(individual) |
It seems like that these are already taken care of here:
|
for unary in axiom.unary(): |
Same for properties, but not individuals. Should we take a similar approach for individuals (constants): to declare all of them even those not in any pattern?
See for example here:
macleod/src/macleod/dl/translation.py
Lines 106 to 125 in e945bab
It seems like that these are already taken care of here:
macleod/src/macleod/Ontology.py
Line 689 in e945bab
Same for properties, but not individuals. Should we take a similar approach for individuals (constants): to declare all of them even those not in any pattern?