fetch_asm_document
Fetch raw Allotrope Simple Model (ASM) JSON documents from purl.allotrope.org, save them locally, and return the absolute file path.
Instructions
Fetch a raw ASM JSON document from purl.allotrope.org.
Downloads the document identified by ``asm_document_uri`` from the Allotrope
PURL repository and saves it to the local filesystem at a path that mirrors
the URI structure. If the file already exists it is returned immediately
without re-downloading. ``$ref`` references are
NOT resolved — the document is saved exactly as received.
Args:
asm_document_uri: Fully-qualified URI starting with
``http://purl.allotrope.org``.
output_dir: Base directory for saving the document. Defaults to the
current working directory when empty.
Returns:
JSON string with a ``path`` key containing the absolute path to the
saved file, or an ``error`` key with a description on failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_dir | No | ||
| asm_document_uri | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |