@Override public void visit(OWLHasKeyAxiom axiom) { hashCode = primes[72]; hashCode = hashCode * MULT + axiom.getClassExpression().hashCode(); hashCode = hashCode * MULT + axiom.getPropertyExpressions().hashCode(); }
public void visit(OWLHasKeyAxiom axiom) { sb.append("HasKey("); axiom.getClassExpression().accept(this); sb.append(" ("); for (OWLObjectPropertyExpression prop : axiom.getObjectPropertyExpressions()) { prop.accept(this); sb.append(" "); } sb.append(") ("); for (OWLDataPropertyExpression prop : axiom.getDataPropertyExpressions()) { prop.accept(this); sb.append(" "); } sb.append(")"); sb.append(")"); }
@Override public void visit(OWLHasKeyAxiom axiom) { process(axiom); axiom.getClassExpression().accept(this); axiom.objectPropertyExpressions().forEach(a -> a.accept(this)); axiom.dataPropertyExpressions().forEach(a -> a.accept(this)); }
public boolean equals(Object obj) { if(obj == this) { return true; } if(!(obj instanceof OWLHasKeyAxiom)) { return false; } OWLHasKeyAxiom other = (OWLHasKeyAxiom) obj; return expression.equals(other.getClassExpression()) && propertyExpressions.equals(other.getPropertyExpressions()) && other.getAnnotations().equals(getAnnotations()); } }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderHasKey(OWLHasKeyAxiom expected, OWLDataFactory df) { this(df); withClass(expected.getClassExpression()).withAnnotations(expected.annotations()) .withItems(expected .dataPropertyExpressions()).withItems(expected.objectPropertyExpressions()); }
@Nonnull @Override public Set<UsageReference> visit(@Nonnull OWLHasKeyAxiom axiom) { return translate(axiom.getClassExpression(), axiom); }
public void visit(OWLHasKeyAxiom axiom) { for (OWLDataPropertyExpression dataPropertyExpression : axiom.getDataPropertyExpressions()) checkTopDataPropertyUse(dataPropertyExpression,axiom); OWLClassExpression description=positive(axiom.getClassExpression()); if (!isSimple(description)) { OWLClassExpression definition=getDefinitionFor(description,m_alreadyExists); if (!m_alreadyExists[0]) m_classExpressionInclusionsAsDisjunctions.add(new OWLClassExpression[] { negative(definition),description }); description=definition; } m_axioms.m_hasKeys.add(m_factory.getOWLHasKeyAxiom(description,axiom.getPropertyExpressions())); for (OWLObjectPropertyExpression objectPropertyExpression : axiom.getObjectPropertyExpressions()) m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(objectPropertyExpression.getNamedProperty()); }
/** * {@inheritDoc} */ @Override public void visit(final OWLHasKeyAxiom theAxiom) { write(theAxiom.getClassExpression()); writeSpace(); write(Keyword.HAS_KEY); writeCollection(theAxiom.objectPropertyExpressions(), "", true); writeSpace(); }
@Override public void visit(OWLHasKeyAxiom axiom) { addSingleTripleAxiom(axiom, axiom.getClassExpression(), OWL_HAS_KEY.getIRI(), axiom.propertyExpressions()); }
@Override public void visit(OWLHasKeyAxiom axiom) { axiom.dataPropertyExpressions().forEach(d->checkTopDataPropertyUse(d,axiom)); OWLClassExpression description=positive(axiom.getClassExpression()); if (!isSimple(description)) { OWLClassExpression definition=getDefinitionFor(description,m_alreadyExists); if (!m_alreadyExists[0]) m_classExpressionInclusionsAsDisjunctions.add(Arrays.asList( negative(definition),description )); description=definition; } m_axioms.m_hasKeys.add(m_factory.getOWLHasKeyAxiom(description,asList(axiom.propertyExpressions()))); axiom.objectPropertyExpressions().forEach(p->m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(p.getNamedProperty())); }
public List<OWLPropertyExpression> getManipulatableObjects() { return new ArrayList<>(getAxiom().getPropertyExpressions()); }}
@Override public void visit(final OWLHasKeyAxiom axiom) { // Make sure UNSUPPORTED_ENTAILMENT is updated if this function is implemented assert UNSUPPORTED_ENTAILMENT.contains(axiom.getAxiomType()); throw new UnsupportedOperationException("Unsupported entailment query: " + axiom); }
@Override public List<? extends ElkDataPropertyExpression> getDataPropertyExpressions() { List<ElkDataPropertyExpression> dpes = new ArrayList<ElkDataPropertyExpression>( this.owlObject.getDataPropertyExpressions().size()); for (OWLDataPropertyExpression dpe : this.owlObject .getDataPropertyExpressions()) { dpes.add(converter.convert(dpe)); } return dpes; }
@Override public List<? extends ElkObjectPropertyExpression> getObjectPropertyExpressions() { List<ElkObjectPropertyExpression> opes = new ArrayList<ElkObjectPropertyExpression>( this.owlObject.getObjectPropertyExpressions().size()); for (OWLObjectPropertyExpression ope : this.owlObject .getObjectPropertyExpressions()) { opes.add(converter.convert(ope)); } return opes; }
public static void parse(OWLOntology ontology, OWLClass owlClass, VowlData vowlData) { for (OWLHasKeyAxiom owlHasKeyAxiom : ontology.hasKeyAxioms(owlClass).collect(Collectors.toSet())) { AbstractClass hasKeysClass = vowlData.getClassForIri(owlClass.getIRI()); for (OWLObjectPropertyExpression propertyExpression : owlHasKeyAxiom.objectPropertyExpressions().collect(Collectors.toSet())) { if (propertyExpression.isAnonymous()) { logger.info("Anonymous has key object property expression " + propertyExpression); continue; } VowlObjectProperty property = vowlData.getObjectPropertyForIri(propertyExpression.asOWLObjectProperty().getIRI()); property.addAttribute(VowlAttribute.KEY); hasKeysClass.addKey(property.getIri()); } for (OWLDataPropertyExpression propertyExpression : owlHasKeyAxiom.dataPropertyExpressions().collect(Collectors.toSet())) { if (propertyExpression.isAnonymous()) { logger.info("Anonymous has key data property expression " + propertyExpression); continue; } VowlDatatypeProperty property = vowlData.getDatatypePropertyForIri(propertyExpression.asOWLDataProperty().getIRI()); property.addAttribute(VowlAttribute.KEY); hasKeysClass.addKey(property.getIri()); } } } }
/** * Gets the set of data property expressions that make up the key. This is simply a convenience * method that filteres out the data property expressions in the key. All of the properties * returned by this method are included in the return value of the * {@link OWLHasKeyAxiom#getPropertyExpressions()} method. * * @return The set of object property expressions in the key described by this axiom * @deprecated use the stream method */ @Deprecated default Set<OWLDataPropertyExpression> getDataPropertyExpressions() { return asSet(dataPropertyExpressions()); }
/** * Builder initialized from an existing object. * * @param expected the existing object * @param df data factory */ public BuilderHasKey(OWLHasKeyAxiom expected, OWLDataFactory df) { this(df); withClass(expected.getClassExpression()).withAnnotations(expected.annotations()) .withItems(expected .dataPropertyExpressions()).withItems(expected.objectPropertyExpressions()); }
@Override public void visit(OWLHasKeyAxiom axiom) { if (!axiom.getClassExpression().isAnonymous()) { hasKeyAxiomsByClass.put(axiom.getClassExpression().asOWLClass(), axiom); } }
/** * {@inheritDoc} */ @Override public void visit(final OWLHasKeyAxiom theAxiom) { write(theAxiom.getClassExpression()); writeSpace(); write(Keyword.HAS_KEY); writeCollection(theAxiom.objectPropertyExpressions(), "", true); writeSpace(); }
@Override public OWLHasKeyAxiom visit(OWLHasKeyAxiom ax) { return df.getOWLHasKeyAxiom(t(ax.getClassExpression()), list(ax.propertyExpressions()), a(ax)); }