本文整理汇总了Java中org.semanticweb.owlapi.model.OWLSameIndividualAxiom类的典型用法代码示例。如果您正苦于以下问题:Java OWLSameIndividualAxiom类的具体用法?Java OWLSameIndividualAxiom怎么用?Java OWLSameIndividualAxiom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLSameIndividualAxiom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLSameIndividualAxiom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSameIndividuals
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
public Node<OWLNamedIndividual> getSameIndividuals(OWLNamedIndividual ind) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
ensurePrepared();
Set<OWLNamedIndividual> inds = new HashSet<OWLNamedIndividual>();
Set<OWLSameIndividualAxiom> processed = new HashSet<OWLSameIndividualAxiom>();
List<OWLNamedIndividual> stack = new ArrayList<OWLNamedIndividual>();
stack.add(ind);
while (!stack.isEmpty()) {
OWLNamedIndividual currentInd = stack.remove(0);
for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
for (OWLSameIndividualAxiom axiom : ontology.getSameIndividualAxioms(currentInd)) {
if (!processed.contains(axiom)) {
processed.add(axiom);
for (OWLIndividual i : axiom.getIndividuals()) {
if (!i.isAnonymous()) {
OWLNamedIndividual namedInd = i.asOWLNamedIndividual();
if (!inds.contains(namedInd)) {
inds.add(namedInd);
stack.add(namedInd);
}
}
}
}
}
}
}
return new OWLNamedIndividualNode(inds);
}
示例2: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public T visit(OWLSameIndividualAxiom axiom) {
throw new IllegalArgumentException(
OWLSameIndividualAxiom.class.getSimpleName()
+ " cannot be converted to "
+ getTargetClass().getSimpleName());
}
示例3: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public Set<ComplexIntegerAxiom> visit(OWLSameIndividualAxiom axiom) {
Objects.requireNonNull(axiom);
Set<OWLIndividual> individualSet = axiom.getIndividuals();
Set<Integer> individualIdSet = new HashSet<>();
individualSet.forEach(individual -> individualIdSet.add(translateIndividual(individual)));
ComplexIntegerAxiom ret = getAxiomFactory().createSameIndividualAxiom(individualIdSet,
translateAnnotations(axiom.getAnnotations()));
return Collections.singleton(ret);
}
示例4: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public Void visit(OWLSameIndividualAxiom axiom) {
List<Long> nodes = transform(axiom.getIndividualsAsList(), new Function<OWLIndividual, Long>() {
@Override
public Long apply(OWLIndividual individual) {
return getOrCreateNode(getIri(individual));
}
});
getOrCreateRelationshipPairwise(nodes, OwlRelationships.OWL_SAME_AS);
return null;
}
示例5: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public void visit(@Nonnull OWLSameIndividualAxiom axiom) {
for (OWLIndividual ind : axiom.getIndividuals()) {
ind.accept(this);
}
processAxiomAnnotations(axiom);
}
示例6: getAxiomWithoutAnnotations
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public OWLSameIndividualAxiom getAxiomWithoutAnnotations() {
if (!isAnnotated()) {
return this;
}
return new OWLSameIndividualAxiomImpl(getIndividuals(), NO_ANNOTATIONS);
}
示例7: asPairwiseAxioms
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public Set<OWLSameIndividualAxiom> asPairwiseAxioms() {
List<OWLIndividual> inds = getIndividualsAsList();
Set<OWLSameIndividualAxiom> result = new HashSet<>();
for (int i = 0; i < inds.size() - 1; i++) {
OWLIndividual indI = inds.get(i);
OWLIndividual indJ = inds.get(i + 1);
result.add(new OWLSameIndividualAxiomImpl(new HashSet<>(Arrays
.asList(indI, indJ)), NO_ANNOTATIONS));
}
return result;
}
示例8: splitToAnnotatedPairs
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public Set<OWLSameIndividualAxiom> splitToAnnotatedPairs() {
List<OWLIndividual> individuals = getIndividualsAsList();
if (individuals.size() == 2) {
return Collections.<OWLSameIndividualAxiom> singleton(this);
}
Set<OWLSameIndividualAxiom> result = new HashSet<>();
for (int i = 0; i < individuals.size() - 1; i++) {
OWLIndividual indI = individuals.get(i);
OWLIndividual indJ = individuals.get(i + 1);
result.add(new OWLSameIndividualAxiomImpl(new HashSet<>(Arrays
.asList(indI, indJ)), getAnnotations()));
}
return result;
}
示例9: equals
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
return obj instanceof OWLSameIndividualAxiom;
}
示例10: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
public void visit(OWLSameIndividualAxiom axiom) {
notSupported(axiom);
}
示例11: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
public void visit(OWLSameIndividualAxiom object) {
}
示例12: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
public void visit(OWLSameIndividualAxiom axiom) {
if (axiom.containsAnonymousIndividuals())
throw new IllegalArgumentException("The axiom "+axiom+" contains anonymous individuals, which is not allowed in OWL 2. ");
addFact(axiom);
}
示例13: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
public void visit(OWLSameIndividualAxiom object) {
OWLIndividual[] individuals=new OWLIndividual[object.getIndividuals().size()];
object.getIndividuals().toArray(individuals);
for (int i=0;i<individuals.length-1;i++)
m_positiveFacts.add(Atom.create(Equality.create(),getIndividual(individuals[i]),getIndividual(individuals[i+1])));
}
示例14: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
public void visit(OWLSameIndividualAxiom axiom) {
}
示例15: visit
import org.semanticweb.owlapi.model.OWLSameIndividualAxiom; //导入依赖的package包/类
@Override
public OWLSameIndividualAxiom visit(ElkSameIndividualAxiom axiom) {
return owlFactory_.getOWLSameIndividualAxiom(
toIndividualSet(axiom.getIndividuals()));
}