This is not exactly an answer but the specs asked by Ulrike Fischer in the comemnts above. It is still in embryonic form and we will edit it accordingly.
The package metadata will define and allow for use and validation
of metadata entries.
To define a new enrty use:
\definemetadataentry[type=
format=yyyy-mm-dd,
lower_range=0001-01-01,
upper_range=9999-12-31,
finite_range=,
default_value=,
optional/required,
validation_routine=,
hierarchy=
]{name_of_metadata_entry}
where:
type (of data):
Can be:
- NUMERIC (INTEGER or DECIMAL)
- CHARACTERSTRING
- DATETIME
format:
Supply the format of the data type just defined.
lower_range=0001-01-01:
upper_range=9999-12-31:
Defines the lower and upper range of data that is either continuous or too long to be listed in full.
Example of Range for a date set: 0001-01-01 through 9999-12-31
finite_range:
Defines the range of data that can be easily listed in full.
default_value:
The value that a metadata entry defaults to, if not defined.
optional/required:
Defines if a particular metadata entry is requied or optional
within the realm that defines it.
validation_routine (external):
A call to an external routine that validates the entry.
hierarchy:
An element defined recusively in terms of another, previously
defined metadata entry.
Definitions and Example of use
Types of data:
There are 3 types of data to consider:
- NUMERIC (INTEGER or DECIMAL)
- CHARACTERSTRING
- DATETIME
DATE Format:
DATE: Format: YYYY-MM-DD
DATETIME: Format: YYYY-MM-DD HH:MI:SS
Format of date can be of different types such as: 'dd-mm-yyyy', 'yyyy-mm-dd', 'mm-dd-yyyy'.
To mention the 10 most used formats, with short-century (yy) and with
long-century (yyyy).
- U.S.: mm/dd/yy & mm/dd/yyyy
- ANSI: yy.mm.dd & yyyy.mm.dd
- British/French: dd/mm/yy & dd/mm/yyyy
- German: dd.mm.yy & dd.mm.yyyy
- Japan: yy/mm/dd & yyyy/mm/dd
- ISO: yymmdd & yyyymmdd
- Europe default + milliseconds: dd mon yyyy hh:mi:ss:mmm (24h)
- Hijri: dd/mm/yyyy hh:mi:ss:mmmAM
RequirePackage{metadata}
\definemetadataentry[type=DATETIME,
format=yyyy-mm-dd,
lower_range=0001-01-01,
upper_range=9999-12-31
default_value=2000-12-31,
optional,
validation_routine=/usr/local/texlive2024/bin/abc.lua,
]{date_of_publication}
\definemetadataentry[type=DECIMAL,
fomat=(8,6),
]{latitude}
\definemetadataentry[type=DECIMAL,
format=(9,6),
]{llongitude}
\definemetadataentry[type=CHARACTERSTRING]{email}
\definemetadataentry[type=CHARACTERSTRING]{url}
\definemetadataentry[type=NUMERIC,
format=integer,
lower-range=1,
upper-range=9999,
]{volume_number}
\definemetadataentry[type=CHARACTERSTRING(2),
range={US,MX,CA,GT,HT,CU,HN,...},
]{north_american_country}
Hierarchy of metadatada.
\definemetadataentry[type=CHARACTERSTRING(2),
required,
]{country}
\definemetadataentry[type=CHARACTERSTRING(10),
hierarchy=country,
]{zipcode}
Example of use:
\zipcode[BR]{22430-085}
\zipcode[US]{91106-3840}
\zipcode[CA]{K1A 0T6}
\zipcode[DE]{13057}
\zipcode[IR]{81599-95950}
\definemetadataentry[type=CHARACTERSTRING(2),
required,
]{decade}
\definemetadataentry[type=CHARACTERSTRING(10),
hierarchy=decade,
]{msc}
Example of use:
\msc[2010]{76B75}
\msc[2020]{76D55}
\definemetadataentry[type=CHARACTERSTRING(100),
required,
]{full_name}
\definemetadataentry[type=CHARACTERSTRING(30),
hierarchy=full_name,
]{last_name}
Example of use:
\full_name{John Ewing}
\last_name{Ewing}
datecould include multiple entry formats: xx/yy/zzzz or yy/zzzz ... The renderization would depend on language and locale and the test for the validity of 29/02/2024 is already a quite non trivial programming. – TeX Apprentice Jan 07 '24 at 14:43hypperrefknows how to handle most of this (for existing metadata). If you or anyone else wants to create the desired package, you might peek intohyperref. If your metadata needs only XMP, might be easiest. – rallg Jan 07 '24 at 16:58metadata and what is the difference betweendataandmetadatawith respect to the OP example? You can easily parse json for example with Lua and you can store whatever you need, validate etc. Lua is a data language and you can use it for handling data of any form. But as Ulrike mentioned, step 1, develop a spec. – yannisl Jan 07 '24 at 17:08metadata=Embed in the PDF a custom info|dictionary to be read by computers and not humans! – yannisl Jan 08 '24 at 02:34hyperxmp– yannisl Jan 08 '24 at 04:29