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


Java OWLNamedIndividual.equals方法代码示例

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


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

示例1: removeAnnotations

import org.semanticweb.owlapi.model.OWLNamedIndividual; //导入方法依赖的package包/类
public OWLObjectPropertyAssertionAxiom removeAnnotations(ModelContainer model, OWLObjectPropertyExpression p,
		OWLNamedIndividual i, OWLNamedIndividual j, Set<OWLAnnotation> annotations, METADATA metadata) {
	OWLOntology ont = model.getAboxOntology();
	Set<OWLObjectPropertyAssertionAxiom> axioms = ont.getObjectPropertyAssertionAxioms(i);
	OWLObjectPropertyAssertionAxiom toModify = null;
	for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
		if (p.equals(axiom.getProperty()) && j.equals(axiom.getObject())) {
			toModify = axiom;
			break;
		}
	}
	OWLObjectPropertyAssertionAxiom newAxiom = null;
	if (toModify != null) {
		Set<OWLAnnotation> combindedAnnotations = new HashSet<OWLAnnotation>(toModify.getAnnotations());
		combindedAnnotations.removeAll(annotations);
		newAxiom = modifyAnnotations(toModify, combindedAnnotations, model, metadata);
	}
	return newAxiom;
}
 
开发者ID:geneontology,项目名称:minerva,代码行数:20,代码来源:CoreMolecularModelManager.java

示例2: findProcesses

import org.semanticweb.owlapi.model.OWLNamedIndividual; //导入方法依赖的package包/类
private Map<OWLClass, Pair<OWLNamedIndividual, Set<OWLAnnotation>>> findProcesses(OWLNamedIndividual mf) {
	Map<OWLClass, Pair<OWLNamedIndividual, Set<OWLAnnotation>>> result = new HashMap<OWLClass, Pair<OWLNamedIndividual,Set<OWLAnnotation>>>();
	Set<OWLObjectPropertyAssertionAxiom> axioms = model.getObjectPropertyAssertionAxioms(mf);
	for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
		if (partOf.equals(axiom.getProperty()) && mf.equals(axiom.getSubject())) {
			// relevant axiom
			OWLIndividual bpCandidate = axiom.getObject();
			if (bpCandidate.isNamed()) {
				final OWLNamedIndividual named = bpCandidate.asOWLNamedIndividual();
				Set<OWLClass> bpTypes = getTypes(named);
				for (OWLClass bpType : bpTypes) {
					if (bpSet.contains(bpType) == false) {
						continue;
					}
					result.put(bpType, Pair.of(named, getAnnotations(axiom, named)));
				}
			}
		}
	}
	return result;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:22,代码来源:ModelAnnotationSolrDocumentLoader.java

示例3: findLocations

import org.semanticweb.owlapi.model.OWLNamedIndividual; //导入方法依赖的package包/类
private Map<OWLClass, Pair<OWLNamedIndividual, Set<OWLAnnotation>>> findLocations(OWLNamedIndividual mf) {
	Map<OWLClass, Pair<OWLNamedIndividual, Set<OWLAnnotation>>> result = new HashMap<OWLClass, Pair<OWLNamedIndividual,Set<OWLAnnotation>>>();
	Set<OWLObjectPropertyAssertionAxiom> axioms = model.getObjectPropertyAssertionAxioms(mf);
	for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
		if (occursIn.equals(axiom.getProperty()) && mf.equals(axiom.getSubject())) {
			// relevant axiom
			OWLIndividual locationCandidate = axiom.getObject();
			if (locationCandidate.isNamed()) {
				OWLNamedIndividual named = locationCandidate.asOWLNamedIndividual();
				Set<OWLClass> locationTypes = getTypes(named);
				for (OWLClass locationType : locationTypes) {
					result.put(locationType, Pair.of(named, getAnnotations(axiom, named)));
				}
			}
		}
	}
	return result;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:19,代码来源:ModelAnnotationSolrDocumentLoader.java

示例4: testMatches

import org.semanticweb.owlapi.model.OWLNamedIndividual; //导入方法依赖的package包/类
private void testMatches() throws Exception {
	for (OWLNamedIndividual i : sourceOntol.getIndividualsInSignature()) {
		LOG.info("Finding matches for "+i+" Types: "+owlsim.getAttributesForElement(i));
		List<ElementPairScores> matches = owlsim.findMatches(i, null, 0, 0);
		LOG.info("|matches|="+matches.size());
		for (ElementPairScores m : matches) {
			LOG.info("  m="+m);
			if (i.equals(m.j)) {
				LOG.info("Self best match for "+i+" "+m.combinedScore+" "+m.rank);
				Assert.assertTrue(100 == m.combinedScore);
				//Assert.assertTrue(m.rank <= 2);
			}
		}
	}
	
	isAllEquiv("x1", "x2");
	isAllEquiv("x3", "x4", "x4b");
	isAllEquiv("x5", "x6");		
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:20,代码来源:OWLSimTest.java

示例5: addAnnotations

import org.semanticweb.owlapi.model.OWLNamedIndividual; //导入方法依赖的package包/类
public void addAnnotations(ModelContainer model, OWLObjectPropertyExpression p,
		OWLNamedIndividual i, OWLNamedIndividual j, Set<OWLAnnotation> annotations,
		METADATA metadata) {
	OWLOntology ont = model.getAboxOntology();
	Set<OWLObjectPropertyAssertionAxiom> axioms = ont.getObjectPropertyAssertionAxioms(i);
	OWLObjectPropertyAssertionAxiom toModify = null;
	for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
		if (p.equals(axiom.getProperty()) && j.equals(axiom.getObject())) {
			toModify = axiom;
			break;
		}
	}
	addAnnotations(model, toModify, annotations, metadata);
}
 
开发者ID:geneontology,项目名称:minerva,代码行数:15,代码来源:CoreMolecularModelManager.java

示例6: updateAnnotation

import org.semanticweb.owlapi.model.OWLNamedIndividual; //导入方法依赖的package包/类
public void updateAnnotation(ModelContainer model, OWLObjectPropertyExpression p,
		OWLNamedIndividual i, OWLNamedIndividual j, OWLAnnotation update,
		METADATA metadata) {
	OWLOntology ont = model.getAboxOntology();
	Set<OWLObjectPropertyAssertionAxiom> axioms = ont.getObjectPropertyAssertionAxioms(i);
	OWLObjectPropertyAssertionAxiom toModify = null;
	for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
		if (p.equals(axiom.getProperty()) && j.equals(axiom.getObject())) {
			toModify = axiom;
			break;
		}
	}
	updateAnnotation(model, toModify, update, metadata);
}
 
开发者ID:geneontology,项目名称:minerva,代码行数:15,代码来源:CoreMolecularModelManager.java


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