/** * Tr synonym type. * * @param type the type * @return the oWL annotation property */ protected OWLAnnotationProperty trSynonymType(String type) { if (type.equals(OboFormatTag.TAG_RELATED.getTag()) || type .equals(OboFormatTag.TAG_EXACT.getTag()) || type .equals(OboFormatTag.TAG_NARROW.getTag()) || type .equals(OboFormatTag.TAG_BROAD.getTag())) { return trTagToAnnotationProp(type); } return trAnnotationProp(type); }
/** * Tr synonym type. * * @param type the type * @return the oWL annotation property */ protected OWLAnnotationProperty trSynonymType(String type) { if (type.equals(OboFormatTag.TAG_RELATED.getTag()) || type .equals(OboFormatTag.TAG_EXACT.getTag()) || type .equals(OboFormatTag.TAG_NARROW.getTag()) || type .equals(OboFormatTag.TAG_BROAD.getTag())) { return trTagToAnnotationProp(type); } return trAnnotationProp(type); }
/** * Tr synonym type. * * @param type the type * @return the oWL annotation property */ protected OWLAnnotationProperty trSynonymType(String type) { if (type.equals(OboFormatTag.TAG_RELATED.getTag()) || type .equals(OboFormatTag.TAG_EXACT.getTag()) || type .equals(OboFormatTag.TAG_NARROW.getTag()) || type .equals(OboFormatTag.TAG_BROAD.getTag())) { return trTagToAnnotationProp(type); } return trAnnotationProp(type); }
/** * Tr synonym type. * * @param type the type * @return the oWL annotation property */ protected OWLAnnotationProperty trSynonymType(String type) { if (type.equals(OboFormatTag.TAG_RELATED.getTag()) || type .equals(OboFormatTag.TAG_EXACT.getTag()) || type .equals(OboFormatTag.TAG_NARROW.getTag()) || type .equals(OboFormatTag.TAG_BROAD.getTag())) { return trTagToAnnotationProp(type); } return trAnnotationProp(type); }
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 annotations. * * @param clause the clause * @param anns the anns */ protected void trAnnotations(Clause clause, Set<OWLAnnotation> anns) { Collection<Xref> xrefs = clause.getXrefs(); for (Xref x : xrefs) { if (!x.getIdref().isEmpty()) { OWLAnnotationProperty ap = trTagToAnnotationProp(OboFormatTag.TAG_XREF.getTag()); OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(x)); anns.add(ann); } } Collection<QualifierValue> qvs = clause.getQualifierValues(); for (QualifierValue qv : qvs) { String qTag = qv.getQualifier(); if (SKIPPED_QUALIFIERS.contains(qTag)) { continue; } OWLAnnotationProperty ap = trTagToAnnotationProp(qTag); OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(qv.getValue())); anns.add(ann); } }
/** * Tr annotations. * * @param clause the clause * @param anns the anns */ protected void trAnnotations(Clause clause, Set<OWLAnnotation> anns) { Collection<Xref> xrefs = clause.getXrefs(); for (Xref x : xrefs) { if (!x.getIdref().isEmpty()) { OWLAnnotationProperty ap = trTagToAnnotationProp(OboFormatTag.TAG_XREF.getTag()); OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(x)); anns.add(ann); } } Collection<QualifierValue> qvs = clause.getQualifierValues(); for (QualifierValue qv : qvs) { String qTag = qv.getQualifier(); if (SKIPPED_QUALIFIERS.contains(qTag)) { continue; } OWLAnnotationProperty ap = trTagToAnnotationProp(qTag); OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(qv.getValue())); anns.add(ann); } }
/** * Tr annotations. * * @param clause the clause * @param anns the anns */ protected void trAnnotations(Clause clause, Set<OWLAnnotation> anns) { Collection<Xref> xrefs = clause.getXrefs(); for (Xref x : xrefs) { if (!x.getIdref().isEmpty()) { OWLAnnotationProperty ap = trTagToAnnotationProp(OboFormatTag.TAG_XREF.getTag()); OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(x)); anns.add(ann); } } Collection<QualifierValue> qvs = clause.getQualifierValues(); for (QualifierValue qv : qvs) { String qTag = qv.getQualifier(); if (SKIPPED_QUALIFIERS.contains(qTag)) { continue; } OWLAnnotationProperty ap = trTagToAnnotationProp(qTag); OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(qv.getValue())); anns.add(ann); } }
/** * Tr annotations. * * @param clause the clause * @param anns the anns */ protected void trAnnotations(Clause clause, Set<OWLAnnotation> anns) { Collection<Xref> xrefs = clause.getXrefs(); for (Xref x : xrefs) { if (!x.getIdref().isEmpty()) { OWLAnnotationProperty ap = trTagToAnnotationProp(OboFormatTag.TAG_XREF.getTag()); OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(x)); anns.add(ann); } } Collection<QualifierValue> qvs = clause.getQualifierValues(); for (QualifierValue qv : qvs) { String qTag = qv.getQualifier(); if (SKIPPED_QUALIFIERS.contains(qTag)) { continue; } OWLAnnotationProperty ap = trTagToAnnotationProp(qTag); OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(qv.getValue())); anns.add(ann); } }
if (!id.equals(xid)) { OWLAxiom ax = fac .getOWLAnnotationAssertionAxiom(trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id), new HashSet<OWLAnnotation>()); add(ax);
if (!id.equals(xid)) { OWLAxiom ax = fac .getOWLAnnotationAssertionAxiom(trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id), new HashSet<OWLAnnotation>()); add(ax);
if (!id.equals(xid)) { OWLAxiom ax = fac .getOWLAnnotationAssertionAxiom(trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id), new HashSet<OWLAnnotation>()); add(ax);
if (!id.equals(xid)) { OWLAxiom ax = fac .getOWLAnnotationAssertionAxiom(trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id), new HashSet<OWLAnnotation>()); add(ax);
if (!xid.equals(id)) { OWLAxiom ax = fac .getOWLAnnotationAssertionAxiom(trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id), new HashSet<OWLAnnotation>()); add(ax);
if (!xid.equals(id)) { OWLAxiom ax = fac .getOWLAnnotationAssertionAxiom(trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id), new HashSet<OWLAnnotation>()); add(ax);
if (!xid.equals(id)) { OWLAxiom ax = fac .getOWLAnnotationAssertionAxiom(trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id), new HashSet<OWLAnnotation>()); add(ax);
if (!xid.equals(id)) { OWLAxiom ax = fac .getOWLAnnotationAssertionAxiom(trTagToAnnotationProp("shorthand"), p.getIRI(), trLiteral(id), new HashSet<OWLAnnotation>()); add(ax);