Dataset

class mowl.datasets.Dataset(ontology, validation=None, testing=None)[source]

Bases: object

This class represents an mOWL dataset.

Parameters:
  • ontology (org.semanticweb.owlapi.model.OWLOntology) – The ontology containing the training data of the dataset.

  • validation (org.semanticweb.owlapi.model.OWLOntology, optional) – The ontology containing the validation data of the dataset, defaults to None.

  • testing (org.semanticweb.owlapi.model.OWLOntology, optional) – The ontology containing the testing data of the dataset, defaults to None.

Attributes Summary

class_to_id

Dictionary mapping OWLClasses to integer ids.

classes

List of classes in the dataset.

evaluation_classes

Pair of lists of classes used for evaluation.

individual_to_id

Dictionary mapping OWLIndividuals to integer ids.

individuals

List of individuals in the dataset.

labels

This method returns labels of entities as a dictionary.

object_properties

List of object properties (relations) in the dataset.

object_property_to_id

Dictionary mapping OWLObjectProperties to integer ids.

ontology

Training dataset

testing

Testing ontology

validation

Validation dataset

Methods Summary

add_axioms(*axioms)

Attributes Documentation

class_to_id

Dictionary mapping OWLClasses to integer ids.

classes

List of classes in the dataset. The classes are collected from training, validation and testing ontologies using the OWLAPI method ontology.getClassesInSignature().

Return type:

OWLClasses

evaluation_classes

Pair of lists of classes used for evaluation. The return type is a tuple of OWLClasses objects.

Return type:

tuple

Changed in version 0.4.0: Delegate implementation to subclasses.

individual_to_id

Dictionary mapping OWLIndividuals to integer ids.

individuals

List of individuals in the dataset. The individuals are collected from training, validation and testing ontologies using the OWLAPI method ontology.getIndividualsSignature().

Return type:

OWLIndividuals

labels

This method returns labels of entities as a dictionary. To be called, the training ontology must contain axioms of the form \(class_1 \sqsubseteq \exists http://has\_label . class_2\).

Return type:

dict

object_properties

List of object properties (relations) in the dataset. The object properties are collected from training, validation and testing ontologies using the OWLAPI method ontology.getObjectPropertiesInSignature().

Return type:

OWLObjectProperties

object_property_to_id

Dictionary mapping OWLObjectProperties to integer ids.

ontology

Training dataset

Return type:

org.semanticweb.owlapi.model.OWLOntology

testing

Testing ontology

Return type:

org.semanticweb.owlapi.model.OWLOntology

validation

Validation dataset

Return type:

org.semanticweb.owlapi.model.OWLOntology

Methods Documentation

add_axioms(*axioms)[source]

Added in version 0.2.0.