当前位置: 首页>>代码示例>>Java>>正文


Java OWLAxiom类代码示例

本文整理汇总了Java中org.semanticweb.owlapi.model.OWLAxiom的典型用法代码示例。如果您正苦于以下问题:Java OWLAxiom类的具体用法?Java OWLAxiom怎么用?Java OWLAxiom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OWLAxiom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLAxiom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AxiomsDialog

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
public AxiomsDialog(IntegrateOntologyWithProtege integrateOntologyWithProtege, JFrame parent) {
	super(parent);
	this.parent = parent;
	this.selectedNewAxioms = new HashSet<OWLAxiom>();
	this.selectedExistingAxioms = new HashSet<OWLAxiom>();
	this.intgOntWProtege = integrateOntologyWithProtege;
	this.isClickedOK = false;

	new UserObjectforTreeView(parent, integrateOntologyWithProtege.getActiveOntology());

	// for sorting rendering is accomplished
	ManchesterOWLSyntaxPrefixNameShortFormProvider shortFormProvider = new ManchesterOWLSyntaxPrefixNameShortFormProvider(
			this.intgOntWProtege.getActiveOntology());
	rendering.setShortFormProvider(shortFormProvider);

	initUI();
	showUI();
}
 
开发者ID:md-k-sarker,项目名称:OWLAx,代码行数:19,代码来源:AxiomsDialog.java

示例2: isAlreadyListed

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
private boolean isAlreadyListed(OWLAxiom axiom) {

		if (intgOntWProtege.getClassAssertionAxioms().contains(axiom))
			return true;
		if (intgOntWProtege.getSubClassOfAxioms().contains(axiom))
			return true;
		if (intgOntWProtege.getCardinalityAxioms().contains(axiom))
			return true;
		if (intgOntWProtege.getDomainAndRangeAxioms().contains(axiom))
			return true;
		if (intgOntWProtege.getDisJointOfAxioms().contains(axiom))
			return true;
		if (intgOntWProtege.getExistentialAxioms().contains(axiom))
			return true;

		return false;
	}
 
开发者ID:md-k-sarker,项目名称:OWLAx,代码行数:18,代码来源:AxiomsDialog.java

示例3: removeDuplicateAndSort

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
/**
 * First removing duplicates and then sorting
 * 
 * @param axiomArray
 * @return
 */
private ArrayList<OWLAxiom> removeDuplicateAndSort(ArrayList<OWLAxiom> axiomArray) {
	ArrayList<OWLAxiom> sortedAxiomArray = new ArrayList<>();
	Set<OWLAxiom> axiomSet = new HashSet<>();
	axiomSet.addAll(axiomArray);
	sortedAxiomArray.addAll(axiomSet);

	// before sorting it uses manchester encoding
	Collections.sort(sortedAxiomArray, new Comparator<OWLAxiom>() {

		@Override
		public int compare(OWLAxiom o1, OWLAxiom o2) {
			// TODO Auto-generated method stub

			String a1 = rendering.render(o1);
			String a2 = rendering.render(o2);

			return a1.compareToIgnoreCase(a2);
		}

	});

	return sortedAxiomArray;
}
 
开发者ID:md-k-sarker,项目名称:OWLAx,代码行数:30,代码来源:IntegrateOntologyWithProtege.java

示例4: showAxiomsDialog

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
private boolean showAxiomsDialog() {

		JFrame topFrame = (JFrame) SwingUtilities.getWindowAncestor(this.editor);
		AxiomsDialog dialog = new AxiomsDialog(this, topFrame);

		if (dialog.isClickedOK()) {
			selectedAxioms = dialog.getSelectedAxioms();
			if (!selectedAxioms.isEmpty()) {
				for (OWLAxiom axiom : selectedAxioms) {
					changes.add(new AddAxiom(activeOntology, axiom));
				}
				return true;
			} else {
				editor.status("Selected Axioms is empty. Nothing to integrate.");
			}
		} else {
			editor.status("");
		}
		return false;
	}
 
开发者ID:md-k-sarker,项目名称:OWLAx,代码行数:21,代码来源:IntegrateOntologyWithProtege.java

示例5: commitDeclarations

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
private boolean commitDeclarations() {
	// editor.status("Integrating Declaration axioms with Protege ");
	if (declarationAxioms != null && !declarationAxioms.isEmpty()) {
		// declarationAxioms
		List<OWLOntologyChange> declarations = new ArrayList<OWLOntologyChange>();
		for (OWLAxiom declarationAxiom : declarationAxioms) {

			declarations.add(new AddAxiom(activeOntology, declarationAxiom));

		}
		ChangeApplied changeResult = owlOntologyManager.applyChanges(declarations);
		if (changeResult == ChangeApplied.SUCCESSFULLY) {
			editor.status("Declaration axioms integrated with protege successfully.");
			return true;
		} else if (changeResult == ChangeApplied.UNSUCCESSFULLY) {
			editor.status("Declaration integration with Protege unsuccessfull.");
			return false;
		} else if (changeResult == ChangeApplied.NO_OPERATION) {
			editor.status(
					"Declaration axioms are duplicate. Possible reason: trying to create new OWL Entity which IRI match with existing OWLEntity IRI.");
			return false;
		}
	} else {

		editor.status("");
		return false;
	}

	return false;
}
 
开发者ID:md-k-sarker,项目名称:OWLAx,代码行数:31,代码来源:IntegrateOntologyWithProtege.java

示例6: testTinyOntology8

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
/**
 * @throws OWLOntologyCreationException
 *             if something goes wrong with the ontology creation
 */
@Test
public void testTinyOntology8() throws OWLOntologyCreationException {
	OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
	OWLDataFactory factory = manager.getOWLDataFactory();
	Set<OWLAxiom> axiomSet = new HashSet<>();
	OWLClass a = createNewClass(factory, "A");
	OWLClass b = createNewClass(factory, "B");
	OWLClass ab = createNewClass(factory, "AB");

	Set<OWLClass> aAndBSet = new HashSet<>();
	aAndBSet.add(a);
	aAndBSet.add(b);
	OWLClassExpression aAndB = factory.getOWLObjectIntersectionOf(aAndBSet);
	axiomSet.add(factory.getOWLEquivalentClassesAxiom(ab, aAndB));

	OWLOntology ontology = manager.createOntology(axiomSet);
	JcelReasonerFactory reasonerFactory = new JcelReasonerFactory();
	OWLReasoner reasoner = reasonerFactory.createReasoner(ontology);
	Set<OWLClass> expectedSet = new HashSet<>();
	expectedSet.add(ab);
	Node<OWLClass> expected = new OWLClassNode(expectedSet);
	Assert.assertEquals(expected, reasoner.getEquivalentClasses(ab));
	Assert.assertEquals(expected, reasoner.getEquivalentClasses(aAndB));
}
 
开发者ID:julianmendez,项目名称:jcel,代码行数:29,代码来源:TinyOntologyTest.java

示例7: processAxioms

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
public void processAxioms(Collection<? extends OWLAxiom> axioms) {
    AxiomVisitor axiomVisitor=new AxiomVisitor();

    for (OWLAxiom axiom : axioms) {
    	axiom = preprocessAssertion(axiom);
		axiom.accept(axiomVisitor);
    }

    // now all axioms are in NNF and converted into disjunctions wherever possible
    // exact cardinalities are rewritten into at least and at most cardinalities etc
    // Rules with multiple head atoms are rewritten into several rules (Lloyd-Topor transformation)

    // normalize rules, this might add new concept and data range inclusions
    // in case a rule atom uses a complex concept or data range
    // we keep this inclusions separate because they are only applied to named individuals
    RuleNormalizer ruleNormalizer=new RuleNormalizer(m_axioms.m_rules,axiomVisitor.m_classExpressionInclusionsAsDisjunctions,axiomVisitor.m_dataRangeInclusionsAsDisjunctions);
    for (SWRLRule rule : axiomVisitor.m_rules)
        ruleNormalizer.visit(rule);

    // in normalization, we now simplify the disjuncts where possible (eliminate
    // unnecessary conjuncts/disjuncts) and introduce fresh atomic concepts for complex
    // concepts m_axioms.m_conceptInclusions contains the normalized axioms after the normalization
    normalizeInclusions(axiomVisitor.m_classExpressionInclusionsAsDisjunctions,axiomVisitor.m_dataRangeInclusionsAsDisjunctions);
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:25,代码来源:OWLNormalization.java

示例8: OwlApiEntailmentQueryTest

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
public OwlApiEntailmentQueryTest(
		final QueryTestManifest<OWLAxiom, Boolean> manifest) {
	super(manifest, new OwlApiReasoningTestDelegate<Boolean>(manifest) {

		@Override
		public Boolean getActualOutput() throws Exception {
			return getReasoner().isEntailed(manifest.getInput().getQuery());
		}

		@Override
		public Class<? extends Exception> getInterruptionExceptionClass() {
			return ReasonerInterruptedException.class;
		}

	});
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:17,代码来源:OwlApiEntailmentQueryTest.java

示例9: process

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
private boolean process(ProofNode<OWLAxiom> node) {
	Collection<? extends ProofStep<OWLAxiom>> steps = node.getInferences();
	if (steps.size() > 1) {
		// don't expand multiple inferences
		return false;
	}
	for (ProofStep<OWLAxiom> step : steps) {
		// just one step
		if (canConvertStep(step) != null) {
			process(step);
			return true;
		}
	}
	// else
	return false;
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:17,代码来源:InlinedClassInclusionExistentialPropertyExpansionStep.java

示例10: EntailmentProofCompletenessTest

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
public EntailmentProofCompletenessTest(
		final TestManifest<QueryTestInput<OWLAxiom>> manifest) {
	super(manifest, new OwlApiReasoningTestDelegate<Void>(manifest) {

		@Override
		public Void getActualOutput() throws Exception {
			// No output should be needed.
			throw new UnsupportedOperationException();
		}

		@Override
		public Class<? extends Exception> getInterruptionExceptionClass() {
			// No exception should be needed.
			throw new UnsupportedOperationException();
		}

	});
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:19,代码来源:EntailmentProofCompletenessTest.java

示例11: isAsymmetric

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
protected boolean isAsymmetric(
		OWLObjectPropertyExpression propertyExpression) {
	checkPreConditions(propertyExpression);
	if (!m_isConsistent)
		return true;
	OWLDataFactory factory = getDataFactory();
	OWLIndividual freshIndividualA = factory
			.getOWLAnonymousIndividual("fresh-individual-A");
	OWLIndividual freshIndividualB = factory
			.getOWLAnonymousIndividual("fresh-individual-B");
	OWLAxiom assertion1 = factory.getOWLObjectPropertyAssertionAxiom(
			propertyExpression, freshIndividualA, freshIndividualB);
	OWLAxiom assertion2 = factory.getOWLObjectPropertyAssertionAxiom(
			propertyExpression.getInverseProperty(), freshIndividualA,
			freshIndividualB);
	Tableau tableau = getTableau(assertion1, assertion2);
	boolean result = tableau.isSatisfiable(true, null, null, null, null,
			null, new ReasoningTaskDescription(true, "asymmetry of {0}",
					H(propertyExpression)));
	tableau.clearAdditionalDLOntology();
	return !result;
}
 
开发者ID:evalincius,项目名称:Hermit_1.3.8_android,代码行数:23,代码来源:Reasoner.java

示例12: compareOntologies

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
private static void compareOntologies() throws OWLException, UnsupportedEncodingException,
		FileNotFoundException, IOException {
	// Write the diff between two ontologies to file
	OntoModel ontModelOriginal = new OntoModel(new File(
			"resources/airbus/input/ontology/component-03072015_original.rdf"), outputFolderName);
	Set<OWLAxiom> axiomsOriginal = ontModelOriginal.getOntologyAxioms();
	OntoModel ontModel = new OntoModel(new File(
			"resources/airbus/input/ontology/component-03072015_changed.rdf"), outputFolderName);
	Set<OWLAxiom> axioms = ontModel.getOntologyAxioms();
	axioms.removeAll(axiomsOriginal);
	// Write axioms that appeared in the second ontology to file
	String OntFileName = outputFolderName + "new_axioms.txt";
	String out = new String();
	java.util.Iterator<OWLAxiom> it = axioms.iterator();
	while (it.hasNext()) {
		out += it.next() + "\n";
	}
	// FileOperations.writeToFile(new File(OntFileName), out);
}
 
开发者ID:ModelWriter,项目名称:Source,代码行数:20,代码来源:InitialOntologyConsistency.java

示例13: translateBioentity

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
protected void translateBioentity(Bioentity e) {
	OWLDataFactory fac = graph.getDataFactory();
	Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
	OWLClass cls = getOWLClass(e.getId());

	// --label---
	axioms.add(fac.getOWLAnnotationAssertionAxiom(fac.getRDFSLabel(),
			cls.getIRI(),
			fac.getOWLLiteral(e.getSymbol())));

	// --taxon--
	OWLClass taxCls = getOWLClass(e.getNcbiTaxonId()); // todo - cache
	axioms.add(fac.getOWLSubClassOfAxiom(cls, 
			fac.getOWLObjectSomeValuesFrom(getGeneAnnotationObjectProperty(Vocab.IN_TAXON), 
					taxCls)));

	// TODO - other properties

	addAxioms(axioms);


}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:23,代码来源:GAFOWLBridge.java

示例14: getInference

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
@Override
public Inference<OWLAxiom> getInference() {
	return new ElkOwlInference(FACTORY.getElkClassInclusionHierarchy(
			new AbstractList<ElkClassExpression>() {

				@Override
				public ElkClassExpression get(int index) {
					switch (index) {
					case 0:
						return getElkSubClassOfAxiom(getPremises().get(0))
								.getSubClassExpression();
					default:
						return getElkSubClassOfAxiom(
								getPremises().get(index - 1))
										.getSuperClassExpression();
					}
				}

				@Override
				public int size() {
					return getPremises().size() + 1;
				}
			}));
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:25,代码来源:InlinedClassInclusionHierarchyStep.java

示例15: renderUsage

import org.semanticweb.owlapi.model.OWLAxiom; //导入依赖的package包/类
private void renderUsage(Set<OWLAxiom> refAxs) {
	List<String> axstrs = new ArrayList<String>();


	renderSection("Usage");
	int n = 0;
	for (OWLAxiom ax : refAxs) {
		axstrs.add(generateText(ax));
		n++;
		if (n > MAX_REFERENCING_AXIOMS) {
			renderTagValue("", "...TRUNCATED REMAINING AXIOMS");
		}
	}
	Collections.sort(axstrs);
	for (String axstr : axstrs) {
		renderTagValue("", axstr);
	}

}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:20,代码来源:MarkdownRenderer.java


注:本文中的org.semanticweb.owlapi.model.OWLAxiom类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。