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
See
OWL API for iOS: https://github.com/sisinflab-swot/OWL-API-for-iOS-
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 }
-
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.
-
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 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).
-
Declaration
Objective-C
- (nonnull NSDictionary<OWLIRI *, TMESemanticDescription *> *)tBox;
Swift
func tBox() -> [AnyHashable : TMESemanticDescription]
Return Value
The TBox.
-
Declaration
Objective-C
- (nonnull NSDictionary<OWLIRI *, TMESemanticDescription *> *)aBox;
Swift
func aBox() -> [AnyHashable : TMESemanticDescription]
Return Value
The ABox.
-
Retrieves all the individuals of a specified type.
Declaration
Objective-C
- (nonnull NSDictionary<OWLIRI *, TMESemanticDescription *> *)individualsOfType: (TMEIndividualType)type;
Swift
func individuals(of type: TMEIndividualType) -> [AnyHashable : TMESemanticDescription]
Parameters
type
Type of individuals to retrieve (resource, request or both).
Return Value
Individuals of the specified type.
-
Returns the semantic description of the specified class.
Declaration
Objective-C
- (nonnull TMESemanticDescription *)descriptionForClassWithIri: (nonnull OWLIRI *)iri;
Swift
func descriptionForClass(with iri: OWLIRI) -> TMESemanticDescription
Parameters
iri
IRI of the class whose description should be retrieved.
Return Value
Semantic description of the specified class.
-
Returns the semantic description of the specified individual.
Declaration
Objective-C
- (nonnull TMESemanticDescription *)descriptionForIndividualWithIri: (nonnull OWLIRI *)iri;
Swift
func descriptionForIndividual(with iri: OWLIRI) -> TMESemanticDescription
Parameters
iri
IRI of the individual whose description should be retrieved.
Return Value
Semantic description of the specified individual.
-
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 a subclass relation holds between two classes.
Declaration
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
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
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 classes that are disjoint with the specified class.
Note
This is currently incomplete as it does not account for inferred disjoints.
Declaration
Parameters
classIri
IRI of the class whose equivalents should be retrieved.
Return Value
Disjoint 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
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
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
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
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.
-
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.