validate
:
- defines a set of RDF files as 'data',
- defines a set of RDF files as 'shapes',
- performs SHACL validation of the data using the shapes
- writes the validation report (in RDF) to an output file
- causes the build to fail if there is one report at or above the
failOnSeverity
threshold (default:Violation
)
infer
:
- defines a set of RDF files as 'data',
- defines a set of RDF files as 'shapes',
- performs SHACL-AF inference of the data using the shapes
- writes the inferred triples to an output file
Both targets are configured with 2 filesets (<shapes>
and <data>
) that <include>
and <exclude>
files using comma/newline-separated ant-style patterns.
The output is written to the <outputFile>
. One may <skip/>
such a fileset if needed.
For the 'validate' target, this configuration is provided in <validations>/<validate>
elements. The validiation report is written to the<outputFile>
.
The optional <failOnSeverity>
parameter (values Violation
, Warning
, Info
) is used to specify the severity level that causes the build to fail.
For the 'infer' target, the configuration is provided in <inferences>/<inference>
elements. The inferred triples are written to the<outputFile>
.
Example configuring both targets and running them in different build lifecycle phases:
<build>
<plugins>
<plugin>
<groupId>io.github.qudtlib</groupId>
<artifactId>shacl-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<validations>
<validation>
<skip>false</skip>
<shapes>
<include>my/shapes.ttl</include>
</shapes>
<data>
<include>**/*.ttl</include>
<exclude>**/*deprecated*.ttl</exclude>
</data>
<outputFile>target/validationReport.ttl</outputFile>
</validation>
</validations>
<inferences>
<inference>
<shapes>
<include>my/rules.ttl</include>
</shapes>
<data>
<include>**/*.ttl</include>
<exclude>**/*deprecated*.ttl</exclude>
</data>
<outputFile>target/inferences.ttl</outputFile>
</inference>
</inferences>
</configuration>
<executions>
<execution>
<id>infer</id>
<phase>compile</phase>
<goals>
<goal>infer</goal>
</goals>
</execution>
<execution>
<id>validate</id>
<phase>test</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>