热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.semanticweb.owlapi.search.EntitySearcher.getIndividuals()方法的使用及代码示例

本文整理了Java中org.semanticweb.owlapi.search.EntitySearcher.getIndividuals()方法的一些代码示例,展示了

本文整理了Java中org.semanticweb.owlapi.search.EntitySearcher.getIndividuals()方法的一些代码示例,展示了EntitySearcher.getIndividuals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EntitySearcher.getIndividuals()方法的具体详情如下:
包路径:org.semanticweb.owlapi.search.EntitySearcher
类名称:EntitySearcher
方法名:getIndividuals

EntitySearcher.getIndividuals介绍

[英]Gets the individuals that have been asserted to be an instance of this class by axioms in the speficied ontologies.
[中]获取通过特定本体中的公理断言为此类实例的个体。

代码示例

代码示例来源:origin: owlcs/owlapi

/**
* Gets the individuals that have been asserted to be an instance of this class by axioms in the
* speficied ontologies.
*
* @param e entity
* @param ontologies The ontologies to be examined for class assertion axioms that assert an
* individual to be an instance of this class.
* @return A {@code Set} of {@code OWLIndividual}s that represent the individual that have been
* asserted to be an instance of this class.
*/
public static Stream getIndividuals(OWLClass e, Stream ontologies) {
return ontologies.flatMap(o -> getIndividuals(e, o));
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-distribution

/**
* Gets the individuals that have been asserted to be an instance of this class by axioms in the
* speficied ontologies.
*
* @param e entity
* @param ontologies The ontologies to be examined for class assertion axioms that assert an
* individual to be an instance of this class.
* @return A {@code Set} of {@code OWLIndividual}s that represent the individual that have been
* asserted to be an instance of this class.
*/
public static Stream getIndividuals(OWLClass e, Stream ontologies) {
return ontologies.flatMap(o -> getIndividuals(e, o));
}

代码示例来源:origin: net.sourceforge.owlapi/owlapi-osgidistribution

/**
* Gets the individuals that have been asserted to be an instance of this class by axioms in the
* speficied ontologies.
*
* @param e entity
* @param ontologies The ontologies to be examined for class assertion axioms that assert an
* individual to be an instance of this class.
* @return A {@code Set} of {@code OWLIndividual}s that represent the individual that have been
* asserted to be an instance of this class.
*/
public static Stream getIndividuals(OWLClass e, Stream ontologies) {
return ontologies.flatMap(o -> getIndividuals(e, o));
}

代码示例来源:origin: ontodev/robot

public static Set selectInstances(OWLOntology ontology, Set objects) {
Set relatedObjects = new HashSet<>();
for (OWLObject object : objects) {
if (object instanceof OWLClass) {
relatedObjects.addAll(EntitySearcher.getIndividuals((OWLClass) object, ontology));
}
}
return relatedObjects;
}

代码示例来源:origin: VisualDataWeb/OWL2VOWL

private void processIndividuals(OWLOntology ontology, VowlData vowlData, OWLOntologyManager manager) {
ontology.classesInSignature(Imports.INCLUDED).collect(Collectors.toSet()).forEach(owlClass -> {
for (OWLOntology owlOntology : manager.ontologies().collect(Collectors.toSet())) {
try {
EntitySearcher.getIndividuals(owlClass, owlOntology).forEach(owlIndividual -> owlIndividual.accept(new IndividualsVisitor(vowlData,
owlIndividual, owlClass, manager)));
}
catch (Exception e){
logger.info("@WORKAROUND: Failed to accept some individuals ... SKIPPING THIS" );
logger.info("Exception: "+e);
logger.info("----------- Continue Process --------");
}
}
});
}

代码示例来源:origin: protegeproject/protege

protected void refill() {
individualsInList.clear();
OWLClass cls = getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass();
if (cls != null) {
typeLabel.setText(getOWLModelManager().getRendering(cls));
typeLabel.setIcon(getOWLWorkspace().getOWLIconProvider().getIcon(cls));
Collection individuals = EntitySearcher.getIndividuals(cls, getOntologies());
for (OWLIndividual ind : individuals) {
if (!ind.isAnonymous()) {
individualsInList.add(ind.asOWLNamedIndividual());
}
}
if (cls.equals(getOWLModelManager().getOWLDataFactory().getOWLThing())) {
individualsInList.addAll(getUntypedIndividuals());
}
}
else {
typeLabel.setIcon(null);
typeLabel.setText("Nothing selected");
individualsInList.addAll(getUntypedIndividuals());
}
reset();
}

代码示例来源:origin: edu.stanford.protege/protege-editor-owl

protected void refill() {
individualsInList.clear();
OWLClass cls = getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass();
if (cls != null) {
typeLabel.setText(getOWLModelManager().getRendering(cls));
typeLabel.setIcon(getOWLWorkspace().getOWLIconProvider().getIcon(cls));
Collection individuals = EntitySearcher.getIndividuals(cls, getOntologies());
for (OWLIndividual ind : individuals) {
if (!ind.isAnonymous()) {
individualsInList.add(ind.asOWLNamedIndividual());
}
}
if (cls.equals(getOWLModelManager().getOWLDataFactory().getOWLThing())) {
individualsInList.addAll(getUntypedIndividuals());
}
}
else {
typeLabel.setIcon(null);
typeLabel.setText("Nothing selected");
individualsInList.addAll(getUntypedIndividuals());
}
reset();
}

推荐阅读
author-avatar
ABC张大脾气
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有