本文整理汇总了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;
}
示例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
}