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); }
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; }
@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); }
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); }
@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); } }
@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()); }
public OWLDataRange visit(OWLDataUnionOf node) { throw new IllegalStateException("OR should be broken down at the outermost level"); }
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); }
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); }
public void visit(OWLDataUnionOf dr) { throw new IllegalStateException("Internal error: invalid normal form."); }
public Object visit(OWLDataUnionOf node) { throw new IllegalStateException("Internal error: invalid normal form."); }
@Override public OWLDataUnionOf visit(ElkDataUnionOf expression) { return owlFactory_ .getOWLDataUnionOf(toDataRangeSet(expression.getDataRanges())); }
@SuppressWarnings("static-method") public ElkDataUnionOf convert(OWLDataUnionOf owlDataUnionOf) { return new ElkDataUnionOfWrap<OWLDataUnionOf>(owlDataUnionOf); }
@Override public ElkDataUnionOf visit(OWLDataUnionOf owlDataUnionOf) { return CONVERTER.convert(owlDataUnionOf); }
@Override public O visit(OWLDataUnionOf node) { return doDefault(node); }
@Override public void visit(OWLDataUnionOf node) { handleDefault(node); }
@Override public void visit(OWLDataUnionOf node) { type = AXIOM_TYPE_INDEX_BASE + 5; }
@Override public void visit(OWLDataUnionOf node) { hashCode = primes[77]; hashCode = hashCode * MULT + node.getOperands().hashCode(); }
@Override protected int compareObjectOfSameType(OWLObject object) { OWLDataUnionOf other = (OWLDataUnionOf) object; return compareSets(getOperands(), other.getOperands()); }
@Override public void visit(@Nonnull OWLDataUnionOf node) { for (OWLDataRange dr : node.getOperands()) { dr.accept(this); } }
public Object visit(OWLDataUnionOf node) { profileViolations.add(new UseOfIllegalDataRange(getCurrentOntology(), getCurrentAxiom(), node)); return null; }
@Override protected void writeObject(OWLDataUnionOf object, BinaryOWLOutputStream outputStream) throws IOException { outputStream.writeOWLObjects(object.getOperands()); }
@Override protected OWLDataUnionOf readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException { Set<OWLDataRange> dataRanges = inputStream.readOWLObjects(); return inputStream.getDataFactory().getOWLDataUnionOf(dataRanges); }