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


Java OWLDataProperty.isBottomEntity方法代码示例

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


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

示例1: getDataPropertyValues

import org.semanticweb.owlapi.model.OWLDataProperty; //导入方法依赖的package包/类
public Set<OWLLiteral> getDataPropertyValues(
		OWLNamedIndividual namedIndividual, OWLDataProperty property) {
	checkPreConditions(namedIndividual, property);
	Set<OWLLiteral> result = new HashSet<OWLLiteral>();
	if (m_dlOntology.hasDatatypes()) {
		OWLDataFactory factory = getDataFactory();
		Set<OWLDataProperty> relevantDataProperties = getSubDataProperties(
				property, false).getFlattened();
		relevantDataProperties.add(property);
		Set<OWLNamedIndividual> relevantIndividuals = getSameIndividuals(
				namedIndividual).getEntities();
		for (OWLDataProperty dataProperty : relevantDataProperties) {
			if (!dataProperty.isBottomEntity()) {
				AtomicRole atomicRole = H(dataProperty);
				Map<Individual, Set<Constant>> dataPropertyAssertions = m_dlOntology
						.getDataPropertyAssertions().get(atomicRole);
				if (dataPropertyAssertions != null) {
					for (OWLNamedIndividual ind : relevantIndividuals) {
						Individual individual = H(ind);
						if (dataPropertyAssertions.containsKey(individual)) {
							for (Constant constant : dataPropertyAssertions
									.get(individual)) {
								String lexicalForm = constant
										.getLexicalForm();
								String datatypeURI = constant
										.getDatatypeURI();
								OWLLiteral literal;
								if ((Prefixes.s_semanticWebPrefixes
										.get("rdf:") + "PlainLiteral")
										.equals(datatypeURI)) {
									int atPosition = lexicalForm
											.lastIndexOf('@');
									literal = factory
											.getOWLLiteral(
													lexicalForm.substring(
															0, atPosition),
													lexicalForm
															.substring(atPosition + 1));
								} else
									literal = factory.getOWLLiteral(
											lexicalForm,
											factory.getOWLDatatype(IRI
													.create(datatypeURI)));
								result.add(literal);
							}
						}
					}
				}
			}
		}
	}
	return result;
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:54,代码来源:Reasoner.java

示例2: processOntologyDataPropLabels

import org.semanticweb.owlapi.model.OWLDataProperty; //导入方法依赖的package包/类
/**
 * This method will also associate an index to each dprop
 */
private void processOntologyDataPropLabels() {
	
	
	
	Set<String> words=new HashSet<String>();
	
	int ident=0;
	
	//DATA Prop
	//First we give a identifier to each class
	for (OWLDataProperty dProp : onto.getDataPropertiesInSignature(true)){ //also imports
		
		if (!dProp.isTopEntity() && !dProp.isBottomEntity()){
			
			listofOWLDProp.add(dProp);
			
			//We extract a fix number of labels (at most).
			for (String label : extractLabels4OWLEntity(dProp, 1)){
			
				words.addAll(cleanLabel(label));
				
				if (words.size()>0){
						
					if (!invertedFileExactLabels_dProp.containsKey(words))
						invertedFileExactLabels_dProp.put(new HashSet<String>(words), new HashSet<Integer>());
						
					invertedFileExactLabels_dProp.get(words).add(ident);
					
				}			
					
				//init
				words.clear();
				
			}//for labels
			
			ident++;
			
		}//if top-bottom
		
	}//for dProp
}
 
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:45,代码来源:OntologyProcessing.java


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