/** * Tr annotations. * * @param clauses the clauses * @return the set of annotations */ protected Set<OWLAnnotation> trAnnotations(Collection<Clause> clauses) { Set<OWLAnnotation> anns = new HashSet<>(); clauses.forEach(c -> trAnnotations(c, anns)); return anns; }
/** * Tr annotations. * * @param clauses the clauses * @return the set of annotations */ protected Set<OWLAnnotation> trAnnotations(Collection<Clause> clauses) { Set<OWLAnnotation> anns = new HashSet<>(); clauses.forEach(c -> trAnnotations(c, anns)); return anns; }
/** * Tr annotations. * * @param clauses the clauses * @return the set of annotations */ protected Set<OWLAnnotation> trAnnotations(Collection<Clause> clauses) { Set<OWLAnnotation> anns = new HashSet<>(); clauses.forEach(c -> trAnnotations(c, anns)); return anns; }
/** * Tr annotations. * * @param clauses the clauses * @return the set of annotations */ protected Set<OWLAnnotation> trAnnotations(Collection<Clause> clauses) { Set<OWLAnnotation> anns = new HashSet<>(); clauses.forEach(c -> trAnnotations(c, anns)); return anns; }
/** * Tr annotations. * * @param clause the clause * @return the sets the */ protected Set<OWLAnnotation> trAnnotations(Clause clause) { if (clause.hasNoAnnotations()) { return CollectionFactory.createSet(); } Set<OWLAnnotation> anns = new HashSet<>(); trAnnotations(clause, anns); return anns; }
/** * Tr annotations. * * @param clause the clause * @return the sets the */ protected Set<OWLAnnotation> trAnnotations(Clause clause) { if (clause.hasNoAnnotations()) { return CollectionFactory.createSet(); } Set<OWLAnnotation> anns = new HashSet<>(); trAnnotations(clause, anns); return anns; }
/** * Tr annotations. * * @param clause the clause * @return the sets the */ protected Set<OWLAnnotation> trAnnotations(Clause clause) { if (clause.hasNoAnnotations()) { return CollectionFactory.createSet(); } Set<OWLAnnotation> anns = new HashSet<>(); trAnnotations(clause, anns); return anns; }
/** * Tr annotations. * * @param clause the clause * @return the sets the */ protected Set<OWLAnnotation> trAnnotations(Clause clause) { if (clause.hasNoAnnotations()) { return CollectionFactory.createSet(); } Set<OWLAnnotation> anns = new HashSet<>(); trAnnotations(clause, anns); return anns; }
protected void handleDate(String t, @Nullable Clause clause) { if (clause != null) { Object value = clause.getValue(); String dateString = null; if (value instanceof Date) { dateString = OBOFormatConstants.headerDateFormat().format((Date) value); } else if (value instanceof String) { dateString = (String) value; } if (dateString != null) { addOntologyAnnotation(trTagToAnnotationProp(t), trLiteral(dateString), trAnnotations(clause)); } else { // TODO: Throw Exceptions OBOFormatException e = new OBOFormatException( "Cannot translate clause «" + clause + '»'); LOG.error("Cannot translate: {}", clause, e); } } }
protected void handleDate(String t, @Nullable Clause clause) { if (clause != null) { Object value = clause.getValue(); String dateString = null; if (value instanceof Date) { dateString = OBOFormatConstants.headerDateFormat().format((Date) value); } else if (value instanceof String) { dateString = (String) value; } if (dateString != null) { addOntologyAnnotation(trTagToAnnotationProp(t), trLiteral(dateString), trAnnotations(clause)); } else { // TODO: Throw Exceptions OBOFormatException e = new OBOFormatException( "Cannot translate clause «" + clause + '»'); LOG.error("Cannot translate: {}", clause, e); } } }
protected void handleDate(String t, @Nullable Clause clause) { if (clause != null) { Object value = clause.getValue(); String dateString = null; if (value instanceof Date) { dateString = OBOFormatConstants.headerDateFormat().format((Date) value); } else if (value instanceof String) { dateString = (String) value; } if (dateString != null) { addOntologyAnnotation(trTagToAnnotationProp(t), trLiteral(dateString), trAnnotations(clause)); } else { // TODO: Throw Exceptions OBOFormatException e = new OBOFormatException( "Cannot translate clause «" + clause + '»'); LOG.error("Cannot translate: {}", clause, e); } } }
protected void handleDate(String t, @Nullable Clause clause) { if (clause != null) { Object value = clause.getValue(); String dateString = null; if (value instanceof Date) { dateString = OBOFormatConstants.headerDateFormat().format((Date) value); } else if (value instanceof String) { dateString = (String) value; } if (dateString != null) { addOntologyAnnotation(trTagToAnnotationProp(t), trLiteral(dateString), trAnnotations(clause)); } else { // TODO: Throw Exceptions OBOFormatException e = new OBOFormatException( "Cannot translate clause «" + clause + '»'); LOG.error("Cannot translate: {}", clause, e); } } }
/** * Tr intersection of. * * @param cls the cls * @param clauses the clauses * @return the oWL axiom */ protected OWLAxiom trIntersectionOf(OWLClass cls, Collection<Clause> clauses) { Set<OWLAnnotation> annotations = trAnnotations(clauses); Set<OWLClassExpression> eSet = new HashSet<>(); eSet.add(cls); Set<OWLClassExpression> iSet = new HashSet<>(); for (Clause clause : clauses) { Collection<QualifierValue> qvs = clause.getQualifierValues(); if (clause.getValues().size() == 1) { iSet.add(trClass(clause.getValue())); } else { iSet.add(trRel((String) clause.getValue(), (String) clause.getValue2(), qvs)); } } eSet.add(fac.getOWLObjectIntersectionOf(iSet)); // TODO - fix this if (annotations.isEmpty()) { return fac.getOWLEquivalentClassesAxiom(eSet); } else { return fac.getOWLEquivalentClassesAxiom(eSet, annotations); } }
/** * Tr intersection of. * * @param cls the cls * @param clauses the clauses * @return the oWL axiom */ protected OWLAxiom trIntersectionOf(OWLClass cls, Collection<Clause> clauses) { Set<OWLAnnotation> annotations = trAnnotations(clauses); Set<OWLClassExpression> eSet = new HashSet<>(); eSet.add(cls); Set<OWLClassExpression> iSet = new HashSet<>(); for (Clause clause : clauses) { Collection<QualifierValue> qvs = clause.getQualifierValues(); if (clause.getValues().size() == 1) { iSet.add(trClass(clause.getValue())); } else { iSet.add(trRel((String) clause.getValue(), (String) clause.getValue2(), qvs)); } } eSet.add(fac.getOWLObjectIntersectionOf(iSet)); // TODO - fix this if (annotations.isEmpty()) { return fac.getOWLEquivalentClassesAxiom(eSet); } else { return fac.getOWLEquivalentClassesAxiom(eSet, annotations); } }
/** * Tr union of. * * @param cls the cls * @param clauses the clauses * @return the oWL axiom */ protected OWLAxiom trUnionOf(OWLClass cls, Collection<Clause> clauses) { Set<OWLAnnotation> annotations = trAnnotations(clauses); Set<OWLClassExpression> eSet = new HashSet<>(); eSet.add(cls); Set<OWLClassExpression> iSet = new HashSet<>(); for (Clause clause : clauses) { Collection<QualifierValue> qvs = clause.getQualifierValues(); // TODO - quals if (clause.getValues().size() == 1) { iSet.add(trClass(clause.getValue())); } else { LOG.error("union_of n-ary slots not is standard - converting anyway"); iSet.add(trRel((String) clause.getValue(), (String) clause.getValue2(), qvs)); } } eSet.add(fac.getOWLObjectUnionOf(iSet)); // TODO - fix this if (annotations.isEmpty()) { return fac.getOWLEquivalentClassesAxiom(eSet); } else { return fac.getOWLEquivalentClassesAxiom(eSet, annotations); } }
/** * Tr union of. * * @param cls the cls * @param clauses the clauses * @return the oWL axiom */ protected OWLAxiom trUnionOf(OWLClass cls, Collection<Clause> clauses) { Set<OWLAnnotation> annotations = trAnnotations(clauses); Set<OWLClassExpression> eSet = new HashSet<>(); eSet.add(cls); Set<OWLClassExpression> iSet = new HashSet<>(); for (Clause clause : clauses) { Collection<QualifierValue> qvs = clause.getQualifierValues(); // TODO - quals if (clause.getValues().size() == 1) { iSet.add(trClass(clause.getValue())); } else { LOG.error("union_of n-ary slots not is standard - converting anyway"); iSet.add(trRel((String) clause.getValue(), (String) clause.getValue2(), qvs)); } } eSet.add(fac.getOWLObjectUnionOf(iSet)); // TODO - fix this if (annotations.isEmpty()) { return fac.getOWLEquivalentClassesAxiom(eSet); } else { return fac.getOWLEquivalentClassesAxiom(eSet, annotations); } }
/** * Tr intersection of. * * @param cls the cls * @param clauses the clauses * @return the oWL axiom */ protected OWLAxiom trIntersectionOf(OWLClass cls, Collection<Clause> clauses) { Set<OWLAnnotation> annotations = trAnnotations(clauses); Set<OWLClassExpression> eSet = new HashSet<>(); eSet.add(cls); Set<OWLClassExpression> iSet = new HashSet<>(); for (Clause clause : clauses) { Collection<QualifierValue> qvs = clause.getQualifierValues(); if (clause.getValues().size() == 1) { iSet.add(trClass(clause.getValue())); } else { iSet.add(trRel((String) clause.getValue(), (String) clause.getValue2(), qvs)); } } eSet.add(fac.getOWLObjectIntersectionOf(iSet)); // TODO - fix this if (annotations.isEmpty()) { return fac.getOWLEquivalentClassesAxiom(eSet); } else { return fac.getOWLEquivalentClassesAxiom(eSet, annotations); } }
/** * Tr union of. * * @param cls the cls * @param clauses the clauses * @return the oWL axiom */ protected OWLAxiom trUnionOf(OWLClass cls, Collection<Clause> clauses) { Set<OWLAnnotation> annotations = trAnnotations(clauses); Set<OWLClassExpression> eSet = new HashSet<>(); eSet.add(cls); Set<OWLClassExpression> iSet = new HashSet<>(); for (Clause clause : clauses) { Collection<QualifierValue> qvs = clause.getQualifierValues(); // TODO - quals if (clause.getValues().size() == 1) { iSet.add(trClass(clause.getValue())); } else { LOG.error("union_of n-ary slots not is standard - converting anyway"); iSet.add(trRel((String) clause.getValue(), (String) clause.getValue2(), qvs)); } } eSet.add(fac.getOWLObjectUnionOf(iSet)); // TODO - fix this if (annotations.isEmpty()) { return fac.getOWLEquivalentClassesAxiom(eSet); } else { return fac.getOWLEquivalentClassesAxiom(eSet, annotations); } }
/** * Tr union of. * * @param cls the cls * @param clauses the clauses * @return the oWL axiom */ protected OWLAxiom trUnionOf(OWLClass cls, Collection<Clause> clauses) { Set<OWLAnnotation> annotations = trAnnotations(clauses); Set<OWLClassExpression> eSet = new HashSet<>(); eSet.add(cls); Set<OWLClassExpression> iSet = new HashSet<>(); for (Clause clause : clauses) { Collection<QualifierValue> qvs = clause.getQualifierValues(); // TODO - quals if (clause.getValues().size() == 1) { iSet.add(trClass(clause.getValue())); } else { LOG.error("union_of n-ary slots not is standard - converting anyway"); iSet.add(trRel((String) clause.getValue(), (String) clause.getValue2(), qvs)); } } eSet.add(fac.getOWLObjectUnionOf(iSet)); // TODO - fix this if (annotations.isEmpty()) { return fac.getOWLEquivalentClassesAxiom(eSet); } else { return fac.getOWLEquivalentClassesAxiom(eSet, annotations); } }
/** * Tr intersection of. * * @param cls the cls * @param clauses the clauses * @return the oWL axiom */ protected OWLAxiom trIntersectionOf(OWLClass cls, Collection<Clause> clauses) { Set<OWLAnnotation> annotations = trAnnotations(clauses); Set<OWLClassExpression> eSet = new HashSet<>(); eSet.add(cls); Set<OWLClassExpression> iSet = new HashSet<>(); for (Clause clause : clauses) { Collection<QualifierValue> qvs = clause.getQualifierValues(); if (clause.getValues().size() == 1) { iSet.add(trClass(clause.getValue())); } else { iSet.add(trRel((String) clause.getValue(), (String) clause.getValue2(), qvs)); } } eSet.add(fac.getOWLObjectIntersectionOf(iSet)); // TODO - fix this if (annotations.isEmpty()) { return fac.getOWLEquivalentClassesAxiom(eSet); } else { return fac.getOWLEquivalentClassesAxiom(eSet, annotations); } }