Open phil-hanisch opened 3 years ago
Same issue here, tried to juggle parameters around but no luck.
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.
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).
This is still an issue in version 0.9
It is not possible to run the command-line client with the argument
materialize
. It results in the errorUnmatched argument at index 0: 'materialize'
. Both Rulewerk v0.7.0 and the current master version contain this issue.Steps to reproduce:
java -jar rulewerk.jar materialize --rule-file=doid.rls --query=humansWhoDiedOfCancer\(\?X\) --query=humansWhoDiedOfNoncancer\(\?X\)
leads toUnmatched argument at index 0: 'materialize'