@Override public Collection<OWLDataProperty> getParents(OWLDataProperty child) { Set<OWLDataProperty> properties = new HashSet<>(); Stream<OWLAxiom> axioms = getRootOntology() .axioms(Filters.subDataPropertyWithSub, child, INCLUDED); sup(axioms, OWLDataPropertyExpression.class) .forEach(p -> properties.add(p.asOWLDataProperty())); return properties; }
@Override protected Collection<OWLDataProperty> getSuperProperties(OWLDataProperty subProperty, Set<OWLOntology> ontologies) { return EntitySearcher.getSuperProperties(subProperty, ontologies) .stream() .filter(p -> !p.isAnonymous()) .map(p -> (OWLDataProperty) p) .collect(toList()); }
@Override public void visit(OWLDataPropertyAssertionAxiom axiom) { process(axiom); axiom.getSubject().accept(this); axiom.getProperty().accept(this); axiom.getObject().accept(this); }
@Override public void visit(OWLDataPropertyRangeAxiom axiom) { if (!axiom.getProperty().isAnonymous()) { getAxiomsForLHS(axiom.getProperty().asOWLDataProperty()).add(axiom); } indexAxiomsByRHSEntities(axiom.getRange(), axiom); }
public void visit(OWLSubDataPropertyOfAxiom axiom) { OWLDataPropertyExpression subDataProperty=axiom.getSubProperty(); checkTopDataPropertyUse(subDataProperty,axiom); OWLDataPropertyExpression superDataProperty=axiom.getSuperProperty(); if (!subDataProperty.isOWLBottomDataProperty() && !superDataProperty.isOWLTopDataProperty()) addInclusion(subDataProperty,superDataProperty); } public void visit(OWLEquivalentDataPropertiesAxiom axiom) {
@Override protected Set<OWLEntity> getEntitiesThatRequireNamespaces() { return asUnorderedSet( Stream.of( getOntology().axioms(AxiomType.OBJECT_PROPERTY_ASSERTION).flatMap( ax -> ax.getProperty().objectPropertiesInSignature()), getOntology().axioms(AxiomType.DATA_PROPERTY_ASSERTION) .map(ax -> ax.getProperty().asOWLDataProperty()), getOntology().annotationPropertiesInSignature(Imports.INCLUDED)).flatMap(x -> x)); }
protected void addAnnotations(OWLNamedIndividual ind, OWLOntology ont) { ont.dataPropertyAssertionAxioms(ind).filter(ax -> !ax.getProperty().isAnonymous()) .forEach(ax -> addAnnotation( ind, ont, ax)); }
@Override public void visit(OWLDisjointDataPropertiesAxiom axiom) { axiom.properties().forEach(prop -> { getAxiomsForLHS(prop.asOWLDataProperty()).add(axiom); indexAxiomsByRHSEntities(prop, axiom); }); }
@Override public void visit(OWLNegativeDataPropertyAssertionAxiom axiom) { process(axiom); axiom.getSubject().accept(this); axiom.getProperty().accept(this); axiom.getObject().accept(this); }
@Override public void visit(OWLDataPropertyRangeAxiom axiom) { process(axiom); axiom.getRange().accept(this); axiom.getProperty().accept(this); }
@Override public void visit(OWLDataSomeValuesFrom desc) { desc.getProperty().accept(this); desc.getFiller().accept(this); }
public Boolean visit(OWLDataPropertyAssertionAxiom axiom) { OWLIndividual sub=axiom.getSubject(); if (sub.isAnonymous()) { anonymousIndividualAxioms.add(axiom); return true; // will be checked afterwards by rolling-up } return reasoner.hasDataPropertyRelationship(sub.asOWLNamedIndividual(),axiom.getProperty().asOWLDataProperty(),axiom.getObject()); } public Boolean visit(OWLNegativeDataPropertyAssertionAxiom axiom) {
@Override public void visit(OWLSubDataPropertyOfAxiom axiom) { axiom.getSubProperty().accept(this); write(SUBCLASS); axiom.getSuperProperty().accept(this); }
protected OWLObjectEditor<OWLDataProperty> getObjectEditor() { OWLDataPropertyEditor editor = new OWLDataPropertyEditor(getOWLEditorKit()); OWLDataPropertyExpression p = getAxiom().getSuperProperty(); if (!p.isAnonymous()){ editor.setEditedObject(p.asOWLDataProperty()); } return editor; }
private void handleRestriction(OWLQuantifiedRestriction<OWLDataRange, OWLDataPropertyExpression, OWLDataRange> r) { if (!r.getProperty().isAnonymous() && r.getFiller().isDatatype()){ p = r.getProperty().asOWLDataProperty(); f = r.getFiller().asOWLDatatype(); isAcceptable = true; } }
public void visit(OWLDataPropertyRangeAxiom axiom) { switch (localityCls) { case BOTTOM_BOTTOM: case TOP_BOTTOM: isLocal = !signature.contains(axiom.getProperty().asOWLDataProperty()) || axiom.getRange().isTopDatatype(); break; case TOP_TOP: isLocal = axiom.getRange().isTopDatatype(); break; } }
@Override public void visit(OWLSubDataPropertyOfAxiom axiom) { getAxiomsForLHS(axiom.getSubProperty().asOWLDataProperty()).add(axiom); indexAxiomsByRHSEntities(axiom.getSuperProperty(), axiom); }
@Nonnull @Override public Set<PropertyValue> visit(OWLDataSomeValuesFrom desc) { if (desc.getFiller().isDatatype()) { return toSet(PropertyDatatypeValue.get(rm.getDataPropertyData(desc.getProperty().asOWLDataProperty()), rm.getDatatypeData(desc.getFiller().asOWLDatatype()), state)); } else { return null; } }
protected void topAsSubProperty(OWLSubDataPropertyOfAxiom axiom) { if (axiom.getSubProperty().isOWLTopDataProperty()) { violations.add(new UseOfTopDataPropertyAsSubPropertyInSubPropertyAxiom( getCurrentOntology(), axiom)); } }