diff --git a/rdfunit-model/src/main/java/org/aksw/rdfunit/model/helper/QueryPrebinding.java b/rdfunit-model/src/main/java/org/aksw/rdfunit/model/helper/QueryPrebinding.java index ebc7ffe5f..6b2cb86a9 100644 --- a/rdfunit-model/src/main/java/org/aksw/rdfunit/model/helper/QueryPrebinding.java +++ b/rdfunit-model/src/main/java/org/aksw/rdfunit/model/helper/QueryPrebinding.java @@ -5,6 +5,7 @@ import lombok.Value; import org.aksw.rdfunit.model.interfaces.shacl.ComponentParameter; import org.aksw.rdfunit.model.interfaces.shacl.Shape; +import org.aksw.rdfunit.model.interfaces.shacl.ShapePath; import org.apache.jena.query.ParameterizedSparqlString; import org.apache.jena.rdf.model.RDFNode; import org.apache.jena.sparql.ARQException; @@ -24,10 +25,11 @@ public class QueryPrebinding { public String applyBindings(Map bindings) { - String bindedQuery = sparqlQuery; - if (shape.isPropertyShape()) { - bindedQuery = bindedQuery.replaceAll(Pattern.quote("$PATH"), Matcher.quoteReplacement(shape.getPath().get().asSparqlPropertyPath())); - } + String bindedQuery = shape.getPath() + .map(ShapePath::asSparqlPropertyPath) + .map(propertyPath -> sparqlQuery.replaceAll(Pattern.quote("$PATH"), Matcher.quoteReplacement(propertyPath))) + .orElse(sparqlQuery); + ParameterizedSparqlString query = new ParameterizedSparqlString(bindedQuery); try { @@ -69,4 +71,6 @@ public void validateSparqlQuery() { } }); } + + } diff --git a/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/ComponentConstraintImpl.java b/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/ComponentConstraintImpl.java index a8d1e4375..5a53d5752 100644 --- a/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/ComponentConstraintImpl.java +++ b/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/ComponentConstraintImpl.java @@ -1,5 +1,6 @@ package org.aksw.rdfunit.model.impl.shacl; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import lombok.*; @@ -10,21 +11,21 @@ import org.aksw.rdfunit.model.helper.MessagePrebinding; import org.aksw.rdfunit.model.helper.QueryPrebinding; import org.aksw.rdfunit.model.impl.ManualTestCaseImpl; -import org.aksw.rdfunit.model.impl.ResultAnnotationImpl; import org.aksw.rdfunit.model.interfaces.ResultAnnotation; import org.aksw.rdfunit.model.interfaces.TestCase; import org.aksw.rdfunit.model.interfaces.TestCaseAnnotation; import org.aksw.rdfunit.model.interfaces.shacl.*; import org.aksw.rdfunit.utils.JenaUtils; import org.aksw.rdfunit.vocabulary.SHACL; +import org.apache.jena.query.Query; +import org.apache.jena.query.QueryFactory; import org.apache.jena.rdf.model.*; -import java.util.Arrays; import java.util.List; -import java.util.Optional; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; @Builder @Value @@ -33,6 +34,7 @@ public class ComponentConstraintImpl implements ComponentConstraint { @Getter @NonNull private final Component component; @NonNull private final ComponentValidator validator; @Getter @NonNull @Singular private final ImmutableMap bindings; + @Getter(lazy = true) @NonNull private final String sparqlWhere = generateSparqlWhere(validator.getSparqlQuery()); @Override public Literal getMessage() { @@ -51,56 +53,21 @@ public Literal getMessage() { public TestCase getTestCase() { ManualTestCaseImpl.ManualTestCaseImplBuilder testBuilder = ManualTestCaseImpl.builder(); - String sparql; - sparql = generateSparqlWhere(validator.getSparqlQuery()); - return testBuilder .element(createTestCaseResource()) .sparqlPrevalence("") - .sparqlWhere(sparql) + .sparqlWhere(getSparqlWhere()) .prefixDeclarations(validator.getPrefixDeclarations()) .testCaseAnnotation(generateTestAnnotations()) .build(); } + private String generateSparqlWhere(String sparqlString) { if (validator.getType().equals(ComponentValidatorType.ASK_VALIDATOR)) { - String valuePath; - if (shape.getPath().isPresent()) { - valuePath = " ?this " + shape.getPath().get().asSparqlPropertyPath() + " ?value . "; - } else { - valuePath = " BIND ($this AS ?value) . "; - } - - - // First check if filter is simple and extract it - // the we use simple filter not exists - Pattern p = Pattern.compile("(?i)ASK\\s*\\{\\s*FILTER\\s*\\(([\\s\\S]*)\\)[\\s\\.]*\\}"); - Matcher matcher = p.matcher(sparqlString.trim()); - - if ( matcher.find()) { - String filter = matcher.group(1); - - String adjustedSparql = - "ASK { " + valuePath + " \n" + - //"FILTER EXISTS {\n" + - "BIND ( (" + filter +") AS ?tmp123456)\n" + - "FILTER ( !?tmp123456 || !bound(?tmp123456) )\n" + - //"}" + - "}"; - return replaceBindings(adjustedSparql); - } else { - // otherwise we use MINUS - - String sparqlWhere = sparqlString.trim() - .replaceFirst("\\{", "") - .replaceFirst("ASK", Matcher.quoteReplacement("ASK {\n " + valuePath + "\n MINUS {\n " + valuePath + " ")) - + "}"; - - return replaceBindings(sparqlWhere); - } + return generateSparqlWhereFromAskValidator(sparqlString); } else { String sparqlWhere = sparqlString .substring(sparqlString.indexOf('{')); @@ -109,12 +76,55 @@ private String generateSparqlWhere(String sparqlString) { } } + // match simple ASK / FILTER validators -> we extract the inner filter function + private static final Pattern patternForExtractingFilterFromSimpleAskValidator = Pattern.compile("(?i)ASK\\s*\\{\\s*FILTER\\s*\\(([\\s\\S]*)\\)[\\s\\.]*\\}"); + + private String generateSparqlWhereFromAskValidator(String sparqlString) { + final String valuePath = shape.getPath() + .map(ShapePath::asSparqlPropertyPath) + .map(propertyPath -> " $this " + propertyPath + " $value . ") + .orElse(" BIND ($this AS $value) . "); + + + // First check if filter is simple and extract it + // the we use simple filter not exists + Matcher filterMatcher = patternForExtractingFilterFromSimpleAskValidator.matcher(sparqlString.trim()); + + if ( filterMatcher.find()) { + String extractedFilter = filterMatcher.group(1); + return constructAskQueryBasedOnExtractedFilter(valuePath, extractedFilter); + } else { + return constructAskSparqlBasedOnOriginalWithMinus(sparqlString, valuePath); + } + } + + private String constructAskSparqlBasedOnOriginalWithMinus(String sparqlString, String valuePath) { + String sparqlWhere = sparqlString.trim() + .replaceFirst("\\{", "") + .replaceFirst("ASK", Matcher.quoteReplacement("ASK {\n " + valuePath + "\n MINUS {\n " + valuePath + " ")) + + "}"; + + return replaceBindings(sparqlWhere); + } + + private String constructAskQueryBasedOnExtractedFilter(String valuePath, String filter) { + String adjustedSparql = + "ASK { " + valuePath + " \n" + + //"FILTER EXISTS {\n" + + "BIND ( (" + filter +") AS ?tmp123456)\n" + + "FILTER ( !?tmp123456 || !bound(?tmp123456) )\n" + + //"}" + + "}"; + return replaceBindings(adjustedSparql); + } + private String replaceBindings(String sparqlSnippet) { return new QueryPrebinding(sparqlSnippet, shape).applyBindings(bindings); } // hack for now private TestCaseAnnotation generateTestAnnotations() { + return new TestCaseAnnotation( createTestCaseResource(), TestGenerationType.AutoGenerated, @@ -129,28 +139,31 @@ private TestCaseAnnotation generateTestAnnotations() { } private Set createResultAnnotations() { - ImmutableSet.Builder annotations = ImmutableSet.builder(); - // add property - getPathAnnotation().ifPresent(annotations::add); - getValueAnnotation().ifPresent(annotations::add); + String prefixes = validator.getPrefixDeclarations().stream() + .map(p -> "PREFIX " + p.getPrefix() + ": <" + p.getNamespace() + ">") + .collect(Collectors.joining("\n")); + String originalSelectClause = validator.getSparqlQuery().substring(0,validator.getSparqlQuery().indexOf('{')); + String constructedQuery = prefixes + "\n" + originalSelectClause + getSparqlWhere() - if (shape.getMessage().isPresent()) { - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultMessage) - .setValue(getMessage()).build()); - } + .replaceFirst("(?i)\\s*ASK\\s*\\{", "SELECT \\?this WHERE \\{"); - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.focusNode) - .setVariableName("this").build()); - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultSeverity) - .setValue(shape.getSeverity()).build()); - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.sourceShape) - .setValue(shape.getElement()).build()); - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.sourceConstraintComponent) - .setValue(component.getElement()).build()); + try { + Query query = QueryFactory.create(constructedQuery); + return ResultAnnotationParser.builder() + .query(query) + .validator(validator) + .component(component) + .shape(shape) + .canBindValueVariable(componentCanBindValueAnnotation()) + .build() + .getResultAnnotations(); + } catch (Exception e) { + + throw new IllegalArgumentException(constructedQuery, e); + } - return annotations.build(); } private Resource createTestCaseResource() { @@ -158,36 +171,12 @@ private Resource createTestCaseResource() { return ResourceFactory.createProperty(JenaUtils.getUniqueIri()); } - private Optional getPathAnnotation() { - ResultAnnotation ra= null; - if (shape.getPath().isPresent()) { - ra = new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultPath) - .setValue(shape.getPath().get().getPathAsRdf()).build(); - } else { - if (validator.getSparqlQuery().contains("$path") || validator.getSparqlQuery().contains("?path")) { - ra = new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultPath) - .setVariableName("path").build(); - } + private static final List nonValueArgs = ImmutableList.of(SHACL.minCount, SHACL.maxCount, SHACL.uniqueLang); + private boolean componentCanBindValueAnnotation() { - } - return Optional.ofNullable(ra); - } - - private Optional getValueAnnotation() { - ResultAnnotation ra= null; - - List nonValueArgs = Arrays.asList(SHACL.minCount, SHACL.maxCount, SHACL.uniqueLang); - boolean canValueBind = getBindings().keySet().stream() + return getBindings().keySet().stream() .map(ComponentParameter::getPredicate) .noneMatch(nonValueArgs::contains); - //.collect(Collectors.toList()); - - if (canValueBind && (validator.getSparqlQuery().contains("$value") || validator.getSparqlQuery().contains("?value") ) - ||shape.isNodeShape()) { - ra = new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.value) - .setVariableName("value").build(); - } - return Optional.ofNullable(ra); } } diff --git a/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/ResultAnnotationParser.java b/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/ResultAnnotationParser.java new file mode 100644 index 000000000..21f6e79a7 --- /dev/null +++ b/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/ResultAnnotationParser.java @@ -0,0 +1,167 @@ +package org.aksw.rdfunit.model.impl.shacl; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import lombok.Builder; +import lombok.NonNull; +import lombok.Value; +import org.aksw.rdfunit.model.impl.ResultAnnotationImpl; +import org.aksw.rdfunit.model.interfaces.ResultAnnotation; +import org.aksw.rdfunit.model.interfaces.shacl.Component; +import org.aksw.rdfunit.model.interfaces.shacl.Shape; +import org.aksw.rdfunit.model.interfaces.shacl.Validator; +import org.aksw.rdfunit.vocabulary.SHACL; +import org.apache.jena.query.Query; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.ResourceFactory; +import org.apache.jena.sparql.core.Var; +import org.apache.jena.sparql.core.VarExprList; + +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @author Dimitris Kontokostas + * @since 6/10/18 + */ +@Builder +@Value +class ResultAnnotationParser { + + @NonNull private final Query query; + @NonNull private final Shape shape; + @NonNull private final Validator validator; + private final boolean canBindValueVariable; + private final Component component; + + private Optional getPathAnnotation() { + if (query.getResultVars().contains("path")) { + List vars = query.getProjectVars(); + VarExprList vel = query.getProject(); + return Optional.of( + createVariableAnnotation(SHACL.resultPath, "path")); + } else { + if (shape.getPath().isPresent()) { + return Optional.of( + createValueAnnotation(SHACL.resultPath, shape.getPath().get().getPathAsRdf())); + } + } + return Optional.empty(); + } + + private Optional getFocusNodeAnnotation() { + if (query.getResultVars().contains("focusNode")) { + return Optional.of( + createVariableAnnotation(SHACL.focusNode, "focusNode")); + } else { + return Optional.of( + createVariableAnnotation(SHACL.focusNode, "this")); + } + } + + private Optional getMessageAnnotation() { + + if (query.getResultVars().contains("message")) { + return Optional.of( + createVariableAnnotation(SHACL.resultMessage, "message")); + } else { + + return ImmutableList.of(shape.getMessage(),validator.getDefaultMessage()).stream() + .filter(Optional::isPresent) + .map(Optional::get) + .findFirst() + .map(message -> createValueAnnotation(SHACL.resultMessage, message)); + + } + + } + + private Optional getValueAnnotation() { + boolean componentThatAllowsValueBinding = canBindValueVariable && (validator.getSparqlQuery().contains("$value") || validator.getSparqlQuery().contains("?value") ); + boolean isNodeShapeAndHasValueVar = shape.isNodeShape() && (validator.getSparqlQuery().contains("$value") || validator.getSparqlQuery().contains("?value") ); + if (isNodeShapeAndHasValueVar || componentThatAllowsValueBinding ) { + return Optional.of( + createVariableAnnotation(SHACL.value, "value")); + } + + // when ?value is not defined in Node Shapes we use ?this + if (shape.isNodeShape()) { + return Optional.of( + createVariableAnnotation(SHACL.value, "this")); + } + + + + return Optional.empty(); + } + + private Optional getSeverityAnnotation() { + return Optional.of( + createValueAnnotation(SHACL.resultSeverity, shape.getSeverity())); + + } + private Optional getSourceShapeAnnotation() { + return Optional.of( + createValueAnnotation(SHACL.sourceShape, shape.getElement())); + + } + private Optional getSourceConstraintComponentAnnotation() { + return Optional + .ofNullable(component) + .map(c -> new ResultAnnotationImpl.Builder(c.getElement(), SHACL.sourceConstraintComponent) + .setValue(component.getElement()).build()); + + } + private Optional getSourceConstraintComponentSparqlAnnotation() { + if (component == null) { + return Optional.of( + createValueAnnotation(SHACL.sourceConstraint, validator.getElement())); + } else {return Optional.empty();} + + } + + private Optional getSourceConstraintAnnotation() { + if (component == null) { + return Optional.of( + createValueAnnotation(SHACL.sourceConstraintComponent, SHACL.SPARQLConstraintComponent)); + } else {return Optional.empty();} + + } + + + + public Set getResultAnnotations() { + + return ImmutableSet.of( + getFocusNodeAnnotation(), + getPathAnnotation(), + getMessageAnnotation(), + getSeverityAnnotation(), + getSourceConstraintAnnotation(), + getSourceConstraintComponentAnnotation(), + getSourceConstraintComponentSparqlAnnotation(), + getSourceShapeAnnotation(), + getValueAnnotation() + ) + .stream() + .filter(Optional::isPresent) + .map(Optional::get) + .collect(Collectors.toSet()); + + + } + + + private ResultAnnotation createValueAnnotation(Property property, RDFNode value) { + return new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), property) + .setValue(value).build(); + } + + private ResultAnnotation createVariableAnnotation(Property property, String variable) { + return new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), property) + .setVariableName(variable).build(); + } +} diff --git a/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/SparqlConstraintImpl.java b/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/SparqlConstraintImpl.java index c3188d917..b00c376d9 100644 --- a/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/SparqlConstraintImpl.java +++ b/rdfunit-model/src/main/java/org/aksw/rdfunit/model/impl/shacl/SparqlConstraintImpl.java @@ -12,21 +12,21 @@ import org.aksw.rdfunit.model.helper.MessagePrebinding; import org.aksw.rdfunit.model.helper.QueryPrebinding; import org.aksw.rdfunit.model.impl.ManualTestCaseImpl; -import org.aksw.rdfunit.model.impl.ResultAnnotationImpl; import org.aksw.rdfunit.model.interfaces.ResultAnnotation; import org.aksw.rdfunit.model.interfaces.TestCase; import org.aksw.rdfunit.model.interfaces.TestCaseAnnotation; import org.aksw.rdfunit.model.interfaces.shacl.Shape; +import org.aksw.rdfunit.model.interfaces.shacl.ShapePath; import org.aksw.rdfunit.model.interfaces.shacl.SparqlConstraint; import org.aksw.rdfunit.model.interfaces.shacl.Validator; import org.aksw.rdfunit.utils.JenaUtils; import org.aksw.rdfunit.vocabulary.SHACL; +import org.apache.jena.query.Query; import org.apache.jena.query.QueryFactory; import org.apache.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory; -import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -37,13 +37,15 @@ public class SparqlConstraintImpl implements SparqlConstraint { @Getter @NonNull private final Literal message; @Getter @NonNull private final Resource severity; @NonNull private final Validator validator; + @Getter(lazy = true) @NonNull private final String sparqlWhere = generateSparqlWhere(validator.getSparqlQuery()); + @Override public TestCase getTestCase() { ManualTestCaseImpl.ManualTestCaseImplBuilder testBuilder = ManualTestCaseImpl.builder(); String sparql; - sparql = generateSparqlWhere(validator.getSparqlQuery()); + sparql = getSparqlWhere(); return testBuilder @@ -57,9 +59,16 @@ public TestCase getTestCase() { private String generateSparqlWhere(String sparqlString) { + final String valuePath = shape.getPath() + .map(ShapePath::asSparqlPropertyPath) + .map(propertyPath -> " $this " + propertyPath + " $value . ") + //.orElse(" BIND ($this AS $value) . "); + .orElse(""); + + String sparqlWhere = sparqlString - .substring(sparqlString.indexOf('{')); - return replaceBindings(sparqlWhere); + .substring(sparqlString.indexOf('{') + 1); + return replaceBindings("{" + valuePath + sparqlWhere); } private String replaceBindings(String sparqlSnippet) { @@ -100,54 +109,32 @@ private TestCaseAnnotation generateTestAnnotations(String originalSelectQuery) { } private Set createResultAnnotations(String originalSelectQuery) { - ImmutableSet.Builder annotations = ImmutableSet.builder(); - String prefixes = validator.getPrefixDeclarations().stream() .map(p -> "PREFIX " + p.getPrefix() + ": <" + p.getNamespace() + ">") .collect(Collectors.joining("\n")); - List variableNames = QueryFactory.create(prefixes + originalSelectQuery).getResultVars(); - // add path - if (variableNames.contains("path")) { - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultPath) - .setVariableName("path").build()); - } else { - if (shape.getPath().isPresent()) { - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultPath) - .setValue(shape.getPath().get().getPathAsRdf()).build()); - } - } + String originalSelectClause = validator.getSparqlQuery().substring(0,validator.getSparqlQuery().indexOf('{')); + String constructedQuery = prefixes + "\n" + originalSelectClause + getSparqlWhere() - if (variableNames.contains("message")) { - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultMessage) - .setVariableName("message").build()); - } else { - if (validator.getDefaultMessage().isPresent()) { - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultMessage) - .setValue(validator.getDefaultMessage().get()).build()); - } else { - if (shape.getMessage().isPresent()) { - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultMessage) - .setValue(shape.getMessage().get()).build()); - } - } + .replaceFirst("(?i)\\s*ASK\\s*\\{", "SELECT \\?this WHERE \\{"); + + try { + Query query = QueryFactory.create(constructedQuery); + + return ResultAnnotationParser.builder() + .query(query) + .shape(shape) + .validator(validator) + .canBindValueVariable(true) + .build() + .getResultAnnotations(); + } catch (Exception e) { + + throw new IllegalArgumentException(constructedQuery, e); } - //annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.focusNode) - // .setVariableName("this").build()); - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.value) - .setVariableName("value").build()); - - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.resultSeverity) - .setValue(shape.getSeverity()).build()); - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.sourceShape) - .setValue(shape.getElement()).build()); - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.sourceConstraintComponent) - .setValue(SHACL.SPARQLConstraintComponent).build()); - annotations.add(new ResultAnnotationImpl.Builder(ResourceFactory.createResource(), SHACL.sourceConstraint) - .setValue(validator.getElement()).build()); - - return annotations.build(); + + } private Resource createTestCaseResource() { diff --git a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-001.ttl.actual.ttl b/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-001.ttl.actual.ttl deleted file mode 100644 index d0891ecd9..000000000 --- a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-001.ttl.actual.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix schema: . -@prefix dsp: . -@prefix rutg: . -@prefix owl: . -@prefix rlog: . -@prefix xsd: . -@prefix rutp: . -@prefix rdfs: . -@prefix oslc: . -@prefix rut: . -@prefix rutr: . -@prefix sh: . -@prefix rdf: . -@prefix rutt: . -@prefix ruts: . -@prefix dcterms: . -@prefix prov: . -@prefix dc: . - -[ a sh:ValidationReport ; - sh:conforms false ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ; - sh:resultMessage "Test message" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape - ] -] . diff --git a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-001.ttl.expected.ttl b/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-001.ttl.expected.ttl deleted file mode 100644 index d7e5e17df..000000000 --- a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-001.ttl.expected.ttl +++ /dev/null @@ -1,31 +0,0 @@ -@prefix schema: . -@prefix dsp: . -@prefix rutg: . -@prefix owl: . -@prefix rlog: . -@prefix xsd: . -@prefix rutp: . -@prefix rdfs: . -@prefix oslc: . -@prefix rut: . -@prefix rutr: . -@prefix sh: . -@prefix rdf: . -@prefix rutt: . -@prefix ruts: . -@prefix dcterms: . -@prefix prov: . -@prefix dc: . - -[ a sh:ValidationReport ; - sh:conforms false ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ; - sh:resultMessage "Test message" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ; - sh:value - ] -] . diff --git a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-004.ttl.actual.ttl b/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-004.ttl.actual.ttl deleted file mode 100644 index 1c12452a5..000000000 --- a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-004.ttl.actual.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix schema: . -@prefix dsp: . -@prefix rutg: . -@prefix owl: . -@prefix rlog: . -@prefix xsd: . -@prefix rutp: . -@prefix rdfs: . -@prefix oslc: . -@prefix rut: . -@prefix rutr: . -@prefix sh: . -@prefix rdf: . -@prefix rutt: . -@prefix ruts: . -@prefix dcterms: . -@prefix prov: . -@prefix dc: . - -[ a sh:ValidationReport ; - sh:conforms false ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape - ] -] . diff --git a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-004.ttl.expected.ttl b/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-004.ttl.expected.ttl deleted file mode 100644 index 59edcd75a..000000000 --- a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-004.ttl.expected.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix schema: . -@prefix dsp: . -@prefix rutg: . -@prefix owl: . -@prefix rlog: . -@prefix xsd: . -@prefix rutp: . -@prefix rdfs: . -@prefix oslc: . -@prefix rut: . -@prefix rutr: . -@prefix sh: . -@prefix rdf: . -@prefix rutt: . -@prefix ruts: . -@prefix dcterms: . -@prefix prov: . -@prefix dc: . - -[ a sh:ValidationReport ; - sh:conforms false ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ; - sh:value - ] -] . diff --git a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-007.ttl.actual.ttl b/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-007.ttl.actual.ttl deleted file mode 100644 index 9e79526a2..000000000 --- a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-007.ttl.actual.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix schema: . -@prefix dsp: . -@prefix rutg: . -@prefix owl: . -@prefix rlog: . -@prefix xsd: . -@prefix rutp: . -@prefix rdfs: . -@prefix oslc: . -@prefix rut: . -@prefix rutr: . -@prefix sh: . -@prefix rdf: . -@prefix rutt: . -@prefix ruts: . -@prefix dcterms: . -@prefix prov: . -@prefix dc: . - -[ a sh:ValidationReport ; - sh:conforms false ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape - ] -] . diff --git a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-007.ttl.expected.ttl b/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-007.ttl.expected.ttl deleted file mode 100644 index 6ba1bc0cb..000000000 --- a/rdfunit-w3c-tests/tests-results-nonconformant/partial/sparql_pre-binding_pre-binding-007.ttl.expected.ttl +++ /dev/null @@ -1,30 +0,0 @@ -@prefix schema: . -@prefix dsp: . -@prefix rutg: . -@prefix owl: . -@prefix rlog: . -@prefix xsd: . -@prefix rutp: . -@prefix rdfs: . -@prefix oslc: . -@prefix rut: . -@prefix rutr: . -@prefix sh: . -@prefix rdf: . -@prefix rutt: . -@prefix ruts: . -@prefix dcterms: . -@prefix prov: . -@prefix dc: . - -[ a sh:ValidationReport ; - sh:conforms false ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ; - sh:value - ] -] .