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

项目:HermiT-android    文件:OWLNormalization.java   
public void visit(SWRLDataRangeAtom at) {
    OWLDataRange dr=at.getPredicate();
    SWRLDArgument argument=at.getArgument();
    if (!(argument instanceof SWRLVariable))
        throw new IllegalArgumentException("A SWRL rule contains a data range with an argument that is not a literal, and such rules are not supported.");
    if (!m_isPositive)
        dr=m_factory.getOWLDataComplementOf(dr);
    dr=m_expressionManager.getNNF(m_expressionManager.getSimplified(dr));
    if (dr instanceof OWLDataIntersectionOf || dr instanceof OWLDataUnionOf) {
        OWLDatatype definition=getDefinitionFor(dr,m_alreadyExists);
        if (!m_alreadyExists[0])
            m_dataRangeInclusions.add(new OWLDataRange[] { negative(definition),dr });
        dr=definition;
    }
    SWRLAtom atom=m_factory.getSWRLDataRangeAtom(dr,argument);
    m_normalizedHeadAtoms.add(atom);
    m_headDataRangeVariables.add((SWRLVariable)argument);
}
项目:HermiT-android    文件:EntailmentChecker.java   
public Boolean visit(OWLDatatypeDefinitionAxiom axiom) {
    reasoner.throwInconsistentOntologyExceptionIfNecessary();
    if (!reasoner.isConsistent())
        return true;
    if (reasoner.m_dlOntology.hasDatatypes()) {
        OWLDataFactory factory=reasoner.getDataFactory();
        OWLIndividual freshIndividual=factory.getOWLAnonymousIndividual("fresh-individual");
        OWLDataProperty freshDataProperty=factory.getOWLDataProperty(IRI.create("fresh-data-property"));
        OWLDataRange dataRange=axiom.getDataRange();
        OWLDatatype dt=axiom.getDatatype();
        OWLDataIntersectionOf dr1=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dataRange),dt);
        OWLDataIntersectionOf dr2=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dt),dataRange);
        OWLDataUnionOf union=factory.getOWLDataUnionOf(dr1,dr2);
        OWLClassExpression c=factory.getOWLDataSomeValuesFrom(freshDataProperty,union);
        OWLClassAssertionAxiom ax=factory.getOWLClassAssertionAxiom(c,freshIndividual);
        Tableau tableau=reasoner.getTableau(ax);
        return !tableau.isSatisfiable(true,true,null,null,null,null,null,ReasoningTaskDescription.isAxiomEntailed(axiom));
    }
    else
        return false;
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public void visit(SWRLDataRangeAtom at) {
    OWLDataRange dr=at.getPredicate();
    SWRLDArgument argument=at.getArgument();
    if (!(argument instanceof SWRLVariable))
        throw new IllegalArgumentException("A SWRL rule contains a data range with an argument that is not a literal, and such rules are not supported.");
    if (!m_isPositive)
        dr=m_factory.getOWLDataComplementOf(dr);
    dr=m_expressionManager.getNNF(m_expressionManager.getSimplified(dr));
    if (dr instanceof OWLDataIntersectionOf || dr instanceof OWLDataUnionOf) {
        OWLDatatype definition=getDefinitionFor(dr,m_alreadyExists);
        if (!m_alreadyExists[0])
            m_dataRangeInclusions.add(new OWLDataRange[] { negative(definition),dr });
        dr=definition;
    }
    SWRLAtom atom=m_factory.getSWRLDataRangeAtom(dr,argument);
    m_normalizedHeadAtoms.add(atom);
    m_headDataRangeVariables.add((SWRLVariable)argument);
}
项目:Hermit_1.3.8_android    文件:EntailmentChecker.java   
public Boolean visit(OWLDatatypeDefinitionAxiom axiom) {
    reasoner.throwInconsistentOntologyExceptionIfNecessary();
    if (!reasoner.isConsistent())
        return true;
    if (reasoner.m_dlOntology.hasDatatypes()) {
        OWLDataFactory factory=reasoner.getDataFactory();
        OWLIndividual freshIndividual=factory.getOWLAnonymousIndividual("fresh-individual");
        OWLDataProperty freshDataProperty=factory.getOWLDataProperty(IRI.create("fresh-data-property"));
        OWLDataRange dataRange=axiom.getDataRange();
        OWLDatatype dt=axiom.getDatatype();
        OWLDataIntersectionOf dr1=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dataRange),dt);
        OWLDataIntersectionOf dr2=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dt),dataRange);
        OWLDataUnionOf union=factory.getOWLDataUnionOf(dr1,dr2);
        OWLClassExpression c=factory.getOWLDataSomeValuesFrom(freshDataProperty,union);
        OWLClassAssertionAxiom ax=factory.getOWLClassAssertionAxiom(c,freshIndividual);
        Tableau tableau=reasoner.getTableau(ax);
        return !tableau.isSatisfiable(true,true,null,null,null,null,null,ReasoningTaskDescription.isAxiomEntailed(axiom));
    }
    else
        return false;
}
项目:Wolpertinger    文件:OWLNormalization.java   
public void visit(SWRLDataRangeAtom at) {
    OWLDataRange dr=at.getPredicate();
    SWRLDArgument argument=at.getArgument();
    if (!(argument instanceof SWRLVariable))
        throw new IllegalArgumentException("A SWRL rule contains a data range with an argument that is not a literal, and such rules are not supported.");
    if (!m_isPositive)
        dr=m_factory.getOWLDataComplementOf(dr);
    dr=m_expressionManager.getNNF(m_expressionManager.getSimplified(dr));
    if (dr instanceof OWLDataIntersectionOf || dr instanceof OWLDataUnionOf) {
        OWLDatatype definition=getDefinitionFor(dr,m_alreadyExists);
        if (!m_alreadyExists[0])
            m_dataRangeInclusions.add(new OWLDataRange[] { negative(definition),dr });
        dr=definition;
    }
    SWRLAtom atom=m_factory.getSWRLDataRangeAtom(dr,argument);
    m_normalizedHeadAtoms.add(atom);
    m_headDataRangeVariables.add((SWRLVariable)argument);
}
项目:OntoBench    文件:OwlDataUnionOfFeature.java   
@Override
public void addToOntology() {
  OWLDatatype d1 = factory.getOWLDatatype(":DataUnionOf_Datatype1", pm);
  OWLDatatype d2 = factory.getOWLDatatype(":DataUnionOf_Datatype2", pm);
  OWLDataUnionOf union = factory.getOWLDataUnionOf(d1, d2);

  OWLDataProperty property = factory.getOWLDataProperty(":DataUnionOf", pm);
  addToGenericDomainAndNewRange(property, union);
}
项目:HermiT-android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
    Set<OWLDataRange> newDisjuncts=new HashSet<OWLDataRange>();
    for (OWLDataRange dr : range.getOperands()) {
        OWLDataRange drSimplified=getSimplified(dr);
        if (drSimplified.isTopDatatype())
            return m_factory.getTopDatatype();
        else if (drSimplified instanceof OWLDataUnionOf)
            newDisjuncts.addAll(((OWLDataUnionOf)drSimplified).getOperands());
        else
            newDisjuncts.add(drSimplified);
    }
    return m_factory.getOWLDataUnionOf(newDisjuncts);
}
项目:Hermit_1.3.8_android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
    Set<OWLDataRange> newDisjuncts=new HashSet<OWLDataRange>();
    for (OWLDataRange dr : range.getOperands()) {
        OWLDataRange drSimplified=getSimplified(dr);
        if (drSimplified.isTopDatatype())
            return m_factory.getTopDatatype();
        else if (drSimplified instanceof OWLDataUnionOf)
            newDisjuncts.addAll(((OWLDataUnionOf)drSimplified).getOperands());
        else
            newDisjuncts.add(drSimplified);
    }
    return m_factory.getOWLDataUnionOf(newDisjuncts);
}
项目:Wolpertinger    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
    Set<OWLDataRange> newDisjuncts=new HashSet<OWLDataRange>();
    for (OWLDataRange dr : range.getOperands()) {
        OWLDataRange drSimplified=getSimplified(dr);
        if (drSimplified.isTopDatatype())
            return m_factory.getTopDatatype();
        else if (drSimplified instanceof OWLDataUnionOf)
            newDisjuncts.addAll(((OWLDataUnionOf)drSimplified).getOperands());
        else
            newDisjuncts.add(drSimplified);
    }
    return m_factory.getOWLDataUnionOf(newDisjuncts);
}
项目:owlapi-gwt    文件:NNF.java   
@Override
public OWLDataRange visit(OWLDataUnionOf node) {
    Set<OWLDataRange> ops = new HashSet<>();
    for (OWLDataRange op : node.getOperands()) {
        ops.add(op.accept(this));
    }
    if (negated) {
        // Flip to an intersection
        return dataFactory.getOWLDataIntersectionOf(ops);
    } else {
        return dataFactory.getOWLDataUnionOf(ops);
    }
}
项目:owlapi-gwt    文件:OWLDataUnionOfImpl.java   
@Override
public boolean equals(Object obj) {
    if (obj == this) {
        return true;
    }
    if (!(obj instanceof OWLDataUnionOf)) {
        return false;
    }
    OWLDataUnionOf other = (OWLDataUnionOf) obj;
    return getOperands().equals(other.getOperands());
}
项目:HermiT-android    文件:OWLNormalization.java   
public OWLDataRange visit(OWLDataUnionOf node) {
    throw new IllegalStateException("OR should be broken down at the outermost level");
}
项目:HermiT-android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
   Set<OWLDataRange> newDisjuncts=new HashSet<OWLDataRange>();
   for (OWLDataRange dr : range.getOperands())
       newDisjuncts.add(getNNF(dr));
   return m_factory.getOWLDataUnionOf(newDisjuncts);
}
项目:HermiT-android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
   Set<OWLDataRange> newConjuncts=new HashSet<OWLDataRange>();
   for (OWLDataRange dr : range.getOperands())
       newConjuncts.add(getComplementNNF(dr));
   return m_factory.getOWLDataIntersectionOf(newConjuncts);
}
项目:HermiT-android    文件:OWLClausification.java   
public void visit(OWLDataUnionOf dr) {
    throw new IllegalStateException("Internal error: invalid normal form.");
}
项目:HermiT-android    文件:OWLClausification.java   
public Object visit(OWLDataUnionOf node) {
    throw new IllegalStateException("Internal error: invalid normal form.");
}
项目:elk-reasoner    文件:AbstractElkObjectConverter.java   
@Override
public OWLDataUnionOf visit(ElkDataUnionOf expression) {
    return owlFactory_
            .getOWLDataUnionOf(toDataRangeSet(expression.getDataRanges()));
}
项目:elk-reasoner    文件:OwlConverter.java   
@SuppressWarnings("static-method")
public ElkDataUnionOf convert(OWLDataUnionOf owlDataUnionOf) {
    return new ElkDataUnionOfWrap<OWLDataUnionOf>(owlDataUnionOf);
}
项目:elk-reasoner    文件:OwlDataRangeConverterVisitor.java   
@Override
public ElkDataUnionOf visit(OWLDataUnionOf owlDataUnionOf) {
    return CONVERTER.convert(owlDataUnionOf);
}
项目:Hermit_1.3.8_android    文件:OWLNormalization.java   
public OWLDataRange visit(OWLDataUnionOf node) {
    throw new IllegalStateException("OR should be broken down at the outermost level");
}
项目:Hermit_1.3.8_android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
   Set<OWLDataRange> newDisjuncts=new HashSet<OWLDataRange>();
   for (OWLDataRange dr : range.getOperands())
       newDisjuncts.add(getNNF(dr));
   return m_factory.getOWLDataUnionOf(newDisjuncts);
}
项目:Hermit_1.3.8_android    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
   Set<OWLDataRange> newConjuncts=new HashSet<OWLDataRange>();
   for (OWLDataRange dr : range.getOperands())
       newConjuncts.add(getComplementNNF(dr));
   return m_factory.getOWLDataIntersectionOf(newConjuncts);
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public void visit(OWLDataUnionOf dr) {
    throw new IllegalStateException("Internal error: invalid normal form.");
}
项目:Hermit_1.3.8_android    文件:OWLClausification.java   
public Object visit(OWLDataUnionOf node) {
    throw new IllegalStateException("Internal error: invalid normal form.");
}
项目:Wolpertinger    文件:OWLNormalization.java   
public OWLDataRange visit(OWLDataUnionOf node) {
    throw new IllegalStateException("OR should be broken down at the outermost level");
}
项目:Wolpertinger    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
   Set<OWLDataRange> newDisjuncts=new HashSet<OWLDataRange>();
   for (OWLDataRange dr : range.getOperands())
       newDisjuncts.add(getNNF(dr));
   return m_factory.getOWLDataUnionOf(newDisjuncts);
}
项目:Wolpertinger    文件:ExpressionManager.java   
public OWLDataRange visit(OWLDataUnionOf range) {
   Set<OWLDataRange> newConjuncts=new HashSet<OWLDataRange>();
   for (OWLDataRange dr : range.getOperands())
       newConjuncts.add(getComplementNNF(dr));
   return m_factory.getOWLDataIntersectionOf(newConjuncts);
}
项目:owlapi-gwt    文件:OWLDataVisitorExAdapter.java   
@Override
public O visit(OWLDataUnionOf node) {
    return doDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectVisitorAdapter.java   
@Override
public void visit(OWLDataUnionOf node) {
    handleDefault(node);
}
项目:owlapi-gwt    文件:OWLObjectTypeIndexProvider.java   
@Override
public void visit(OWLDataUnionOf node) {
    type = AXIOM_TYPE_INDEX_BASE + 5;
}
项目:owlapi-gwt    文件:HashCode.java   
@Override
public void visit(OWLDataUnionOf node) {
    hashCode = primes[77];
    hashCode = hashCode * MULT + node.getOperands().hashCode();
}
项目:owlapi-gwt    文件:OWLDataUnionOfImpl.java   
@Override
protected int compareObjectOfSameType(OWLObject object) {
    OWLDataUnionOf other = (OWLDataUnionOf) object;
    return compareSets(getOperands(), other.getOperands());
}
项目:owlapi-gwt    文件:AbstractEntityRegistrationManager.java   
@Override
public void visit(@Nonnull OWLDataUnionOf node) {
    for (OWLDataRange dr : node.getOperands()) {
        dr.accept(this);
    }
}
项目:SVoNt    文件:PelletOWL2ELProfile.java   
public Object visit(OWLDataUnionOf node) {
  profileViolations.add(new UseOfIllegalDataRange(getCurrentOntology(), getCurrentAxiom(), node));
  return null;
}
项目:binaryowl    文件:OWLDataUnionOfSerializer.java   
@Override
protected void writeObject(OWLDataUnionOf object, BinaryOWLOutputStream outputStream) throws IOException {
    outputStream.writeOWLObjects(object.getOperands());
}
项目:binaryowl    文件:OWLDataUnionOfSerializer.java   
@Override
protected OWLDataUnionOf readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException {
    Set<OWLDataRange> dataRanges = inputStream.readOWLObjects();
    return inputStream.getDataFactory().getOWLDataUnionOf(dataRanges);
}