Ontology Module (indra_world.ontology
)
Module containing the implementation of an IndraOntology for the World Modelers use case.
World Ontology (indra_world.ontology.ontology
)
- class indra_world.ontology.ontology.WorldOntology(url)[source]
Represents the ontology used for World Modelers applications.
- Parameters
url (str) – The URL or file path pointing to a World Modelers ontology YAML.
- add_entry(entry, examples=None, neg_examples=None)[source]
Add a new ontology entry with examples.
This works by adding the entry to the yml attribute first and then reloading the entire yaml to build a new graph.
- Parameters
entry (str) – The new entry.
examples (Optional[list of str]) – Examples for the new entry.
neg_examples (Optional[list of str]) – Negative examples for the new entry.
- build_relations(node, tree, prefix)[source]
Build relations for the classic ontology format <= v3.0
- build_relations_new_format(node, prefix)[source]
Build relations for the new ontology format > v3.0