From: Lady Date: Sun, 10 Aug 2025 21:33:12 +0000 (-0400) Subject: Support parsed metadata X-Git-Url: https://git.ladys.computer/Shushe/commitdiff_plain/53a87e096837ce277a5b90303884796627760e2a?hp=53a87e096837ce277a5b90303884796627760e2a 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 <书社:parsed> <书社:result> <书社:metadata> ``` 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. ---