当前位置: 首页>>代码示例>>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;未经允许,请勿转载。