From: <jen...@us...> - 2009-04-09 12:53:12
|
Revision: 1693 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1693&view=rev Author: jenslehmann Date: 2009-04-09 12:53:04 +0000 (Thu, 09 Apr 2009) Log Message: ----------- test case Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/test/PelletBug.java Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2009-04-09 11:47:12 UTC (rev 1692) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2009-04-09 12:53:04 UTC (rev 1693) @@ -495,6 +495,7 @@ @Override public boolean isSuperClassOfImpl(Description superConcept, Description subConcept) { try { +// System.out.println("super: " + superConcept + "; sub: " + subConcept); return reasoner.isSubClassOf(OWLAPIDescriptionConvertVisitor.getOWLDescription(subConcept), OWLAPIDescriptionConvertVisitor.getOWLDescription(superConcept)); } catch (OWLReasonerException e) { e.printStackTrace(); Added: trunk/src/dl-learner/org/dllearner/test/PelletBug.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/PelletBug.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/test/PelletBug.java 2009-04-09 12:53:04 UTC (rev 1693) @@ -0,0 +1,50 @@ +package org.dllearner.test; + +import java.io.File; +import java.net.URI; +import java.util.HashSet; +import java.util.Set; + +import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.inference.OWLReasoner; +import org.semanticweb.owl.inference.OWLReasonerException; +import org.semanticweb.owl.model.OWLClass; +import org.semanticweb.owl.model.OWLDataFactory; +import org.semanticweb.owl.model.OWLDescription; +import org.semanticweb.owl.model.OWLOntology; +import org.semanticweb.owl.model.OWLOntologyCreationException; +import org.semanticweb.owl.model.OWLOntologyManager; + +public class PelletBug { + + public static void main(String[] args) throws OWLOntologyCreationException, OWLReasonerException { + + OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + File f = new File("examples/family/father_oe.owl"); + URI physicalURI = f.toURI(); + OWLOntology ontology = manager.loadOntologyFromPhysicalURI(physicalURI); + OWLDataFactory factory = manager.getOWLDataFactory(); + + String ontologyURI = "http://example.com/father#"; + + // super: (http://example.com/father#female AND http://example.com/father#male); sub: http://example.com/father#female + + OWLClass male = factory.getOWLClass(URI.create(ontologyURI + "male")); + OWLClass female = factory.getOWLClass(URI.create(ontologyURI + "female")); +// OWLDescription negA = factory.getOWLObjectComplementOf(a); + OWLDescription insat = factory.getOWLObjectIntersectionOf(male, female); +// OWLClass d = factory.getOWLClass(URI.create(ontologyURI + "#b")); + + Set<OWLOntology> ontologies = new HashSet<OWLOntology>(); + ontologies.add(ontology); + + OWLReasoner reasoner = new org.mindswap.pellet.owlapi.Reasoner(manager); + reasoner.loadOntologies(ontologies); + + boolean result = reasoner.isSubClassOf(female, insat); + System.out.println(result); + +// System.out.println(reasoner.getIndividuals(female, true)); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |