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(":DatatypeIntersectionOf_Datatype1", pm); OWLDatatype d2 = factory.getOWLDatatype(":DatatypeIntersectionOf_Datatype2", pm); OWLDataIntersectionOf intersection = factory.getOWLDataIntersectionOf(d1, d2); OWLDataProperty property = factory.getOWLDataProperty(":datatypeIntersectionOfProperty", pm); addToGenericDomainAndNewRange(property, intersection); }
@Override public void addToOntology() { OWLDatatype d1 = OWL2Datatype.XSD_STRING.getDatatype(factory); OWLDatatype d2 = OWL2Datatype.XSD_DATE_TIME.getDatatype(factory); OWLDataIntersectionOf intersection = factory.getOWLDataIntersectionOf(d1, d2); OWLDataProperty property = factory.getOWLDataProperty(":datatypeIntersectionOfProperty_OWL2", pm); addToGenericDomainAndNewRange(property, intersection); }
public OWLDataRange visit(OWLDataIntersectionOf object) { OWLDataRange definition=getDefinitionFor(object,m_alreadyExists); if (!m_alreadyExists[0]) for (OWLDataRange description : object.getOperands()) m_newDataRangeInclusions.add(new OWLDataRange[] { negative(definition),description }); return definition; }
public OWLDataRange visit(OWLDataIntersectionOf range) { Set<OWLDataRange> newConjuncts=new HashSet<OWLDataRange>(); for (OWLDataRange dr : range.getOperands()) { OWLDataRange drSimplified=getSimplified(dr); if (drSimplified.isTopDatatype()) continue; else if (drSimplified instanceof OWLDataIntersectionOf) newConjuncts.addAll(((OWLDataIntersectionOf)drSimplified).getOperands()); else newConjuncts.add(drSimplified); } return m_factory.getOWLDataIntersectionOf(newConjuncts); }
@Override public OWLDataRange visit(OWLDataIntersectionOf node) { Set<OWLDataRange> ops = new HashSet<>(); for (OWLDataRange op : node.getOperands()) { ops.add(op.accept(this)); } if (negated) { return dataFactory.getOWLDataUnionOf(ops); } else { return dataFactory.getOWLDataIntersectionOf(ops); } }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof OWLDataIntersectionOf)) { return false; } OWLDataIntersectionOf other = (OWLDataIntersectionOf) obj; return getOperands().equals(other.getOperands()); }
public OWLDataRange visit(OWLDataIntersectionOf range) { Set<OWLDataRange> newConjuncts=new HashSet<OWLDataRange>(); for (OWLDataRange dr : range.getOperands()) newConjuncts.add(getNNF(dr)); return m_factory.getOWLDataIntersectionOf(newConjuncts); }
public OWLDataRange visit(OWLDataIntersectionOf range) { Set<OWLDataRange> newDisjuncts=new HashSet<OWLDataRange>(); for (OWLDataRange dr : range.getOperands()) newDisjuncts.add(getComplementNNF(dr)); return m_factory.getOWLDataUnionOf(newDisjuncts); }
public void visit(OWLDataIntersectionOf dr) { throw new IllegalStateException("Internal error: invalid normal form."); }
public Object visit(OWLDataIntersectionOf node) { throw new IllegalStateException("Internal error: invalid normal form."); }
@Override public OWLDataIntersectionOf visit(ElkDataIntersectionOf expression) { return owlFactory_.getOWLDataIntersectionOf( toDataRangeSet(expression.getDataRanges())); }
@SuppressWarnings("static-method") public ElkDataIntersectionOf convert( OWLDataIntersectionOf owlDataIntersectionOf) { return new ElkDataIntersectionOfWrap<OWLDataIntersectionOf>( owlDataIntersectionOf); }
@Override public ElkDataIntersectionOf visit( OWLDataIntersectionOf owlDataIntersectionOf) { return CONVERTER.convert(owlDataIntersectionOf); }
@Override public O visit(OWLDataIntersectionOf node) { return doDefault(node); }
@Override public void visit(OWLDataIntersectionOf node) { handleDefault(node); }
@Override public void visit(OWLDataIntersectionOf node) { type = DATA_TYPE_INDEX_BASE + 4; }
@Override public void visit(OWLDataIntersectionOf node) { hashCode = primes[76]; hashCode = hashCode * MULT + node.getOperands().hashCode(); }
@Override public void visit(@Nonnull OWLDataIntersectionOf node) { for (OWLDataRange dr : node.getOperands()) { dr.accept(this); } }
@Override protected int compareObjectOfSameType(OWLObject object) { OWLDataIntersectionOf other = (OWLDataIntersectionOf) object; return compareSets(getOperands(), other.getOperands()); }
@Override protected void writeObject(OWLDataIntersectionOf object, BinaryOWLOutputStream outputStream) throws IOException { outputStream.writeOWLObjects(object.getOperands()); }
@Override protected OWLDataIntersectionOf readObject(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException { Set<OWLDataRange> dataRanges = inputStream.readOWLObjects(); return inputStream.getDataFactory().getOWLDataIntersectionOf(dataRanges); }