Repository navigation
EMPTY: read the OWL files EMPTY.m reads, with its matching and failover (#11 item 3) - #14
Merged
Merged
Conversation
…er (#11 item 3) EMPTYProvider read empty-base.json; EMPTY.m reads main/empty-base.owl, detects RDF/XML vs functional syntax, and falls back to the development branch's src/ontology/empty-edit.owl, re-raising main's error when that 404s and combining both errors otherwise. Port all of it under MATLAB's method names (lookupTermOrID, performRemoteLookup, parseXMLFormat, parseFunctionalFormat, unescapeXML). Matching now follows EMPTY.m: bare numeric id or whole label, case-insensitive, exact. The old zero-padding, EMPTY_ form and label substring fallback are gone, as MATLAB has none of them. The per-process cache stays (by URL, failures never cached, reset by clearCache()). The 404 check uses the HTTP status rather than MATLAB's message sniffing. Both recorded in the bridge entry, now examined at 8e109b0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UaMQ8AiBeK9Bj7tZ7U1CS2
stevevanhooser
pushed a commit
that referenced
this pull request
Oct 21, 2026
…ed helpers main brought #14 (EMPTY), #15 (NCIT codes by obo_id), #17 (lookup trimming, the same fix as this branch's) and #18 (known_gaps). #15's NCITProvider.lookup_term called OLSProvider._search_ols, which this branch replaces; git merged it cleanly, and every NCIT lookup would have raised AttributeError. It now does what NCIT.m does on the ported helpers: preprocessLookupInput, then searchOLSAndPerformIRILookup on obo_id for ['NCIT:', search_query]. Its tests move to FakeOLS, plus one for the prefixed and numeric forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iFBFMQmEZaz21d9ZFJbiH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 3 of #11: brings
EMPTYProviderto parity withsrc/ndi/+ndi/+ontology/EMPTY.m(ndi-ontology-matlab @8e109b0). Only EMPTY changes, in code, tests and bridge entry. No other provider or bridge entry is touched.What changed
main/empty-base.owlinstead ofempty-base.json.EMPTY.mdoes. If the content contains<?xmlor<rdf:RDFit goes toparseXMLFormat; anything else goes toparseFunctionalFormat.development/src/ontology/empty-edit.owl.LookupFailed, which carries both errors (EMPTY.m:46-51).EMPTY.m:89/:160: the bare numeric id or the whole label, case-insensitive and exact, with the first match winning.EMPTY_0000074form and label-substring fallback are removed, because MATLAB has none of them.EMPTY:2and partial labels no longer resolve.EMPTY:<digits>, the label, the firstIAO_0000115definition, and every exact or related synonym.unescapeXMLin MATLAB's order:&before</>, leftover tags stripped, result trimmed. It is kept separate from the module's_unescape_xml, which other providers use and which gives different results.lookupTermOrID,performRemoteLookup,parseXMLFormat,parseFunctionalFormat,unescapeXML, plus the constantsOWL_URL_MAINandOWL_URL_DEV.Kept from #10
clearCache()resetsEMPTYProvider._cache. The cache now holds each file's body, keyed by URL.Deliberate differences (recorded in the bridge entry)
EMPTY.mcaches nothing, but a failure can no longer end up in the cache, so the cache is safe to keep.EMPTY.m:39checks whether the error message contains404orNot Found. Python checks the HTTP status code instead, so a term containing404is not mistaken for a missing branch. Only which error gets raised can differ; both versions raise.Testing
black,ruffandpytest -m "not live"(166 passed) are clean.-k EMPTY.Generated by Claude Code