Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow arbitrary defined annotation properties as qualifier tags in OBO format #1099

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,15 @@ public static IRI trTagToIRI(String tag) {
return iri;
}

@Nonnull
private IRI trTagToIRIIncludingTypedefs(String tag) {
IRI iri = ANNOTATIONPROPERTYMAP.get(tag);
if (iri == null) {
iri = oboIdToIRI(tag);
}
return iri;
}

/**
* Translate tag to annotation prop.
*
Expand All @@ -1526,7 +1535,7 @@ public static IRI trTagToIRI(String tag) {
*/
@Nonnull
protected OWLAnnotationProperty trTagToAnnotationProp(@Nonnull String tag) {
IRI iri = trTagToIRI(tag);
IRI iri = trTagToIRIIncludingTypedefs(tag);
OWLAnnotationProperty ap = fac.getOWLAnnotationProperty(iri);
if (!apToDeclare.contains(ap)) {
apToDeclare.add(ap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,8 @@ public static String owlObjectToTag(OWLObject obj) {
String prefix = Obo2OWLConstants.OIOVOCAB_IRI_PREFIX;
if (iri.startsWith(prefix)) {
tag = iri.substring(prefix.length());
} else {
tag = getIdentifier(iriObj);
}
}
return tag;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public enum Obo2OWLVocabulary implements HasIRI {
/**IRI_IAO_0100001*/ IRI_IAO_0100001(DEFAULT_IRI_PREFIX, "IAO_0100001", "term replaced by", OboFormatTag.TAG_REPLACED_BY.getTag()),
/**IRI_OIO_shorthand*/ IRI_OIO_shorthand(OIOVOCAB_IRI_PREFIX, "shorthand", "shorthand", "shorthand"),
/**IRI_OIO_consider*/ IRI_OIO_consider(OIOVOCAB_IRI_PREFIX, "consider", "consider", OboFormatTag.TAG_CONSIDER.getTag()),
/**IRI_OIO_id*/ IRI_OIO_id(OIOVOCAB_IRI_PREFIX, "id", "id", OboFormatTag.TAG_ID.getTag()),
/**IRI_OIO_hasOBOFormatVersion*/ IRI_OIO_hasOBOFormatVersion(OIOVOCAB_IRI_PREFIX, "hasOBOFormatVersion", "has_obo_format_version", OboFormatTag.TAG_FORMAT_VERSION.getTag()),
/**IRI_OIO_treatXrefsAsIsA*/ IRI_OIO_treatXrefsAsIsA(OIOVOCAB_IRI_PREFIX, "treat-xrefs-as-is_a", "treat-xrefs-as-is_a", OboFormatTag.TAG_TREAT_XREFS_AS_IS_A.getTag()),
/**IRI_OIO_treatXrefsAsHasSubClass*/ IRI_OIO_treatXrefsAsHasSubClass(OIOVOCAB_IRI_PREFIX, "treat-xrefs-as-has-subclass", "treat-xrefs-as-has-subclass", OboFormatTag.TAG_TREAT_XREFS_AS_HAS_SUBCLASS.getTag()),
Expand Down