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

Running the command-line client with 'materialize' not possible #201

Open
phil-hanisch opened this issue Mar 9, 2021 · 4 comments
Open
Labels
bug Something isn't working

Comments

@phil-hanisch
Copy link

It is not possible to run the command-line client with the argument materialize.
It results in the error Unmatched argument at index 0: 'materialize'.
Both Rulewerk v0.7.0 and the current master version contain this issue.

Steps to reproduce:

  • follow the example for the command-line client
  • running java -jar rulewerk.jar materialize --rule-file=doid.rls --query=humansWhoDiedOfCancer\(\?X\) --query=humansWhoDiedOfNoncancer\(\?X\) leads to Unmatched argument at index 0: 'materialize'
@mzattera
Copy link

Same issue here, tried to juggle parameters around but no luck.

@mzattera
Copy link

Version 0.6.0 recognizes the command (I have other issues with running the doid example under Windows) but version 0..0 (Latest) does not.

@mkroetzsch
Copy link
Member

Yes, this mode of running Rulewerk was damaged during the re-implementation of the Rulewerk shell. In the future, a more flexible way of passing commands to the command-line client will be supported. To some extent, this is already possible as a workaround to this issue. The following works:

echo -e "@load './doid.rls' .\n @reason .\n @query humansWhoDiedOfCancer(?X) ." | java -jar /path/to/standalone-rulewerk-client-0.7.0.jar

This will execute the following three commands:

  • @load './doid.rls' .
  • @reason .
  • @query humansWhoDiedOfCancer(?X) .

and then exit. Using the usual syntax, one can also export query results to CSV or materialize all facts to an rls file: see @help query and @help export in the rulewerk shell for details. Please note that @source directives that use paths inside the rls file must use paths that are relative to the location of the rls file.

In this way, arbitrary batch processing of tasks through rulewerk is already possible from the command line, but the interface is still a bit fragile (e.g., the newlines \n in the input are needed at the moment for the parser to work).

@mmarx mmarx added the bug Something isn't working label May 2, 2023
@marco-calautti
Copy link

This is still an issue in version 0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants