Closed pkiraly closed 6 years ago
The namespace changed recently. fr.univLille.cristal.shex is now fr.inria.lille.shexjava.
I don't have example without maven, but it should be really similar. I think there is a problem with the url of the file. You have written file:////[path to]/validation/Is1_Ip1_Io1.ttl and I think there is too many / at the beginning. For the url it is file:// then followed by the absolute path to your file. Can you try that and if it doesn't work can you give me the full URL that you are using?
Thanks for the response!
My suggestion is that you should update the README file accordingly.
I got the same response even if I put three '/'-s. The file points to the [git]/shexTest/validation/Is1_Ip1_Io1.ttl file (where [git] is the absolute path of the parent directory of the cloned shexTest project). If I remove the file:// protocol notation I get a different error mesage:
Error while reading the data file.
Caused by:
no protocol: [git]/shexTest/validation/Is1_Ip1_Io1.ttl
Was unable to the parse data. Aborting.
I have updated the readme.
Can you try running the following command and give me the output?
mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass="fr.inria.lille.shexjava.commandLine.Validate" -Dexec.args="-s ../../shexTest/schemas/1dotSemi.shex -d https://raw.githubusercontent.com/shexSpec/shexTest/master/validation/Is1_Ip1_Io1.ttl -l http://a.example/S1 -f http://a.example/s1 -a recursive"
Sure, this is what I get:
Validating graph https://raw.githubusercontent.com/shexSpec/shexTest/master/validation/Is1_Ip1_Io1.ttl against schema ../../shexTest/schemas/1dotSemi.shex.
Typing constructed.
http://a.example/s1 SATISFIES IRI:http://a.example/S1
And also, if I use file:///... notation in this command I received the same output. I received the error when I try to use it without maven, with pure Java. Maybe this part is handled by a Java library which I did not include into the classpath.
So I guess the next step is to try using the same classpath as maven. After some search, you can print it using the command:
mvn dependency:build-classpath -Dmdep.includeScope=runtime
Otherwise, the parsing of the data is done by the following code:
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.Rio;
...
java.net.URL documentUrl = new URL(dataFileName);
InputStream inputStream = documentUrl.openStream();
dataModel = Rio.parse(inputStream, documentUrl.toString(), RDFFormat.TURTLE);
So I managed to make it works using the following command lines:
mvn dependency:build-classpath -Dmdep.includeScope=runtime -Dmdep.outputFile=cp.txt
SHEXCP="target/shexjava-core-1.1.jar:"`cat cp.txt`
java -cp $SHEXCP fr.inria.lille.shexjava.commandLine.Validate -s ../../shexTest/schemas/1dotSemi.shex -d https://raw.githubusercontent.com/shexSpec/shexTest/master/validation/Is1_Ip1_Io1.ttl -l http://a.example/S1 -f http://a.example/s1 -a recursive
This produces the following output:
log4j:WARN No appenders could be found for logger (org.eclipse.rdf4j.rio.RDFParserRegistry).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Validating graph https://raw.githubusercontent.com/shexSpec/shexTest/master/validation/Is1_Ip1_Io1.ttl against schema ../../shexTest/schemas/1dotSemi.shex.
Typing constructed.
<http://a.example/s1> SATISFIES IRI:<http://a.example/S1>
Do you manage to reproduces it?
It works this way. Thanks a lot!
You are welcome. I am closing this issue if you don't have anything to add?
No, I don't have. You can close it.
Dear developers,
the README contains an example, how to run the software, i.e.:
mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass="fr.univLille.cristal.shex.commandLine.Validate" -Dexec.args="-s ../../shexTest/schemas/1dotSemi.shex -d file:///home/jdusart/Documents/Shex/workspace/shexTest/validation/Is1_Ip1_Io1.ttl -l http://a.example/S1 -f http://a.example/s1 -a recursive"
According to this, the Java class is
fr.univLille.cristal.shex.commandLine.Validate
, however in your basic namespace isfr.inria.lille.shexjava
.I have another question: Do you have examples for running the software from the command line without Maven, such as:
?
I tried this way:
and what I get: