GraphPlusPyKEENModel

class mowl.models.GraphPlusPyKEENModel(*args, **kwargs)[source]

Bases: KGEModel

This is a wrapper class of pykeen.models.ERModel that allows to use the PyKEEN models in the mOWL framework.

New in version 0.2.0.

Attributes Summary

class_embeddings

Returns a dictionary with class names as keys and class embeddings as values.

individual_embeddings

Returns a dictionary with individual names as keys and individual embeddings as values.

object_property_embeddings

Returns a dictionary with object property names as keys and object property embeddings as values.

triples_factory

The triples factory of the model.

Methods Summary

add_axioms(*axioms)

This method adds axioms to the dataset contained in the model and reorders the embedding information for each entity accordingly.

from_pretrained(model)

This method loads a pretrained model from a file.

set_kge_method(kge_method, *args, **kwargs)

Set the KGE method of the model.

train([epochs])

Triggers the PyKEEN training process.

Attributes Documentation

class_embeddings
individual_embeddings
object_property_embeddings
triples_factory

The triples factory of the model.

Return type:

pykeen.triples.TriplesFactory

Methods Documentation

add_axioms(*axioms)[source]

This method adds axioms to the dataset contained in the model and reorders the embedding information for each entity accordingly. New entites are initalized with random embedding.

Parameters:

axioms (org.semanticweb.owlapi.model.OWLAxiom) – Axioms to be added to the dataset.

New in version 0.2.0.

from_pretrained(model)[source]

This method loads a pretrained model from a file.

Parameters:

file_name (str) – Path to the pretrained model file.

New in version 0.2.0.

set_kge_method(kge_method, *args, **kwargs)[source]

Set the KGE method of the model.

Parameters:

kge_method (pykeen.models.ERModel) – The KGE method.

train(epochs=0)[source]

Triggers the PyKEEN training process.

Parameters:

epochs (int) – Number of epochs to train the model. If None, the value of the epochs parameter passed to the constructor will be used.