-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cli tools #359
Conversation
Also, I have yet to write the corresponding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! Here are some comments for changes in the actual code. I will write a separate comment to respond to your questions and the text in the PR description.
...nector/src/main/java/se/liu/ida/hefquin/engine/wrappers/lpg/conn/Neo4jConnectionFactory.java
Outdated
Show resolved
Hide resolved
...nector/src/main/java/se/liu/ida/hefquin/engine/wrappers/lpg/conn/Neo4jConnectionFactory.java
Outdated
Show resolved
Hide resolved
...nector/src/main/java/se/liu/ida/hefquin/engine/wrappers/lpg/conn/Neo4jConnectionFactory.java
Show resolved
Hide resolved
...nector/src/main/java/se/liu/ida/hefquin/engine/wrappers/lpg/conn/Neo4jConnectionFactory.java
Outdated
Show resolved
Hide resolved
hefquin-service/src/main/java/se/liu/ida/hefquin/service/HeFQUINServlet.java
Show resolved
Hide resolved
Yes! The shell scripts should really just be simple wrappers around the Java programs and it makes no sense to duplicate usage instructions, argument validation, etc. Is there any specific issue in the current Java-side usage instructions, argument validation, etc. that you didn't like and, thus, made you start replicating this functionality in the scripts?
Probably yes. I have so far only played around with a Neo4j instance that I start natively on my computer, and that one doesn't need a username/password.
Looks good. That would have been another TODO anyways. I think we may still want to make that a bit more robust in the future, but for the moment your extension is a good intermediate solution.
I don't like the need to create this extra directory ( ... at least not when working on the source code package. For the release packages that contain only the binaries, however, it makes sense to have all the relevant JARs in such a |
…appers/lpg/conn/Neo4jConnectionFactory.java Co-authored-by: Olaf Hartig <olaf.hartig@liu.se>
Great! I will try it to confirm that it works on my computer as well.
Okay, so this doesn't affect me unless I really want to use the WAR. In other words, if I want to use the built-in servlet container to run the service, I still need to do only
I see that you are still pushing commits. Shall I take a look at the PR now or wait until you are done? |
Now this is ready to be reviewed. Had forgotten to update |
Correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates to Neo4jConnectionFactory according to review discussion were done in separate commits.
...nector/src/main/java/se/liu/ida/hefquin/engine/wrappers/lpg/conn/Neo4jConnectionFactory.java
Outdated
Show resolved
Hide resolved
...nector/src/main/java/se/liu/ida/hefquin/engine/wrappers/lpg/conn/Neo4jConnectionFactory.java
Outdated
Show resolved
Hide resolved
@keski I was checking the CLI tools on my computer and had to make a change: The scripts wouldn't run with the given she bang Additionally, I extended Please check that things still work on your side. |
Regarding the separate compilation of the WAR file (which you mention above), it doesn't work on my computer. More specifically, after successfully running
I do
which gives me the following error message.
Do you have any idea how to fix this issue? |
hefquin-cli/src/main/java/se/liu/ida/hefquin/cli/modules/ModEndpoint.java
Outdated
Show resolved
Hide resolved
hefquin-cli/src/main/java/se/liu/ida/hefquin/cli/modules/ModEndpoint.java
Outdated
Show resolved
Hide resolved
hefquin-cli/src/main/java/se/liu/ida/hefquin/cli/modules/ModEndpoint.java
Outdated
Show resolved
Hide resolved
hefquin-cli/src/main/java/se/liu/ida/hefquin/cli/RunBGPOverNeo4j.java
Outdated
Show resolved
Hide resolved
hefquin-cli/src/main/java/se/liu/ida/hefquin/cli/MaterializeRDFViewOfLPG.java
Outdated
Show resolved
Hide resolved
hefquin-cli/src/main/java/se/liu/ida/hefquin/cli/RunBGPOverNeo4j.java
Outdated
Show resolved
Hide resolved
hefquin-cli/src/main/java/se/liu/ida/hefquin/cli/RunBGPOverNeo4j.java
Outdated
Show resolved
Hide resolved
hefquin-service/src/test/java/se/liu/ida/hefquin/service/HeFQUINServletTest.java
Outdated
Show resolved
Hide resolved
…dpoint.java Co-authored-by: Olaf Hartig <olaf.hartig@liu.se>
…dpoint.java Co-authored-by: Olaf Hartig <olaf.hartig@liu.se>
…4j.java Co-authored-by: Olaf Hartig <olaf.hartig@liu.se>
…INServletTest.java Co-authored-by: Olaf Hartig <olaf.hartig@liu.se>
Could you try running |
Running the scripts with bash ( |
That works. But doing it this way means that creating the WAR would require one to always deploy/install the JARs locally first. While that's not so nice, I can live with it. However, it also means that invoking both steps on a single line:
does not actually do what one would expect; i.e., the WAR is not built using the JARs created in the first step but, instead, using some JARs (of the same version) that have been deployed/installed earlier using Do you still have an idea how to improve this part? Otherwise, we will have to live with it. (The rest of the PR is okay now. Thanks!!!) |
I just found that there is an option that tells Maven to also build all required dependencies mvn package -pl hefquin-service -P build-war -am |
Perfect, that works! (yes, I removed the earlier-installed JARs from my So, the one-line version for compiling and packaging everything (the JARs and the WAR) then is:
I will merge the PR now :-) |
This pull request is not yet ready for merge but should be discussed.
This pull request adds the following CLI wrappers:
hefquin
- runs a query via the enginehefquin-server
- starts the embedded Web servicehefquin-pgmat
- materializes the RDF view of the PGhefquin-pg
- runs a SPARQL query over a PG storeFor
hefquin
,hefquin-server
, andhefquin-pgmat
the wrapper script provides usage instruction and and some argument validation. However, I realized when working onhefquin-pg
that there is a great risk of introducing discrepancies between the script the the underlying Java CLI files. Thus I think we should focus on improving the usage instructions, argument validation, and error messages on the Java side, and then drop these parts on the script side.With respect to the
hefquin-service
, there was a need to add command-line configuration support. Thus the use of a separate configuration file has been dropped andSystem.properties
is now instead used to configure the servlet. This also means that there is no longer any need for theConfigLoader
.For
hefquin-pgmat
andhefquin-pg
, I was unable to make it work on my side without also introducing authorization (i.e. authentication). But I was running Neo4J in a docker container so I'm not sure if this was simply preconfigured for me. Anyways, I added parameters forusername
/password
and passed these on to the connection if provided.Usage
To use the scripts, the
bin/
file needs to be added to the path, andHEFQUIN_HOME
must be pointing to a directory containing the uber jars forhefquin-cli
andhefquin-server
. For example, from the project root run:Q: How much focus we should put into making the Java CLI more user friendly in terms of parameter validation, usage instructions, and help texts at this point?