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


Java OWLOntology.getDataPropertiesInSignature方法代碼示例

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


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

示例1: getOntoDataProperty

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
/**
 * Get the {@link OWLDataProperty} object corresponding to a named data
 * property (i.e. attribute in OO) of the ontology.
 * @param onto
 * @param name
 * @return
 */
public static OWLDataProperty getOntoDataProperty(OWLOntology onto,
    String name) {
  for (OWLDataProperty p : onto.getDataPropertiesInSignature())
    if (p.getIRI().getFragment().equals(name))
      return p;
  return null;
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:15,代碼來源:OwlUtil.java

示例2: getEntities

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
@Override
protected Set<OWLDataProperty> getEntities(OWLOntology ont) {
    return ont.getDataPropertiesInSignature();
}
 
開發者ID:ernestojimenezruiz,項目名稱:logmap-matcher,代碼行數:5,代碼來源:StructuralReasoner2.java

示例3: getAxioms

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
/**
 * Get axioms from ontology depending on requirements
 * @param ontology
 * @param considerImportsClosure
 * @param considerEntityAnnotations
 * @param ignoreAssertions
 * @return
 */
private static Set<OWLAxiom> getAxioms(
		OWLOntology ontology,
		boolean considerImportsClosure, 
		boolean considerEntityAnnotations, 
		boolean ignoreAssertions){

	Set<OWLAxiom> axioms = new HashSet<OWLAxiom>(); 
			
	
	//axioms.addAll(ontology.getGeneralClassAxioms());
	axioms.addAll(ontology.getTBoxAxioms(considerImportsClosure));
	axioms.addAll(ontology.getRBoxAxioms(considerImportsClosure));
	if (!ignoreAssertions){
		axioms.addAll(ontology.getABoxAxioms(considerImportsClosure));
	}
	
	if (considerEntityAnnotations){
		
		for (OWLClass cls : ontology.getClassesInSignature(considerImportsClosure)){
			axioms.addAll(cls.getAnnotationAssertionAxioms(ontology));
			//axioms.addAll(ontology.getDeclarationAxioms(cls));
			
		}
		
		for (OWLObjectProperty oprop : ontology.getObjectPropertiesInSignature(considerImportsClosure)){
			axioms.addAll(oprop.getAnnotationAssertionAxioms(ontology));
			//axioms.addAll(ontology.getDeclarationAxioms(oprop));
		}
		
		for (OWLDataProperty dprop : ontology.getDataPropertiesInSignature(considerImportsClosure)){
			axioms.addAll(dprop.getAnnotationAssertionAxioms(ontology));
			//axioms.addAll(ontology.getDeclarationAxioms(dprop));
		}
		
		for (OWLAnnotationProperty aprop : ontology.getAnnotationPropertiesInSignature()){
			axioms.addAll(aprop.getAnnotationAssertionAxioms(ontology));
			//axioms.addAll(ontology.getDeclarationAxioms(aprop));
		}
		
		if (!ignoreAssertions){
			for (OWLNamedIndividual indiv : ontology.getIndividualsInSignature(considerImportsClosure)){
				axioms.addAll(indiv.getAnnotationAssertionAxioms(ontology));
				//axioms.addAll(ontology.getDeclarationAxioms(indiv));
			}
			
			//TODO In pizza.owl gives an error
			//for (OWLAnonymousIndividual aindiv : ontology.getAnonymousIndividuals()){
			//	axioms.addAll(ontology.getAnnotationAssertionAxioms(aindiv));
			//}
			
			
			
		}
	}	
	
	/*for (OWLAxiom ax : ontology.getAxioms()){
		if (!axioms.contains(ax)){
			
			System.out.println(ax);
			
		}
	}*/
		
	
	return axioms;
	
}
 
開發者ID:ernestojimenezruiz,項目名稱:logmap-matcher,代碼行數:76,代碼來源:OntologyModuleExtractor.java


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