TMEReasoner

@interface TMEReasoner : NSObject

The main reasoner class, exposing standard and non-standard inference tasks.

Non-standard matchmaking services are detailed in “Ruta et al., WIAS 2011”: http://sisinflab.poliba.it/publications/2011/RDS11

For more information about the project, visit Tiny-ME’s website: http://swot.sisinflab.poliba.it/tinyme

Properties

  • The root ontology.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) id<OWLOntology> _Nonnull ontology;
  • Data factory instance.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) TMEDataFactory *_Nonnull factory;

    Swift

    var factory: TMEDataFactory { get }

Lifecycle

  • Initializes a new reasoner instance.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithOntology:(nonnull id<OWLOntology>)ontology;

    Parameters

    ontology

    Ontology to load into the reasoner.

    Return Value

    Initialized reasoner instance.

Loading

  • Loads the specified individual into the reasoner as either a resource or a request.

    Declaration

    Objective-C

    - (void)loadIndividualWithIri:(nonnull OWLIRI *)iri
                      description:(nonnull TMESemanticDescription *)description
                             type:(TMEIndividualType)type;

    Swift

    func loadIndividual(with iri: OWLIRI, description: TMESemanticDescription, type: TMEIndividualType)

    Parameters

    iri

    IRI of the individual to load.

    description

    Semantic description of the individual to load.

    type

    Type of the individual to load (resource, request or both).

  • Loads the individuals present in the signature of the specified ontology.

    Declaration

    Objective-C

    - (void)loadIndividualsFromOntology:(nonnull id<OWLOntology>)ontology
                                   type:(TMEIndividualType)type;

    Parameters

    ontology

    Ontology containing the individuals to load.

    type

    Type of the loaded individuals (resource, request or both).

  • Tells the reasoner that the individual is of the specified type.

    Declaration

    Objective-C

    - (void)tellIndividualWithIri:(nonnull OWLIRI *)iri
                         isOfType:(TMEIndividualType)type;

    Swift

    func tellIndividual(with iri: OWLIRI, isOf type: TMEIndividualType)

    Parameters

    iri

    IRI of the individual whose type should be updated.

    type

    Type of the individual (resource, request or both).

  • Unloads the specified individual.

    Declaration

    Objective-C

    - (void)unloadIndividualWithIri:(nonnull OWLIRI *)iri;

    Swift

    func unloadIndividual(with iri: OWLIRI)

    Parameters

    iri

    IRI of the individual to unload.

  • Unloads the individuals present in the signature of the specified ontology.

    Declaration

    Objective-C

    - (void)unloadIndividualsFromOntology:(nonnull id<OWLOntology>)ontology;

    Parameters

    ontology

    Ontology containing the individuals to unload.

  • Unloads all the individuals of a given type.

    Declaration

    Objective-C

    - (void)unloadIndividualsOfType:(TMEIndividualType)type;

    Swift

    func unloadIndividuals(of type: TMEIndividualType)

    Parameters

    type

    Type of the individuals to unload (resource, request or both).

Querying

Reasoning

  • Computes the taxonomy of classes present in the root ontology.

    Declaration

    Objective-C

    - (void)classify;

    Swift

    func classify()
  • Declaration

    Objective-C

    - (BOOL)isClassified;

    Swift

    func isClassified() -> Bool

    Return Value

    True if the ontology has been classified, false otherwise.

  • Checks the coherence of the root ontology.

    See

    Moguillansky et al., IBERAMIA 2010 ( https://cs.uns.edu.ar/~mom/publications/iberamia2010.pdf )

    Declaration

    Objective-C

    - (BOOL)isCoherent;

    Swift

    func isCoherent() -> Bool

    Return Value

    True if the ontology is coherent, false otherwise.

  • Performs the unfolding and CNF normalization of the specified semantic description.

    Declaration

    Objective-C

    - (void)normalizeDescription:(nonnull TMESemanticDescription *)description;

    Swift

    func normalize(_ description: TMESemanticDescription)

    Parameters

    description

    Semantic description to normalize.

  • Checks whether the specified class is satisfiable.

    Declaration

    Objective-C

    - (BOOL)classWithIriIsSatisfiable:(nonnull OWLIRI *)iri;

    Swift

    func `class`(withIriIsSatisfiable iri: OWLIRI) -> Bool

    Parameters

    iri

    IRI of the class.

    Return Value

    True if the class is satisfiable, false otherwise.

  • Checks whether a subclass relation holds between two classes.

    Declaration

    Objective-C

    - (BOOL)classWithIri:(nonnull OWLIRI *)subClassIri
            isSubClassOf:(nonnull OWLIRI *)superClassIri;

    Swift

    func `class`(with subClassIri: OWLIRI, isSubClassOf superClassIri: OWLIRI) -> Bool

    Parameters

    subClassIri

    IRI of the subclass.

    superClassIri

    IRI of the superclass.

    Return Value

    True if the relation holds, false otherwise.

  • Retrieves the direct subclasses of the specified class.

    Declaration

    Objective-C

    - (nonnull NSArray<OWLIRI *> *)subClassesOfClassWithIri:
                                       (nonnull OWLIRI *)classIri
                                                     direct:(BOOL)direct;

    Swift

    func subClassesOfClass(with classIri: OWLIRI, direct: Bool) -> [OWLIRI]

    Parameters

    classIri

    IRI of the class whose subclasses should be retrieved.

    direct

    True: returns the direct subclasses; false: returns the recursive subclasses.

    Return Value

    Subclasses.

  • Retrieves the direct superclasses of the specified class.

    Declaration

    Objective-C

    - (nonnull NSArray<OWLIRI *> *)superClassesOfClassWithIri:
                                       (nonnull OWLIRI *)classIri
                                                       direct:(BOOL)direct;

    Swift

    func superClassesOfClass(with classIri: OWLIRI, direct: Bool) -> [OWLIRI]

    Parameters

    classIri

    IRI of the class whose superclasses should be retrieved.

    direct

    True: returns the direct superclasses; false: returns the recursive superclasses.

    Return Value

    Superclasses.

  • Retrieves the equivalent classes of the specified class.

    Declaration

    Objective-C

    - (nonnull NSArray<OWLIRI *> *)equivalentClassesOfClassWithIri:
        (nonnull OWLIRI *)classIri;

    Swift

    func equivalentClassesOfClass(with classIri: OWLIRI) -> [OWLIRI]

    Parameters

    classIri

    IRI of the class whose equivalents should be retrieved.

    Return Value

    Equivalent classes.

  • Retrieves the classes that are disjoint with the specified class.

    Note

    This is currently incomplete as it does not account for inferred disjoints.

    Declaration

    Objective-C

    - (nonnull NSArray<OWLIRI *> *)disjointClassesOfClassWithIri:
        (nonnull OWLIRI *)classIri;

    Swift

    func disjointClassesOfClass(with classIri: OWLIRI) -> [OWLIRI]

    Parameters

    classIri

    IRI of the class whose equivalents should be retrieved.

    Return Value

    Disjoint classes.

  • Declaration

    Objective-C

    - (nonnull NSArray<OWLIRI *> *)unsatisfiableClasses;

    Swift

    func unsatisfiableClasses() -> [OWLIRI]

    Return Value

    All the unsatisfiable classes.

  • Checks whether the given individual is consistent.

    Declaration

    Objective-C

    - (BOOL)individualWithIriIsConsistent:(nonnull OWLIRI *)iri;

    Swift

    func individual(withIriIsConsistent iri: OWLIRI) -> Bool

    Parameters

    iri

    IRI of the individual whose consistency should be checked.

    Return Value

    True if the individual is consistent, false otherwise.

  • Determines if a subsumption relation holds between two semantic profiles (that is, if one is more general than the other), in which case they are referred to as subsumer and subsumed. The profiles are OWL individuals previously loaded into the reasoner using the ‘load’ methods.

    If the subsumption relation holds, two conclusions can be drawn: 1) The subsumer is more general than the subsumed, hence the former (usually a requested semantic profile) is satisfied by the latter (usually a supplied resource) in every aspect. 2) The two elements involved in the relation are compatible.

    If the relation does not hold, abduction may be used to compute what should be hypothesized in the subsumed individual in order to completely satisfy the subsumer individual.

    Declaration

    Objective-C

    - (BOOL)individualWithIri:(nonnull OWLIRI *)subsumed
                 isSubsumedBy:(nonnull OWLIRI *)subsumer;

    Swift

    func individual(with subsumed: OWLIRI, isSubsumedBy subsumer: OWLIRI) -> Bool

    Parameters

    subsumed

    Subsumed element in the subsumption relation.

    subsumer

    Subsumer element in the subsumption relation.

    Return Value

    True if the subsumption relation holds, false otherwise.

  • Checks whether the specified individual is an instance of a certain class.

    Note

    This is currently incomplete, since the reasoner does not process the ABox.

    Declaration

    Objective-C

    - (BOOL)individualWithIri:(nonnull OWLIRI *)individualIri
                 isInstanceOf:(nonnull OWLIRI *)classIri;

    Swift

    func individual(with individualIri: OWLIRI, isInstanceOf classIri: OWLIRI) -> Bool

    Parameters

    individualIri

    IRI of the individual.

    classIri

    IRI of the class.

    Return Value

    True if the individual is an instance of the class, false otherwise.

  • Determines if a supplied resource and a requested semantic profile are compatible (that is, whether the semantic description of the resource does not contain any information in conflict with the request). Resource and request are OWL individuals previously loaded into the reasoner using the ‘load’ methods.

    If the compatibility relation between the two individuals holds, then they don’t contain any conflicting part. If the relation does not hold, contraction may be used to compute the conflicting part.

    Declaration

    Objective-C

    - (BOOL)compatibilityBetweenResource:(nonnull OWLIRI *)resourceIri
                              andRequest:(nonnull OWLIRI *)requestIri;

    Swift

    func compatibilityBetweenResource(_ resourceIri: OWLIRI, andRequest requestIri: OWLIRI) -> Bool

    Parameters

    resourceIri

    IRI of the resource against which the request is checked for compatibility.

    requestIri

    IRI of the request against which the resource is checked for compatibility.

    Return Value

    True if the compatibility relation holds, false otherwise.

  • Performs the Concept Abduction non-standard matchmaking task, comparing a requested semantic profile with a supplied resource. Resource and request are OWL individuals previously loaded into the reasoner using the ‘load’ methods.

    See

    Ruta et al., WIAS 2011 (Section 4, Chapter 2) ( http://sisinflab.poliba.it/publications/2011/RDS11 )

    Declaration

    Objective-C

    - (nonnull TMEAbduction *)abductionBetweenResource:(nonnull OWLIRI *)resourceIri
                                            andRequest:(nonnull OWLIRI *)requestIri;

    Swift

    func abductionBetweenResource(_ resourceIri: OWLIRI, andRequest requestIri: OWLIRI) -> TMEAbduction

    Parameters

    resourceIri

    IRI of the resource.

    requestIri

    IRI of the request.

    Return Value

    Result of the abduction inference service.

  • Performs the Concept Bonus non-standard matchmaking task, comparing a requested semantic profile with a supplied resource. Resource and request are OWL individuals previously loaded into the reasoner using the ‘load’ methods.

    See

    Scioscia et al., SRLGIPD18 ( http://sisinflab.poliba.it/publications/2018/SRLGIPD18 )

    Declaration

    Objective-C

    - (nonnull TMEBonus *)bonusBetweenResource:(nonnull OWLIRI *)resourceIri
                                    andRequest:(nonnull OWLIRI *)requestIri;

    Swift

    func bonusBetweenResource(_ resourceIri: OWLIRI, andRequest requestIri: OWLIRI) -> TMEBonus

    Parameters

    resourceIri

    IRI of the resource.

    requestIri

    IRI of the request.

    Return Value

    Result of the bonus inference service.

  • Performs the Concept Contraction non-standard matchmaking task, comparing a requested semantic profile with a supplied resource. Resource and request are OWL individuals previously loaded into the reasoner using the ‘load’ methods.

    See

    Ruta et al., WIAS 2011 (Section 4, Chapter 2) ( http://sisinflab.poliba.it/publications/2011/RDS11 )

    Declaration

    Objective-C

    - (nonnull TMEContraction *)
        contractionBetweenResource:(nonnull OWLIRI *)resourceIri
                        andRequest:(nonnull OWLIRI *)requestIri;

    Swift

    func contractionBetweenResource(_ resourceIri: OWLIRI, andRequest requestIri: OWLIRI) -> TMEContraction

    Parameters

    resourceIri

    IRI of the resource.

    requestIri

    IRI of the request.

    Return Value

    Result of the contraction inference service.

  • Performs the Concept Covering non-standard matchmaking task, comparing a requested semantic profile with available resources. Request is an OWL individual previously loaded into the reasoner using the ‘load’ methods.

    See

    Di Noia et al., Concept Covering ( http://sisinflab.poliba.it/publications/2004/DDD04a )

    Declaration

    Objective-C

    - (nonnull TMEComposition *)coveringForRequest:(nonnull OWLIRI *)requestIri;

    Swift

    func covering(forRequest requestIri: OWLIRI) -> TMEComposition

    Parameters

    requestIri

    IRI of the request.

    Return Value

    Result of the covering inference service.

  • Computes the Concept Difference between two individuals.

    Declaration

    Objective-C

    - (nonnull TMESemanticDescription *)differenceBetween:(nonnull OWLIRI *)lhsIri
                                                      and:(nonnull OWLIRI *)rhsIri;

    Swift

    func differenceBetween(_ lhsIri: OWLIRI, and rhsIri: OWLIRI) -> TMESemanticDescription

    Parameters

    lhsIri

    LHS of the difference.

    rhsIri

    RHS of the difference.

    Return Value

    Result of the difference task.

  • Computes the maximum penalty for the specified individual.

    Declaration

    Objective-C

    - (double)maxPenaltyFor:(nonnull OWLIRI *)iri;

    Swift

    func maxPenalty(for iri: OWLIRI) -> Double

    Parameters

    iri

    IRI of the individual.

    Return Value

    Maximum penalty.

  • Determines if the specified description is satisfiable with respect to the root ontology.

    Declaration

    Objective-C

    - (BOOL)descriptionIsSatisfiable:(nonnull TMESemanticDescription *)description;

    Swift

    func descriptionIsSatisfiable(_ description: TMESemanticDescription) -> Bool

    Parameters

    description

    Description whose satisfiability should be checked.

    Return Value

    True if the description is satisfiable, false otherwise.

  • Determines if a subsumption relation holds between two semantic profiles (that is, if one is more general than the other), in which case they are referred to as subsumer and subsumed.

    Declaration

    Objective-C

    - (BOOL)description:(nonnull TMESemanticDescription *)subsumed
           isSubsumedBy:(nonnull TMESemanticDescription *)subsumer;

    Swift

    func description(_ subsumed: TMESemanticDescription, isSubsumedBy subsumer: TMESemanticDescription) -> Bool

    Parameters

    subsumed

    Subsumed element in the subsumption relation.

    subsumer

    Subsumer element in the subsumption relation.

    Return Value

    True if the subsumption relation holds, false otherwise.