Advanced Octave A58 — Documentation and descriptors from the Bridge
Advanced GNU Octave with GX-TXT · Module 10
To use an API reliably, you need to know which operations and contracts belong to the installed version. The Documentation Browser allows you to search and read public entries from the same copy of the framework.
Objectives and prerequisites
Let’s repeat the calls to the Bridge used in previous lessons. The test uses GX-TXT dev112-P011-bis and GNU Octave 9.4.0. Import catalogo.m, register it and run it in the Runner.
Discover and read
DOCUMENTATION_BROWSER_API_v1/api_info describes the service; list searches for items associated with NUMERIC_API_v1. The test finds a voice with ID api:NUMERIC_API_v1. The script shows the metadata and uses read on the returned ID to read the text; print only length and first row, avoiding pouring all the manual into the output.
In addition, API_CATALOG_SERVICE_API_v1/status reports the status of the catalogue installed. A document item describes the contract; it does not imply that each host operation is invoked by a script. For a specific operation also check the Script Bridge cover, arguments and capabilities required in the version in use.
Choose the right source
See the copy documentation with which you run the program: a manual of another release can list different operations or behaviors. It records the name and version of the API along with the parameters of analysis. The result of the search can change if installation or modules change; a script must also manage the absence of entries.
Exercise
- What identification of the numerical voice was found in the test?
- Why use the ID returned by
listin theread? - The fact that a function is documented for the host ensures that it is available via Bridge?
Worked solution
api:NUMERIC_API_v1.- To read the item actually identified by the catalog installed.
- No: you need to check the Bridge’s cover and contract.
Other steps of this project
- Advanced Octave A75 — Dynamical systems in phase space
- Advanced Octave A81 — Geography of the waves and a 3D surface
- Advanced Octave A82 — Age, sex and demographic inequalities
- Advanced Octave A83 — All-cause mortality, certified COVID deaths and surveillance
- Advanced Octave A84 — A reproducible public account
- Advanced Octave A73 — Optimization landscapes and 3D trajectories