本文整理汇总了Java中org.semanticweb.owlapi.model.OWLEntity.getAnnotations方法的典型用法代码示例。如果您正苦于以下问题:Java OWLEntity.getAnnotations方法的具体用法?Java OWLEntity.getAnnotations怎么用?Java OWLEntity.getAnnotations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLEntity
的用法示例。
在下文中一共展示了OWLEntity.getAnnotations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPrefLabels
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
@Override
public Set<String> getPrefLabels(OWLEntity cpt) {
Set<String> finalLabels = new HashSet<String>();
Set<OWLAnnotation> annotations = cpt.getAnnotations(ontology);
for(OWLAnnotation annot : annotations) {
if(annot.getValue() instanceof OWLLiteral) {
OWLAnnotationProperty prop = annot.getProperty();
// The DOE prefLabel, if they exist
if(prop.getIRI().equals(prefLabelIRI) ||
prop.getIRI().equals(SKOSVocabulary.PREFLABEL.getIRI()) ||
prop.getIRI().equals(OWLRDFVocabulary.RDFS_LABEL.getIRI())) {
OWLLiteral literal = (OWLLiteral)annot.getValue();
finalLabels.add(literal.getLiteral());
}
}
}
return finalLabels;
}
示例2: getAltLabels
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
@Override
public Set<String> getAltLabels(OWLEntity cpt) {
Set<String> finalLabels = new HashSet<String>();
Set<OWLAnnotation> annotations = cpt.getAnnotations(ontology);
for(OWLAnnotation annot : annotations) {
if(annot.getValue() instanceof OWLLiteral) {
OWLAnnotationProperty prop = annot.getProperty();
// The DOE prefLabel, if they exist
if(prop.getIRI().equals(altLabelIRI) ||
prop.getIRI().equals(hiddenLabelIRI) ||
prop.getIRI().equals(SKOSVocabulary.ALTLABEL.getIRI()) ||
prop.getIRI().equals(SKOSVocabulary.HIDDENLABEL.getIRI())) {
OWLLiteral literal = (OWLLiteral)annot.getValue();
finalLabels.add(literal.getLiteral());
}
}
}
return finalLabels;
}
示例3: getAltLabels
import org.semanticweb.owlapi.model.OWLEntity; //导入方法依赖的package包/类
@Override
public Set<String> getAltLabels(OWLEntity cpt) {
if(cpt == null)
throw new IllegalArgumentException("cpt cannot be null");
// The rdfs:label, if it exists
Set<String> finalLabels = new HashSet<String>();
Set<OWLAnnotation> annotations = cpt.getAnnotations(
ontology,
df.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()));
for(OWLAnnotation annot : annotations) {
if(annot.getValue() instanceof OWLLiteral) {
finalLabels.add(((OWLLiteral)annot.getValue()).getLiteral());
}
}
return finalLabels;
}