Reasoner description |
|
|
Due to architectural and performance reasons,
it is currently unfeasible or impractical to use available Semantic Web reasoners in the Semantic Web of Things.
Therefore we are developing a prototypical mobile reasoner for the SWoT.
It supports standard Semantic Web technologies through the OWL API and implements both standard reasoning tasks for knowledge base (KB)
management (subsumption, classification, satisfiability) and non-standard inference services for semantic-based matchmaking and
resource ranking (abduction and contraction).
Mini-ME is developed in Java, adopting Android as the current target computing platform, but running also on Java SE.
|
|
Download Mini-ME |
|
|
The current Mini-ME beta version is distributed for the only purpose of academic review and evaluation. Any other use is not allowed.
You can download the beta version of Mini-ME from the following link: minime-beta-1.0.0.jar You can try Mini-ME using the following source code and ontology dataset: Example - Dataset Usage: Download the most recent version of Mini-ME from download section. Add minime-beta-1.0.0.jar file in the directory lib to your Java class path. You will also need the OWL API 3.2.4 itself, which can be downloaded from here, and the Colt 1.2.0 API, available here. |
|
Using Mini-ME with the OWL API 3.0 |
|
Load and classify an ontology - Shows how to interact with the Mini-ME reasoner
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLDataFactory owlDataFactory = OWLManager.getOWLDataFactory();
File onto_path = new File(ONTO_DIR);
//Load ontology from an input file
OWLOntology onto = manager.loadOntologyFromOntologyDocument(onto_path);
//Create the factory
OWLReasonerFactory reasonerFactory = new OWLMicroReasoner.ReasonerFactory();
//Return an instance of OWLReasoner class that represents our Mini-ME reasoner
reasoner = reasonerFactory.createReasoner(onto);
reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
Class Satisfiability - Shows how to check the satisfiability of a class
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLDataFactory owlDataFactory = OWLManager.getOWLDataFactory();
File onto_path = new File(ONTO_DIR);
//Load ontology from an input file
OWLOntology onto = manager.loadOntologyFromOntologyDocument(onto_path);
//An instance of the class of which to verify the satisfiability
OWLClass class2check = owlDataFactory.getOWLClass(IRI.create(CLASS_IRI));
//Create the factory
OWLReasonerFactory reasonerFactory = new OWLMicroReasoner.ReasonerFactory();
//Return an instance of OWLReasoner class that represents our Mini-ME reasoner
reasoner = reasonerFactory.createReasoner(onto);
reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
//The returned value is a boolean
boolean result = reasoner.isSatisfiable(class2check);
Ontology Satisfiability - Shows how to check the satisfiability of an ontology
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
File onto_path = new File(ONTO_DIR);
//Load ontology from an input file
OWLOntology onto = manager.loadOntologyFromOntologyDocument(onto_path);
//Create the factory
OWLReasonerFactory reasonerFactory = new OWLMicroReasoner.ReasonerFactory();
//Return an instance of OWLReasoner class that represents our Mini-ME reasoner
reasoner = reasonerFactory.createReasoner(onto);
reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY);
//The returned value is a boolean
boolean result = reasoner.isConsistent();
|
|
Using Mini-ME for non-standard inference services |
|
Concept Abduction and Contraction - Shows how to use the non-standard inference services
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
File file = new File(ONTO_DIR);
File demand = new File(DEMAND_DIR);
try{
onto = manager.loadOntologyFromOntologyDocument(file);
reasoner = new MicroReasoner();
HashMap<String,Item> individuals = reasoner.normalizeIdividuals(onto);
onto_demand = manager.loadOntologyFromOntologyDocument(demand);
Item request = reasoner.normalizeDemand(onto_demand);
Set<String> list = individuals.keySet();
Iterator<String> iter = list.iterator();
while(iter.hasNext()){
String nameInd = (String) iter.next();
Item supply = individuals.get(nameInd);
if(reasoner.checkCompatibility(supply.description, request.description) == true){
IRI supplyIRI = IRI.create(nameInd);
IRI requestIRI = IRI.create(request.name);
System.out.println("Compute abduction between "+supplyIRI.getFragment()+" e "+requestIRI.getFragment());
SemanticDescription h = reasoner.abduction(supply.description, request.description);
System.out.println("H: "+h.toString());
}else {
IRI supplyIRI = IRI.create(nameInd);
IRI requestIRI = IRI.create(request.name);
System.out.println("Compute contraction between "+supplyIRI.getFragment()+" e "+requestIRI.getFragment());
SemanticDescription[] result = reasoner.contraction(supply.description, request.description);
System.out.println("Keep: "+result[1].toString());
System.out.println("Give-up: "+result[0].toString());
}
}
}catch(Exception e){
e.printStackTrace();
}
|
|
Project coordinators |
|
