Extract & persist IAO:0000700 as hasOntologyRootTerm
Part of ncbo/bioportal-project#218 (full design and decisions there).
Read an ontology's declared root terms (IAO:0000700, "has ontology root term") at submission-processing time and store them as a submission attribute, so the UI can start the class hierarchy at the declared roots instead of owl:Thing. This issue only exposes the metadata — it does not change /roots.
Changes
1. Declare the attribute — config/schemes/ontology_submission.yml:
hasOntologyRootTerm:
display: "relations"
label: "Ontology root term(s)"
helpText: "Class(es) the ontology declares as display roots (IAO:0000700)."
example: 'http://purl.obolibrary.org/obo/CL_0000000'
extractedMetadata: true
metadataMappings: [ "obo_purl:IAO_0000700" ]
2. Declare it on the model — models/ontology_submission.rb:
attribute :hasOntologyRootTerm, type: [:list, :uri]
(Mirrors obsoleteParent, but a list.)
Notes / verification
obo_purl (http://purl.obolibrary.org/obo/) is already registered in Goo.namespaces, so obo_purl:IAO_0000700 resolves with no new namespace.
- The existing
submission_extract_metadata operation queries with the ontology IRI as subject (SELECT … FROM <submission-graph> WHERE { <ontology_uri> obo_purl:IAO_0000700 ?o }) and handles :list URI attributes, so no new extraction code is expected.
- The attribute must be kept out of the
content_metadata_attributes reject list so it appears in the API catalog and the submission edit form (which is generated from that catalog). The user_provided_value guard preserves a manually set value across re-processing.
Acceptance
- Re-process an ontology that declares
IAO:0000700 (CL / Cell Ontology is the reference case); latest_submission?display=hasOntologyRootTerm returns the declared root(s).
- An ontology without the annotation returns an empty value, not an error.
- A submission where the value was set manually is not overwritten by re-processing.
Out of scope
Extract & persist
IAO:0000700ashasOntologyRootTermPart of ncbo/bioportal-project#218 (full design and decisions there).
Read an ontology's declared root terms (
IAO:0000700, "has ontology root term") at submission-processing time and store them as a submission attribute, so the UI can start the class hierarchy at the declared roots instead ofowl:Thing. This issue only exposes the metadata — it does not change/roots.Changes
1. Declare the attribute —
config/schemes/ontology_submission.yml:2. Declare it on the model —
models/ontology_submission.rb:(Mirrors
obsoleteParent, but a list.)Notes / verification
obo_purl(http://purl.obolibrary.org/obo/) is already registered inGoo.namespaces, soobo_purl:IAO_0000700resolves with no new namespace.submission_extract_metadataoperation queries with the ontology IRI as subject (SELECT … FROM <submission-graph> WHERE { <ontology_uri> obo_purl:IAO_0000700 ?o }) and handles:listURI attributes, so no new extraction code is expected.content_metadata_attributesreject list so it appears in the API catalog and the submission edit form (which is generated from that catalog). Theuser_provided_valueguard preserves a manually set value across re-processing.Acceptance
IAO:0000700(CL / Cell Ontology is the reference case);latest_submission?display=hasOntologyRootTermreturns the declared root(s).Out of scope
/rootsto prefer declared roots (deferred — P4 in CSV Format Change: prefLabel Field Now Contains List Instead of String Value #218).extract_metadatastep withprocess_rdf: falseetc.).