public void visit(OWLDataMaxCardinality object) { int number=object.getCardinality(); LiteralDataRange negatedDataRange=m_dataRangeConverter.convertDataRange(object.getFiller()).getNegation(); ensureYNotZero(); Variable[] yVars=new Variable[number+1]; for (int i=0;i<yVars.length;i++) { yVars[i]=nextY(); m_bodyAtoms.add(getRoleAtom(object.getProperty(),X,yVars[i])); if (negatedDataRange.isNegatedInternalDatatype()) { InternalDatatype negated=(InternalDatatype)negatedDataRange.getNegation(); if (!negated.isAlwaysTrue()) m_bodyAtoms.add(Atom.create(negated,yVars[i])); } else { if (!negatedDataRange.isAlwaysFalse()) m_headAtoms.add(Atom.create((DLPredicate)negatedDataRange,yVars[i])); } } for (int i=0;i<yVars.length;i++) for (int j=i+1;j<yVars.length;j++) m_headAtoms.add(Atom.create(Equality.INSTANCE,yVars[i],yVars[j])); }
@Override public OWLClassExpression visit(OWLDataMaxCardinality ce) { boolean neg = negated; int card = ce.getCardinality(); if (negated) { card = ce.getCardinality() + 1; } negated = false; OWLDataRange filler = ce.getFiller().accept(this); OWLClassExpression nnf = null; if (neg) { nnf = dataFactory.getOWLDataMinCardinality(card, ce.getProperty(), filler); } else { nnf = dataFactory.getOWLDataMaxCardinality(card, ce.getProperty(), filler); } negated = neg; return nnf; }
@Override public void addToOntology() { OWLDataProperty property = factory.getOWLDataProperty(":dataMaxQualifiedCardinality_RL", pm); OWLDatatype datatype = OWL2Datatype.RDFS_LITERAL.getDatatype(factory); addToGenericDomainAndNewRange(property, datatype); OWLDatatype affectedDatatype = OWL2Datatype.XSD_BYTE.getDatatype(factory); OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(1, property, affectedDatatype); addAxiomToOntology(factory.getOWLSubClassOfAxiom(featurePool.getExclusiveClass(":DataMaxQualifiedCardinalityRange_RL"), cardinality)); }
@Override public void addToOntology() { OWLDataProperty property = factory.getOWLDataProperty(":dataMaxCardinality_RL", pm); OWLDatatype datatype = OWL2Datatype.XSD_FLOAT.getDatatype(factory); addToGenericDomainAndNewRange(property, datatype); OWLClass range = featurePool.getExclusiveClass(":DataMaxCardinalityRange_RL"); OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(1, property); addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality)); }
@Override public void addToOntology() { OWLDataProperty property = factory.getOWLDataProperty(":dataMaxQualifiedCardinality", pm); OWLDatatype datatype = OWL2Datatype.RDFS_LITERAL.getDatatype(factory); addToGenericDomainAndNewRange(property, datatype); OWLDatatype affectedDatatype = OWL2Datatype.XSD_BYTE.getDatatype(factory); OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(18, property, affectedDatatype); addAxiomToOntology(factory.getOWLSubClassOfAxiom(featurePool.getExclusiveClass(":DataMaxQualifiedCardinalityRange"), cardinality)); }
@Override public void addToOntology() { OWLDataProperty property = factory.getOWLDataProperty(":dataMaxCardinality", pm); OWLDatatype datatype = OWL2Datatype.XSD_FLOAT.getDatatype(factory); addToGenericDomainAndNewRange(property, datatype); OWLClass range = featurePool.getExclusiveClass(":DataMaxCardinalityRange"); OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(19, property); addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality)); }
/** * create axioms for class--dataproperty----literal relation. * * @param src * @param dataprop * @param dest * @return */ private void getClass2DataProperty2LiteralAxioms(OWLClass src, OWLDataProperty dataprop, OWLLiteral dest) { // Set<OWLAxiom> tmpaxioms = new HashSet<OWLAxiom>(); OWLAxiom axiom; OWLDataSomeValuesFrom owlDataSomeValuesFrom; OWLDataHasValue owlLDataHasValue; OWLDataMaxCardinality owlDataMaxCardinality; OWLDataOneOf owldataOneOf; // set domain and range // scoped domain if (editor.isGenerateDomainAxiom()) { owlLDataHasValue = owlDataFactory.getOWLDataHasValue(dataprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlLDataHasValue, src); domainAndRangeAxioms.add(axiom); owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, owlDataFactory.getTopDatatype()); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataSomeValuesFrom, src); domainAndRangeAxioms.add(axiom); } if (editor.isGenerateCardinalityAxiom()) { owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop, owlDataFactory.getTopDatatype()); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataMaxCardinality); cardinalityAxioms.add(axiom); // need to verify with Adila owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop, owlDataFactory.getTopDatatype()); axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataMaxCardinality); cardinalityAxioms.add(axiom); } // return tmpaxioms; }
public void visit(OWLDataMaxCardinality arg0) { try { final OWLDatatype dt = Utils.ensureDatatype(arg0.getFiller()); final OWLDataProperty dp = Utils.ensureDataProperty(arg0 .getProperty()); integrityConstraints.add(integrityConstraintFactory .MaxDataParticipationConstraint(subjClass, dp, dt, arg0.getCardinality())); } catch (UnsupportedICException e) { notSupported(arg0); } }
public OWLClassExpression visit(OWLDataMaxCardinality object) { OWLDataRange filler=object.getFiller(); OWLDataPropertyExpression prop=object.getProperty(); if (prop.isOWLTopDataProperty()) throwInvalidTopDPUseError(object); if (isLiteral(filler)) return m_factory.getOWLDataMaxCardinality(object.getCardinality(),prop,filler); else { OWLDataRange complementDescription=m_expressionManager.getComplementNNF(filler); OWLDatatype definition=getDefinitionFor(complementDescription,m_alreadyExists); if (!m_alreadyExists[0]) m_newDataRangeInclusions.add(new OWLDataRange[] { negative(definition),filler }); return m_factory.getOWLDataMaxCardinality(object.getCardinality(),prop,m_expressionManager.getComplementNNF(definition)); } }
public OWLClassExpression visit(OWLDataMaxCardinality d) { OWLDataRange filler=getSimplified(d.getFiller()); if (isBottomDataRange(filler)) return m_factory.getOWLThing(); else if (d.getCardinality()<=0) return m_factory.getOWLDataAllValuesFrom(d.getProperty(),m_factory.getOWLDataComplementOf(filler)); else return m_factory.getOWLDataMaxCardinality(d.getCardinality(),d.getProperty(),filler); }
public OWLClassExpression visit(OWLDataExactCardinality d) { OWLDataRange filler=getSimplified(d.getFiller()); if (d.getCardinality()<0) return m_factory.getOWLNothing(); else if (d.getCardinality()==0) return m_factory.getOWLDataAllValuesFrom(d.getProperty(),m_factory.getOWLDataComplementOf(filler)); else if (isBottomDataRange(filler)) return m_factory.getOWLNothing(); else { OWLDataMinCardinality minCardinality=m_factory.getOWLDataMinCardinality(d.getCardinality(),d.getProperty(),filler); OWLDataMaxCardinality maxCardinality=m_factory.getOWLDataMaxCardinality(d.getCardinality(),d.getProperty(),filler); return m_factory.getOWLObjectIntersectionOf(minCardinality,maxCardinality); } }
public Boolean visit(OWLDisjointDataPropertiesAxiom axiom) { int n=axiom.getProperties().size(); OWLDataPropertyExpression[] props=axiom.getProperties().toArray(new OWLDataPropertyExpression[n]); for (int i=0;i<n-1;i++) { for (int j=i+1;j<n;j++) { OWLDataSomeValuesFrom some_i=factory.getOWLDataSomeValuesFrom(props[i],factory.getOWLDatatype(IRI.create(InternalDatatype.RDFS_LITERAL.getIRI()))); OWLDataSomeValuesFrom some_j=factory.getOWLDataSomeValuesFrom(props[j],factory.getOWLDatatype(IRI.create(InternalDatatype.RDFS_LITERAL.getIRI()))); OWLDataMaxCardinality max1=factory.getOWLDataMaxCardinality(1,factory.getOWLDataProperty(IRI.create(AtomicRole.TOP_DATA_ROLE.getIRI()))); OWLClassExpression desc=factory.getOWLObjectIntersectionOf(some_i,some_j,max1); if (reasoner.isSatisfiable(desc)) return Boolean.FALSE; } } return Boolean.TRUE; }
@Override public OWLDataMaxCardinality visit( ElkDataMaxCardinalityQualified expression) { return owlFactory_.getOWLDataMaxCardinality(expression.getCardinality(), convert(expression.getProperty()), convert(expression.getFiller())); }
@SuppressWarnings("static-method") public ElkDataMaxCardinality convert( OWLDataMaxCardinality owlDataMaxCardinality) { if (owlDataMaxCardinality.isQualified()) return new ElkDataMaxCardinalityQualifiedWrap<OWLDataMaxCardinality>( owlDataMaxCardinality); // else return new ElkDataMaxCardinalityUnqualifiedWrap<OWLDataMaxCardinality>( owlDataMaxCardinality); }
@Override public void visit(OWLDataMaxCardinality ce) { hashCode = primes[36]; hashCode = hashCode * MULT + ce.getProperty().hashCode(); hashCode = hashCode * MULT + ce.getCardinality(); hashCode = hashCode * MULT + ce.getFiller().hashCode(); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } return obj instanceof OWLDataMaxCardinality; }
/** * create axioms for class--dataproperty----datatype relation. */ // be sure for OWLDatatype vs OWL2DataType private void getClass2DataProperty2DataTypeAxioms(OWLClass src, OWLDataProperty dataprop, OWLDatatype dest) { // Set<OWLAxiom> tmpaxioms = new HashSet<OWLAxiom>(); OWLAxiom axiom; OWLDataSomeValuesFrom owlDataSomeValuesFrom; OWLDataAllValuesFrom owlDataAllValuesFrom; OWLDataMaxCardinality owlDataMaxCardinality; // set domain and range // scoped domain if (editor.isGenerateDomainAxiom()) { owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataSomeValuesFrom, src); domainAndRangeAxioms.add(axiom); owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, owlDataFactory.getTopDatatype()); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataSomeValuesFrom, src); domainAndRangeAxioms.add(axiom); } // scoped range if (editor.isGenerateRangeAxiom()) { owlDataAllValuesFrom = owlDataFactory.getOWLDataAllValuesFrom(dataprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataAllValuesFrom); domainAndRangeAxioms.add(axiom); owlDataAllValuesFrom = owlDataFactory.getOWLDataAllValuesFrom(dataprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataAllValuesFrom); domainAndRangeAxioms.add(axiom); } // set existential restriction // source existential functionality if (editor.isGenerateExistentialAxiom()) { owlDataSomeValuesFrom = owlDataFactory.getOWLDataSomeValuesFrom(dataprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataSomeValuesFrom); existentialAxioms.add(axiom); } // destination existential functionality. dataproperty doesn't have // inverse property // set cardinality restriction if (editor.isGenerateCardinalityAxiom()) { owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataMaxCardinality); cardinalityAxioms.add(axiom); owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop, dest); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataMaxCardinality); cardinalityAxioms.add(axiom); owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop, owlDataFactory.getTopDatatype()); axiom = owlDataFactory.getOWLSubClassOfAxiom(owlDataFactory.getOWLThing(), owlDataMaxCardinality); cardinalityAxioms.add(axiom); owlDataMaxCardinality = owlDataFactory.getOWLDataMaxCardinality(1, dataprop, owlDataFactory.getTopDatatype()); axiom = owlDataFactory.getOWLSubClassOfAxiom(src, owlDataMaxCardinality); cardinalityAxioms.add(axiom); } // dataproperty doesn't have inverse property // System.out.println(axiom.toString()); // return tmpaxioms; }
public void visit(OWLDataMaxCardinality object) { visitProperty(object.getProperty()); }
public Boolean visit(OWLDataMaxCardinality desc) { return Boolean.TRUE; }
public void visit(OWLDataMaxCardinality object) { m_hasDatatypes=true; }
public OWLClassExpression visit(OWLDataMaxCardinality d) { OWLDataRange filler=getNNF(d.getFiller()); return m_factory.getOWLDataMaxCardinality(d.getCardinality(),d.getProperty(),filler); }
public OWLClassExpression visit(OWLDataMaxCardinality d) { OWLDataRange filler=getNNF(d.getFiller()); return m_factory.getOWLDataMinCardinality(d.getCardinality()+1,d.getProperty(),filler); }
@Override public OWLDataMaxCardinality visit( ElkDataMaxCardinalityUnqualified expression) { return owlFactory_.getOWLDataMaxCardinality(expression.getCardinality(), convert(expression.getProperty())); }
@Override public ElkDataMaxCardinality visit( OWLDataMaxCardinality owlDataMaxCardinality) { return CONVERTER.convert(owlDataMaxCardinality); }
@Override public OWLDataMaxCardinality visit(OWLDataMaxCardinality ce) { return null; }
@Override public HandlerResult visit(OWLDataMaxCardinality ce) { return null; }