From e8b500feb380db6a927dd3be92ef2fadfca1c12e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20M=2E=20Ottestad?= Date: Thu, 29 Jan 2026 20:43:04 +0100 Subject: [PATCH 1/2] GH-0000 Expose SHACL options in workbench --- .../rdf4j/repository/config/memory-shacl.ttl | 15 ++ .../rdf4j/repository/config/native-shacl.ttl | 15 ++ .../transformations/create-memory-shacl.xsl | 157 ++++++++++++++++++ .../transformations/create-native-shacl.xsl | 157 ++++++++++++++++++ .../workbench/commands/CreateServletTest.java | 50 ++++++ 5 files changed, 394 insertions(+) diff --git a/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl b/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl index 30bc38c117e..beb0cb1e44b 100644 --- a/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl +++ b/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl @@ -11,6 +11,21 @@ config:rep.type "openrdf:SailRepository" ; config:sail.impl [ config:sail.type "rdf4j:ShaclSail" ; + config:shacl.parallelValidation {%Parallel validation|true|false%} ; + config:shacl.logValidationPlans {%Log validation plans|true|false%} ; + config:shacl.logValidationViolations {%Log validation violations|true|false%} ; + config:shacl.validationEnabled {%Validation enabled|true|false%} ; + config:shacl.cacheSelectNodes {%Cache select nodes|true|false%} ; + config:shacl.globalLogValidationExecution {%Global log validation execution|true|false%} ; + config:shacl.rdfsSubClassReasoning {%RDFS subclass reasoning|true|false%} ; + config:shacl.performanceLogging {%Performance logging|true|false%} ; + config:shacl.serializableValidation {%Serializable validation|true|false%} ; + config:shacl.eclipseRdf4jShaclExtensions {%Eclipse RDF4J SHACL extensions|true|false%} ; + config:shacl.dashDataShapes {%DASH data shapes|true|false%} ; + config:shacl.validationResultsLimitTotal {%Validation results limit total|1000000%} ; + config:shacl.validationResultsLimitPerConstraint {%Validation results limit per constraint|1000%} ; + config:shacl.transactionalValidationLimit {%Transactional validation limit|500000%} ; + config:shacl.shapesGraph {%Shapes graphs|%} ; config:delegate [ config:sail.type "openrdf:MemoryStore" ; config:iterationCacheSyncThreshold "{%Query Iteration Cache size|10000%}"; diff --git a/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/native-shacl.ttl b/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/native-shacl.ttl index 18a2d2c1dc7..7e0ed33871f 100644 --- a/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/native-shacl.ttl +++ b/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/native-shacl.ttl @@ -12,6 +12,21 @@ config:rep.type "openrdf:SailRepository" ; config:sail.impl [ config:sail.type "rdf4j:ShaclSail" ; + config:shacl.parallelValidation {%Parallel validation|true|false%} ; + config:shacl.logValidationPlans {%Log validation plans|true|false%} ; + config:shacl.logValidationViolations {%Log validation violations|true|false%} ; + config:shacl.validationEnabled {%Validation enabled|true|false%} ; + config:shacl.cacheSelectNodes {%Cache select nodes|true|false%} ; + config:shacl.globalLogValidationExecution {%Global log validation execution|true|false%} ; + config:shacl.rdfsSubClassReasoning {%RDFS subclass reasoning|true|false%} ; + config:shacl.performanceLogging {%Performance logging|true|false%} ; + config:shacl.serializableValidation {%Serializable validation|true|false%} ; + config:shacl.eclipseRdf4jShaclExtensions {%Eclipse RDF4J SHACL extensions|true|false%} ; + config:shacl.dashDataShapes {%DASH data shapes|true|false%} ; + config:shacl.validationResultsLimitTotal {%Validation results limit total|1000000%} ; + config:shacl.validationResultsLimitPerConstraint {%Validation results limit per constraint|1000%} ; + config:shacl.transactionalValidationLimit {%Transactional validation limit|500000%} ; + config:shacl.shapesGraph {%Shapes graphs|%} ; config:delegate [ config:sail.type "openrdf:NativeStore" ; config:sail.iterationCacheSyncThreshold "{%Query Iteration Cache size|10000%}"; diff --git a/tools/workbench/src/main/webapp/transformations/create-memory-shacl.xsl b/tools/workbench/src/main/webapp/transformations/create-memory-shacl.xsl index 614f3730bc0..fd2fc3599f7 100644 --- a/tools/workbench/src/main/webapp/transformations/create-memory-shacl.xsl +++ b/tools/workbench/src/main/webapp/transformations/create-memory-shacl.xsl @@ -86,6 +86,163 @@ + + Parallel validation + + + + + + + + + + Log validation plans + + + + + + + + + + Log validation violations + + + + + + + + + + Validation enabled + + + + + + + + + + Cache select nodes + + + + + + + + + + Global log validation execution + + + + + + + + + + RDFS subclass reasoning + + + + + + + + + + Performance logging + + + + + + + + + + Serializable validation + + + + + + + + + + Eclipse RDF4J SHACL extensions + + + + + + + + + + DASH data shapes + + + + + + + + + + Validation results limit total + + + + + + + Validation results limit per constraint + + + + + + + Transactional validation limit + + + + + + + Shapes graphs + + + + + diff --git a/tools/workbench/src/main/webapp/transformations/create-native-shacl.xsl b/tools/workbench/src/main/webapp/transformations/create-native-shacl.xsl index 24edc48c553..09c41e742c9 100644 --- a/tools/workbench/src/main/webapp/transformations/create-native-shacl.xsl +++ b/tools/workbench/src/main/webapp/transformations/create-native-shacl.xsl @@ -72,6 +72,163 @@ + + Parallel validation + + + + + + + + + + Log validation plans + + + + + + + + + + Log validation violations + + + + + + + + + + Validation enabled + + + + + + + + + + Cache select nodes + + + + + + + + + + Global log validation execution + + + + + + + + + + RDFS subclass reasoning + + + + + + + + + + Performance logging + + + + + + + + + + Serializable validation + + + + + + + + + + Eclipse RDF4J SHACL extensions + + + + + + + + + + DASH data shapes + + + + + + + + + + Validation results limit total + + + + + + + Validation results limit per constraint + + + + + + + Transactional validation limit + + + + + + + Shapes graphs + + + + + diff --git a/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/commands/CreateServletTest.java b/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/commands/CreateServletTest.java index 7753a02966b..4e70b970ab1 100644 --- a/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/commands/CreateServletTest.java +++ b/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/commands/CreateServletTest.java @@ -15,7 +15,11 @@ import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import org.eclipse.rdf4j.common.exception.RDF4JException; import org.eclipse.rdf4j.repository.config.RepositoryConfig; @@ -115,4 +119,50 @@ public void testUpdateRepositoryConfig_useLegacy_legacyConfig() { fail(e.getMessage()); } } + + @Test + public void testShaclTemplatesExposeAllOptions() throws IOException { + String memoryTemplate = readConfigTemplate("memory-shacl.ttl"); + String nativeTemplate = readConfigTemplate("native-shacl.ttl"); + + for (String option : SHACL_OPTION_NAMES) { + assertThat(memoryTemplate).contains("{%" + option + "|"); + assertThat(nativeTemplate).contains("{%" + option + "|"); + } + + assertShaclInputsPresent(Paths.get("src/main/webapp/transformations/create-memory-shacl.xsl")); + assertShaclInputsPresent(Paths.get("src/main/webapp/transformations/create-native-shacl.xsl")); + } + + private static final String[] SHACL_OPTION_NAMES = { + "Parallel validation", + "Log validation plans", + "Log validation violations", + "Validation enabled", + "Cache select nodes", + "Global log validation execution", + "RDFS subclass reasoning", + "Performance logging", + "Serializable validation", + "Eclipse RDF4J SHACL extensions", + "DASH data shapes", + "Validation results limit total", + "Validation results limit per constraint", + "Transactional validation limit", + "Shapes graphs" + }; + + private static String readConfigTemplate(String resource) throws IOException { + try (InputStream input = RepositoryConfig.class.getResourceAsStream(resource)) { + assertThat(input).as(resource).isNotNull(); + return new String(input.readAllBytes(), StandardCharsets.UTF_8); + } + } + + private static void assertShaclInputsPresent(Path path) throws IOException { + String xsl = Files.readString(path, StandardCharsets.UTF_8); + for (String option : SHACL_OPTION_NAMES) { + assertThat(xsl).contains("name=\"" + option + "\""); + } + } } From afcfc0f87edece765b03f102eaa2db4e36624e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20M=2E=20Ottestad?= Date: Thu, 29 Jan 2026 22:02:48 +0100 Subject: [PATCH 2/2] GH-0000 Fix SHACL template defaults --- .../rdf4j/repository/config/memory-shacl.ttl | 12 ++++++------ .../rdf4j/repository/config/native-shacl.ttl | 12 ++++++------ .../workbench/commands/CreateServletTest.java | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl b/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl index beb0cb1e44b..9c74f4a94d8 100644 --- a/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl +++ b/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/memory-shacl.ttl @@ -12,16 +12,16 @@ config:sail.impl [ config:sail.type "rdf4j:ShaclSail" ; config:shacl.parallelValidation {%Parallel validation|true|false%} ; - config:shacl.logValidationPlans {%Log validation plans|true|false%} ; - config:shacl.logValidationViolations {%Log validation violations|true|false%} ; + config:shacl.logValidationPlans {%Log validation plans|false|true%} ; + config:shacl.logValidationViolations {%Log validation violations|false|true%} ; config:shacl.validationEnabled {%Validation enabled|true|false%} ; config:shacl.cacheSelectNodes {%Cache select nodes|true|false%} ; - config:shacl.globalLogValidationExecution {%Global log validation execution|true|false%} ; + config:shacl.globalLogValidationExecution {%Global log validation execution|false|true%} ; config:shacl.rdfsSubClassReasoning {%RDFS subclass reasoning|true|false%} ; - config:shacl.performanceLogging {%Performance logging|true|false%} ; + config:shacl.performanceLogging {%Performance logging|false|true%} ; config:shacl.serializableValidation {%Serializable validation|true|false%} ; - config:shacl.eclipseRdf4jShaclExtensions {%Eclipse RDF4J SHACL extensions|true|false%} ; - config:shacl.dashDataShapes {%DASH data shapes|true|false%} ; + config:shacl.eclipseRdf4jShaclExtensions {%Eclipse RDF4J SHACL extensions|false|true%} ; + config:shacl.dashDataShapes {%DASH data shapes|false|true%} ; config:shacl.validationResultsLimitTotal {%Validation results limit total|1000000%} ; config:shacl.validationResultsLimitPerConstraint {%Validation results limit per constraint|1000%} ; config:shacl.transactionalValidationLimit {%Transactional validation limit|500000%} ; diff --git a/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/native-shacl.ttl b/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/native-shacl.ttl index 7e0ed33871f..5d8866e1917 100644 --- a/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/native-shacl.ttl +++ b/core/repository/api/src/main/resources/org/eclipse/rdf4j/repository/config/native-shacl.ttl @@ -13,16 +13,16 @@ config:sail.impl [ config:sail.type "rdf4j:ShaclSail" ; config:shacl.parallelValidation {%Parallel validation|true|false%} ; - config:shacl.logValidationPlans {%Log validation plans|true|false%} ; - config:shacl.logValidationViolations {%Log validation violations|true|false%} ; + config:shacl.logValidationPlans {%Log validation plans|false|true%} ; + config:shacl.logValidationViolations {%Log validation violations|false|true%} ; config:shacl.validationEnabled {%Validation enabled|true|false%} ; config:shacl.cacheSelectNodes {%Cache select nodes|true|false%} ; - config:shacl.globalLogValidationExecution {%Global log validation execution|true|false%} ; + config:shacl.globalLogValidationExecution {%Global log validation execution|false|true%} ; config:shacl.rdfsSubClassReasoning {%RDFS subclass reasoning|true|false%} ; - config:shacl.performanceLogging {%Performance logging|true|false%} ; + config:shacl.performanceLogging {%Performance logging|false|true%} ; config:shacl.serializableValidation {%Serializable validation|true|false%} ; - config:shacl.eclipseRdf4jShaclExtensions {%Eclipse RDF4J SHACL extensions|true|false%} ; - config:shacl.dashDataShapes {%DASH data shapes|true|false%} ; + config:shacl.eclipseRdf4jShaclExtensions {%Eclipse RDF4J SHACL extensions|false|true%} ; + config:shacl.dashDataShapes {%DASH data shapes|false|true%} ; config:shacl.validationResultsLimitTotal {%Validation results limit total|1000000%} ; config:shacl.validationResultsLimitPerConstraint {%Validation results limit per constraint|1000%} ; config:shacl.transactionalValidationLimit {%Transactional validation limit|500000%} ; diff --git a/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/commands/CreateServletTest.java b/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/commands/CreateServletTest.java index 4e70b970ab1..9d8943b13d3 100644 --- a/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/commands/CreateServletTest.java +++ b/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/commands/CreateServletTest.java @@ -130,6 +130,9 @@ public void testShaclTemplatesExposeAllOptions() throws IOException { assertThat(nativeTemplate).contains("{%" + option + "|"); } + assertShaclDefaultsMatchConfig(memoryTemplate); + assertShaclDefaultsMatchConfig(nativeTemplate); + assertShaclInputsPresent(Paths.get("src/main/webapp/transformations/create-memory-shacl.xsl")); assertShaclInputsPresent(Paths.get("src/main/webapp/transformations/create-native-shacl.xsl")); } @@ -152,6 +155,15 @@ public void testShaclTemplatesExposeAllOptions() throws IOException { "Shapes graphs" }; + private static final String[] SHACL_FALSE_DEFAULTS = { + "Log validation plans", + "Log validation violations", + "Global log validation execution", + "Performance logging", + "Eclipse RDF4J SHACL extensions", + "DASH data shapes" + }; + private static String readConfigTemplate(String resource) throws IOException { try (InputStream input = RepositoryConfig.class.getResourceAsStream(resource)) { assertThat(input).as(resource).isNotNull(); @@ -165,4 +177,10 @@ private static void assertShaclInputsPresent(Path path) throws IOException { assertThat(xsl).contains("name=\"" + option + "\""); } } + + private static void assertShaclDefaultsMatchConfig(String template) { + for (String option : SHACL_FALSE_DEFAULTS) { + assertThat(template).contains("{%" + option + "|false|true%}"); + } + } }