opencaesar / owl-tools

A set of analysis tools for OWL
Apache License 2.0
5 stars 1 forks source link

Output directory #30

Closed NicolasRouquette closed 2 years ago

NicolasRouquette commented 2 years ago

Fixes #29

There could be an improvement for this example:

task owlShacl(type:io.opencaesar.owl.shacl.fuseki.OwlShaclFusekiTask, dependsOn: owlLoad, group: 'oml') {
    endpointURL = "http://localhost:3030/$fusekiDataset"
    queryPath = file('src/shacl')
    resultPath = file('build/reports')
}

If the queryPath does not exists, we get no error message:

 .\gradlew

> Configure project :

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\opt\local\github.imce-demos\msr-fse-demo1\build.gradle' line: 400

* What went wrong:
A problem occurred evaluating root project 'msr-fse-demo1'.
> C:\opt\local\github.imce-demos\msr-fse-demo1\src\shacl
   > C:\opt\local\github.imce-demos\msr-fse-demo1\src\shacl

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

With --stacktrace, we find that the exception comes from this code:

    protected void calculateInputOutputFiles() {
        if (null != queryPath && null != resultPath) {
            final List<File> inputFiles = new ArrayList<>();
            final List<File> outputFiles = new ArrayList<>();
            if (queryPath.isFile()) {
                inputFiles.add(queryPath);
            } else {
                // See https://docs.oracle.com/javase/8/docs/api/java/nio/file/DirectoryStream.html
                try (DirectoryStream<Path> stream = Files.newDirectoryStream(queryPath.toPath(), "*.shacl")) {
                    for (Path entry : stream) {
                        inputFiles.add(entry.toFile());
                    }
                } catch (DirectoryIteratorException ex) {
                    throw new ProjectConfigurationException(ex.getCause().getMessage(), ex.getCause());
                } catch (IOException e) {
                    throw new ProjectConfigurationException(e.getMessage(), e); // here
                }
            }
...

Tried to throw GradleException -- still no message.