ATOP 2023-03-27 to 2023-03-31
to : Martin Holmes
Minutes: 200
On Tuesday, began working on the mechanisms by which we might retrieve or generate
namespaces and their associated prefixes from any context in which we need to supply
the @context
attribute for a Schematron rule we need to construct. This
is how far I’ve got:
- You can retrieve all the in-scope prefixes for any given context, and you can retrieve the namespace URI for each of those prefixes; however, I don’t see how that can be done globally, because many prefixes will be declared in different places in the tree, and be in-scope only in those specific contexts. Unless we enumerate all possible contexts in the tree, we can’t reliably retrieve all possible prefixes and their associated ns URIs.
- Given the above, the same prefix might be re-used for different ns URIs in different contexts, which means there can be no usable global mapping of prefixes to namespaces at all. Similarly, the same URI might have multiple prefixes in different contexts.
- Given this, it seems to me that the only sane thing would be to invent a prefix for every ns we can discover, using the pattern atopns1, with the exception of a specific selection of well-known (to our community) URIs including TEI, Examples, Schematron, RELAXNG, etc., for which we could specify conventional prefixes.
- So it seems to me that if we are going to be able to call out from any random context where we find Schematron to get a prefix we can use for a specific namespace, and we want to use the same prefix every time for any given namespace, we will need to do this:
- Create a global map by visiting every node in the tree and getting the in-scope prefixes there, then the URI for each of those prefixes;
- Take the distinct-values of that collection of URIs and create a map which includes, first, every one of our known/familiar namespaces as keys, with values of their associated well-known prefix, then for each of the unfamiliar ones, add a map entry for the namespace and make its value the next constructed
atopns1
-style prefix.
On Wednesday, had our regular project meeting.