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

Implement the metaschema-cli query command #267

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

aj-stein-nist
Copy link
Collaborator

@aj-stein-nist aj-stein-nist commented Dec 1, 2023

Committer Notes

Closes #241.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you squashed any non-relevant commits and commit messages? [instructions]
  • Do all automated CI/CD checks pass?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all website](https://pages.nist.gov/metaschema) and readme documentation affected by the changes you made? Changes to the website can be made in the website/content directory of your branch.

@aj-stein-nist
Copy link
Collaborator Author

I discussed with @david-waltermire-nist and I think to make this easily testable. I will have to adjust the existing tests first a bit, following my oscal-cli approach from here.

usnistgov/oscal-cli@4b6b205

/cc @Arminta-Jenkins-NIST

@aj-stein-nist
Copy link
Collaborator Author

Rebasing this off of the #271 branch until it lands, wanted to keep it separate from this code and just the relevant tests later.

@aj-stein-nist
Copy link
Collaborator Author

aj-stein-nist commented Jan 23, 2024

TODO Work:

  • Add functionality to the CLI to support a document being passed in via STDIN not with an explicit file path.
  • The Metaschema and document instance file path arguments should be URIable, not just local file paths. PRed separately to develop in Allow file or URI arguments to metaschema-cli #298 and this PR will rebase once merged.
  • Add an --as=FORMAT command to support the output "converting" to desired output format of a node item.
  • Render various forms of complex output, see challenges below.

Challenges:

  1. What do we do if there is a collection of node items? A little more straightforward, join them into a single document dynamically for display purposes.
  2. What do we do if there is a mixture of stringifiable values (atomic items) and node items? Re 1, this is a lot more complex than that because it now "two documents" you just dynamically join in a collection. Do we use a delimiter --- between results? Do we allow a CLI argument to change that delimiter at runtime? Food for thought.
  3. It is unclear we should support a CLI runtime for "simple expressions only" for education and understanding, without a defined document instance and the module it conforms to it. It is not clear this is a primary goal or not, and it will potentially cause confusion (even A.J. forgets) because you need to process a document and module together. So where the criterion for simple enough or too complex is not clear at this time.
  4. Maybe not in this PR, we are going to have to plan better work around error message and handling (that comes later).

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

Successfully merging this pull request may close these issues.

Metapath Query Parser for the CLI
1 participant