當前位置: 首頁>>代碼示例>>Java>>正文


Java OWLOntologyCreationException.printStackTrace方法代碼示例

本文整理匯總了Java中org.semanticweb.owlapi.model.OWLOntologyCreationException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java OWLOntologyCreationException.printStackTrace方法的具體用法?Java OWLOntologyCreationException.printStackTrace怎麽用?Java OWLOntologyCreationException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.semanticweb.owlapi.model.OWLOntologyCreationException的用法示例。


在下文中一共展示了OWLOntologyCreationException.printStackTrace方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testUnsatifiabilityDueToClashInABoxAssertions

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
/**
   * Atomic clash
   */
  public void testUnsatifiabilityDueToClashInABoxAssertions() {
  	OWLDataFactory factory = OWLManager.getOWLDataFactory();
  	OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  	
  	OWLClassExpression expr1 = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "A")));
  	OWLClassExpression expr2 = factory.getOWLObjectComplementOf(expr1);
  	OWLNamedIndividual indiv = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "a")));
  	
  	OWLIndividualAxiom fact1 = factory.getOWLClassAssertionAxiom(expr1, indiv);
  	OWLIndividualAxiom fact2 = factory.getOWLClassAssertionAxiom(expr2, indiv);
  	
  	try {
	OWLOntology ontology = manager.createOntology();
	manager.addAxiom(ontology, fact1);
	manager.addAxiom(ontology, fact2);
	
	Wolpertinger wolpertinger = new Wolpertinger(ontology);
	
	assertFalse(wolpertinger.isConsistent());
} catch (OWLOntologyCreationException e) {
	e.printStackTrace();
	fail();
}
  }
 
開發者ID:wolpertinger-reasoner,項目名稱:Wolpertinger,代碼行數:28,代碼來源:WolpertingerTest.java

示例2: StatisticalFunctionalityDetector

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
public StatisticalFunctionalityDetector(File ontologyFile, double threshold) {
	try {
		OWLOntologyManager man = OWLManager.createOWLOntologyManager();
		ontology = man.loadOntologyFromOntologyDocument(ontologyFile);
		dataFactory = man.getOWLDataFactory();
	} catch (OWLOntologyCreationException e) {
		e.printStackTrace();
	}
	this.threshold = threshold;
}
 
開發者ID:dice-group,項目名稱:BENGAL,代碼行數:11,代碼來源:StatisticalFunctionalityDetector.java

示例3: loadOntology

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
private OWLOntology loadOntology(OWLOntologyManager man, String input) {
	OWLOntology ont = null;
	try {
		ont = man.loadOntologyFromOntologyDocument(new File(input));
	} catch (OWLOntologyCreationException e) {
		e.printStackTrace();
	}
	return ont;
}
 
開發者ID:rsgoncalves,項目名稱:module-extractor,代碼行數:10,代碼來源:ModuleExtractorView.java

示例4: getOntology

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
private OWLOntology getOntology() {
	if (ontology == null) {
		try {
			ontology = getOWLOntologyManager().createOntology();
		} catch (OWLOntologyCreationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	return ontology;
}
 
開發者ID:owlcollab,項目名稱:owltools,代碼行數:12,代碼來源:OWLRenderer.java

示例5: testUnsatisfiabilityDuetoSimpleSubsumptionViolation

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
public void testUnsatisfiabilityDuetoSimpleSubsumptionViolation() {
  	OWLDataFactory factory = OWLManager.getOWLDataFactory();
  	OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  	
  	OWLClassExpression classA = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "A")));
  	OWLClassExpression classB = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "B")));
  	OWLClassExpression complClassB = factory.getOWLObjectComplementOf(classB);
  	
  	OWLNamedIndividual indiv = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "a")));
  	
  	OWLIndividualAxiom fact1 = factory.getOWLClassAssertionAxiom(classA, indiv);
  	OWLIndividualAxiom fact2 = factory.getOWLClassAssertionAxiom(complClassB, indiv);
  	
  	OWLSubClassOfAxiom subClOf = factory.getOWLSubClassOfAxiom(classA, classB);
  	
  	try {
	OWLOntology ontology = manager.createOntology();
	manager.addAxiom(ontology, fact1);
	manager.addAxiom(ontology, fact2);
	manager.addAxiom(ontology, subClOf);
	
	Wolpertinger wolpertinger = new Wolpertinger(ontology);
	
	assertFalse(wolpertinger.isConsistent());
} catch (OWLOntologyCreationException e) {
	e.printStackTrace();
	fail();
}
  }
 
開發者ID:wolpertinger-reasoner,項目名稱:Wolpertinger,代碼行數:30,代碼來源:WolpertingerTest.java

示例6: testUnsatisfiabilityDueToConflictingAxioms1

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
/**
   * Smth like:
   *    A subClassOf B
   *    A subClassOf C
   *    C disjoint with B
   *    ...
   */
  public void testUnsatisfiabilityDueToConflictingAxioms1() {
  	OWLDataFactory factory = OWLManager.getOWLDataFactory();
  	OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  	
  	OWLClassExpression classA = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "A")));
  	OWLClassExpression classB = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "B")));
  	OWLClassExpression classC = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "C")));
  	OWLNamedIndividual indiv = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "a")));
  	
  	OWLIndividualAxiom fact1 = factory.getOWLClassAssertionAxiom(classA, indiv);
  	OWLSubClassOfAxiom axmAsubB = factory.getOWLSubClassOfAxiom(classA, classB);
  	OWLSubClassOfAxiom axmAsubC = factory.getOWLSubClassOfAxiom(classA, classC);
  	OWLDisjointClassesAxiom axmBdisC = factory.getOWLDisjointClassesAxiom(classB, classC);
  	
  	try {
	OWLOntology ontology = manager.createOntology();
	manager.addAxiom(ontology, fact1);
	manager.addAxiom(ontology, axmAsubB);
	manager.addAxiom(ontology, axmAsubC);
	manager.addAxiom(ontology, axmBdisC);
	
	Wolpertinger wolpertinger = new Wolpertinger(ontology);
	
	assertFalse(wolpertinger.isConsistent());
} catch (OWLOntologyCreationException e) {
	e.printStackTrace();
	fail();
}
  }
 
開發者ID:wolpertinger-reasoner,項目名稱:Wolpertinger,代碼行數:37,代碼來源:WolpertingerTest.java

示例7: testUnsatisfiabilityDoToFixedDomain1

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
/**
   * Smth like
   *    A subClassOf r min 5 B
   *  But we have only a domain with 4 elements ...
   */
  public void testUnsatisfiabilityDoToFixedDomain1() {
  	OWLDataFactory factory = OWLManager.getOWLDataFactory();
  	OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  	
  	OWLClassExpression classA = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "A")));
  	OWLClassExpression classB = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "B")));
  	OWLObjectPropertyExpression roleR = factory.getOWLObjectProperty(IRI.create(String.format("%s#%s", PREFIX, "r")));
  	
  	OWLNamedIndividual indA = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "a")));
  	OWLNamedIndividual indB = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "b")));
  	OWLNamedIndividual indC = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "c")));
  	OWLNamedIndividual indD = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "d")));

  	OWLIndividualAxiom fact1 = factory.getOWLClassAssertionAxiom(classA, indA);
  	OWLIndividualAxiom fact2 = factory.getOWLClassAssertionAxiom(classA, indB);
  	OWLIndividualAxiom fact3 = factory.getOWLClassAssertionAxiom(classA, indC);
  	OWLIndividualAxiom fact4 = factory.getOWLClassAssertionAxiom(classA, indD);
  	
  	OWLObjectMinCardinality exprRmin5B = factory.getOWLObjectMinCardinality(5, roleR, classB);
  	OWLSubClassOfAxiom axmAsubRsomeB = factory.getOWLSubClassOfAxiom(classA, exprRmin5B);
  	
  	try {
	OWLOntology ontology = manager.createOntology();
	manager.addAxiom(ontology, fact1);
	manager.addAxiom(ontology, fact2);
	manager.addAxiom(ontology, fact3);
	manager.addAxiom(ontology, fact4);
	manager.addAxiom(ontology, axmAsubRsomeB);
	
	Wolpertinger wolpertinger = new Wolpertinger(ontology);
	
	assertFalse(wolpertinger.isConsistent());
} catch (OWLOntologyCreationException e) {
	e.printStackTrace();
	fail();
}
  }
 
開發者ID:wolpertinger-reasoner,項目名稱:Wolpertinger,代碼行數:43,代碼來源:WolpertingerTest.java

示例8: load

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
public ProbKnowledgeBase load(String uri) throws OntologyLoadingException {

		OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
		//Take everything before the last "/"
		OWLOntologyIRIMapper iriMapper = new BaseIRIMapper(uri.substring( 0, uri.lastIndexOf( '/' ) )); 

		manager.addIRIMapper( iriMapper );
		
		try {
			
			return load(manager.loadOntology( IRI.create( uri ) ));

		} catch( OWLOntologyCreationException e ) {

			e.printStackTrace();
			
			throw new OntologyLoadingException(e);
		}
	}
 
開發者ID:klinovp,項目名稱:pronto,代碼行數:20,代碼來源:KBStandaloneLoader.java

示例9: createSimpleGraphColoring

import org.semanticweb.owlapi.model.OWLOntologyCreationException; //導入方法依賴的package包/類
private OWLOntology createSimpleGraphColoring() {
  	OWLOntology ontoColoring = null;
  	OWLDataFactory factory = OWLManager.getOWLDataFactory();
  	OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  	
  	OWLObjectPropertyExpression edgeProp = factory.getOWLObjectProperty(IRI.create(String.format("%s#%s", PREFIX, "edge")));
  	OWLClassExpression classNode = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "Node")));
  	OWLClassExpression classBlue = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "Blue")));
  	OWLClassExpression classRed = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "Red")));
  	OWLClassExpression classGreen = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "Green")));
  	
  	OWLNamedIndividual indNode1 = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "node1")));
  	OWLNamedIndividual indNode2 = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "node2")));
  	OWLNamedIndividual indNode3 = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "node3")));
  	OWLNamedIndividual indNode4 = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "node4")));
  	
  	// now the facts
  	// nodes
  	OWLIndividualAxiom axmNodeInst4 =factory.getOWLClassAssertionAxiom(classNode, indNode4);
  	OWLIndividualAxiom axmNodeInst3 =factory.getOWLClassAssertionAxiom(classNode, indNode3);
  	OWLIndividualAxiom axmNodeInst2 =factory.getOWLClassAssertionAxiom(classNode, indNode2);
  	OWLIndividualAxiom axmNodeInst1 =factory.getOWLClassAssertionAxiom(classNode, indNode1);
  	
  	// 1
  	// | \
  	// |  3 - 4
  	// | /
  	// 2
  	//
  	OWLIndividualAxiom axmEdge12 = factory.getOWLObjectPropertyAssertionAxiom(edgeProp, indNode1, indNode2);
  	OWLIndividualAxiom axmEdge13 = factory.getOWLObjectPropertyAssertionAxiom(edgeProp, indNode1, indNode3);
  	OWLIndividualAxiom axmEdge23 = factory.getOWLObjectPropertyAssertionAxiom(edgeProp, indNode2, indNode3);
  	OWLIndividualAxiom axmEdge34 = factory.getOWLObjectPropertyAssertionAxiom(edgeProp, indNode3, indNode4);
  	
  	// symmetry of edge property
  	OWLObjectPropertyAxiom axmEdgeSym =  factory.getOWLSymmetricObjectPropertyAxiom(edgeProp);
  	
  	// axioms
  	OWLObjectUnionOf exprColorUnion = factory.getOWLObjectUnionOf(classBlue, classRed, classGreen);
  	OWLSubClassOfAxiom axmNodeColorings = factory.getOWLSubClassOfAxiom(classNode, exprColorUnion);
  	
  	// coloring constraints
  	OWLSubClassOfAxiom axmRedConstraint = factory.getOWLSubClassOfAxiom(classRed, factory.getOWLObjectAllValuesFrom(edgeProp, factory.getOWLObjectUnionOf(classGreen, classBlue)));
  	OWLSubClassOfAxiom axmBlueConstraint = factory.getOWLSubClassOfAxiom(classBlue, factory.getOWLObjectAllValuesFrom(edgeProp, factory.getOWLObjectUnionOf(classGreen, classRed)));
  	OWLSubClassOfAxiom axmGreenConstraint = factory.getOWLSubClassOfAxiom(classGreen, factory.getOWLObjectAllValuesFrom(edgeProp, factory.getOWLObjectUnionOf(classRed, classBlue)));
  	OWLDisjointClassesAxiom axmDisColors = factory.getOWLDisjointClassesAxiom(classRed, classBlue, classGreen);
  	
  	try {
	ontoColoring = manager.createOntology(); 
	
	manager.addAxiom(ontoColoring, axmNodeInst1);
	manager.addAxiom(ontoColoring, axmNodeInst2);
	manager.addAxiom(ontoColoring, axmNodeInst3);
	manager.addAxiom(ontoColoring, axmNodeInst4);
	
	manager.addAxiom(ontoColoring, axmEdge12);
	manager.addAxiom(ontoColoring, axmEdge13);
	manager.addAxiom(ontoColoring, axmEdge23);
	manager.addAxiom(ontoColoring, axmEdge34);
	
	manager.addAxiom(ontoColoring, axmEdgeSym);
	manager.addAxiom(ontoColoring, axmNodeColorings);
	manager.addAxiom(ontoColoring, axmRedConstraint);
	manager.addAxiom(ontoColoring, axmBlueConstraint);
	manager.addAxiom(ontoColoring, axmGreenConstraint);
	manager.addAxiom(ontoColoring, axmDisColors);
} catch (OWLOntologyCreationException e) {
	e.printStackTrace();
}
  	
  	return ontoColoring;
  }
 
開發者ID:wolpertinger-reasoner,項目名稱:Wolpertinger,代碼行數:73,代碼來源:WolpertingerTest.java


注:本文中的org.semanticweb.owlapi.model.OWLOntologyCreationException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。