ELDataset
- class mowl.datasets.ELDataset(ontology, class_index_dict=None, object_property_index_dict=None, individual_index_dict=None, extended=True, load_normalized=False, device='cpu', ontology_path=None, use_cache=True)[source]
Bases:
objectThis class provides data-related methods to work with \(\mathcal{EL}\) description logic language. In general, it receives an ontology, normalizes it into 4 or 7 \(\mathcal{EL}\) normal forms and returns a
torch.utils.data.Datasetper normal form. In the process, the classes and object properties names are mapped to an integer values to create the datasets and the corresponding dictionaries can be input or created from scratch.- Parameters:
ontology (
org.semanticweb.owlapi.model.OWLOntology) – Input ontology that will be normalized into \(\mathcal{EL}\) normal formsextended (bool, optional) – If true, the normalization process will return 7 normal forms. If false, only 4 normal forms. See Embedding the EL language for more information. Defaults to
True.class_index_dict (dict, optional) – Dictionary containing information class name –> index. If not provided, a dictionary will be created from the ontology classes. Defaults to
None.object_property_index_dict (dict, optional) – Dictionary containing information object property name –> index. If not provided, a dictionary will be created from the ontology object properties. Defaults to
None.load_normalized (bool, optional) – If true, the ontology is assumed to be already normalized and the normalization process will be skipped. Defaults to
False.ontology_path (str, optional) – Path to the original ontology file. If provided, the normalized ontology will be cached to
<ontology_path>_mowl_el_normalized.owland loaded from cache on subsequent calls. This significantly speeds up repeated normalization of the same ontology. Defaults toNone.use_cache (bool, optional) – Whether to use caching when
ontology_pathis provided. Defaults toTrue.
Attributes Summary
Returns indexed dictionary with class names present in the dataset.
Returns indexed dictionary with object property names present in the dataset.
Methods Summary
Returns a dictionary containing the name of the normal forms as keys and the corresponding datasets as values.
load()Attributes Documentation
- class_assertion_dataset
- class_index_dict
Returns indexed dictionary with class names present in the dataset.
- Return type:
- gci0_bot_dataset
- gci0_dataset
- gci1_bot_dataset
- gci1_dataset
- gci2_dataset
- gci3_bot_dataset
- gci3_dataset
- object_property_assertion_dataset
- object_property_index_dict
Returns indexed dictionary with object property names present in the dataset.
- Return type:
Methods Documentation