Java 类org.semanticweb.owlapi.model.OWLDifferentIndividualsAxiom 实例源码

项目:HermiT-android    文件:EntailmentChecker.java   
public Boolean visit(OWLDifferentIndividualsAxiom axiom) {
    // see OWL 2 Syntax, Sec 11.2
    // No axiom in Ax of the following form contains anonymous individuals:
    // SameIndividual, DifferentIndividuals, NegativeObjectPropertyAssertion, and NegativeDataPropertyAssertion.
    ArrayList<OWLIndividual> list=new ArrayList<OWLIndividual>(axiom.getIndividuals());
    for (OWLIndividual i : list) {
        if (i.isAnonymous()) {
            throw new IllegalArgumentException("OWLDifferentIndividualsAxiom axioms are not allowed to be used "+"with anonymous individuals (see OWL 2 Syntax Sec 11.2) but the axiom "+axiom+" cotains an anonymous individual. ");
        }
    }
    for (int i=0;i<list.size()-1;i++) {
        OWLNamedIndividual head=list.get(i).asOWLNamedIndividual();
        for (int j=i+1;j<list.size();j++) {
            OWLNamedIndividual next=list.get(j).asOWLNamedIndividual();
            if (!reasoner.hasType(head,factory.getOWLObjectComplementOf(factory.getOWLObjectOneOf(next)),false))
                return Boolean.FALSE;
        }
    }
    return Boolean.TRUE;
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
public Boolean visit(OWLDifferentIndividualsAxiom axiom) {
    // see OWL 2 Syntax, Sec 11.2
    // No axiom in Ax of the following form contains anonymous individuals:
    // SameIndividual, DifferentIndividuals, NegativeObjectPropertyAssertion, and NegativeDataPropertyAssertion.
    ArrayList<OWLIndividual> list=new ArrayList<OWLIndividual>(axiom.getIndividuals());
    for (OWLIndividual i : list) {
        if (i.isAnonymous()) {
            throw new IllegalArgumentException("OWLDifferentIndividualsAxiom axioms are not allowed to be used "+"with anonymous individuals (see OWL 2 Syntax Sec 11.2) but the axiom "+axiom+" cotains an anonymous individual. ");
        }
    }
    for (int i=0;i<list.size()-1;i++) {
        OWLNamedIndividual head=list.get(i).asOWLNamedIndividual();
        for (int j=i+1;j<list.size();j++) {
            OWLNamedIndividual next=list.get(j).asOWLNamedIndividual();
            if (!reasoner.hasType(head,factory.getOWLObjectComplementOf(factory.getOWLObjectOneOf(next)),false))
                return Boolean.FALSE;
        }
    }
    return Boolean.TRUE;
}
项目:HermiT-android    文件:OWLClausification.java   
public void visit(OWLDifferentIndividualsAxiom object) {
    OWLIndividual[] individuals=new OWLIndividual[object.getIndividuals().size()];
    object.getIndividuals().toArray(individuals);
    for (int i=0;i<individuals.length;i++)
        for (int j=i+1;j<individuals.length;j++)
            m_positiveFacts.add(Atom.create(Inequality.create(),getIndividual(individuals[i]),getIndividual(individuals[j])));
}
项目:HermiT-android    文件:ReducedABoxOnlyClausification.java   
public void visit(OWLDifferentIndividualsAxiom object) {
    OWLIndividual[] individuals=new OWLIndividual[object.getIndividuals().size()];
    object.getIndividuals().toArray(individuals);
    for (int i=0;i<individuals.length;i++)
        for (int j=i+1;j<individuals.length;j++)
            m_positiveFacts.add(Atom.create(Inequality.create(),getIndividual(individuals[i]),getIndividual(individuals[j])));
}
项目:elk-reasoner    文件:AbstractOwlAxiomConverterVisitor.java   
@Override
public T visit(OWLDifferentIndividualsAxiom axiom) {
    throw new IllegalArgumentException(
            OWLDifferentIndividualsAxiom.class.getSimpleName()
                    + " cannot be converted to "
                    + getTargetClass().getSimpleName());
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public void visit(OWLDifferentIndividualsAxiom object) {
    OWLIndividual[] individuals=new OWLIndividual[object.getIndividuals().size()];
    object.getIndividuals().toArray(individuals);
    for (int i=0;i<individuals.length;i++)
        for (int j=i+1;j<individuals.length;j++)
            m_positiveFacts.add(Atom.create(Inequality.create(),getIndividual(individuals[i]),getIndividual(individuals[j])));
}
项目:Hermit_1.3.8_android    文件:ReducedABoxOnlyClausification.java   
public void visit(OWLDifferentIndividualsAxiom object) {
    OWLIndividual[] individuals=new OWLIndividual[object.getIndividuals().size()];
    object.getIndividuals().toArray(individuals);
    for (int i=0;i<individuals.length;i++)
        for (int j=i+1;j<individuals.length;j++)
            m_positiveFacts.add(Atom.create(Inequality.create(),getIndividual(individuals[i]),getIndividual(individuals[j])));
}
项目:jcel    文件:AxiomTranslator.java   
@Override
public Set<ComplexIntegerAxiom> visit(OWLDifferentIndividualsAxiom axiom) {
    Objects.requireNonNull(axiom);
    Set<OWLIndividual> individualSet = axiom.getIndividuals();
    Set<Integer> individualIdSet = new HashSet<>();
    individualSet.forEach(individual -> {
        getTranslationRepository().addNamedIndividual(individual.asOWLNamedIndividual());
        individualIdSet.add(translateIndividual(individual));
    });
    ComplexIntegerAxiom ret = getAxiomFactory().createDifferentIndividualsAxiom(individualIdSet,
            translateAnnotations(axiom.getAnnotations()));
    return Collections.singleton(ret);
}
项目:SciGraph    文件:GraphOwlVisitor.java   
@Override
public Void visit(OWLDifferentIndividualsAxiom 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_DIFFERENT_FROM);
  return null;
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull OWLDifferentIndividualsAxiom axiom) {
    for (OWLIndividual ind : axiom.getIndividuals()) {
        ind.accept(this);
    }
    processAxiomAnnotations(axiom);
}
项目:owlapi-gwt    文件:OWLDifferentIndividualsAxiomImpl.java   
@Override
public OWLDifferentIndividualsAxiom getAxiomWithoutAnnotations() {
    if (!isAnnotated()) {
        return this;
    }
    return new OWLDifferentIndividualsAxiomImpl(getIndividuals(),
            NO_ANNOTATIONS);
}
项目:owlapi-gwt    文件:OWLDifferentIndividualsAxiomImpl.java   
@Override
public Set<OWLDifferentIndividualsAxiom> asPairwiseAxioms() {
    List<OWLIndividual> individuals = getIndividualsAsList();
    Set<OWLDifferentIndividualsAxiom> result = new HashSet<>();
    for (int i = 0; i < individuals.size() - 1; i++) {
        for (int j = i + 1; j < individuals.size(); j++) {
            OWLIndividual indI = individuals.get(i);
            OWLIndividual indJ = individuals.get(j);
            result.add(new OWLDifferentIndividualsAxiomImpl(new HashSet<>(
                    Arrays.asList(indI, indJ)), NO_ANNOTATIONS));
        }
    }
    return result;
}
项目:owlapi-gwt    文件:OWLDifferentIndividualsAxiomImpl.java   
@Override
public Set<OWLDifferentIndividualsAxiom> splitToAnnotatedPairs() {
    List<OWLIndividual> individuals = getIndividualsAsList();
    if (individuals.size() == 2) {
        return Collections.<OWLDifferentIndividualsAxiom> singleton(this);
    }
    Set<OWLDifferentIndividualsAxiom> 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 OWLDifferentIndividualsAxiomImpl(new HashSet<>(
                Arrays.asList(indI, indJ)), getAnnotations()));
    }
    return result;
}
项目:owlapi-gwt    文件:OWLDifferentIndividualsAxiomImpl.java   
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!super.equals(obj)) {
        return false;
    }
    return obj instanceof OWLDifferentIndividualsAxiom;
}
项目:jopa    文件:IntegrityConstraintParser.java   
public void visit(OWLDifferentIndividualsAxiom axiom) {
    notSupported(axiom);
}
项目:HermiT-android    文件:BuiltInPropertyManager.java   
public void visit(OWLDifferentIndividualsAxiom object) {
}
项目:HermiT-android    文件:OWLNormalization.java   
public void visit(OWLDifferentIndividualsAxiom axiom) {
    if (axiom.containsAnonymousIndividuals())
        throw new IllegalArgumentException("The axiom "+axiom+" contains anonymous individuals, which is not allowed in OWL 2. ");
    addFact(axiom);
}
项目:HermiT-android    文件:EntailmentChecker.java   
public void visit(OWLDifferentIndividualsAxiom axiom) {
}
项目:elk-reasoner    文件:AbstractElkObjectConverter.java   
@Override
public OWLDifferentIndividualsAxiom visit(
        ElkDifferentIndividualsAxiom axiom) {
    return owlFactory_.getOWLDifferentIndividualsAxiom(
            toIndividualSet(axiom.getIndividuals()));
}
项目:elk-reasoner    文件:OwlConverter.java   
@SuppressWarnings("static-method")
public ElkDifferentIndividualsAxiom convert(
        OWLDifferentIndividualsAxiom owlDifferentIndividualsAxiom) {
    return new ElkDifferentIndividualsAxiomWrap<OWLDifferentIndividualsAxiom>(
            owlDifferentIndividualsAxiom);
}
项目:elk-reasoner    文件:OwlAxiomConverterVisitor.java   
@Override
public ElkAxiom visit(OWLDifferentIndividualsAxiom axiom) {
    return CONVERTER.convert(axiom);
}
项目:elk-reasoner    文件:OwlIndividualAxiomConverterVisitor.java   
@Override
public ElkAssertionAxiom visit(OWLDifferentIndividualsAxiom axiom) {
    return CONVERTER.convert(axiom);
}
项目:elk-reasoner    文件:FailingOwlAxiomVisitor.java   
@Override
public void visit(OWLDifferentIndividualsAxiom axiom) {
    defaultVisit(axiom);
}
项目:Hermit_1.3.8_android    文件:BuiltInPropertyManager.java   
public void visit(OWLDifferentIndividualsAxiom object) {
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(OWLDifferentIndividualsAxiom axiom) {
    if (axiom.containsAnonymousIndividuals())
        throw new IllegalArgumentException("The axiom "+axiom+" contains anonymous individuals, which is not allowed in OWL 2. ");
    addFact(axiom);
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
public void visit(OWLDifferentIndividualsAxiom axiom) {
}
项目:owltools    文件:AxiomAnnotationTools.java   
@Override
public OWLAxiom visit(OWLDifferentIndividualsAxiom axiom) {
    return factory.getOWLDifferentIndividualsAxiom(axiom.getIndividuals(), annotations);
}
项目:owltools    文件:CardinalityContraintsTools.java   
@Override
public void visit(OWLDifferentIndividualsAxiom axiom) {
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(OWLDifferentIndividualsAxiom axiom) {
    if (axiom.containsAnonymousIndividuals())
        throw new IllegalArgumentException("The axiom "+axiom+" contains anonymous individuals, which is not allowed in OWL 2. ");
    addFact(axiom);
}
项目:born    文件:CycleDetector.java   
@Override
public Boolean visit(OWLDifferentIndividualsAxiom axiom) {
    return true;
}
项目:born    文件:ElAxiomFilter.java   
@Override
public Boolean visit(OWLDifferentIndividualsAxiom axiom) {
    return false;
}
项目:born    文件:AnnotationProcessor.java   
@Override
public Boolean visit(OWLDifferentIndividualsAxiom axiom) {
    Objects.requireNonNull(axiom);
    return add(this.df.getOWLDifferentIndividualsAxiom(axiom.getIndividuals(), reg(axiom.getAnnotations())));
}
项目:born    文件:AnnotationCreator.java   
@Override
public Boolean visit(OWLDifferentIndividualsAxiom axiom) {
    Objects.requireNonNull(axiom);
    return add(this.df.getOWLDifferentIndividualsAxiom(axiom.getIndividuals(), empty()));
}
项目:semantika    文件:TMappingProcessor.java   
@Override
public void visit(OWLDifferentIndividualsAxiom axiom)
{
   ignoreOwlAxiom("DifferentIndividualsAxiom", axiom);
}
项目:OWL2SPARQL    文件:OWLAxiomToSPARQLConverter.java   
@Override
public void visit(OWLDifferentIndividualsAxiom axiom) {
    aBoxAxiomsNotSupportedWarning(axiom);
}
项目:owlapi-gwt    文件:OWLObjectVisitorExAdapter.java   
@Override
public O visit(OWLDifferentIndividualsAxiom axiom) {
    return doDefault(axiom);
}
项目:owlapi-gwt    文件:OWLObjectTypeIndexProvider.java   
@Override
public void visit(OWLDifferentIndividualsAxiom axiom) {
    type = AXIOM_TYPE_INDEX_BASE + axiom.getAxiomType().getIndex();
}
项目:owlapi-gwt    文件:NNF.java   
@Override
public OWLAxiom visit(OWLDifferentIndividualsAxiom axiom) {
    return axiom;
}
项目:owlapi-gwt    文件:HashCode.java   
@Override
public void visit(OWLDifferentIndividualsAxiom axiom) {
    hashCode = primes[7];
    hashCode = hashCode * MULT + axiom.getIndividuals().hashCode();
    hashCode = hashCode * MULT + axiom.getAnnotations().hashCode();
}
项目:owlapi-gwt    文件:OWLAxiomVisitorAdapter.java   
@Override
public void visit(OWLDifferentIndividualsAxiom axiom) {
    handleDefault(axiom);
}