@Override public Set<OWLDisjointObjectPropertiesAxiom> splitToAnnotatedPairs() { List<OWLObjectPropertyExpression> ops = new ArrayList<>(getProperties()); if (ops.size() == 2) { return Collections .<OWLDisjointObjectPropertiesAxiom> singleton(this); } Set<OWLDisjointObjectPropertiesAxiom> result = new HashSet<>(); for (int i = 0; i < ops.size() - 1; i++) { OWLObjectPropertyExpression indI = ops.get(i); OWLObjectPropertyExpression indJ = ops.get(i + 1); result.add(new OWLDisjointObjectPropertiesAxiomImpl(new HashSet<>( Arrays.asList(indI, indJ)), getAnnotations())); } return result; }
public void visit(OWLDisjointObjectPropertiesAxiom axiom) { OWLObjectPropertyExpression[] objectPropertyExpressions=new OWLObjectPropertyExpression[axiom.getProperties().size()]; axiom.getProperties().toArray(objectPropertyExpressions); for (int i=0;i<objectPropertyExpressions.length;i++) { objectPropertyExpressions[i]=objectPropertyExpressions[i].getSimplified(); m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(objectPropertyExpressions[i].getNamedProperty()); } m_axioms.m_disjointObjectProperties.add(objectPropertyExpressions); }
public Boolean visit(OWLDisjointObjectPropertiesAxiom axiom) { int n=axiom.getProperties().size(); OWLObjectPropertyExpression[] props=axiom.getProperties().toArray(new OWLObjectPropertyExpression[n]); for (int i=0;i<n-1;i++) for (int j=i+1;j<n;j++) if (!reasoner.isDisjointObjectProperty(props[i],props[j])) return Boolean.FALSE; return Boolean.TRUE; }
@Override public OWLDisjointObjectPropertiesAxiom visit( ElkDisjointObjectPropertiesAxiom axiom) { return owlFactory_.getOWLDisjointObjectPropertiesAxiom( toObjectPropertyExpressionSet( axiom.getObjectPropertyExpressions())); }
@Override public T visit(OWLDisjointObjectPropertiesAxiom axiom) { throw new IllegalArgumentException( OWLDisjointObjectPropertiesAxiom.class.getSimpleName() + " cannot be converted to " + getTargetClass().getSimpleName()); }
/** * Disjoint Properties are translated into constraints:</br> * <code>:- r(X,Y), s(X,Y), ...</code> * @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom) */ public void visit(OWLDisjointObjectPropertiesAxiom disProperties) { writer.write("icons " + ASP2CoreSymbols.IMPLICATION); writer.write(String.format(" activated(%d), ", nConstraints++)); String cVar = var.currentVar(); String nVar = var.nextVariable(); boolean isFirst=true; for (OWLObjectPropertyExpression property : disProperties.getProperties()) { String propertyName = mapper.getPredicateName(property.getNamedProperty()); if (!isFirst) { writer.write(ASP2CoreSymbols.CONJUNCTION); } isFirst = false; writer.write(propertyName); writer.write(ASP2CoreSymbols.BRACKET_OPEN); writer.write(cVar); writer.write(ASP2CoreSymbols.ARG_SEPERATOR); writer.write(nVar); writer.write(ASP2CoreSymbols.BRACKET_CLOSE); } writer.write(ASP2CoreSymbols.EOR); }
/** * Disjoint Properties are translated into constraints:</br> * <code>:- r(X,Y), s(X,Y), ...</code> * @see org.semanticweb.owlapi.model.OWLAxiomVisitor#visit(org.semanticweb.owlapi.model.OWLDisjointObjectPropertiesAxiom) */ public void visit(OWLDisjointObjectPropertiesAxiom disProperties) { writer.write(ASP2CoreSymbols.IMPLICATION); String cVar = var.currentVar(); String nVar = var.nextVariable(); boolean isFirst=true; for (OWLObjectPropertyExpression property : disProperties.getProperties()) { String propertyName = mapper.getPredicateName(property.getNamedProperty()); if (!isFirst) { writer.write(ASP2CoreSymbols.CONJUNCTION); } isFirst = false; writer.write(propertyName); writer.write(ASP2CoreSymbols.BRACKET_OPEN); writer.write(cVar); writer.write(ASP2CoreSymbols.ARG_SEPERATOR); writer.write(nVar); writer.write(ASP2CoreSymbols.BRACKET_CLOSE); } writer.write(ASP2CoreSymbols.EOR); }
@Override public void visit(OWLDisjointObjectPropertiesAxiom axiom) { List<OWLObjectPropertyExpression> propertyExpressions = new LinkedList<>(axiom.getProperties()); for(int i = 0; i < propertyExpressions.size(); i++){ sparql += "{"; OWLObjectPropertyExpression pe = propertyExpressions.remove(i); if(pe.isAnonymous()){ sparql += objectVar + "<" + pe.getInverseProperty().asOWLObjectProperty().toStringID() + "> " + subjectVar + " ."; } else { sparql += subjectVar + "<" + pe.asOWLObjectProperty().toStringID() + "> " + objectVar + " ."; } for (OWLObjectPropertyExpression pe2 : propertyExpressions) { String pattern; if(pe2.isAnonymous()){ pattern = objectVar + "<" + pe2.getInverseProperty().asOWLObjectProperty().toStringID() + "> " + subjectVar + " ."; } else { pattern = subjectVar + "<" + pe2.asOWLObjectProperty().toStringID() + "> " + objectVar + " ."; } sparql += notExists(pattern); } propertyExpressions.add(i, pe); sparql += "}"; if(i < propertyExpressions.size()-1){ sparql += " UNION "; } } }
@Override public void visit(@Nonnull OWLDisjointObjectPropertiesAxiom axiom) { for (OWLObjectPropertyExpression prop : axiom.getProperties()) { prop.accept(this); } processAxiomAnnotations(axiom); }
@Nonnull @Override public OWLDisjointObjectPropertiesAxiom getAxiomWithoutAnnotations() { if (!isAnnotated()) { return this; } return new OWLDisjointObjectPropertiesAxiomImpl(getProperties(), NO_ANNOTATIONS); }
@Nonnull @Override public OWLDisjointObjectPropertiesAxiom getAnnotatedAxiom( @Nonnull Set<OWLAnnotation> annotations) { return new OWLDisjointObjectPropertiesAxiomImpl(getProperties(), mergeAnnos(annotations)); }
@Nonnull @Override public Set<OWLDisjointObjectPropertiesAxiom> asPairwiseAxioms() { Set<OWLDisjointObjectPropertiesAxiom> result = new HashSet<>(); List<OWLObjectPropertyExpression> list = new ArrayList<>( getProperties()); for (int i = 0; i < list.size() - 1; i++) { for (int j = i + 1; j < list.size(); j++) { result.add(new OWLDisjointObjectPropertiesAxiomImpl( new HashSet<>(Arrays.asList(list.get(i), list.get(j))), NO_ANNOTATIONS)); } } return result; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } return obj instanceof OWLDisjointObjectPropertiesAxiom; }
public void visit(OWLDisjointObjectPropertiesAxiom axiom) { notSupported(axiom); }
public void visit(OWLDisjointObjectPropertiesAxiom axiom) { }
@SuppressWarnings("static-method") public ElkDisjointObjectPropertiesAxiom convert( OWLDisjointObjectPropertiesAxiom owlDisjointObjectPropertiesAxiom) { return new ElkDisjointObjectPropertiesAxiomWrap<OWLDisjointObjectPropertiesAxiom>( owlDisjointObjectPropertiesAxiom); }
@Override public ElkAxiom visit( OWLDisjointObjectPropertiesAxiom owlDisjointObjectPropertiesAxiom) { return CONVERTER.convert(owlDisjointObjectPropertiesAxiom); }
@Override public ElkObjectPropertyAxiom visit( OWLDisjointObjectPropertiesAxiom owlDisjointObjectPropertiesAxiom) { return CONVERTER.convert(owlDisjointObjectPropertiesAxiom); }
@Override public void visit(OWLDisjointObjectPropertiesAxiom axiom) { defaultVisit(axiom); }
@Override public OWLAxiom visit(OWLDisjointObjectPropertiesAxiom axiom) { return factory.getOWLDisjointObjectPropertiesAxiom(axiom.getProperties(), annotations); }
@Override public void visit(OWLDisjointObjectPropertiesAxiom axiom) { }
@Override public Boolean visit(OWLDisjointObjectPropertiesAxiom axiom) { return true; }
@Override public Boolean visit(OWLDisjointObjectPropertiesAxiom axiom) { return false; }
@Override public Boolean visit(OWLDisjointObjectPropertiesAxiom axiom) { Objects.requireNonNull(axiom); return add(this.df.getOWLDisjointObjectPropertiesAxiom(axiom.getProperties(), reg(axiom.getAnnotations()))); }
@Override public Boolean visit(OWLDisjointObjectPropertiesAxiom axiom) { Objects.requireNonNull(axiom); return add(this.df.getOWLDisjointObjectPropertiesAxiom(axiom.getProperties(), empty())); }
@Override public Set<ComplexIntegerAxiom> visit(OWLDisjointObjectPropertiesAxiom axiom) { Objects.requireNonNull(axiom); throw TranslationException.newUnsupportedAxiomException(axiom); }
@Override public void visit(OWLDisjointObjectPropertiesAxiom axiom) { ignoreOwlAxiom("DisjointObjectProperty", axiom); }
@Override public O visit(OWLDisjointObjectPropertiesAxiom axiom) { return doDefault(axiom); }
@Override public void visit(OWLDisjointObjectPropertiesAxiom axiom) { type = AXIOM_TYPE_INDEX_BASE + axiom.getAxiomType().getIndex(); }
@Override public OWLAxiom visit(OWLDisjointObjectPropertiesAxiom axiom) { return axiom; }
@Override public void visit(OWLDisjointObjectPropertiesAxiom axiom) { hashCode = primes[10]; hashCode = hashCode * MULT + axiom.getProperties().hashCode(); hashCode = hashCode * MULT + axiom.getAnnotations().hashCode(); }
@Override public void visit(OWLDisjointObjectPropertiesAxiom axiom) { handleDefault(axiom); }
public Object visit(OWLDisjointObjectPropertiesAxiom axiom) { profileViolations.add(new UseOfIllegalAxiom(getCurrentOntology(), axiom)); return null; }
public void visit(OWLDisjointObjectPropertiesAxiom arg0) { unusedAxiom(arg0); }
@Override protected void writeAxiom(OWLDisjointObjectPropertiesAxiom axiom, BinaryOWLOutputStream outputStream) throws IOException { outputStream.writeOWLObjects(axiom.getProperties()); }
@Override protected OWLDisjointObjectPropertiesAxiom readAxiom(BinaryOWLInputStream inputStream, Set<OWLAnnotation> annotations) throws IOException, BinaryOWLParseException { Set<OWLObjectPropertyExpression> propertyExpressions = inputStream.readOWLObjects(); return inputStream.getDataFactory().getOWLDisjointObjectPropertiesAxiom(propertyExpressions, annotations); }