ontolearn.owl_neural_reasoner
Classes
OWL Neural Reasoner uses a neural link predictor to retrieve instances of an OWL Class Expression |
Module Contents
- class ontolearn.owl_neural_reasoner.TripleStoreNeuralReasoner(path_of_kb: str = None, path_neural_embedding: str = None, gamma: float = 0.25)[source]
OWL Neural Reasoner uses a neural link predictor to retrieve instances of an OWL Class Expression
- model: dicee.knowledge_graph_embeddings.KGE
- gamma: float
- inferred_owl_individuals = None
- inferred_object_properties = None
- inferred_named_owl_classes = None
- property set_inferred_individuals
- property set_inferred_object_properties
- property set_inferred_owl_classes
- get_predictions(h: str = None, r: str = None, t: str = None, confidence_threshold: float = None) Generator[Tuple[str, float], None, None] [source]
Generate predictions for a given head entity (h), relation (r), or tail entity (t) with an optional confidence threshold. The method yields predictions that exceed the specified confidence threshold. If no threshold is provided, it defaults to the model’s gamma value.
Parameters: - h (str, optional): The identifier for the head entity. - r (str, optional): The identifier for the relation. - t (str, optional): The identifier for the tail entity. - confidence_threshold (float, optional): The minimum confidence level required for a prediction to be returned.
Returns: - Generator[Tuple[str, float], None, None]: A generator of tuples, where each tuple contains a predicted entity or relation identifier (IRI) as a string and its corresponding confidence level as a float.
Raises: - Exception: If an error occurs during prediction.
- abox(str_iri: str) Generator[Tuple[Tuple[owlapy.owl_individual.OWLNamedIndividual, owlapy.owl_property.OWLProperty, owlapy.class_expression.OWLClass], Tuple[owlapy.owl_property.OWLObjectProperty, owlapy.owl_property.OWLObjectProperty, owlapy.owl_individual.OWLNamedIndividual], Tuple[owlapy.owl_property.OWLObjectProperty, owlapy.owl_property.OWLDataProperty, owlapy.owl_literal.OWLLiteral]], None, None] [source]
- classes_in_signature(confidence_threshold: float = None) Generator[owlapy.class_expression.OWLClass, None, None] [source]
- most_general_classes(confidence_threshold: float = None) Generator[owlapy.class_expression.OWLClass, None, None] [source]
At least it has single subclass and there is no superclass
- least_general_named_concepts(confidence_threshold: float = None) Generator[owlapy.class_expression.OWLClass, None, None] [source]
At least it has single superclass and there is no subclass
- subconcepts(named_concept: owlapy.class_expression.OWLClass, confidence_threshold: float = None) Generator[owlapy.class_expression.OWLClass, None, None] [source]
- get_direct_parents(named_concept: owlapy.class_expression.OWLClass, direct=True, confidence_threshold: float = None)[source]
- get_type_individuals(individual: str, confidence_threshold: float = None) Generator[owlapy.class_expression.OWLClass, None, None] [source]
- individuals(expression: owlapy.class_expression.OWLClassExpression = None, named_individuals: bool = False, confidence_threshold: float = None) Generator[owlapy.owl_individual.OWLNamedIndividual, None, None] [source]
- instances(expression: owlapy.class_expression.OWLClassExpression, named_individuals=False, confidence_threshold: float = None) Generator[owlapy.owl_individual.OWLNamedIndividual, None, None] [source]
- if expression.is_owl_thing():
yield from self.individuals_in_signature()
- individuals_in_signature() Generator[owlapy.owl_individual.OWLNamedIndividual, None, None] [source]
- data_properties_in_signature(confidence_threshold: float = None) Generator[owlapy.owl_property.OWLDataProperty, None, None] [source]
- object_properties_in_signature(confidence_threshold: float = None) Generator[owlapy.owl_property.OWLObjectProperty, None, None] [source]
- boolean_data_properties(confidence_threshold: float = None) Generator[owlapy.owl_property.OWLDataProperty, None, None] [source]
- double_data_properties(confidence_threshold: float = None) Generator[owlapy.owl_property.OWLDataProperty, None, None] [source]
- get_object_property_values(subject: str, object_property: owlapy.owl_property.OWLObjectProperty, confidence_threshold: float = None) Generator[owlapy.owl_individual.OWLNamedIndividual, None, None] [source]
- get_data_property_values(subject: str, data_property: owlapy.owl_property.OWLDataProperty, confidence_threshold: float = None) Generator[owlapy.owl_literal.OWLLiteral, None, None] [source]