public List<OWLAnnotationAssertionAxiom> handleConflict(OWLEntity entity, OWLAnnotationProperty property, Collection<OWLAnnotationAssertionAxiom> annotations) throws AnnotationCardinalityException { if (annotations.size() > 1) { String tag = Owl2Obo.owlObjectToTag(property); if (tag == null) { tag = property.getIRI().toString(); } // take the first one in the collection // (may be random) LOGGER.log(Level.WARNING, "Fixing multiple " + tag + " tags for entity: " + entity.getIRI()); return Collections.singletonList(annotations.iterator().next()); } throw new AnnotationCardinalityException("Could not resolve conflict for property: "+property); }
public List<OWLAnnotation> handleConflict(OWLAnnotationProperty property, Collection<OWLAnnotation> ontologyAnnotations) throws AnnotationCardinalityException { if (ontologyAnnotations.size() > 1) { String tag = Owl2Obo.owlObjectToTag(property); if (tag == null) { tag = property.getIRI().toString(); } // take the first one in the collection // (may be random) LOGGER.log(Level.WARNING, "Fixing multiple ontolgy annotations with, tag: " + tag); return Collections.singletonList(ontologyAnnotations.iterator().next()); } throw new AnnotationCardinalityException("Could not resolve conflict for property: "+property); } };
private void addQualifiers(Clause c, Set<OWLAnnotation> qualifiers){ for(OWLAnnotation ann: qualifiers){ String prop = owlObjectToTag(ann.getProperty()); if (prop == null) { prop = ann.getProperty().getIRI().toString(); } if (prop.equals("gci_relation") || prop.equals("gci_filler") || prop.equals("cardinality") || prop.equals("minCardinality") || prop.equals("maxCardinality") || prop.equals("all_some") || prop.equals("all_only")) { continue; } String value = ann.getValue().toString(); if(ann.getValue() instanceof OWLLiteral){ value = ((OWLLiteral) ann.getValue()).getLiteral(); }else if(ann.getValue() instanceof IRI){ value = getIdentifierUsingBaseOntology((IRI)ann.getValue()); //getIdentifier((IRI)aanAx.getValue()); } QualifierValue qv = new QualifierValue(prop, value); c.addQualifierValue(qv); } }
private void handleSynonym(Set<OWLAnnotation> qualifiers, String scope, Clause clause, Set<OWLAnnotation> unprocessedQualifiers) { clause.setTag(OboFormatTag.TAG_SYNONYM.getTag()); String type = null; clause.setXrefs(new Vector<Xref>()); for(OWLAnnotation aan: qualifiers){ String propId = owlObjectToTag(aan.getProperty()); if(OboFormatTag.TAG_XREF.getTag().equals(propId)){ String xrefValue = ((OWLLiteral) aan.getValue()).getLiteral(); Xref xref = new Xref(xrefValue); clause.addXref(xref); unprocessedQualifiers.remove(aan); }else if(OboFormatTag.TAG_HAS_SYNONYM_TYPE.getTag().equals(propId)){ type = getIdentifier(aan.getValue()); unprocessedQualifiers.remove(aan); } } if(scope != null){ clause.addValue(scope); if(type != null){ clause.addValue(type); } } }
String tag = owlObjectToTag(prop); if(OboFormatTag.TAG_IS_METADATA_TAG.getTag().equals(tag)){ f = getTypedefFrame(entity);
String _tag = owlObjectToTag(sup); if (OboFormatTag.TAG_SYNONYMTYPEDEF.getTag().equals(_tag)) { String name = ""; String scope = null; for(OWLAnnotationAssertionAxiom axiom: sub.getAnnotationAssertionAxioms(owlOntology)){ String tg = owlObjectToTag(axiom.getProperty()); if(OboFormatTag.TAG_NAME.getTag().equals(tg)){ name = ((OWLLiteral)axiom.getValue()).getLiteral(); }else if(OboFormatTag.TAG_SCOPE.getTag().equals(tg)){ scope = owlObjectToTag(axiom.getValue()); String comment = ""; for(OWLAnnotationAssertionAxiom axiom: sub.getAnnotationAssertionAxioms(owlOntology)){ String tg = owlObjectToTag(axiom.getProperty()); if(OboFormatTag.TAG_COMMENT.getTag().equals(tg)){ comment = ((OWLLiteral)axiom.getValue()).getLiteral();
private boolean tr(OWLAnnotationProperty prop, OWLAnnotationValue annVal, Set<OWLAnnotation> qualifiers, Frame frame) { String tagString = owlObjectToTag(prop); String synonymType = null; if (tagString == null) { String propId = owlObjectToTag(aan.getProperty()); if("xref".equals(propId)){ String xrefValue = ((OWLLiteral) aan.getValue()).getLiteral();
String tagString = owlObjectToTag(property); if (OboFormatTag.TAG_COMMENT.getTag().equals(tagString)) { property = fac.getOWLAnnotationProperty(Obo2Owl.trTagToIRI(OboFormatTag.TAG_REMARK.getTag()));