Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pattern/@document should allow variable that is a document #63

Open
rjelliffe opened this issue Jun 7, 2023 · 1 comment
Open

pattern/@document should allow variable that is a document #63

rjelliffe opened this issue Jun 7, 2023 · 1 comment
Labels
element pattern Issues relating to element pattern

Comments

@rjelliffe
Copy link
Member

rjelliffe commented Jun 7, 2023

At the moment, sch:pattern/@documents takes a list of IRIs, or string variables.

I propose that it shoukd also allow variables names that are documents.

For example, at its simplest:
'''
<sch:let name="xxx" as="document()" >
< x/>
</sch:let>
<sch:pattern document=" $xxx " > ...
'''

This would address three issues:

  1. The document could be selected by an Xpath, allowing use of document-available() for better fallback. For example, if the extetnal document is not available, the variable is a document with a fallback element < no-doc/> which can then have a rule/report in the pattern so the SVRL reflects that no document was found.
  2. The document could be JSON parsed by the XPath3 functiom, or csv parsed by some function provided, or constructed ftom multiple inputs
  3. There would be no risk that if multiple patterns validate the same @document, that document gets read in multiple times.

I don't think this would be hard to implement: iterate over each token,
if the token does not start with $ treat it as an IRI,
else if it starts with $ then check if the variable's contains a document() and use that,
else take the string value of the variable as an IRI.

Rick

@AndrewSales AndrewSales added the element pattern Issues relating to element pattern label Jun 19, 2023
@dmj
Copy link
Member

dmj commented Aug 2, 2023

At the moment, sch:pattern/https://github.com/documents takes a list of IRIs, or string variables.

I think this is not correct: The @‍documents attribute contains an expression that evaluates to a sequence of IRIs. The envisioned use-case for @‍documents is a manifest file that enumerates a list of other files. If the files are e.g. referenced by an &lt;link&gt; element with an @‍href attribute, then &lt;pattern documents="link/@‍href"&gt; would return the sequence of IRIs of the documents you want to validate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
element pattern Issues relating to element pattern
Projects
None yet
Development

No branches or pull requests

3 participants