作者:ABC张大脾气 | 来源:互联网 | 2023-10-13 07:41
本文整理了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();
}