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


Java OWLOntology.getDeclarationAxioms方法代碼示例

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


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

示例1: addBioEntity

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
private void addBioEntity(OWLClass pr, OWLOntology lego, Bioentity bioentity) {
	Set<OWLDeclarationAxiom> declarationAxioms = lego.getDeclarationAxioms(pr);
	if (declarationAxioms == null || declarationAxioms.isEmpty()) {
		// add class declaration and add label
		OWLOntologyManager m = lego.getOWLOntologyManager();
		OWLDataFactory f = m.getOWLDataFactory();
		
		Set<OWLAxiom> axioms = new HashSet<OWLAxiom>();
		axioms.add(f.getOWLDeclarationAxiom(pr));
		
		String label = bioentity.getSymbol()+" - "+bioentity.getFullName();
		
		axioms.add(f.getOWLAnnotationAssertionAxiom(f.getRDFSLabel(), pr.getIRI(), f.getOWLLiteral(label)));
		
		m.addAxioms(lego, axioms);
	}
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:18,代碼來源:GafToLegoTranslator.java

示例2: getDcSourceProperty

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
private OWLAnnotationProperty getDcSourceProperty(OWLOntology lego, OWLDataFactory f) {
	OWLAnnotationProperty p = f.getOWLAnnotationProperty(DC_SOURCE);
	Set<OWLDeclarationAxiom> declarationAxioms = lego.getDeclarationAxioms(p);
	if (declarationAxioms == null || declarationAxioms.isEmpty()) {
		OWLOntologyManager m = lego.getOWLOntologyManager();
		m.addAxiom(lego, f.getOWLDeclarationAxiom(p));
	}
	return p;
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:10,代碼來源:GafToLegoTranslator.java

示例3: getOWLIndividual

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
/**
 * Returns an OWLNamedIndividual with this IRI <b>if it has been declared</b>
 * in the source or support ontologies. Returns null otherwise.
 * 
 * @param iri
 * @return {@link OWLNamedIndividual}
 */
public OWLNamedIndividual getOWLIndividual(IRI iri) {
	OWLNamedIndividual c = getDataFactory().getOWLNamedIndividual(iri);
	for (OWLOntology o : getAllOntologies()) {
		for (OWLDeclarationAxiom da : o.getDeclarationAxioms(c)) {
			if (da.getEntity() instanceof OWLNamedIndividual) {
				return (OWLNamedIndividual) da.getEntity();
			}
		}
	}
	return null;
}
 
開發者ID:owlcollab,項目名稱:owltools,代碼行數:19,代碼來源:OWLGraphWrapperExtended.java


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