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

List 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)

New in version 0.2.0.

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

List of classes used for evaluation. Depending on the dataset, this method could return a single OWLClasses object (as in PPIYeastDataset) or a tuple of OWLClasses objects (as in GDAHumanDataset). If not overriden, this method returns the classes in the testing ontology obtained from the OWLAPI method getClassesInSignature() as a OWLClasses object.

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]

New in version 0.2.0.