]> Lady’s Gitweb - Shushe/commit
Support parsed metadata current
authorLady <redacted>
Sun, 10 Aug 2025 21:33:12 +0000 (17:33 -0400)
committerLady <redacted>
Sun, 10 Aug 2025 21:49:00 +0000 (17:49 -0400)
commit53a87e096837ce277a5b90303884796627760e2a
treefe4f7d8f1c7bba53ccff8a9eb8b384b6b72ea9cb
parent338b26f8c92351bad03a180ad4b4f88e4cfeab76
Support parsed metadata

It is very common to want to have some basic metadata for files
with·out needing to include them in their entirety and then parse out
the metadata during the transform phase. This can be done, to an
extent, using a multi·stage build, but it would be a lot easier to
simply allow basic metadata to be parsed out of documents at the same
time as they are being parsed otherwise. This commit implements this
functionality.

The approach taken essentially changes the result of parsing to look
like :⁠—

```xml
<?xml version="1.0"?>
<书社:parsed>
<书社:result>
<!-- the result of the parse -->
</书社:result>
<书社:metadata>
<rdf:RDF>
<rdf:Description>
<!-- the result of the new 书社:about mode -->
</rdf:Description>
</rdf:RDF>
</书社:metadata>
</书社:parsed>
```

This requires adding an additional step to extract out the contents of
`/书社:parsed/书社:result`, which is very fast conceptually but yet
another file read∕write. Fortunately, as with parsed results in
general, this file should be infrequenly updated.

The parsed metadata is applied to
`$书社:about//*[@rdf:about=$IDENTIFIER]/nie:interpretedAs/*`; i·e it is
metadata on the _interpretation_ of the file; this aligns with it being
“parsed out” of the file by the parser.

Many of the best use·cases for this feature depend on being able to
declare “soft dependencies” (depending on a file with·out embedding
it), so that files can read in metadata from else·where with·out costly
reads and embeds, and files can depend on each others metadata in a
circular manner. “Soft dependency” support is planned, but not yet
implemented.

Right now, assets do not have parsed metadata. How·ever, it would be
nice if parsed metadata support could be added for assets which have
X·M·P metadata, which matches this format. That would have to be an
optional feature if `exiftool` (or similar) is available, and is left
as future work.
.metadata-format-changed-since
GNUmakefile
README.markdown
lib/catalog2parser.xslt
lib/expandmetadata.xslt
This page took 0.236945 seconds and 4 git commands to generate.