From e0d6978a5626833d08819a5f1c3bc8aaaa983aa0 Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Thu, 7 May 2020 11:41:23 +1000 Subject: [PATCH 01/35] next development iteration: 3.3.0-SNAPSHOT --- assembly/pom.xml | 2 +- bom/pom.xml | 2 +- compliance/elasticsearch/pom.xml | 2 +- compliance/geosparql/pom.xml | 2 +- compliance/lucene/pom.xml | 2 +- compliance/model/pom.xml | 2 +- compliance/pom.xml | 2 +- compliance/repository/pom.xml | 2 +- compliance/rio/pom.xml | 2 +- compliance/serql/pom.xml | 2 +- compliance/shacl/pom.xml | 2 +- compliance/solr/pom.xml | 2 +- compliance/sparql/pom.xml | 2 +- core/client/pom.xml | 2 +- core/http/client/pom.xml | 2 +- core/http/pom.xml | 2 +- core/http/protocol/pom.xml | 2 +- core/model/pom.xml | 2 +- core/pom.xml | 2 +- core/query/pom.xml | 2 +- core/queryalgebra/evaluation/pom.xml | 2 +- core/queryalgebra/geosparql/pom.xml | 2 +- core/queryalgebra/model/pom.xml | 2 +- core/queryalgebra/pom.xml | 2 +- core/queryparser/api/pom.xml | 2 +- core/queryparser/pom.xml | 2 +- core/queryparser/serql/pom.xml | 2 +- core/queryparser/sparql/pom.xml | 2 +- core/queryrender/pom.xml | 2 +- core/queryresultio/api/pom.xml | 2 +- core/queryresultio/binary/pom.xml | 2 +- core/queryresultio/pom.xml | 2 +- core/queryresultio/sparqljson/pom.xml | 2 +- core/queryresultio/sparqlxml/pom.xml | 2 +- core/queryresultio/text/pom.xml | 2 +- core/repository/api/pom.xml | 2 +- core/repository/contextaware/pom.xml | 2 +- core/repository/dataset/pom.xml | 2 +- core/repository/event/pom.xml | 2 +- core/repository/http/pom.xml | 2 +- core/repository/manager/pom.xml | 2 +- core/repository/pom.xml | 2 +- core/repository/sail/pom.xml | 2 +- core/repository/sparql/pom.xml | 2 +- core/rio/api/pom.xml | 2 +- core/rio/binary/pom.xml | 2 +- core/rio/datatypes/pom.xml | 2 +- core/rio/hdt/pom.xml | 2 +- core/rio/jsonld/pom.xml | 2 +- core/rio/languages/pom.xml | 2 +- core/rio/n3/pom.xml | 2 +- core/rio/nquads/pom.xml | 2 +- core/rio/ntriples/pom.xml | 2 +- core/rio/pom.xml | 2 +- core/rio/rdfjson/pom.xml | 2 +- core/rio/rdfxml/pom.xml | 2 +- core/rio/trig/pom.xml | 2 +- core/rio/trix/pom.xml | 2 +- core/rio/turtle/pom.xml | 2 +- core/sail/api/pom.xml | 2 +- core/sail/base/pom.xml | 2 +- core/sail/elasticsearch-store/pom.xml | 2 +- core/sail/elasticsearch/pom.xml | 2 +- core/sail/extensible-store/pom.xml | 2 +- core/sail/federation/pom.xml | 2 +- core/sail/inferencer/pom.xml | 2 +- core/sail/lucene-api/pom.xml | 2 +- core/sail/lucene-spin/pom.xml | 2 +- core/sail/lucene/pom.xml | 2 +- core/sail/memory/pom.xml | 2 +- core/sail/model/pom.xml | 2 +- core/sail/nativerdf/pom.xml | 2 +- core/sail/pom.xml | 2 +- core/sail/sail-spin/pom.xml | 2 +- core/sail/shacl/pom.xml | 2 +- core/sail/solr/pom.xml | 2 +- core/sparqlbuilder/pom.xml | 2 +- core/spin/pom.xml | 2 +- core/storage/pom.xml | 2 +- core/util/pom.xml | 2 +- pom.xml | 2 +- testsuites/benchmark/pom.xml | 2 +- testsuites/geosparql/pom.xml | 2 +- testsuites/lucene/pom.xml | 2 +- testsuites/model/pom.xml | 2 +- testsuites/pom.xml | 2 +- testsuites/queryresultio/pom.xml | 2 +- testsuites/repository/pom.xml | 2 +- testsuites/rio/pom.xml | 2 +- testsuites/sail/pom.xml | 2 +- testsuites/serql/pom.xml | 2 +- testsuites/shacl/pom.xml | 2 +- testsuites/sparql/pom.xml | 2 +- tools/config/pom.xml | 2 +- tools/console/pom.xml | 2 +- tools/federation/pom.xml | 2 +- tools/pom.xml | 2 +- tools/runtime-osgi/pom.xml | 2 +- tools/runtime/pom.xml | 2 +- tools/server-spring/pom.xml | 2 +- tools/server/pom.xml | 2 +- tools/workbench/pom.xml | 2 +- 102 files changed, 102 insertions(+), 102 deletions(-) diff --git a/assembly/pom.xml b/assembly/pom.xml index 82707bd4830..6e2cc5362f6 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-assembly pom diff --git a/bom/pom.xml b/bom/pom.xml index 20339962d5e..8ee73408dad 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-bom pom diff --git a/compliance/elasticsearch/pom.xml b/compliance/elasticsearch/pom.xml index b257d5a8782..e0721443a23 100644 --- a/compliance/elasticsearch/pom.xml +++ b/compliance/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-elasticsearch-compliance RDF4J Elasticsearch Sail Tests diff --git a/compliance/geosparql/pom.xml b/compliance/geosparql/pom.xml index 99ed0ce71f7..60af5141244 100644 --- a/compliance/geosparql/pom.xml +++ b/compliance/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-compliance RDF4J GeoSPARQL compliance tests diff --git a/compliance/lucene/pom.xml b/compliance/lucene/pom.xml index 4c708a08db6..e53b1ab6f69 100644 --- a/compliance/lucene/pom.xml +++ b/compliance/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-compliance RDF4J Lucene Sail Tests diff --git a/compliance/model/pom.xml b/compliance/model/pom.xml index 9e288fd4175..676cf158bfa 100644 --- a/compliance/model/pom.xml +++ b/compliance/model/pom.xml @@ -3,7 +3,7 @@ rdf4j-compliance org.eclipse.rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT 4.0.0 rdf4j-model-compliance diff --git a/compliance/pom.xml b/compliance/pom.xml index b8fc21cb51a..452df902de4 100644 --- a/compliance/pom.xml +++ b/compliance/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-compliance pom diff --git a/compliance/repository/pom.xml b/compliance/repository/pom.xml index 39438ea1fb7..945ccdec499 100644 --- a/compliance/repository/pom.xml +++ b/compliance/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-compliance war diff --git a/compliance/rio/pom.xml b/compliance/rio/pom.xml index a6b1b72c3be..270aa343a42 100644 --- a/compliance/rio/pom.xml +++ b/compliance/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-compliance RDF4J Rio compliance tests diff --git a/compliance/serql/pom.xml b/compliance/serql/pom.xml index 93da143ff60..3582b88a288 100644 --- a/compliance/serql/pom.xml +++ b/compliance/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-compliance RDF4J SeRQL query parser compliance tests diff --git a/compliance/shacl/pom.xml b/compliance/shacl/pom.xml index bd99bea6399..2f70fdbf779 100644 --- a/compliance/shacl/pom.xml +++ b/compliance/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-compliance RDF4J SHACL compliance tests diff --git a/compliance/solr/pom.xml b/compliance/solr/pom.xml index fb48e907de8..917d864d771 100644 --- a/compliance/solr/pom.xml +++ b/compliance/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-solr-compliance RDF4J Solr Sail Tests diff --git a/compliance/sparql/pom.xml b/compliance/sparql/pom.xml index a3138b3139f..7054a1ff892 100644 --- a/compliance/sparql/pom.xml +++ b/compliance/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-compliance war diff --git a/core/client/pom.xml b/core/client/pom.xml index d21dfea9cf1..2639cd8a1cd 100644 --- a/core/client/pom.xml +++ b/core/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-client RDF4J: Client Libraries diff --git a/core/http/client/pom.xml b/core/http/client/pom.xml index fccc794e59f..c41aaab00cc 100644 --- a/core/http/client/pom.xml +++ b/core/http/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-client RDF4J: HTTP client diff --git a/core/http/pom.xml b/core/http/pom.xml index 0b92767808b..d35255a95eb 100644 --- a/core/http/pom.xml +++ b/core/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http pom diff --git a/core/http/protocol/pom.xml b/core/http/protocol/pom.xml index ab1e370f39a..1a3d6dff039 100644 --- a/core/http/protocol/pom.xml +++ b/core/http/protocol/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-protocol RDF4J: HTTP protocol diff --git a/core/model/pom.xml b/core/model/pom.xml index 2fa6044b197..5020f0a7277 100644 --- a/core/model/pom.xml +++ b/core/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model RDF4J: Model diff --git a/core/pom.xml b/core/pom.xml index ee598a0426e..1e27344892b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-core pom diff --git a/core/query/pom.xml b/core/query/pom.xml index 6d1e0a0c052..98b09396e29 100644 --- a/core/query/pom.xml +++ b/core/query/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-query RDF4J: Query diff --git a/core/queryalgebra/evaluation/pom.xml b/core/queryalgebra/evaluation/pom.xml index 3de765a8a1d..4aaed5165f3 100644 --- a/core/queryalgebra/evaluation/pom.xml +++ b/core/queryalgebra/evaluation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-evaluation RDF4J: Query algebra - evaluation diff --git a/core/queryalgebra/geosparql/pom.xml b/core/queryalgebra/geosparql/pom.xml index c9fdca4c26c..01e1dfd69f9 100644 --- a/core/queryalgebra/geosparql/pom.xml +++ b/core/queryalgebra/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-geosparql RDF4J: Query algebra - GeoSPARQL diff --git a/core/queryalgebra/model/pom.xml b/core/queryalgebra/model/pom.xml index e66b528f610..9756bfa3fab 100644 --- a/core/queryalgebra/model/pom.xml +++ b/core/queryalgebra/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-model RDF4J: Query algebra - model diff --git a/core/queryalgebra/pom.xml b/core/queryalgebra/pom.xml index de45202f3e7..e1b487d6952 100644 --- a/core/queryalgebra/pom.xml +++ b/core/queryalgebra/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra pom diff --git a/core/queryparser/api/pom.xml b/core/queryparser/api/pom.xml index 49363240b98..57e8066dd0c 100644 --- a/core/queryparser/api/pom.xml +++ b/core/queryparser/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-api RDF4J: Query parser - API diff --git a/core/queryparser/pom.xml b/core/queryparser/pom.xml index cf2623d7b22..ed654e6514f 100644 --- a/core/queryparser/pom.xml +++ b/core/queryparser/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser pom diff --git a/core/queryparser/serql/pom.xml b/core/queryparser/serql/pom.xml index 53bb48d232b..1ba3fbdf31d 100644 --- a/core/queryparser/serql/pom.xml +++ b/core/queryparser/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-serql RDF4J: Query parser - SeRQL diff --git a/core/queryparser/sparql/pom.xml b/core/queryparser/sparql/pom.xml index ac50d635d81..3f8b7f9cf18 100644 --- a/core/queryparser/sparql/pom.xml +++ b/core/queryparser/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-sparql RDF4J: Query parser - SPARQL diff --git a/core/queryrender/pom.xml b/core/queryrender/pom.xml index 25bc8b006ab..a9f0a872074 100644 --- a/core/queryrender/pom.xml +++ b/core/queryrender/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryrender RDF4J: Query Rendering diff --git a/core/queryresultio/api/pom.xml b/core/queryresultio/api/pom.xml index b5eb7706162..b33ca33d98b 100644 --- a/core/queryresultio/api/pom.xml +++ b/core/queryresultio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-api RDF4J: Query result IO - API diff --git a/core/queryresultio/binary/pom.xml b/core/queryresultio/binary/pom.xml index 5edfa03755f..c2f157e6bf9 100644 --- a/core/queryresultio/binary/pom.xml +++ b/core/queryresultio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-binary RDF4J: Query result IO - binary diff --git a/core/queryresultio/pom.xml b/core/queryresultio/pom.xml index 1fa9f5c28dd..d9e5dd06fc9 100644 --- a/core/queryresultio/pom.xml +++ b/core/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio pom diff --git a/core/queryresultio/sparqljson/pom.xml b/core/queryresultio/sparqljson/pom.xml index 638c6f1a7c6..0e47e241561 100644 --- a/core/queryresultio/sparqljson/pom.xml +++ b/core/queryresultio/sparqljson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqljson RDF4J: Query result IO - SPARQL/JSON diff --git a/core/queryresultio/sparqlxml/pom.xml b/core/queryresultio/sparqlxml/pom.xml index a387bb900af..fe97661f6a9 100644 --- a/core/queryresultio/sparqlxml/pom.xml +++ b/core/queryresultio/sparqlxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqlxml RDF4J: Query result IO - SPARQL/XML diff --git a/core/queryresultio/text/pom.xml b/core/queryresultio/text/pom.xml index 42d4b1f28d4..38dbfcbec03 100644 --- a/core/queryresultio/text/pom.xml +++ b/core/queryresultio/text/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-text RDF4J: Query result IO - plain text booleans diff --git a/core/repository/api/pom.xml b/core/repository/api/pom.xml index 46bdbdde949..329699b9801 100644 --- a/core/repository/api/pom.xml +++ b/core/repository/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-api RDF4J: Repository - API diff --git a/core/repository/contextaware/pom.xml b/core/repository/contextaware/pom.xml index 893026b6cdf..485ec462156 100644 --- a/core/repository/contextaware/pom.xml +++ b/core/repository/contextaware/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-contextaware RDF4J: Repository - context aware (wrapper) diff --git a/core/repository/dataset/pom.xml b/core/repository/dataset/pom.xml index 5464fd186d2..646760c1527 100644 --- a/core/repository/dataset/pom.xml +++ b/core/repository/dataset/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-dataset RDF4J: DatasetRepository (wrapper) diff --git a/core/repository/event/pom.xml b/core/repository/event/pom.xml index f602ee089a3..2358504439a 100644 --- a/core/repository/event/pom.xml +++ b/core/repository/event/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-event RDF4J: Repository - event (wrapper) diff --git a/core/repository/http/pom.xml b/core/repository/http/pom.xml index 45ebfd570a2..727a025e228 100644 --- a/core/repository/http/pom.xml +++ b/core/repository/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-http RDF4J: HTTPRepository diff --git a/core/repository/manager/pom.xml b/core/repository/manager/pom.xml index 860bb45f9bc..3f291fe0bc4 100644 --- a/core/repository/manager/pom.xml +++ b/core/repository/manager/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-manager RDF4J: Repository manager diff --git a/core/repository/pom.xml b/core/repository/pom.xml index 4db70fbbff3..9b9b97cde3d 100644 --- a/core/repository/pom.xml +++ b/core/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository pom diff --git a/core/repository/sail/pom.xml b/core/repository/sail/pom.xml index 3bd3bb135c4..8d7df65029c 100644 --- a/core/repository/sail/pom.xml +++ b/core/repository/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sail RDF4J: SailRepository diff --git a/core/repository/sparql/pom.xml b/core/repository/sparql/pom.xml index 18c4fe6e1d7..61c7785d99e 100644 --- a/core/repository/sparql/pom.xml +++ b/core/repository/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sparql RDF4J: SPARQL Repository diff --git a/core/rio/api/pom.xml b/core/rio/api/pom.xml index 7d5fff77740..5a4cd20d614 100644 --- a/core/rio/api/pom.xml +++ b/core/rio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-api RDF4J: Rio - API diff --git a/core/rio/binary/pom.xml b/core/rio/binary/pom.xml index 3aeb8e320ce..ee0bd22954f 100644 --- a/core/rio/binary/pom.xml +++ b/core/rio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-binary RDF4J: Rio - Binary diff --git a/core/rio/datatypes/pom.xml b/core/rio/datatypes/pom.xml index 2fe3763d234..1250511c4b8 100644 --- a/core/rio/datatypes/pom.xml +++ b/core/rio/datatypes/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-datatypes RDF4J: Rio - Datatypes diff --git a/core/rio/hdt/pom.xml b/core/rio/hdt/pom.xml index 8f6b8a1792f..d6cb85f1ece 100644 --- a/core/rio/hdt/pom.xml +++ b/core/rio/hdt/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-hdt jar diff --git a/core/rio/jsonld/pom.xml b/core/rio/jsonld/pom.xml index e14f06e439a..6208961e90f 100644 --- a/core/rio/jsonld/pom.xml +++ b/core/rio/jsonld/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-jsonld RDF4J: Rio - JSON-LD diff --git a/core/rio/languages/pom.xml b/core/rio/languages/pom.xml index 7f04729d396..2c6618646da 100644 --- a/core/rio/languages/pom.xml +++ b/core/rio/languages/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-languages RDF4J: Rio - Languages diff --git a/core/rio/n3/pom.xml b/core/rio/n3/pom.xml index e9bbfabf322..12a90ac868b 100644 --- a/core/rio/n3/pom.xml +++ b/core/rio/n3/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-n3 RDF4J: Rio - N3 (writer-only) diff --git a/core/rio/nquads/pom.xml b/core/rio/nquads/pom.xml index ef02e385f1f..27f08c03eb3 100644 --- a/core/rio/nquads/pom.xml +++ b/core/rio/nquads/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-nquads RDF4J: Rio - N-Quads diff --git a/core/rio/ntriples/pom.xml b/core/rio/ntriples/pom.xml index 9df6c3cfef0..dc7302637bc 100644 --- a/core/rio/ntriples/pom.xml +++ b/core/rio/ntriples/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-ntriples RDF4J: Rio - N-Triples diff --git a/core/rio/pom.xml b/core/rio/pom.xml index e823f91b8fd..db0afa2698c 100644 --- a/core/rio/pom.xml +++ b/core/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio pom diff --git a/core/rio/rdfjson/pom.xml b/core/rio/rdfjson/pom.xml index 6395059488a..26b57806918 100644 --- a/core/rio/rdfjson/pom.xml +++ b/core/rio/rdfjson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfjson RDF4J: Rio - RDF/JSON diff --git a/core/rio/rdfxml/pom.xml b/core/rio/rdfxml/pom.xml index f4f0c6531d1..2e12c77035b 100644 --- a/core/rio/rdfxml/pom.xml +++ b/core/rio/rdfxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfxml RDF4J: Rio - RDF/XML diff --git a/core/rio/trig/pom.xml b/core/rio/trig/pom.xml index 369f1e56be1..d6a18113cba 100644 --- a/core/rio/trig/pom.xml +++ b/core/rio/trig/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trig RDF4J: Rio - TriG diff --git a/core/rio/trix/pom.xml b/core/rio/trix/pom.xml index b3ceaf9fd23..b1a6fc818a4 100644 --- a/core/rio/trix/pom.xml +++ b/core/rio/trix/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trix RDF4J: Rio - TriX diff --git a/core/rio/turtle/pom.xml b/core/rio/turtle/pom.xml index fb9d1c2425a..14363862440 100644 --- a/core/rio/turtle/pom.xml +++ b/core/rio/turtle/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-turtle RDF4J: Rio - Turtle diff --git a/core/sail/api/pom.xml b/core/sail/api/pom.xml index b26db6883e1..b12bb1457a2 100644 --- a/core/sail/api/pom.xml +++ b/core/sail/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-api RDF4J: Sail API diff --git a/core/sail/base/pom.xml b/core/sail/base/pom.xml index c19bfa55d14..3a29b447d92 100644 --- a/core/sail/base/pom.xml +++ b/core/sail/base/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-base RDF4J: Sail base implementations diff --git a/core/sail/elasticsearch-store/pom.xml b/core/sail/elasticsearch-store/pom.xml index 9276e4af076..89c5ad1e22a 100644 --- a/core/sail/elasticsearch-store/pom.xml +++ b/core/sail/elasticsearch-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch-store RDF4J Elasticsearch Store diff --git a/core/sail/elasticsearch/pom.xml b/core/sail/elasticsearch/pom.xml index 6ce93f9e6f3..787f0b89234 100644 --- a/core/sail/elasticsearch/pom.xml +++ b/core/sail/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch RDF4J Elastic Search Sail Index diff --git a/core/sail/extensible-store/pom.xml b/core/sail/extensible-store/pom.xml index deebcb20e8a..de8f72aff13 100644 --- a/core/sail/extensible-store/pom.xml +++ b/core/sail/extensible-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-extensible-store RDF4J Extensible Store diff --git a/core/sail/federation/pom.xml b/core/sail/federation/pom.xml index 33dbdf0868d..563c203457e 100644 --- a/core/sail/federation/pom.xml +++ b/core/sail/federation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-federation RDF4J: Federation SAIL diff --git a/core/sail/inferencer/pom.xml b/core/sail/inferencer/pom.xml index f773fd3fd58..9422f06037f 100644 --- a/core/sail/inferencer/pom.xml +++ b/core/sail/inferencer/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-inferencer RDF4J: Inferencer Sails diff --git a/core/sail/lucene-api/pom.xml b/core/sail/lucene-api/pom.xml index fb2a1c9122d..adbd392650e 100644 --- a/core/sail/lucene-api/pom.xml +++ b/core/sail/lucene-api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene-api RDF4J Lucene Sail API diff --git a/core/sail/lucene-spin/pom.xml b/core/sail/lucene-spin/pom.xml index df1c8c51011..111dc308b42 100644 --- a/core/sail/lucene-spin/pom.xml +++ b/core/sail/lucene-spin/pom.xml @@ -4,7 +4,7 @@ rdf4j-sail org.eclipse.rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-spin RDF4J Lucene Sail Spin diff --git a/core/sail/lucene/pom.xml b/core/sail/lucene/pom.xml index 6bf181b6c92..b752e12b16c 100644 --- a/core/sail/lucene/pom.xml +++ b/core/sail/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene RDF4J Lucene Sail Index diff --git a/core/sail/memory/pom.xml b/core/sail/memory/pom.xml index 38e45562a67..31a265883d9 100644 --- a/core/sail/memory/pom.xml +++ b/core/sail/memory/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-memory RDF4J: MemoryStore diff --git a/core/sail/model/pom.xml b/core/sail/model/pom.xml index e46662436e2..bc69ab76280 100644 --- a/core/sail/model/pom.xml +++ b/core/sail/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-model RDF4J: Sail Model diff --git a/core/sail/nativerdf/pom.xml b/core/sail/nativerdf/pom.xml index a30ca7da5ec..9f3d7ed7f9c 100644 --- a/core/sail/nativerdf/pom.xml +++ b/core/sail/nativerdf/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-nativerdf RDF4J: NativeStore diff --git a/core/sail/pom.xml b/core/sail/pom.xml index 4bd58bde2e2..32a7d02c191 100644 --- a/core/sail/pom.xml +++ b/core/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail pom diff --git a/core/sail/sail-spin/pom.xml b/core/sail/sail-spin/pom.xml index 0d555afe920..46bb8d1b75f 100644 --- a/core/sail/sail-spin/pom.xml +++ b/core/sail/sail-spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-spin RDF4J: SPIN SAIL diff --git a/core/sail/shacl/pom.xml b/core/sail/shacl/pom.xml index 5626ca6d02f..67e94f3bd13 100644 --- a/core/sail/shacl/pom.xml +++ b/core/sail/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl RDF4J: SHACL diff --git a/core/sail/solr/pom.xml b/core/sail/solr/pom.xml index 8c951ebca90..547ab856231 100644 --- a/core/sail/solr/pom.xml +++ b/core/sail/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-solr RDF4J Solr Sail Index diff --git a/core/sparqlbuilder/pom.xml b/core/sparqlbuilder/pom.xml index 10fcb1be887..85470528110 100644 --- a/core/sparqlbuilder/pom.xml +++ b/core/sparqlbuilder/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparqlbuilder RDF4J: SparqlBuilder diff --git a/core/spin/pom.xml b/core/spin/pom.xml index aaa62e5c4d3..6bf2f0ae88b 100644 --- a/core/spin/pom.xml +++ b/core/spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-spin RDF4J: SPIN diff --git a/core/storage/pom.xml b/core/storage/pom.xml index 18dedb05457..511dca86c86 100644 --- a/core/storage/pom.xml +++ b/core/storage/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-storage RDF4J: Storage Libraries diff --git a/core/util/pom.xml b/core/util/pom.xml index 3f8d3d3e231..ed76ac9f873 100644 --- a/core/util/pom.xml +++ b/core/util/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-util RDF4J: util diff --git a/pom.xml b/pom.xml index 051b2e0f95e..4eb33f49d3b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.eclipse.rdf4j rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT pom Eclipse RDF4J An extensible Java framework for RDF and SPARQL diff --git a/testsuites/benchmark/pom.xml b/testsuites/benchmark/pom.xml index 07a8a1ebe67..7c3fa436804 100644 --- a/testsuites/benchmark/pom.xml +++ b/testsuites/benchmark/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-benchmark RDF4J: benchmarks diff --git a/testsuites/geosparql/pom.xml b/testsuites/geosparql/pom.xml index 78628ff7591..83e751e8e3d 100644 --- a/testsuites/geosparql/pom.xml +++ b/testsuites/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-testsuite RDF4J GeoSPARQL compliance test suite diff --git a/testsuites/lucene/pom.xml b/testsuites/lucene/pom.xml index 889ebae942c..8d9405c43a4 100644 --- a/testsuites/lucene/pom.xml +++ b/testsuites/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-testsuite RDF4J Lucene Sail Tests diff --git a/testsuites/model/pom.xml b/testsuites/model/pom.xml index c187a623edf..a8ad142b919 100644 --- a/testsuites/model/pom.xml +++ b/testsuites/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model-testsuite RDF4J: Model API testsuite diff --git a/testsuites/pom.xml b/testsuites/pom.xml index 40bcbe2c864..745926f4ef3 100644 --- a/testsuites/pom.xml +++ b/testsuites/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-testsuites pom diff --git a/testsuites/queryresultio/pom.xml b/testsuites/queryresultio/pom.xml index 3c5e0e70e8d..d6d2205ccda 100644 --- a/testsuites/queryresultio/pom.xml +++ b/testsuites/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-testsuite RDF4J: QueryResultIO testsuite diff --git a/testsuites/repository/pom.xml b/testsuites/repository/pom.xml index c3eff84c1e3..37db19075b0 100644 --- a/testsuites/repository/pom.xml +++ b/testsuites/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-testsuite RDF4J: Repository API testsuite diff --git a/testsuites/rio/pom.xml b/testsuites/rio/pom.xml index 6608fc91127..439ce4c21c8 100644 --- a/testsuites/rio/pom.xml +++ b/testsuites/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-testsuite RDF4J Rio compliance test suite diff --git a/testsuites/sail/pom.xml b/testsuites/sail/pom.xml index d8289963b22..3de37b6f45e 100644 --- a/testsuites/sail/pom.xml +++ b/testsuites/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-testsuite RDF4J: Sail API testsuite diff --git a/testsuites/serql/pom.xml b/testsuites/serql/pom.xml index 30f70883586..08f8d46e616 100644 --- a/testsuites/serql/pom.xml +++ b/testsuites/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-testsuite RDF4J SeRQL test suite diff --git a/testsuites/shacl/pom.xml b/testsuites/shacl/pom.xml index 6e3a53ba4ea..952bb546e4e 100644 --- a/testsuites/shacl/pom.xml +++ b/testsuites/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-testsuite RDF4J SHACL compliance test suite diff --git a/testsuites/sparql/pom.xml b/testsuites/sparql/pom.xml index fce1dd6d2a9..45663cc3c0b 100644 --- a/testsuites/sparql/pom.xml +++ b/testsuites/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-testsuite RDF4J SPARQL compliance test suite diff --git a/tools/config/pom.xml b/tools/config/pom.xml index a27bae16847..74aff1aea3b 100644 --- a/tools/config/pom.xml +++ b/tools/config/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-config RDF4J: application configuration diff --git a/tools/console/pom.xml b/tools/console/pom.xml index 7ba69b19072..b9dddcdc4ba 100644 --- a/tools/console/pom.xml +++ b/tools/console/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-console RDF4J: Console diff --git a/tools/federation/pom.xml b/tools/federation/pom.xml index 1adbff92fa1..736c0f77da1 100644 --- a/tools/federation/pom.xml +++ b/tools/federation/pom.xml @@ -8,7 +8,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT 9.4.19.v20190610 diff --git a/tools/pom.xml b/tools/pom.xml index 48298bd2d80..81979390a16 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT org.eclipse.rdf4j rdf4j-tools diff --git a/tools/runtime-osgi/pom.xml b/tools/runtime-osgi/pom.xml index 2737359f353..bf3ba94fb55 100644 --- a/tools/runtime-osgi/pom.xml +++ b/tools/runtime-osgi/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime-osgi bundle diff --git a/tools/runtime/pom.xml b/tools/runtime/pom.xml index 62f3c380dbf..58dae30a158 100644 --- a/tools/runtime/pom.xml +++ b/tools/runtime/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime RDF4J: Runtime diff --git a/tools/server-spring/pom.xml b/tools/server-spring/pom.xml index 9d99ed79334..6a82ef5d935 100644 --- a/tools/server-spring/pom.xml +++ b/tools/server-spring/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server-spring RDF4J: HTTP server - core diff --git a/tools/server/pom.xml b/tools/server/pom.xml index 6928e058f72..8e9c552094d 100644 --- a/tools/server/pom.xml +++ b/tools/server/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server war diff --git a/tools/workbench/pom.xml b/tools/workbench/pom.xml index 00dda487f0f..bb1dbdf328f 100644 --- a/tools/workbench/pom.xml +++ b/tools/workbench/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.0-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-workbench war From 3835a9b23c871c42ddc86896f7a343a362721b1f Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Thu, 7 May 2020 11:45:29 +1000 Subject: [PATCH 02/35] set correct version Signed-off-by: Jeen Broekstra --- assembly/pom.xml | 2 +- bom/pom.xml | 2 +- compliance/elasticsearch/pom.xml | 2 +- compliance/geosparql/pom.xml | 2 +- compliance/lucene/pom.xml | 2 +- compliance/model/pom.xml | 2 +- compliance/pom.xml | 2 +- compliance/repository/pom.xml | 2 +- compliance/rio/pom.xml | 2 +- compliance/serql/pom.xml | 2 +- compliance/shacl/pom.xml | 2 +- compliance/solr/pom.xml | 2 +- compliance/sparql/pom.xml | 2 +- core/client/pom.xml | 2 +- core/http/client/pom.xml | 2 +- core/http/pom.xml | 2 +- core/http/protocol/pom.xml | 2 +- core/model/pom.xml | 2 +- core/pom.xml | 2 +- core/query/pom.xml | 2 +- core/queryalgebra/evaluation/pom.xml | 2 +- core/queryalgebra/geosparql/pom.xml | 2 +- core/queryalgebra/model/pom.xml | 2 +- core/queryalgebra/pom.xml | 2 +- core/queryparser/api/pom.xml | 2 +- core/queryparser/pom.xml | 2 +- core/queryparser/serql/pom.xml | 2 +- core/queryparser/sparql/pom.xml | 2 +- core/queryrender/pom.xml | 2 +- core/queryresultio/api/pom.xml | 2 +- core/queryresultio/binary/pom.xml | 2 +- core/queryresultio/pom.xml | 2 +- core/queryresultio/sparqljson/pom.xml | 2 +- core/queryresultio/sparqlxml/pom.xml | 2 +- core/queryresultio/text/pom.xml | 2 +- core/repository/api/pom.xml | 2 +- core/repository/contextaware/pom.xml | 2 +- core/repository/dataset/pom.xml | 2 +- core/repository/event/pom.xml | 2 +- core/repository/http/pom.xml | 2 +- core/repository/manager/pom.xml | 2 +- core/repository/pom.xml | 2 +- core/repository/sail/pom.xml | 2 +- core/repository/sparql/pom.xml | 2 +- core/rio/api/pom.xml | 2 +- core/rio/binary/pom.xml | 2 +- core/rio/datatypes/pom.xml | 2 +- core/rio/hdt/pom.xml | 2 +- core/rio/jsonld/pom.xml | 2 +- core/rio/languages/pom.xml | 2 +- core/rio/n3/pom.xml | 2 +- core/rio/nquads/pom.xml | 2 +- core/rio/ntriples/pom.xml | 2 +- core/rio/pom.xml | 2 +- core/rio/rdfjson/pom.xml | 2 +- core/rio/rdfxml/pom.xml | 2 +- core/rio/trig/pom.xml | 2 +- core/rio/trix/pom.xml | 2 +- core/rio/turtle/pom.xml | 2 +- core/sail/api/pom.xml | 2 +- core/sail/base/pom.xml | 2 +- core/sail/elasticsearch-store/pom.xml | 2 +- core/sail/elasticsearch/pom.xml | 2 +- core/sail/extensible-store/pom.xml | 2 +- core/sail/federation/pom.xml | 2 +- core/sail/inferencer/pom.xml | 2 +- core/sail/lucene-api/pom.xml | 2 +- core/sail/lucene-spin/pom.xml | 2 +- core/sail/lucene/pom.xml | 2 +- core/sail/memory/pom.xml | 2 +- core/sail/model/pom.xml | 2 +- core/sail/nativerdf/pom.xml | 2 +- core/sail/pom.xml | 2 +- core/sail/sail-spin/pom.xml | 2 +- core/sail/shacl/pom.xml | 2 +- core/sail/solr/pom.xml | 2 +- core/sparqlbuilder/pom.xml | 2 +- core/spin/pom.xml | 2 +- core/storage/pom.xml | 2 +- core/util/pom.xml | 2 +- pom.xml | 2 +- testsuites/benchmark/pom.xml | 2 +- testsuites/geosparql/pom.xml | 2 +- testsuites/lucene/pom.xml | 2 +- testsuites/model/pom.xml | 2 +- testsuites/pom.xml | 2 +- testsuites/queryresultio/pom.xml | 2 +- testsuites/repository/pom.xml | 2 +- testsuites/rio/pom.xml | 2 +- testsuites/sail/pom.xml | 2 +- testsuites/serql/pom.xml | 2 +- testsuites/shacl/pom.xml | 2 +- testsuites/sparql/pom.xml | 2 +- tools/config/pom.xml | 2 +- tools/console/pom.xml | 2 +- tools/federation/pom.xml | 2 +- tools/pom.xml | 2 +- tools/runtime-osgi/pom.xml | 2 +- tools/runtime/pom.xml | 2 +- tools/server-spring/pom.xml | 2 +- tools/server/pom.xml | 2 +- tools/workbench/pom.xml | 2 +- 102 files changed, 102 insertions(+), 102 deletions(-) diff --git a/assembly/pom.xml b/assembly/pom.xml index 467d6d13dcc..6e2cc5362f6 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-assembly pom diff --git a/bom/pom.xml b/bom/pom.xml index 78200e3505a..8ee73408dad 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-bom pom diff --git a/compliance/elasticsearch/pom.xml b/compliance/elasticsearch/pom.xml index aeb5f21c6d1..e0721443a23 100644 --- a/compliance/elasticsearch/pom.xml +++ b/compliance/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-elasticsearch-compliance RDF4J Elasticsearch Sail Tests diff --git a/compliance/geosparql/pom.xml b/compliance/geosparql/pom.xml index 457f129a5fe..60af5141244 100644 --- a/compliance/geosparql/pom.xml +++ b/compliance/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-compliance RDF4J GeoSPARQL compliance tests diff --git a/compliance/lucene/pom.xml b/compliance/lucene/pom.xml index dd0bfb8fca2..e53b1ab6f69 100644 --- a/compliance/lucene/pom.xml +++ b/compliance/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-compliance RDF4J Lucene Sail Tests diff --git a/compliance/model/pom.xml b/compliance/model/pom.xml index 0110b98c6f5..676cf158bfa 100644 --- a/compliance/model/pom.xml +++ b/compliance/model/pom.xml @@ -3,7 +3,7 @@ rdf4j-compliance org.eclipse.rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT 4.0.0 rdf4j-model-compliance diff --git a/compliance/pom.xml b/compliance/pom.xml index 876c643f179..452df902de4 100644 --- a/compliance/pom.xml +++ b/compliance/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-compliance pom diff --git a/compliance/repository/pom.xml b/compliance/repository/pom.xml index fdc3d305aec..945ccdec499 100644 --- a/compliance/repository/pom.xml +++ b/compliance/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-compliance war diff --git a/compliance/rio/pom.xml b/compliance/rio/pom.xml index 713b626c2e9..270aa343a42 100644 --- a/compliance/rio/pom.xml +++ b/compliance/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-compliance RDF4J Rio compliance tests diff --git a/compliance/serql/pom.xml b/compliance/serql/pom.xml index 0ee1bbfcc83..3582b88a288 100644 --- a/compliance/serql/pom.xml +++ b/compliance/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-compliance RDF4J SeRQL query parser compliance tests diff --git a/compliance/shacl/pom.xml b/compliance/shacl/pom.xml index da8c5a23148..2f70fdbf779 100644 --- a/compliance/shacl/pom.xml +++ b/compliance/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-compliance RDF4J SHACL compliance tests diff --git a/compliance/solr/pom.xml b/compliance/solr/pom.xml index 81abf8a0b05..917d864d771 100644 --- a/compliance/solr/pom.xml +++ b/compliance/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-solr-compliance RDF4J Solr Sail Tests diff --git a/compliance/sparql/pom.xml b/compliance/sparql/pom.xml index c3d75029613..7054a1ff892 100644 --- a/compliance/sparql/pom.xml +++ b/compliance/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-compliance war diff --git a/core/client/pom.xml b/core/client/pom.xml index b78e598f470..2639cd8a1cd 100644 --- a/core/client/pom.xml +++ b/core/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-client RDF4J: Client Libraries diff --git a/core/http/client/pom.xml b/core/http/client/pom.xml index d6e9da25213..c41aaab00cc 100644 --- a/core/http/client/pom.xml +++ b/core/http/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-client RDF4J: HTTP client diff --git a/core/http/pom.xml b/core/http/pom.xml index 97bc3543ffe..d35255a95eb 100644 --- a/core/http/pom.xml +++ b/core/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http pom diff --git a/core/http/protocol/pom.xml b/core/http/protocol/pom.xml index b5a0ead904c..1a3d6dff039 100644 --- a/core/http/protocol/pom.xml +++ b/core/http/protocol/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-protocol RDF4J: HTTP protocol diff --git a/core/model/pom.xml b/core/model/pom.xml index 2778355a56e..5020f0a7277 100644 --- a/core/model/pom.xml +++ b/core/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model RDF4J: Model diff --git a/core/pom.xml b/core/pom.xml index 32ca9f803da..1e27344892b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-core pom diff --git a/core/query/pom.xml b/core/query/pom.xml index b113d76fb7c..98b09396e29 100644 --- a/core/query/pom.xml +++ b/core/query/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-query RDF4J: Query diff --git a/core/queryalgebra/evaluation/pom.xml b/core/queryalgebra/evaluation/pom.xml index bf391735b0f..4aaed5165f3 100644 --- a/core/queryalgebra/evaluation/pom.xml +++ b/core/queryalgebra/evaluation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-evaluation RDF4J: Query algebra - evaluation diff --git a/core/queryalgebra/geosparql/pom.xml b/core/queryalgebra/geosparql/pom.xml index 6a25be43145..01e1dfd69f9 100644 --- a/core/queryalgebra/geosparql/pom.xml +++ b/core/queryalgebra/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-geosparql RDF4J: Query algebra - GeoSPARQL diff --git a/core/queryalgebra/model/pom.xml b/core/queryalgebra/model/pom.xml index 06760c2052f..9756bfa3fab 100644 --- a/core/queryalgebra/model/pom.xml +++ b/core/queryalgebra/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-model RDF4J: Query algebra - model diff --git a/core/queryalgebra/pom.xml b/core/queryalgebra/pom.xml index 6c478879b69..e1b487d6952 100644 --- a/core/queryalgebra/pom.xml +++ b/core/queryalgebra/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra pom diff --git a/core/queryparser/api/pom.xml b/core/queryparser/api/pom.xml index 7d906efc20b..57e8066dd0c 100644 --- a/core/queryparser/api/pom.xml +++ b/core/queryparser/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-api RDF4J: Query parser - API diff --git a/core/queryparser/pom.xml b/core/queryparser/pom.xml index 9deb78895d0..ed654e6514f 100644 --- a/core/queryparser/pom.xml +++ b/core/queryparser/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser pom diff --git a/core/queryparser/serql/pom.xml b/core/queryparser/serql/pom.xml index 4950da6155b..1ba3fbdf31d 100644 --- a/core/queryparser/serql/pom.xml +++ b/core/queryparser/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-serql RDF4J: Query parser - SeRQL diff --git a/core/queryparser/sparql/pom.xml b/core/queryparser/sparql/pom.xml index 7c26bf34578..3f8b7f9cf18 100644 --- a/core/queryparser/sparql/pom.xml +++ b/core/queryparser/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-sparql RDF4J: Query parser - SPARQL diff --git a/core/queryrender/pom.xml b/core/queryrender/pom.xml index b2568480bc0..a9f0a872074 100644 --- a/core/queryrender/pom.xml +++ b/core/queryrender/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryrender RDF4J: Query Rendering diff --git a/core/queryresultio/api/pom.xml b/core/queryresultio/api/pom.xml index 59b7a601c99..b33ca33d98b 100644 --- a/core/queryresultio/api/pom.xml +++ b/core/queryresultio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-api RDF4J: Query result IO - API diff --git a/core/queryresultio/binary/pom.xml b/core/queryresultio/binary/pom.xml index 1a5a867a3c9..c2f157e6bf9 100644 --- a/core/queryresultio/binary/pom.xml +++ b/core/queryresultio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-binary RDF4J: Query result IO - binary diff --git a/core/queryresultio/pom.xml b/core/queryresultio/pom.xml index 7fbfa2ad481..d9e5dd06fc9 100644 --- a/core/queryresultio/pom.xml +++ b/core/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio pom diff --git a/core/queryresultio/sparqljson/pom.xml b/core/queryresultio/sparqljson/pom.xml index 24c85e8276f..0e47e241561 100644 --- a/core/queryresultio/sparqljson/pom.xml +++ b/core/queryresultio/sparqljson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqljson RDF4J: Query result IO - SPARQL/JSON diff --git a/core/queryresultio/sparqlxml/pom.xml b/core/queryresultio/sparqlxml/pom.xml index 9abd2fab4ec..fe97661f6a9 100644 --- a/core/queryresultio/sparqlxml/pom.xml +++ b/core/queryresultio/sparqlxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqlxml RDF4J: Query result IO - SPARQL/XML diff --git a/core/queryresultio/text/pom.xml b/core/queryresultio/text/pom.xml index db6b0bd11a5..38dbfcbec03 100644 --- a/core/queryresultio/text/pom.xml +++ b/core/queryresultio/text/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-text RDF4J: Query result IO - plain text booleans diff --git a/core/repository/api/pom.xml b/core/repository/api/pom.xml index 058e062b22a..329699b9801 100644 --- a/core/repository/api/pom.xml +++ b/core/repository/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-api RDF4J: Repository - API diff --git a/core/repository/contextaware/pom.xml b/core/repository/contextaware/pom.xml index 71bb65f231b..485ec462156 100644 --- a/core/repository/contextaware/pom.xml +++ b/core/repository/contextaware/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-contextaware RDF4J: Repository - context aware (wrapper) diff --git a/core/repository/dataset/pom.xml b/core/repository/dataset/pom.xml index 0a52f9d3a6b..646760c1527 100644 --- a/core/repository/dataset/pom.xml +++ b/core/repository/dataset/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-dataset RDF4J: DatasetRepository (wrapper) diff --git a/core/repository/event/pom.xml b/core/repository/event/pom.xml index 200a044ac8f..2358504439a 100644 --- a/core/repository/event/pom.xml +++ b/core/repository/event/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-event RDF4J: Repository - event (wrapper) diff --git a/core/repository/http/pom.xml b/core/repository/http/pom.xml index 9179e15689d..727a025e228 100644 --- a/core/repository/http/pom.xml +++ b/core/repository/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-http RDF4J: HTTPRepository diff --git a/core/repository/manager/pom.xml b/core/repository/manager/pom.xml index 0217c4a78a4..3f291fe0bc4 100644 --- a/core/repository/manager/pom.xml +++ b/core/repository/manager/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-manager RDF4J: Repository manager diff --git a/core/repository/pom.xml b/core/repository/pom.xml index ac94be97a31..9b9b97cde3d 100644 --- a/core/repository/pom.xml +++ b/core/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository pom diff --git a/core/repository/sail/pom.xml b/core/repository/sail/pom.xml index eafcf5d49cc..8d7df65029c 100644 --- a/core/repository/sail/pom.xml +++ b/core/repository/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sail RDF4J: SailRepository diff --git a/core/repository/sparql/pom.xml b/core/repository/sparql/pom.xml index f60460aa73c..61c7785d99e 100644 --- a/core/repository/sparql/pom.xml +++ b/core/repository/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sparql RDF4J: SPARQL Repository diff --git a/core/rio/api/pom.xml b/core/rio/api/pom.xml index 907290a395b..5a4cd20d614 100644 --- a/core/rio/api/pom.xml +++ b/core/rio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-api RDF4J: Rio - API diff --git a/core/rio/binary/pom.xml b/core/rio/binary/pom.xml index fdaa92ad75b..ee0bd22954f 100644 --- a/core/rio/binary/pom.xml +++ b/core/rio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-binary RDF4J: Rio - Binary diff --git a/core/rio/datatypes/pom.xml b/core/rio/datatypes/pom.xml index 6326a3e52c7..1250511c4b8 100644 --- a/core/rio/datatypes/pom.xml +++ b/core/rio/datatypes/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-datatypes RDF4J: Rio - Datatypes diff --git a/core/rio/hdt/pom.xml b/core/rio/hdt/pom.xml index 042139954ae..d6cb85f1ece 100644 --- a/core/rio/hdt/pom.xml +++ b/core/rio/hdt/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-hdt jar diff --git a/core/rio/jsonld/pom.xml b/core/rio/jsonld/pom.xml index 302ca53e981..6208961e90f 100644 --- a/core/rio/jsonld/pom.xml +++ b/core/rio/jsonld/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-jsonld RDF4J: Rio - JSON-LD diff --git a/core/rio/languages/pom.xml b/core/rio/languages/pom.xml index 8d93f9a816f..2c6618646da 100644 --- a/core/rio/languages/pom.xml +++ b/core/rio/languages/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-languages RDF4J: Rio - Languages diff --git a/core/rio/n3/pom.xml b/core/rio/n3/pom.xml index 85d4740887d..12a90ac868b 100644 --- a/core/rio/n3/pom.xml +++ b/core/rio/n3/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-n3 RDF4J: Rio - N3 (writer-only) diff --git a/core/rio/nquads/pom.xml b/core/rio/nquads/pom.xml index 8e59f50f95a..27f08c03eb3 100644 --- a/core/rio/nquads/pom.xml +++ b/core/rio/nquads/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-nquads RDF4J: Rio - N-Quads diff --git a/core/rio/ntriples/pom.xml b/core/rio/ntriples/pom.xml index 398cd8749e1..dc7302637bc 100644 --- a/core/rio/ntriples/pom.xml +++ b/core/rio/ntriples/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-ntriples RDF4J: Rio - N-Triples diff --git a/core/rio/pom.xml b/core/rio/pom.xml index f62b2905bcb..db0afa2698c 100644 --- a/core/rio/pom.xml +++ b/core/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio pom diff --git a/core/rio/rdfjson/pom.xml b/core/rio/rdfjson/pom.xml index 8c90f01e8b7..26b57806918 100644 --- a/core/rio/rdfjson/pom.xml +++ b/core/rio/rdfjson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfjson RDF4J: Rio - RDF/JSON diff --git a/core/rio/rdfxml/pom.xml b/core/rio/rdfxml/pom.xml index 30e48b07c7c..2e12c77035b 100644 --- a/core/rio/rdfxml/pom.xml +++ b/core/rio/rdfxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfxml RDF4J: Rio - RDF/XML diff --git a/core/rio/trig/pom.xml b/core/rio/trig/pom.xml index 9aea099b935..d6a18113cba 100644 --- a/core/rio/trig/pom.xml +++ b/core/rio/trig/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trig RDF4J: Rio - TriG diff --git a/core/rio/trix/pom.xml b/core/rio/trix/pom.xml index 2e8e4d08023..b1a6fc818a4 100644 --- a/core/rio/trix/pom.xml +++ b/core/rio/trix/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trix RDF4J: Rio - TriX diff --git a/core/rio/turtle/pom.xml b/core/rio/turtle/pom.xml index 88e1b154de8..14363862440 100644 --- a/core/rio/turtle/pom.xml +++ b/core/rio/turtle/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-turtle RDF4J: Rio - Turtle diff --git a/core/sail/api/pom.xml b/core/sail/api/pom.xml index 4aec981a84b..b12bb1457a2 100644 --- a/core/sail/api/pom.xml +++ b/core/sail/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-api RDF4J: Sail API diff --git a/core/sail/base/pom.xml b/core/sail/base/pom.xml index 8f95340a8df..3a29b447d92 100644 --- a/core/sail/base/pom.xml +++ b/core/sail/base/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-base RDF4J: Sail base implementations diff --git a/core/sail/elasticsearch-store/pom.xml b/core/sail/elasticsearch-store/pom.xml index e3a4a335226..89c5ad1e22a 100644 --- a/core/sail/elasticsearch-store/pom.xml +++ b/core/sail/elasticsearch-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch-store RDF4J Elasticsearch Store diff --git a/core/sail/elasticsearch/pom.xml b/core/sail/elasticsearch/pom.xml index 9429754f430..787f0b89234 100644 --- a/core/sail/elasticsearch/pom.xml +++ b/core/sail/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch RDF4J Elastic Search Sail Index diff --git a/core/sail/extensible-store/pom.xml b/core/sail/extensible-store/pom.xml index efab79e66f1..de8f72aff13 100644 --- a/core/sail/extensible-store/pom.xml +++ b/core/sail/extensible-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-extensible-store RDF4J Extensible Store diff --git a/core/sail/federation/pom.xml b/core/sail/federation/pom.xml index a95d38af98b..563c203457e 100644 --- a/core/sail/federation/pom.xml +++ b/core/sail/federation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-federation RDF4J: Federation SAIL diff --git a/core/sail/inferencer/pom.xml b/core/sail/inferencer/pom.xml index f3251f34bdd..9422f06037f 100644 --- a/core/sail/inferencer/pom.xml +++ b/core/sail/inferencer/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-inferencer RDF4J: Inferencer Sails diff --git a/core/sail/lucene-api/pom.xml b/core/sail/lucene-api/pom.xml index ff59a833c36..adbd392650e 100644 --- a/core/sail/lucene-api/pom.xml +++ b/core/sail/lucene-api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene-api RDF4J Lucene Sail API diff --git a/core/sail/lucene-spin/pom.xml b/core/sail/lucene-spin/pom.xml index 516f8ccd5a9..111dc308b42 100644 --- a/core/sail/lucene-spin/pom.xml +++ b/core/sail/lucene-spin/pom.xml @@ -4,7 +4,7 @@ rdf4j-sail org.eclipse.rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-spin RDF4J Lucene Sail Spin diff --git a/core/sail/lucene/pom.xml b/core/sail/lucene/pom.xml index d81c601d66c..b752e12b16c 100644 --- a/core/sail/lucene/pom.xml +++ b/core/sail/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene RDF4J Lucene Sail Index diff --git a/core/sail/memory/pom.xml b/core/sail/memory/pom.xml index 9f491db89eb..31a265883d9 100644 --- a/core/sail/memory/pom.xml +++ b/core/sail/memory/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-memory RDF4J: MemoryStore diff --git a/core/sail/model/pom.xml b/core/sail/model/pom.xml index 54bf4b6518b..bc69ab76280 100644 --- a/core/sail/model/pom.xml +++ b/core/sail/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-model RDF4J: Sail Model diff --git a/core/sail/nativerdf/pom.xml b/core/sail/nativerdf/pom.xml index e5373b31f3d..9f3d7ed7f9c 100644 --- a/core/sail/nativerdf/pom.xml +++ b/core/sail/nativerdf/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-nativerdf RDF4J: NativeStore diff --git a/core/sail/pom.xml b/core/sail/pom.xml index e4a3ab14280..32a7d02c191 100644 --- a/core/sail/pom.xml +++ b/core/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail pom diff --git a/core/sail/sail-spin/pom.xml b/core/sail/sail-spin/pom.xml index ae59fb55260..46bb8d1b75f 100644 --- a/core/sail/sail-spin/pom.xml +++ b/core/sail/sail-spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-spin RDF4J: SPIN SAIL diff --git a/core/sail/shacl/pom.xml b/core/sail/shacl/pom.xml index d68da5582c7..67e94f3bd13 100644 --- a/core/sail/shacl/pom.xml +++ b/core/sail/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl RDF4J: SHACL diff --git a/core/sail/solr/pom.xml b/core/sail/solr/pom.xml index 5d0635a17d2..547ab856231 100644 --- a/core/sail/solr/pom.xml +++ b/core/sail/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-solr RDF4J Solr Sail Index diff --git a/core/sparqlbuilder/pom.xml b/core/sparqlbuilder/pom.xml index 3b6af320dfc..85470528110 100644 --- a/core/sparqlbuilder/pom.xml +++ b/core/sparqlbuilder/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparqlbuilder RDF4J: SparqlBuilder diff --git a/core/spin/pom.xml b/core/spin/pom.xml index 518e68da926..6bf2f0ae88b 100644 --- a/core/spin/pom.xml +++ b/core/spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-spin RDF4J: SPIN diff --git a/core/storage/pom.xml b/core/storage/pom.xml index 3027c3217d4..511dca86c86 100644 --- a/core/storage/pom.xml +++ b/core/storage/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-storage RDF4J: Storage Libraries diff --git a/core/util/pom.xml b/core/util/pom.xml index 457599d4354..ed76ac9f873 100644 --- a/core/util/pom.xml +++ b/core/util/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-util RDF4J: util diff --git a/pom.xml b/pom.xml index 9309c3caac6..4eb33f49d3b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.eclipse.rdf4j rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT pom Eclipse RDF4J An extensible Java framework for RDF and SPARQL diff --git a/testsuites/benchmark/pom.xml b/testsuites/benchmark/pom.xml index 258f13264d0..7c3fa436804 100644 --- a/testsuites/benchmark/pom.xml +++ b/testsuites/benchmark/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-benchmark RDF4J: benchmarks diff --git a/testsuites/geosparql/pom.xml b/testsuites/geosparql/pom.xml index 8ef243d1bf2..83e751e8e3d 100644 --- a/testsuites/geosparql/pom.xml +++ b/testsuites/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-testsuite RDF4J GeoSPARQL compliance test suite diff --git a/testsuites/lucene/pom.xml b/testsuites/lucene/pom.xml index c2fd2a8df0c..8d9405c43a4 100644 --- a/testsuites/lucene/pom.xml +++ b/testsuites/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-testsuite RDF4J Lucene Sail Tests diff --git a/testsuites/model/pom.xml b/testsuites/model/pom.xml index c4ff995aaac..a8ad142b919 100644 --- a/testsuites/model/pom.xml +++ b/testsuites/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model-testsuite RDF4J: Model API testsuite diff --git a/testsuites/pom.xml b/testsuites/pom.xml index 9fa8faa16d3..745926f4ef3 100644 --- a/testsuites/pom.xml +++ b/testsuites/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-testsuites pom diff --git a/testsuites/queryresultio/pom.xml b/testsuites/queryresultio/pom.xml index 87872fdb787..d6d2205ccda 100644 --- a/testsuites/queryresultio/pom.xml +++ b/testsuites/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-testsuite RDF4J: QueryResultIO testsuite diff --git a/testsuites/repository/pom.xml b/testsuites/repository/pom.xml index 12898b4dfba..37db19075b0 100644 --- a/testsuites/repository/pom.xml +++ b/testsuites/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-testsuite RDF4J: Repository API testsuite diff --git a/testsuites/rio/pom.xml b/testsuites/rio/pom.xml index c26762584ac..439ce4c21c8 100644 --- a/testsuites/rio/pom.xml +++ b/testsuites/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-testsuite RDF4J Rio compliance test suite diff --git a/testsuites/sail/pom.xml b/testsuites/sail/pom.xml index 02d10904737..3de37b6f45e 100644 --- a/testsuites/sail/pom.xml +++ b/testsuites/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-testsuite RDF4J: Sail API testsuite diff --git a/testsuites/serql/pom.xml b/testsuites/serql/pom.xml index 04e6676d948..08f8d46e616 100644 --- a/testsuites/serql/pom.xml +++ b/testsuites/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-testsuite RDF4J SeRQL test suite diff --git a/testsuites/shacl/pom.xml b/testsuites/shacl/pom.xml index 7ce47fde0bc..952bb546e4e 100644 --- a/testsuites/shacl/pom.xml +++ b/testsuites/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-testsuite RDF4J SHACL compliance test suite diff --git a/testsuites/sparql/pom.xml b/testsuites/sparql/pom.xml index ac7a11fdac2..45663cc3c0b 100644 --- a/testsuites/sparql/pom.xml +++ b/testsuites/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-testsuite RDF4J SPARQL compliance test suite diff --git a/tools/config/pom.xml b/tools/config/pom.xml index 8181b5c30e2..74aff1aea3b 100644 --- a/tools/config/pom.xml +++ b/tools/config/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-config RDF4J: application configuration diff --git a/tools/console/pom.xml b/tools/console/pom.xml index 102d98f29dc..b9dddcdc4ba 100644 --- a/tools/console/pom.xml +++ b/tools/console/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-console RDF4J: Console diff --git a/tools/federation/pom.xml b/tools/federation/pom.xml index 08d494b9378..736c0f77da1 100644 --- a/tools/federation/pom.xml +++ b/tools/federation/pom.xml @@ -8,7 +8,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT 9.4.19.v20190610 diff --git a/tools/pom.xml b/tools/pom.xml index c48a2833d95..81979390a16 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT org.eclipse.rdf4j rdf4j-tools diff --git a/tools/runtime-osgi/pom.xml b/tools/runtime-osgi/pom.xml index edd342d147a..bf3ba94fb55 100644 --- a/tools/runtime-osgi/pom.xml +++ b/tools/runtime-osgi/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime-osgi bundle diff --git a/tools/runtime/pom.xml b/tools/runtime/pom.xml index 9c1eaf7b667..58dae30a158 100644 --- a/tools/runtime/pom.xml +++ b/tools/runtime/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime RDF4J: Runtime diff --git a/tools/server-spring/pom.xml b/tools/server-spring/pom.xml index f9d7af82877..6a82ef5d935 100644 --- a/tools/server-spring/pom.xml +++ b/tools/server-spring/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server-spring RDF4J: HTTP server - core diff --git a/tools/server/pom.xml b/tools/server/pom.xml index 004c4cb8914..8e9c552094d 100644 --- a/tools/server/pom.xml +++ b/tools/server/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server war diff --git a/tools/workbench/pom.xml b/tools/workbench/pom.xml index c5849c5b4e2..bb1dbdf328f 100644 --- a/tools/workbench/pom.xml +++ b/tools/workbench/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.1-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-workbench war From d8d3c00f50cb50958b006b695811be6f38891391 Mon Sep 17 00:00:00 2001 From: Bart Hanssens Date: Tue, 12 May 2020 01:21:59 +0200 Subject: [PATCH 03/35] GH-2015 lucene solr elastic upgrade (#2191) * GH-2015 bump solr, es and lucene versions + implement abstract method Signed-off-by:Bart Hanssens * GH-2015 use 7.7.2 instead of 7.7.3 Signed-off-by:Bart Hanssens * GH-2015 move versions to pom + changes from hmottestad Signed-off-by:Bart Hanssens --- compliance/elasticsearch/pom.xml | 4 ---- compliance/solr/pom.xml | 3 --- compliance/solr/solr/cores/embedded/conf/solrconfig.xml | 2 +- .../rdf4j/sail/elasticsearchstore/ClientWithStats.java | 6 ++++++ .../eclipse/rdf4j/sail/elasticsearchstore/TestHelpers.java | 2 +- core/sail/lucene/pom.xml | 3 --- pom.xml | 5 +++-- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/compliance/elasticsearch/pom.xml b/compliance/elasticsearch/pom.xml index e0721443a23..2552cf4419b 100644 --- a/compliance/elasticsearch/pom.xml +++ b/compliance/elasticsearch/pom.xml @@ -9,10 +9,6 @@ rdf4j-elasticsearch-compliance RDF4J Elasticsearch Sail Tests Tests for Elasticsearch. - - 7.5.0 - 6.5.4 - diff --git a/compliance/solr/pom.xml b/compliance/solr/pom.xml index 917d864d771..027561418fa 100644 --- a/compliance/solr/pom.xml +++ b/compliance/solr/pom.xml @@ -9,9 +9,6 @@ rdf4j-solr-compliance RDF4J Solr Sail Tests Tests for Solr Sail. - - 7.5.0 - ${project.groupId} diff --git a/compliance/solr/solr/cores/embedded/conf/solrconfig.xml b/compliance/solr/solr/cores/embedded/conf/solrconfig.xml index 9fcc587df52..865edefe422 100644 --- a/compliance/solr/solr/cores/embedded/conf/solrconfig.xml +++ b/compliance/solr/solr/cores/embedded/conf/solrconfig.xml @@ -1,6 +1,6 @@ - 7.5.0 + 7.7.2 target/test-data diff --git a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/ClientWithStats.java b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/ClientWithStats.java index bb322abc1e5..0d720077652 100644 --- a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/ClientWithStats.java +++ b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/ClientWithStats.java @@ -160,6 +160,12 @@ public BulkRequestBuilder prepareBulk() { return wrapped.prepareBulk(); } + @Override + public BulkRequestBuilder prepareBulk(String globalIndex, String globalType) { + bulkCalls++; + return wrapped.prepareBulk(globalIndex, globalType); + } + @Override public ActionFuture get(GetRequest request) { return wrapped.get(request); diff --git a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/TestHelpers.java b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/TestHelpers.java index a696873acb4..e2b75d4d8ed 100644 --- a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/TestHelpers.java +++ b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/TestHelpers.java @@ -23,7 +23,7 @@ public class TestHelpers { private final static Random random = new Random(); - public static final String VERSION = "6.5.4"; + public static final String VERSION = "6.8.8"; public static final String CLUSTER = "cluster1"; public static final String ELASTICSEARCH_DOWNLOAD_DIRECTORY = "tempElasticsearchDownload"; diff --git a/core/sail/lucene/pom.xml b/core/sail/lucene/pom.xml index b752e12b16c..956bb6818d8 100644 --- a/core/sail/lucene/pom.xml +++ b/core/sail/lucene/pom.xml @@ -9,9 +9,6 @@ rdf4j-sail-lucene RDF4J Lucene Sail Index StackableSail implementation offering full-text search on literals, based on Apache Lucene. - - 7.5.0 - ${project.groupId} diff --git a/pom.xml b/pom.xml index 4eb33f49d3b..cf52d5378e0 100644 --- a/pom.xml +++ b/pom.xml @@ -287,8 +287,9 @@ 0.12.5 3.1.4 2.3.1 - 7.5.0 - 6.5.4 + 7.7.2 + 7.7.2 + 6.8.8 3.1.0 5.2.4.RELEASE 18.0 From 72d90e5fb5b3f5b0ea5235dd1ff52cc26231b9d9 Mon Sep 17 00:00:00 2001 From: Bart Hanssens Date: Tue, 12 May 2020 01:28:36 +0200 Subject: [PATCH 04/35] GH-2203 use slf4j 1.7.30 (#2204) Signed-off-by:Bart Hanssens --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cf52d5378e0..f81c927ad2c 100644 --- a/pom.xml +++ b/pom.xml @@ -279,7 +279,7 @@ UTF-8 UTF-8 - 1.7.26 + 1.7.30 1.1.11 4.5.10 4.4.12 From d39b97a13c964ac6c12f7ab2208466b438fd571a Mon Sep 17 00:00:00 2001 From: Bart Hanssens Date: Tue, 12 May 2020 12:06:23 +0200 Subject: [PATCH 05/35] GH-1974 sync jetty version + move to root pom (#1977) Signed-off-by:Bart Hanssens --- compliance/repository/pom.xml | 3 --- compliance/sparql/pom.xml | 3 --- pom.xml | 1 + tools/federation/pom.xml | 3 --- tools/server/pom.xml | 5 +---- 5 files changed, 2 insertions(+), 13 deletions(-) diff --git a/compliance/repository/pom.xml b/compliance/repository/pom.xml index 945ccdec499..c7beb571a14 100644 --- a/compliance/repository/pom.xml +++ b/compliance/repository/pom.xml @@ -10,9 +10,6 @@ war RDF4J Repository compliance tests Compliance testing for the Repository API implementations - - 9.4.19.v20190610 - ${project.groupId} diff --git a/compliance/sparql/pom.xml b/compliance/sparql/pom.xml index 7054a1ff892..878b1f476d6 100644 --- a/compliance/sparql/pom.xml +++ b/compliance/sparql/pom.xml @@ -10,9 +10,6 @@ war RDF4J SPARQL query parser compliance tests Tests for the SPARQL query language implementation - - 9.4.19.v20190610 - ${project.groupId} diff --git a/pom.xml b/pom.xml index f81c927ad2c..13b03392db9 100644 --- a/pom.xml +++ b/pom.xml @@ -291,6 +291,7 @@ 7.7.2 6.8.8 3.1.0 + 9.4.24.v20191120 5.2.4.RELEASE 18.0 1.21 diff --git a/tools/federation/pom.xml b/tools/federation/pom.xml index 736c0f77da1..4afee27fda1 100644 --- a/tools/federation/pom.xml +++ b/tools/federation/pom.xml @@ -10,9 +10,6 @@ rdf4j-tools 3.3.0-SNAPSHOT - - 9.4.19.v20190610 - diff --git a/tools/server/pom.xml b/tools/server/pom.xml index 8e9c552094d..5281c75e688 100644 --- a/tools/server/pom.xml +++ b/tools/server/pom.xml @@ -10,9 +10,6 @@ war RDF4J: HTTP server HTTP server implementing a REST-style protocol - - 9.2.28.v20190418 - ${project.groupId} @@ -84,7 +81,7 @@ org.eclipse.jetty - jetty-jsp + apache-jsp ${jetty.version} test From 705a98faf14504d59004e54f715ca8aaea479fb8 Mon Sep 17 00:00:00 2001 From: hmottestad Date: Tue, 12 May 2020 14:40:52 +0200 Subject: [PATCH 06/35] GH-2206 prettier plans by using box-drawing characters to group joins (#2207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håvard Ottestad --- .../query/explanation/GenericPlanNode.java | 63 ++- .../sail/memory/QueryPlanRetrievalTest.java | 418 +++++++++--------- 2 files changed, 268 insertions(+), 213 deletions(-) diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/GenericPlanNode.java b/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/GenericPlanNode.java index 90aab4f4b00..788f9111bb4 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/GenericPlanNode.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/GenericPlanNode.java @@ -217,6 +217,8 @@ public void setAlgorithm(String algorithm) { this.algorithm = algorithm; } + private static int prettyBoxDrawingType = 0; + /** * Human readable string. Do not attempt to parse this. * @@ -224,7 +226,16 @@ public void setAlgorithm(String algorithm) { */ @Override public String toString() { + return getHumanReadable(0); + } + /** + * + * @param prettyBoxDrawingType for deciding if we should use single or double walled character for drawing the + * connectors between nodes in the query plan. Eg. ├ or ╠ and ─ o + * @return + */ + private String getHumanReadable(int prettyBoxDrawingType) { StringBuilder sb = new StringBuilder(); String newLine = System.getProperty("line.separator"); @@ -246,10 +257,54 @@ public String toString() { } appendCostAnnotation(sb); sb.append(newLine); - plans.forEach(child -> sb.append(Arrays.stream(child.toString().split(newLine)) - .map(c -> " " + c) - .reduce((a, b) -> a + newLine + b) - .orElse("") + newLine)); + + // we use box-drawing characters to "group" nodes in the plan visually when there are exactly two child plans + // and + // the child plans contain child plans + if (plans.size() == 2 && plans.stream().anyMatch(p -> !p.plans.isEmpty())) { + + String start; + String horizontal; + String vertical; + String end; + + if (prettyBoxDrawingType % 2 == 0) { + start = "╠"; + horizontal = "══"; + vertical = "║"; + end = "╚"; + } else { + start = "├"; + horizontal = "──"; + vertical = "│"; + end = "└"; + } + + String left = plans.get(0).getHumanReadable(prettyBoxDrawingType + 1); + String right = plans.get(1).getHumanReadable(prettyBoxDrawingType + 1); + { + String[] split = left.split(newLine); + sb.append(start).append(horizontal).append(split[0]).append(newLine); + for (int i = 1; i < split.length; i++) { + sb.append(vertical).append(" ").append(split[i]).append(newLine); + } + } + + { + String[] split = right.split(newLine); + sb.append(end).append(horizontal).append(split[0]).append(newLine); + for (int i = 1; i < split.length; i++) { + sb.append(" ").append(split[i]).append(newLine); + } + } + + } else { + plans.forEach( + child -> sb.append(Arrays.stream(child.getHumanReadable(prettyBoxDrawingType + 1).split(newLine)) + .map(c -> " " + c) + .reduce((a, b) -> a + newLine + b) + .orElse("") + newLine)); + } return sb.toString(); } diff --git a/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/QueryPlanRetrievalTest.java b/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/QueryPlanRetrievalTest.java index b840923fd48..073e98d2132 100644 --- a/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/QueryPlanRetrievalTest.java +++ b/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/QueryPlanRetrievalTest.java @@ -87,32 +87,32 @@ public void testTupleQuery() { String actual = query.explain(Explanation.Level.Unoptimized).toString(); String expected = "Projection\n" + - " ProjectionElemList\n" + - " ProjectionElem \"a\"\n" + - " Filter\n" + - " Compare (!=)\n" + - " Var (name=c)\n" + - " Var (name=d)\n" + - " LeftJoin\n" + - " Join\n" + - " Join\n" + - " LeftJoin (new scope)\n" + - " SingletonSet\n" + - " StatementPattern\n" + - " Var (name=d)\n" + - " Var (name=e)\n" + - " Var (name=f)\n" + - " StatementPattern\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + "╠══ProjectionElemList\n" + + "║ ProjectionElem \"a\"\n" + + "╚══Filter\n" + + " ├──Compare (!=)\n" + + " │ Var (name=c)\n" + + " │ Var (name=d)\n" + + " └──LeftJoin\n" + + " ╠══Join\n" + + " ║ ├──Join\n" + + " ║ │ ╠══LeftJoin (new scope)\n" + + " ║ │ ║ ├──SingletonSet\n" + + " ║ │ ║ └──StatementPattern\n" + + " ║ │ ║ Var (name=d)\n" + + " ║ │ ║ Var (name=e)\n" + + " ║ │ ║ Var (name=f)\n" + + " ║ │ ╚══StatementPattern\n" + + " ║ │ Var (name=a)\n" + + " ║ │ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=c)\n" + - " StatementPattern\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " ║ │ Var (name=c)\n" + + " ║ └──StatementPattern\n" + + " ║ Var (name=a)\n" + + " ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=d)\n" + - " StatementPattern\n" + + " ║ Var (name=d)\n" + + " ╚══StatementPattern\n" + " Var (name=d)\n" + " Var (name=e)\n" + " Var (name=f)\n"; @@ -132,32 +132,32 @@ public void testTupleQueryOptimized() { TupleQuery query = connection.prepareTupleQuery(TUPLE_QUERY); String actual = query.explain(Explanation.Level.Optimized).toString(); String expected = "Projection\n" + - " ProjectionElemList\n" + - " ProjectionElem \"a\"\n" + - " LeftJoin (LeftJoinIterator)\n" + - " Join (JoinIterator)\n" + - " StatementPattern (costEstimate=1, resultSizeEstimate=4)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + "╠══ProjectionElemList\n" + + "║ ProjectionElem \"a\"\n" + + "╚══LeftJoin (LeftJoinIterator)\n" + + " ├──Join (JoinIterator)\n" + + " │ ╠══StatementPattern (costEstimate=1, resultSizeEstimate=4)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=d)\n" + - " Filter\n" + - " Compare (!=)\n" + - " Var (name=c)\n" + - " Var (name=d)\n" + - " Join\n" + - " StatementPattern (costEstimate=2, resultSizeEstimate=4)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " │ ║ Var (name=d)\n" + + " │ ╚══Filter\n" + + " │ ├──Compare (!=)\n" + + " │ │ Var (name=c)\n" + + " │ │ Var (name=d)\n" + + " │ └──Join\n" + + " │ ╠══StatementPattern (costEstimate=2, resultSizeEstimate=4)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=c)\n" + - " LeftJoin (new scope) (costEstimate=5, resultSizeEstimate=12)\n" + - " SingletonSet\n" + - " StatementPattern (resultSizeEstimate=12)\n" + - " Var (name=d)\n" + - " Var (name=e)\n" + - " Var (name=f)\n" + - " StatementPattern (resultSizeEstimate=12)\n" + + " │ ║ Var (name=c)\n" + + " │ ╚══LeftJoin (new scope) (costEstimate=5, resultSizeEstimate=12)\n" + + " │ ├──SingletonSet\n" + + " │ └──StatementPattern (resultSizeEstimate=12)\n" + + " │ Var (name=d)\n" + + " │ Var (name=e)\n" + + " │ Var (name=f)\n" + + " └──StatementPattern (resultSizeEstimate=12)\n" + " Var (name=d)\n" + " Var (name=e)\n" + " Var (name=f)\n"; @@ -206,33 +206,33 @@ public void testTupleQueryExecuted() { String actual = query.explain(Explanation.Level.Executed).toString(); String expected = "Projection (resultSizeActual=2)\n" + - " ProjectionElemList\n" + - " ProjectionElem \"a\"\n" + - " LeftJoin (LeftJoinIterator) (resultSizeActual=2)\n" + - " Join (JoinIterator) (resultSizeActual=2)\n" + - " StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=4)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + "╠══ProjectionElemList\n" + + "║ ProjectionElem \"a\"\n" + + "╚══LeftJoin (LeftJoinIterator) (resultSizeActual=2)\n" + + " ├──Join (JoinIterator) (resultSizeActual=2)\n" + + " │ ╠══StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=4)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=d)\n" + - " Filter (resultSizeActual=2)\n" + - " Compare (!=)\n" + - " Var (name=c)\n" + - " Var (name=d)\n" + - " Join (HashJoinIteration) (resultSizeActual=6)\n" + - " StatementPattern (costEstimate=2, resultSizeEstimate=4, resultSizeActual=6)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " │ ║ Var (name=d)\n" + + " │ ╚══Filter (resultSizeActual=2)\n" + + " │ ├──Compare (!=)\n" + + " │ │ Var (name=c)\n" + + " │ │ Var (name=d)\n" + + " │ └──Join (HashJoinIteration) (resultSizeActual=6)\n" + + " │ ╠══StatementPattern (costEstimate=2, resultSizeEstimate=4, resultSizeActual=6)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=c)\n" + - " LeftJoin (new scope) (BadlyDesignedLeftJoinIterator) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=4)\n" + " │ ║ Var (name=c)\n" + + " │ ╚══LeftJoin (new scope) (BadlyDesignedLeftJoinIterator) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=4)\n" + - " SingletonSet (resultSizeActual=4)\n" + - " StatementPattern (resultSizeEstimate=12, resultSizeActual=48)\n" + - " Var (name=d)\n" + - " Var (name=e)\n" + - " Var (name=f)\n" + - " StatementPattern (resultSizeEstimate=12, resultSizeActual=2)\n" + + " │ ├──SingletonSet (resultSizeActual=4)\n" + + " │ └──StatementPattern (resultSizeEstimate=12, resultSizeActual=48)\n" + + " │ Var (name=d)\n" + + " │ Var (name=e)\n" + + " │ Var (name=f)\n" + + " └──StatementPattern (resultSizeEstimate=12, resultSizeActual=2)\n" + " Var (name=d)\n" + " Var (name=e)\n" + " Var (name=f)\n"; @@ -253,33 +253,33 @@ public void testGenericPlanNode() { String actual = query.explain(Explanation.Level.Executed).toGenericPlanNode().toString(); String expected = "Projection (resultSizeActual=2)\n" + - " ProjectionElemList\n" + - " ProjectionElem \"a\"\n" + - " LeftJoin (LeftJoinIterator) (resultSizeActual=2)\n" + - " Join (JoinIterator) (resultSizeActual=2)\n" + - " StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=4)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + "╠══ProjectionElemList\n" + + "║ ProjectionElem \"a\"\n" + + "╚══LeftJoin (LeftJoinIterator) (resultSizeActual=2)\n" + + " ├──Join (JoinIterator) (resultSizeActual=2)\n" + + " │ ╠══StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=4)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=d)\n" + - " Filter (resultSizeActual=2)\n" + - " Compare (!=)\n" + - " Var (name=c)\n" + - " Var (name=d)\n" + - " Join (HashJoinIteration) (resultSizeActual=6)\n" + - " StatementPattern (costEstimate=2, resultSizeEstimate=4, resultSizeActual=6)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " │ ║ Var (name=d)\n" + + " │ ╚══Filter (resultSizeActual=2)\n" + + " │ ├──Compare (!=)\n" + + " │ │ Var (name=c)\n" + + " │ │ Var (name=d)\n" + + " │ └──Join (HashJoinIteration) (resultSizeActual=6)\n" + + " │ ╠══StatementPattern (costEstimate=2, resultSizeEstimate=4, resultSizeActual=6)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=c)\n" + - " LeftJoin (new scope) (BadlyDesignedLeftJoinIterator) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=4)\n" + " │ ║ Var (name=c)\n" + + " │ ╚══LeftJoin (new scope) (BadlyDesignedLeftJoinIterator) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=4)\n" + - " SingletonSet (resultSizeActual=4)\n" + - " StatementPattern (resultSizeEstimate=12, resultSizeActual=48)\n" + - " Var (name=d)\n" + - " Var (name=e)\n" + - " Var (name=f)\n" + - " StatementPattern (resultSizeEstimate=12, resultSizeActual=2)\n" + + " │ ├──SingletonSet (resultSizeActual=4)\n" + + " │ └──StatementPattern (resultSizeEstimate=12, resultSizeActual=48)\n" + + " │ Var (name=d)\n" + + " │ Var (name=e)\n" + + " │ Var (name=f)\n" + + " └──StatementPattern (resultSizeEstimate=12, resultSizeActual=2)\n" + " Var (name=d)\n" + " Var (name=e)\n" + " Var (name=f)\n"; @@ -411,30 +411,30 @@ public void testAskQuery() { String actual = query.explain(Explanation.Level.Executed).toString(); String expected = "Slice (limit=1) (resultSizeActual=1)\n" + " LeftJoin (LeftJoinIterator) (resultSizeActual=1)\n" + - " Join (JoinIterator) (resultSizeActual=1)\n" + - " StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=3)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " ├──Join (JoinIterator) (resultSizeActual=1)\n" + + " │ ╠══StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=3)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=d)\n" + - " Filter (resultSizeActual=1)\n" + - " Compare (!=)\n" + - " Var (name=c)\n" + - " Var (name=d)\n" + - " Join (HashJoinIteration) (resultSizeActual=4)\n" + - " StatementPattern (costEstimate=2, resultSizeEstimate=4, resultSizeActual=4)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " │ ║ Var (name=d)\n" + + " │ ╚══Filter (resultSizeActual=1)\n" + + " │ ├──Compare (!=)\n" + + " │ │ Var (name=c)\n" + + " │ │ Var (name=d)\n" + + " │ └──Join (HashJoinIteration) (resultSizeActual=4)\n" + + " │ ╠══StatementPattern (costEstimate=2, resultSizeEstimate=4, resultSizeActual=4)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=c)\n" + - " LeftJoin (new scope) (BadlyDesignedLeftJoinIterator) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=3)\n" + " │ ║ Var (name=c)\n" + + " │ ╚══LeftJoin (new scope) (BadlyDesignedLeftJoinIterator) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=3)\n" + - " SingletonSet (resultSizeActual=3)\n" + - " StatementPattern (resultSizeEstimate=12, resultSizeActual=36)\n" + - " Var (name=d)\n" + - " Var (name=e)\n" + - " Var (name=f)\n" + - " StatementPattern (resultSizeEstimate=12, resultSizeActual=1)\n" + + " │ ├──SingletonSet (resultSizeActual=3)\n" + + " │ └──StatementPattern (resultSizeEstimate=12, resultSizeActual=36)\n" + + " │ Var (name=d)\n" + + " │ Var (name=e)\n" + + " │ Var (name=f)\n" + + " └──StatementPattern (resultSizeEstimate=12, resultSizeActual=1)\n" + " Var (name=d)\n" + " Var (name=e)\n" + " Var (name=f)\n"; @@ -465,34 +465,34 @@ public void testConstructQuery() { " ProjectionElem \"_const_f5e5585a_uri\" AS \"predicate\"\n" + " ProjectionElem \"d\" AS \"object\"\n" + " Extension (resultSizeActual=2)\n" + - " ExtensionElem (_const_f5e5585a_uri)\n" + - " ValueConstant (value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type)\n" + - " LeftJoin (LeftJoinIterator) (resultSizeActual=2)\n" + - " Join (JoinIterator) (resultSizeActual=2)\n" + - " StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=4)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " ╠══ExtensionElem (_const_f5e5585a_uri)\n" + + " ║ ValueConstant (value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type)\n" + + " ╚══LeftJoin (LeftJoinIterator) (resultSizeActual=2)\n" + + " ├──Join (JoinIterator) (resultSizeActual=2)\n" + + " │ ╠══StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=4)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=d)\n" + - " Filter (resultSizeActual=2)\n" + - " Compare (!=)\n" + - " Var (name=c)\n" + - " Var (name=d)\n" + - " Join (HashJoinIteration) (resultSizeActual=6)\n" + - " StatementPattern (costEstimate=2, resultSizeEstimate=4, resultSizeActual=6)\n" + " │ ║ Var (name=d)\n" + + " │ ╚══Filter (resultSizeActual=2)\n" + + " │ ├──Compare (!=)\n" + + " │ │ Var (name=c)\n" + + " │ │ Var (name=d)\n" + + " │ └──Join (HashJoinIteration) (resultSizeActual=6)\n" + + " │ ╠══StatementPattern (costEstimate=2, resultSizeEstimate=4, resultSizeActual=6)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=c)\n" + - " LeftJoin (new scope) (BadlyDesignedLeftJoinIterator) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=4)\n" + " │ ║ Var (name=c)\n" + + " │ ╚══LeftJoin (new scope) (BadlyDesignedLeftJoinIterator) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=4)\n" + - " SingletonSet (resultSizeActual=4)\n" + - " StatementPattern (resultSizeEstimate=12, resultSizeActual=48)\n" + - " Var (name=d)\n" + - " Var (name=e)\n" + - " Var (name=f)\n" + - " StatementPattern (resultSizeEstimate=12, resultSizeActual=2)\n" + + " │ ├──SingletonSet (resultSizeActual=4)\n" + + " │ └──StatementPattern (resultSizeEstimate=12, resultSizeActual=48)\n" + + " │ Var (name=d)\n" + + " │ Var (name=e)\n" + + " │ Var (name=f)\n" + + " └──StatementPattern (resultSizeEstimate=12, resultSizeActual=2)\n" + " Var (name=d)\n" + " Var (name=e)\n" + " Var (name=f)\n"; @@ -538,44 +538,44 @@ public void testSubQuery() { String actual = query.explain(Explanation.Level.Executed).toString(); String expected = "Projection (resultSizeActual=4)\n" + - " ProjectionElemList\n" + - " ProjectionElem \"a\"\n" + - " Join (HashJoinIteration) (resultSizeActual=4)\n" + - " Projection (new scope) (resultSizeActual=4)\n" + - " ProjectionElemList\n" + - " ProjectionElem \"a\"\n" + - " StatementPattern (resultSizeActual=4)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + "╠══ProjectionElemList\n" + + "║ ProjectionElem \"a\"\n" + + "╚══Join (HashJoinIteration) (resultSizeActual=4)\n" + + " ├──Projection (new scope) (resultSizeActual=4)\n" + + " │ ╠══ProjectionElemList\n" + + " │ ║ ProjectionElem \"a\"\n" + + " │ ╚══StatementPattern (resultSizeActual=4)\n" + + " │ Var (name=a)\n" + + " │ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=type)\n" + - " Projection (new scope) (resultSizeActual=2)\n" + - " ProjectionElemList\n" + - " ProjectionElem \"a\"\n" + - " LeftJoin (LeftJoinIterator) (resultSizeActual=2)\n" + - " Join (JoinIterator) (resultSizeActual=2)\n" + - " Filter (resultSizeActual=44)\n" + - " Compare (!=)\n" + - " Var (name=c)\n" + - " Var (name=d)\n" + - " Join (JoinIterator) (resultSizeActual=48)\n" + - " LeftJoin (new scope) (LeftJoinIterator) (resultSizeActual=12)\n" + - " SingletonSet (resultSizeActual=1)\n" + - " StatementPattern (resultSizeActual=12)\n" + - " Var (name=d)\n" + - " Var (name=e)\n" + - " Var (name=f)\n" + - " StatementPattern (resultSizeActual=48)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " │ Var (name=type)\n" + + " └──Projection (new scope) (resultSizeActual=2)\n" + + " ╠══ProjectionElemList\n" + + " ║ ProjectionElem \"a\"\n" + + " ╚══LeftJoin (LeftJoinIterator) (resultSizeActual=2)\n" + + " ├──Join (JoinIterator) (resultSizeActual=2)\n" + + " │ ╠══Filter (resultSizeActual=44)\n" + + " │ ║ ├──Compare (!=)\n" + + " │ ║ │ Var (name=c)\n" + + " │ ║ │ Var (name=d)\n" + + " │ ║ └──Join (JoinIterator) (resultSizeActual=48)\n" + + " │ ║ ╠══LeftJoin (new scope) (LeftJoinIterator) (resultSizeActual=12)\n" + + " │ ║ ║ ├──SingletonSet (resultSizeActual=1)\n" + + " │ ║ ║ └──StatementPattern (resultSizeActual=12)\n" + + " │ ║ ║ Var (name=d)\n" + + " │ ║ ║ Var (name=e)\n" + + " │ ║ ║ Var (name=f)\n" + + " │ ║ ╚══StatementPattern (resultSizeActual=48)\n" + + " │ ║ Var (name=a)\n" + + " │ ║ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=c)\n" + - " StatementPattern (resultSizeActual=2)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " │ ║ Var (name=c)\n" + + " │ ╚══StatementPattern (resultSizeActual=2)\n" + + " │ Var (name=a)\n" + + " │ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=d)\n" + - " StatementPattern (resultSizeActual=2)\n" + + " │ Var (name=d)\n" + + " └──StatementPattern (resultSizeActual=2)\n" + " Var (name=d)\n" + " Var (name=e)\n" + " Var (name=f)\n"; @@ -597,46 +597,46 @@ public void testUnionQuery() { String actual = query.explain(Explanation.Level.Executed).toString(); String expected = "Projection (resultSizeActual=0)\n" + - " ProjectionElemList\n" + - " ProjectionElem \"a\"\n" + - " Join (HashJoinIteration) (resultSizeActual=0)\n" + - " StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=4)\n" + - " Var (name=a)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + "╠══ProjectionElemList\n" + + "║ ProjectionElem \"a\"\n" + + "╚══Join (HashJoinIteration) (resultSizeActual=0)\n" + + " ├──StatementPattern (costEstimate=1, resultSizeEstimate=4, resultSizeActual=4)\n" + + " │ Var (name=a)\n" + + " │ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=type)\n" + - " Union (new scope) (resultSizeActual=24)\n" + - " Join (HashJoinIteration) (resultSizeActual=12)\n" + - " StatementPattern (costEstimate=2, resultSizeEstimate=12, resultSizeActual=12)\n" + - " Var (name=a)\n" + - " Var (name=b)\n" + - " Var (name=c2)\n" + - " Union (new scope) (resultSizeActual=96)\n" + - " Join (JoinIterator) (resultSizeActual=48)\n" + - " StatementPattern (new scope) (costEstimate=2, resultSizeEstimate=4, resultSizeActual=4)\n" + " │ Var (name=type)\n" + + " └──Union (new scope) (resultSizeActual=24)\n" + + " ╠══Join (HashJoinIteration) (resultSizeActual=12)\n" + + " ║ ├──StatementPattern (costEstimate=2, resultSizeEstimate=12, resultSizeActual=12)\n" + + " ║ │ Var (name=a)\n" + + " ║ │ Var (name=b)\n" + + " ║ │ Var (name=c2)\n" + + " ║ └──Union (new scope) (resultSizeActual=96)\n" + + " ║ ╠══Join (JoinIterator) (resultSizeActual=48)\n" + + " ║ ║ ├──StatementPattern (new scope) (costEstimate=2, resultSizeEstimate=4, resultSizeActual=4)\n" + - " Var (name=c2)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " ║ ║ │ Var (name=c2)\n" + + " ║ ║ │ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=type1)\n" + - " StatementPattern (costEstimate=2, resultSizeEstimate=12, resultSizeActual=48)\n" + " ║ ║ │ Var (name=type1)\n" + + " ║ ║ └──StatementPattern (costEstimate=2, resultSizeEstimate=12, resultSizeActual=48)\n" + - " Var (name=a)\n" + - " Var (name=b)\n" + - " Var (name=c)\n" + - " Join (JoinIterator) (resultSizeActual=48)\n" + - " StatementPattern (new scope) (costEstimate=2, resultSizeEstimate=4, resultSizeActual=4)\n" + " ║ ║ Var (name=a)\n" + + " ║ ║ Var (name=b)\n" + + " ║ ║ Var (name=c)\n" + + " ║ ╚══Join (JoinIterator) (resultSizeActual=48)\n" + + " ║ ├──StatementPattern (new scope) (costEstimate=2, resultSizeEstimate=4, resultSizeActual=4)\n" + - " Var (name=c2)\n" + - " Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + " ║ │ Var (name=c2)\n" + + " ║ │ Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)\n" + - " Var (name=type2)\n" + - " StatementPattern (costEstimate=2, resultSizeEstimate=12, resultSizeActual=48)\n" + " ║ │ Var (name=type2)\n" + + " ║ └──StatementPattern (costEstimate=2, resultSizeEstimate=12, resultSizeActual=48)\n" + - " Var (name=a)\n" + - " Var (name=b)\n" + - " Var (name=c)\n" + - " StatementPattern (new scope) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=12)\n" + " ║ Var (name=a)\n" + + " ║ Var (name=b)\n" + + " ║ Var (name=c)\n" + + " ╚══StatementPattern (new scope) (costEstimate=5, resultSizeEstimate=12, resultSizeActual=12)\n" + " Var (name=type)\n" + " Var (name=d)\n" + From 64ceb0ab044283a108511d74d77ce099c0fd9936 Mon Sep 17 00:00:00 2001 From: Bart Hanssens Date: Fri, 15 May 2020 18:57:32 +0200 Subject: [PATCH 07/35] GH-2189 remove unused imports, add Override annotation, use diamond op (#2190) Signed-off-by:Bart Hanssens --- .../elasticsearch/ElasticsearchIndexTest.java | 1 - ...lasticsearchSailIndexedPropertiesTest.java | 1 - .../elasticsearch/ElasticsearchSailTest.java | 1 - .../org/elasticsearch/bootstrap/JarHell.java | 1 - .../sparql/ArbitraryLengthPathTest.java | 2 ++ .../sparql/SPARQLServiceEvaluationTest.java | 15 +++++------ .../parser/sparql/manifest/EarlReport.java | 4 +++ .../W3CApprovedSPARQL10QueryTest.java | 4 ++- .../W3CApprovedSPARQL10SyntaxTest.java | 2 ++ .../W3CApprovedSPARQL11SyntaxTest.java | 2 ++ .../http/client/util/HttpClientBuilders.java | 2 -- .../http/client/RDF4JProtocolSessionTest.java | 1 - .../java/org/eclipse/rdf4j/model/Model.java | 1 - .../rdf4j/model/util/SynchronizedModel.java | 1 - .../org/eclipse/rdf4j/query/QueryResult.java | 4 +-- .../org/eclipse/rdf4j/query/QueryResults.java | 2 -- .../evaluation/function/xsd/BooleanCast.java | 1 - .../evaluation/function/xsd/ByteCast.java | 1 - .../evaluation/function/xsd/DateTimeCast.java | 1 - .../evaluation/function/xsd/DecimalCast.java | 1 - .../evaluation/function/xsd/IntCast.java | 1 - .../evaluation/function/xsd/IntegerCast.java | 1 - .../function/xsd/NegativeIntegerCast.java | 1 - .../function/xsd/NonNegativeIntegerCast.java | 1 - .../function/xsd/NonPositiveIntegerCast.java | 1 - .../function/xsd/PositiveIntegerCast.java | 1 - .../evaluation/function/xsd/ShortCast.java | 1 - .../EvaluationStrategyWithRDFStarTest.java | 26 +++++++++---------- .../impl/StrictEvaluationStrategyTest.java | 1 - .../query/algebra/ArbitraryLengthPath.java | 1 - .../query/algebra/BindingSetAssignment.java | 1 - .../rdf4j/query/algebra/DescribeOperator.java | 2 -- .../eclipse/rdf4j/query/algebra/Distinct.java | 2 -- .../rdf4j/query/algebra/Extension.java | 1 - .../eclipse/rdf4j/query/algebra/Group.java | 1 - .../rdf4j/query/algebra/MultiProjection.java | 1 - .../eclipse/rdf4j/query/algebra/Order.java | 1 - .../rdf4j/query/algebra/Projection.java | 1 - .../eclipse/rdf4j/query/algebra/Reduced.java | 2 -- .../eclipse/rdf4j/query/algebra/Service.java | 1 - .../eclipse/rdf4j/query/algebra/Slice.java | 2 -- .../rdf4j/query/algebra/StatementPattern.java | 1 - .../query/algebra/UnaryTupleOperator.java | 1 - .../helpers/QueryModelTreePrinter.java | 1 - .../QueryModelTreeToGenericPlanNode.java | 1 - .../parser/sparql/TripleRefCollector.java | 2 +- .../parser/sparql/ast/ASTConstTripleRef.java | 1 + .../query/parser/sparql/ast/ASTTripleRef.java | 1 + .../sparql/ast/JJTSyntaxTreeBuilderState.java | 4 +-- .../parser/sparql/ast/SyntaxTreeBuilder.java | 2 +- .../ast/SyntaxTreeBuilderTokenManager.java | 8 ------ .../query/parser/sparql/SPARQLParserTest.java | 1 - .../sparql/TestServiceUpdateExprBuilder.java | 1 - .../parser/sparql/TestSparqlStarParser.java | 16 ++++++------ .../rdf4j/repository/RepositoryResult.java | 3 +-- .../rdf4j/repository/util/RepositoryUtil.java | 1 - .../dataset/DatasetBooleanQuery.java | 1 - .../NotifyingRepositoryConnectionWrapper.java | 3 --- .../RepositoryFederatedService.java | 2 +- .../rdf4j/rio/binary/BinaryRDFWriter.java | 1 - .../rdf4j/rio/trix/TriXParserTest.java | 2 -- .../rdf4j/rio/turtle/TurtleParser.java | 1 - .../org/eclipse/rdf4j/sail/base/SailSink.java | 1 - .../ElasticsearchContextStatement.java | 2 +- .../ElasticsearchDataStructure.java | 3 --- .../ElasticsearchHelper.java | 1 - .../ElasticsearchStatement.java | 3 +-- .../ElasticsearchStore.java | 1 - .../benchmark/DeleteBenchmark.java | 1 - .../benchmark/ReadCacheBenchmark.java | 1 - .../benchmark/TransactionBenchmark.java | 9 ------- .../TransactionParallelBenchmark.java | 2 -- .../ElasticsearchStoreIsolationLevelTest.java | 2 -- .../elasticsearch/ElasticsearchIndex.java | 1 - ...ExtensibleDynamicEvaluationStatistics.java | 2 +- .../NaiveHashSetDataStructure.java | 4 --- .../AbstractEchoWriteConnection.java | 1 - .../optimizers/EvaluationStatistics.java | 2 -- ...rwardChainingRDFSInferencerConnection.java | 3 --- .../fc/SchemaCachingRDFSInferencer.java | 2 -- ...DFSInferencerNativeIsolationLevelTest.java | 2 -- ...erencerNativeRepositoryConnectionTest.java | 6 ----- ...FSchemaMemoryRepositoryConnectionTest.java | 2 -- .../sail/lucene/LuceneDocumentScore.java | 1 - .../memory/benchmark/MemoryBenchmark.java | 1 - .../sail/nativerdf/ContextStoreTest.java | 1 - .../benchmark/DataFileBenchmark.java | 1 - .../benchmark/HashFileBenchmark.java | 1 - .../nativerdf/benchmark/IDFileBenchmark.java | 1 - .../eclipse/rdf4j/sail/spin/SpinSailTest.java | 1 - .../sail/shacl/RdfsSubClassOfReasoner.java | 1 - .../sail/shacl/results/ValidationReport.java | 1 + .../rdf4j/sail/shacl/MultithreadedTest.java | 1 - .../rdf4j/sail/shacl/OrderingTest.java | 7 ----- .../sail/shacl/TrackAddedStatementsTest.java | 1 - .../eclipse/rdf4j/sail/shacl/UniqueTest.java | 17 ++++++------ .../shacl/benchmark/ClassBenchmarkEmpty.java | 1 - .../shacl/benchmark/ComplexBenchmark.java | 1 - .../benchmark/DatatypeBenchmarkEmpty.java | 1 - .../benchmark/DatatypeBenchmarkPrefilled.java | 1 - .../DatatypeBenchmarkSerializableEmpty.java | 1 - .../benchmark/MaxCountBenchmarkEmpty.java | 1 - .../benchmark/MinCountBenchmarkEmpty.java | 1 - .../benchmark/MinCountBenchmarkPrefilled.java | 1 - .../benchmark/NotClassBenchmarkEmpty.java | 1 - .../shacl/benchmark/ParallelBenchmark.java | 1 - .../sail/shacl/mock/MockInputPlanNode.java | 1 - .../rdf4j/sail/solr/SolrSearchQuery.java | 1 - .../org/eclipse/rdf4j/spin/SpinParser.java | 4 +-- .../spin/function/spif/HasAllObjects.java | 1 - .../rdf4j/spin/function/spif/Name.java | 4 --- .../common/iteration/CloseableIteration.java | 2 -- .../iteration/IterationSpliterator.java | 2 -- .../rdf4j/common/iteration/Iterations.java | 1 - .../common/iteration/MinusIteration.java | 1 - .../eclipse/rdf4j/common/text/ASCIIUtil.java | 2 -- .../iteration/AutoClosingIterationTest.java | 1 - .../common/iteration/SilentIterationTest.java | 2 +- .../rdf4j/common/text/StringUtilTest.java | 2 -- .../benchmark/ReasoningUpdateBenchmark.java | 4 --- .../RDFSchemaRepositoryConnectionTest.java | 1 - .../eclipse/rdf4j/sail/InferencingTest.java | 2 -- .../rdf4j/sail/SailConcurrencyTest.java | 1 - .../eclipse/rdf4j/console/command/Verify.java | 1 - .../rdf4j/console/command/FederateTest.java | 5 ---- .../rdf4j/federated/FedXConnection.java | 2 +- .../optimizer/GenericInfoOptimizer.java | 2 +- .../federated/util/QueryAlgebraUtil.java | 4 +-- .../ActiveTransactionRegistry.java | 2 -- .../eclipse/rdf4j/http/server/TestServer.java | 2 -- .../workbench/commands/UpdateServlet.java | 1 - 131 files changed, 68 insertions(+), 231 deletions(-) diff --git a/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchIndexTest.java b/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchIndexTest.java index 04e39f0bcf7..1dfc1727088 100644 --- a/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchIndexTest.java +++ b/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchIndexTest.java @@ -40,7 +40,6 @@ import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; @ClusterScope(numDataNodes = 1) diff --git a/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchSailIndexedPropertiesTest.java b/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchSailIndexedPropertiesTest.java index f5bfa998c7b..d25f8ac2eb6 100644 --- a/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchSailIndexedPropertiesTest.java +++ b/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchSailIndexedPropertiesTest.java @@ -22,7 +22,6 @@ import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; @ClusterScope(numDataNodes = 1) diff --git a/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchSailTest.java b/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchSailTest.java index 333dcd5eaac..1b8e349dff2 100644 --- a/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchSailTest.java +++ b/compliance/elasticsearch/src/test/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchSailTest.java @@ -22,7 +22,6 @@ import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; @ClusterScope(numDataNodes = 1) diff --git a/compliance/elasticsearch/src/test/java/org/elasticsearch/bootstrap/JarHell.java b/compliance/elasticsearch/src/test/java/org/elasticsearch/bootstrap/JarHell.java index e25d3501b6a..22a75373aca 100644 --- a/compliance/elasticsearch/src/test/java/org/elasticsearch/bootstrap/JarHell.java +++ b/compliance/elasticsearch/src/test/java/org/elasticsearch/bootstrap/JarHell.java @@ -4,7 +4,6 @@ import java.util.Collections; import java.util.Set; import java.util.function.Consumer; -import java.util.logging.Logger; /** * test of elasticsearch pass. Thus as a workaround we deactivate this test. see diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/ArbitraryLengthPathTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/ArbitraryLengthPathTest.java index 0d774ea534d..76ec646d62d 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/ArbitraryLengthPathTest.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/ArbitraryLengthPathTest.java @@ -32,6 +32,7 @@ public class ArbitraryLengthPathTest extends TestCase { private RepositoryConnection con; @Before + @Override public void setUp() throws Exception { repo = new SailRepository(new MemoryStore()); repo.initialize(); @@ -39,6 +40,7 @@ public void setUp() throws Exception { } @After + @Override public void tearDown() throws Exception { con.close(); repo.shutDown(); diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLServiceEvaluationTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLServiceEvaluationTest.java index 2981e7d0415..e1e75f001c6 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLServiceEvaluationTest.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLServiceEvaluationTest.java @@ -23,7 +23,6 @@ import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.common.text.StringUtil; import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; @@ -47,7 +46,6 @@ import org.eclipse.rdf4j.query.impl.TupleQueryResultBuilder; import org.eclipse.rdf4j.query.resultio.QueryResultFormat; import org.eclipse.rdf4j.query.resultio.QueryResultIO; -import org.eclipse.rdf4j.query.resultio.TupleQueryResultFormat; import org.eclipse.rdf4j.query.resultio.TupleQueryResultParser; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryConnection; @@ -63,7 +61,6 @@ import org.eclipse.rdf4j.sail.memory.MemoryStore; import org.junit.After; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -101,9 +98,10 @@ public SPARQLServiceEvaluationTest() { * @throws java.lang.Exception */ @Before + @Override public void setUp() throws Exception { // set up the server: the maximal number of endpoints must be known - List repositoryIds = new ArrayList(MAX_ENDPOINTS); + List repositoryIds = new ArrayList<>(MAX_ENDPOINTS); for (int i = 1; i <= MAX_ENDPOINTS; i++) repositoryIds.add("endpoint" + i); server = new SPARQLEmbeddedServer(repositoryIds); @@ -115,7 +113,7 @@ public void setUp() throws Exception { throw e; } - remoteRepositories = new ArrayList(MAX_ENDPOINTS); + remoteRepositories = new ArrayList<>(MAX_ENDPOINTS); for (int i = 1; i <= MAX_ENDPOINTS; i++) { HTTPRepository r = new HTTPRepository(getRepositoryUrl(i)); r.initialize(); @@ -204,6 +202,7 @@ protected void loadDataSet(Repository rep, String datasetFile) * @throws java.lang.Exception */ @After + @Override public void tearDown() throws Exception { try { localRepository.shutDown(); @@ -558,7 +557,7 @@ private Set readExpectedGraphQueryResult(String resultFile) throws Ex parser.setPreserveBNodeIDs(true); parser.setValueFactory(SimpleValueFactory.getInstance()); - Set result = new LinkedHashSet(); + Set result = new LinkedHashSet<>(); parser.setRDFHandler(new StatementCollector(result)); InputStream in = SPARQLServiceEvaluationTest.class.getResourceAsStream(resultFile); @@ -625,10 +624,10 @@ private void compareTupleQueryResults(TupleQueryResult queryResult, TupleQueryRe List expectedBindings = Iterations.asList(expectedResultTable); - List missingBindings = new ArrayList(expectedBindings); + List missingBindings = new ArrayList<>(expectedBindings); missingBindings.removeAll(queryBindings); - List unexpectedBindings = new ArrayList(queryBindings); + List unexpectedBindings = new ArrayList<>(queryBindings); unexpectedBindings.removeAll(expectedBindings); StringBuilder message = new StringBuilder(128); diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/EarlReport.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/EarlReport.java index d9d62e047ea..15ad36a7d6f 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/EarlReport.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/EarlReport.java @@ -127,10 +127,12 @@ protected static class EarlTestListener implements TestListener { private int failureCount; + @Override public void startTest(Test test) { errorCount = failureCount = 0; } + @Override public void endTest(Test test) { String testURI = null; ; @@ -167,10 +169,12 @@ public void endTest(Test test) { } } + @Override public void addError(Test test, Throwable t) { errorCount++; } + @Override public void addFailure(Test test, AssertionFailedError error) { failureCount++; } diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL10QueryTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL10QueryTest.java index cf9654d665c..7943cc02bca 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL10QueryTest.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL10QueryTest.java @@ -8,7 +8,6 @@ package org.eclipse.rdf4j.query.parser.sparql.manifest; import org.eclipse.rdf4j.query.Dataset; -import org.eclipse.rdf4j.query.parser.sparql.manifest.SPARQL11ManifestTest; import org.eclipse.rdf4j.query.parser.sparql.manifest.SPARQLQueryTest; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.dataset.DatasetRepository; @@ -27,12 +26,14 @@ public class W3CApprovedSPARQL10QueryTest extends SPARQLQueryTest { public static Test suite() throws Exception { return SPARQL10ManifestTest.suite(new Factory() { + @Override public W3CApprovedSPARQL10QueryTest createSPARQLQueryTest(String testURI, String name, String queryFileURL, String resultFileURL, Dataset dataSet, boolean laxCardinality) { return createSPARQLQueryTest(testURI, name, queryFileURL, resultFileURL, dataSet, laxCardinality, false); } + @Override public W3CApprovedSPARQL10QueryTest createSPARQLQueryTest(String testURI, String name, String queryFileURL, String resultFileURL, Dataset dataSet, boolean laxCardinality, boolean checkOrder) { String[] ignoredTests = { @@ -60,6 +61,7 @@ protected W3CApprovedSPARQL10QueryTest(String testURI, String name, String query super(testURI, name, queryFileURL, resultFileURL, dataSet, laxCardinality, checkOrder, ignoredTests); } + @Override protected Repository newRepository() { return new DatasetRepository(new SailRepository(new MemoryStore())); } diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL10SyntaxTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL10SyntaxTest.java index 0667ca16927..1960cca6392 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL10SyntaxTest.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL10SyntaxTest.java @@ -25,6 +25,7 @@ public class W3CApprovedSPARQL10SyntaxTest extends SPARQL11SyntaxTest { public static Test suite() throws Exception { return SPARQL11SyntaxTest.suite(new Factory() { + @Override public SPARQL11SyntaxTest createSPARQLSyntaxTest(String testURI, String testName, String testAction, boolean positiveTest) { return new W3CApprovedSPARQL10SyntaxTest(testURI, testName, testAction, positiveTest); @@ -36,6 +37,7 @@ public W3CApprovedSPARQL10SyntaxTest(String testURI, String name, String queryFi super(testURI, name, queryFileURL, positiveTest); } + @Override protected ParsedOperation parseOperation(String operation, String fileURL) throws MalformedQueryException { return QueryParserUtil.parseOperation(QueryLanguage.SPARQL, operation, fileURL); } diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL11SyntaxTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL11SyntaxTest.java index f5637f490c8..ef5019ffbd0 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL11SyntaxTest.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/W3CApprovedSPARQL11SyntaxTest.java @@ -20,6 +20,7 @@ public class W3CApprovedSPARQL11SyntaxTest extends SPARQL11SyntaxTest { public static Test suite() throws Exception { return SPARQL11SyntaxTest.suite(new Factory() { + @Override public SPARQL11SyntaxTest createSPARQLSyntaxTest(String testURI, String testName, String testAction, boolean positiveTest) { return new W3CApprovedSPARQL11SyntaxTest(testURI, testName, testAction, positiveTest); @@ -31,6 +32,7 @@ public W3CApprovedSPARQL11SyntaxTest(String testURI, String name, String queryFi super(testURI, name, queryFileURL, positiveTest); } + @Override protected ParsedOperation parseOperation(String operation, String fileURL) throws MalformedQueryException { return QueryParserUtil.parseOperation(QueryLanguage.SPARQL, operation, fileURL); } diff --git a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/util/HttpClientBuilders.java b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/util/HttpClientBuilders.java index 91dee10ffc1..c7380e70be0 100644 --- a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/util/HttpClientBuilders.java +++ b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/util/HttpClientBuilders.java @@ -7,7 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.http.client.util; -import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import javax.net.ssl.HostnameVerifier; @@ -18,7 +17,6 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContextBuilder; -import org.apache.http.ssl.TrustStrategy; import org.eclipse.rdf4j.http.client.HttpClientDependent; /** diff --git a/core/http/client/src/test/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSessionTest.java b/core/http/client/src/test/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSessionTest.java index a60467bf583..d0c86447af2 100644 --- a/core/http/client/src/test/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSessionTest.java +++ b/core/http/client/src/test/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSessionTest.java @@ -44,7 +44,6 @@ import org.eclipse.rdf4j.query.resultio.TupleQueryResultFormat; import org.eclipse.rdf4j.repository.config.RepositoryConfig; import org.eclipse.rdf4j.rio.RDFFormat; -import org.eclipse.rdf4j.rio.RDFParserRegistry; import org.eclipse.rdf4j.rio.helpers.StatementCollector; import org.junit.Before; import org.junit.ClassRule; diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/Model.java b/core/model/src/main/java/org/eclipse/rdf4j/model/Model.java index 30cdabfee1d..0f8a27b6cf7 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/Model.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/Model.java @@ -8,7 +8,6 @@ package org.eclipse.rdf4j.model; import java.io.Serializable; -import java.util.Iterator; import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/util/SynchronizedModel.java b/core/model/src/main/java/org/eclipse/rdf4j/model/util/SynchronizedModel.java index ecdb1bdc35f..d5044dee922 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/util/SynchronizedModel.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/util/SynchronizedModel.java @@ -14,7 +14,6 @@ import java.util.Set; import java.util.Spliterator; import java.util.function.Consumer; -import java.util.function.IntFunction; import java.util.function.Predicate; import java.util.stream.Stream; diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResult.java b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResult.java index ee869bd378d..bf6134444cd 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResult.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResult.java @@ -8,10 +8,8 @@ package org.eclipse.rdf4j.query; import java.util.Iterator; -import java.util.stream.Stream; import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.common.iterator.CloseableIterationIterator; /** @@ -24,7 +22,7 @@ public interface QueryResult extends CloseableIteration iterator() { - return new CloseableIterationIterator(this); + return new CloseableIterationIterator<>(this); } } diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java index e17a98e5970..9f7690f56f5 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java @@ -36,9 +36,7 @@ import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.impl.DynamicModel; import org.eclipse.rdf4j.model.impl.DynamicModelFactory; -import org.eclipse.rdf4j.model.impl.LinkedHashModelFactory; import org.eclipse.rdf4j.model.util.Models; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; import org.eclipse.rdf4j.query.impl.BackgroundGraphResult; diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/BooleanCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/BooleanCast.java index 1a407717ff9..fdc26f318a5 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/BooleanCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/BooleanCast.java @@ -17,7 +17,6 @@ import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ByteCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ByteCast.java index dc4e1ce2117..d4432437d2f 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ByteCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ByteCast.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DateTimeCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DateTimeCast.java index 5bdc67ef22d..744e313a324 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DateTimeCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DateTimeCast.java @@ -17,7 +17,6 @@ import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DecimalCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DecimalCast.java index 81253840b95..cf9fa81a28f 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DecimalCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DecimalCast.java @@ -16,7 +16,6 @@ import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntCast.java index 3f5ab2e501d..f5b5f901d2e 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntCast.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCast.java index 98c8ec78aad..5e9ff44474f 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCast.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NegativeIntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NegativeIntegerCast.java index d9ff76071eb..c26891a7592 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NegativeIntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NegativeIntegerCast.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonNegativeIntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonNegativeIntegerCast.java index e954055bfd3..123ffdd17a2 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonNegativeIntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonNegativeIntegerCast.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonPositiveIntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonPositiveIntegerCast.java index cc7b46134dd..540306322ea 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonPositiveIntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonPositiveIntegerCast.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/PositiveIntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/PositiveIntegerCast.java index 516b61372c8..ef5a8f0c99d 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/PositiveIntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/PositiveIntegerCast.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ShortCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ShortCast.java index 558ac20ddc6..72efaf34ebc 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ShortCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ShortCast.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/EvaluationStrategyWithRDFStarTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/EvaluationStrategyWithRDFStarTest.java index 17df4692dd9..486a2033b38 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/EvaluationStrategyWithRDFStarTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/EvaluationStrategyWithRDFStarTest.java @@ -59,7 +59,7 @@ public static Object[] params() { public boolean bRDFStarData; // the triples over which the evaluations is carried - private ArrayList triples = new ArrayList(); + private ArrayList triples = new ArrayList<>(); ValueFactory vf = SimpleValueFactory.getInstance(); @@ -223,11 +223,11 @@ public void testMatchAllUnbound() { // case check all unbound try (CloseableIteration iter = strategy.evaluate(tripleRefNode, new EmptyBindingSet())) { - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); triples.forEach(t -> { expected.add(fromTriple(t)); }); - ArrayList received = new ArrayList(); + ArrayList received = new ArrayList<>(); while (iter.hasNext()) { received.add(iter.next()); } @@ -240,13 +240,13 @@ public void testMatchAllUnbound() { public void testSubjVarBound() { try (CloseableIteration iter = strategy.evaluate(tripleRefNode, createWithVarValue(tripleRefNode.getSubjectVar(), vf.createIRI("urn:a")))) { - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); triples.forEach(t -> { if (t.getSubject().equals(vf.createIRI("urn:a"))) { expected.add(fromTriple(t)); } }); - ArrayList received = new ArrayList(); + ArrayList received = new ArrayList<>(); while (iter.hasNext()) { received.add(iter.next()); } @@ -260,13 +260,13 @@ public void testPredVarBound() { try (CloseableIteration iter = strategy.evaluate(tripleRefNode, createWithVarValue(tripleRefNode.getPredicateVar(), vf.createIRI("urn:p")))) { - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); triples.forEach(t -> { if (t.getPredicate().equals(vf.createIRI("urn:p"))) { expected.add(fromTriple(t)); } }); - ArrayList received = new ArrayList(); + ArrayList received = new ArrayList<>(); while (iter.hasNext()) { received.add(iter.next()); } @@ -280,13 +280,13 @@ public void testObjVarBound() { try (CloseableIteration iter = strategy.evaluate(tripleRefNode, createWithVarValue(tripleRefNode.getObjectVar(), vf.createIRI("urn:b")))) { - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); triples.forEach(t -> { if (t.getObject().equals(vf.createIRI("urn:b"))) { expected.add(fromTriple(t)); } }); - ArrayList received = new ArrayList(); + ArrayList received = new ArrayList<>(); while (iter.hasNext()) { received.add(iter.next()); } @@ -302,13 +302,13 @@ public void testSubjAndObjVarBound() { try (CloseableIteration iter = strategy.evaluate(tripleRefNode, set)) { - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); triples.forEach(t -> { if (t.getObject().equals(vf.createIRI("urn:c")) && t.getSubject().equals(vf.createIRI("urn:a:2"))) { expected.add(fromTriple(t)); } }); - ArrayList received = new ArrayList(); + ArrayList received = new ArrayList<>(); while (iter.hasNext()) { received.add(iter.next()); } @@ -324,9 +324,9 @@ public void testExtVarBound() { try (CloseableIteration iter = strategy.evaluate(tripleRefNode, set)) { - ArrayList expected = new ArrayList(); + ArrayList expected = new ArrayList<>(); expected.add(fromTriple(triple)); - ArrayList received = new ArrayList(); + ArrayList received = new ArrayList<>(); while (iter.hasNext()) { received.add(iter.next()); } diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategyTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategyTest.java index a1432370b44..e7b8907de4d 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategyTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategyTest.java @@ -26,7 +26,6 @@ import org.eclipse.rdf4j.query.algebra.evaluation.EvaluationStrategy; import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet; import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizer; -import org.eclipse.rdf4j.query.algebra.evaluation.QueryOptimizerPipeline; import org.eclipse.rdf4j.query.parser.ParsedQuery; import org.eclipse.rdf4j.query.parser.QueryParserUtil; import org.junit.Before; diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/ArbitraryLengthPath.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/ArbitraryLengthPath.java index 7384496e691..3dc46ec83c0 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/ArbitraryLengthPath.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/ArbitraryLengthPath.java @@ -9,7 +9,6 @@ import java.util.HashSet; import java.util.Set; -import java.util.stream.Stream; import org.eclipse.rdf4j.query.algebra.StatementPattern.Scope; diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/BindingSetAssignment.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/BindingSetAssignment.java index b4b0314858d..d58b8a6ba9d 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/BindingSetAssignment.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/BindingSetAssignment.java @@ -10,7 +10,6 @@ import java.util.HashSet; import java.util.Objects; import java.util.Set; -import java.util.stream.Stream; import org.eclipse.rdf4j.query.BindingSet; diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/DescribeOperator.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/DescribeOperator.java index b94fa13e2a9..3ba872f5e46 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/DescribeOperator.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/DescribeOperator.java @@ -7,8 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.query.algebra; -import java.util.stream.Stream; - /** * @author Jeen Broekstra */ diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Distinct.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Distinct.java index 196a0faffee..121049ab73a 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Distinct.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Distinct.java @@ -7,8 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.query.algebra; -import java.util.stream.Stream; - public class Distinct extends UnaryTupleOperator { /*--------------* diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Extension.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Extension.java index 6bfca7688ce..4b5b394e4f1 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Extension.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Extension.java @@ -11,7 +11,6 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -import java.util.stream.Stream; /** * An extension operator that can be used to add bindings to solutions whose values are defined by {@link ValueExpr diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Group.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Group.java index 430c8875284..6304631ea63 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Group.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Group.java @@ -13,7 +13,6 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; -import java.util.stream.Stream; import org.eclipse.rdf4j.util.iterators.Iterators; diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/MultiProjection.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/MultiProjection.java index 15095760361..89936731586 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/MultiProjection.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/MultiProjection.java @@ -12,7 +12,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.stream.Stream; /** * A "multi-projection" that can produce multiple solutions from a single set of bindings. diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Order.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Order.java index 5ca44bad57b..db19a400272 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Order.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Order.java @@ -9,7 +9,6 @@ import java.util.ArrayList; import java.util.List; -import java.util.stream.Stream; /** * An order operator that can be used to order bindings as specified by a set of value expressions. diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Projection.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Projection.java index bfbc4d78a7b..49659a91e1a 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Projection.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Projection.java @@ -8,7 +8,6 @@ package org.eclipse.rdf4j.query.algebra; import java.util.Set; -import java.util.stream.Stream; /** * A generalized projection (allowing the bindings to be renamed) on a tuple expression. diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Reduced.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Reduced.java index b8bb737de7f..abe49770c2f 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Reduced.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Reduced.java @@ -7,8 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.query.algebra; -import java.util.stream.Stream; - public class Reduced extends UnaryTupleOperator { /*--------------* diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Service.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Service.java index 6c07ae8eeb6..62f7de2562b 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Service.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Service.java @@ -11,7 +11,6 @@ import java.util.Map; import java.util.Set; import java.util.regex.Pattern; -import java.util.stream.Stream; import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor; diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Slice.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Slice.java index 5191b0a6c60..c1d7ec64f91 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Slice.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Slice.java @@ -7,8 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.query.algebra; -import java.util.stream.Stream; - /** * The SLICE operator, as defined in SPARQL Query * Language for RDF. The SLICE operator selects specific results from the underlying tuple expression based on an diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/StatementPattern.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/StatementPattern.java index d2f37e50be6..b667ef8fc44 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/StatementPattern.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/StatementPattern.java @@ -12,7 +12,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.stream.Stream; /** * A tuple expression that matches a statement pattern against an RDF graph. Statement patterns can be targeted at one diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/UnaryTupleOperator.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/UnaryTupleOperator.java index fe07b6a334f..237c079064e 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/UnaryTupleOperator.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/UnaryTupleOperator.java @@ -8,7 +8,6 @@ package org.eclipse.rdf4j.query.algebra; import java.util.Set; -import java.util.stream.Stream; /** * An abstract superclass for unary tuple operators which, by definition, has one argument. diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/QueryModelTreePrinter.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/QueryModelTreePrinter.java index e7e5c60c5cf..2ebd39380c0 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/QueryModelTreePrinter.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/QueryModelTreePrinter.java @@ -9,7 +9,6 @@ import java.util.stream.Stream; -import org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode; import org.eclipse.rdf4j.query.algebra.BinaryTupleOperator; import org.eclipse.rdf4j.query.algebra.QueryModelNode; import org.eclipse.rdf4j.query.algebra.VariableScopeChange; diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/QueryModelTreeToGenericPlanNode.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/QueryModelTreeToGenericPlanNode.java index 81be5daec93..085d18d1d23 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/QueryModelTreeToGenericPlanNode.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/QueryModelTreeToGenericPlanNode.java @@ -11,7 +11,6 @@ import org.eclipse.rdf4j.common.annotation.Experimental; import org.eclipse.rdf4j.common.annotation.InternalUseOnly; -import org.eclipse.rdf4j.query.algebra.AbstractQueryModelNode; import org.eclipse.rdf4j.query.algebra.BinaryTupleOperator; import org.eclipse.rdf4j.query.algebra.QueryModelNode; import org.eclipse.rdf4j.query.algebra.VariableScopeChange; diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/TripleRefCollector.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/TripleRefCollector.java index 5347d4bb6c8..2189bb38a24 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/TripleRefCollector.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/TripleRefCollector.java @@ -25,7 +25,7 @@ public static Map process(QueryModelNode node) { return collector.getTripleRefs(); } - private Map tripleRefs = new HashMap(); + private Map tripleRefs = new HashMap<>(); public Map getTripleRefs() { return tripleRefs; diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/ASTConstTripleRef.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/ASTConstTripleRef.java index d9149725023..9b4d20ccd68 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/ASTConstTripleRef.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/ASTConstTripleRef.java @@ -31,6 +31,7 @@ public SimpleNode getObj() { } /** Accept the visitor. **/ + @Override public Object jjtAccept(SyntaxTreeBuilderVisitor visitor, Object data) throws VisitorException { return visitor.visit(this, data); } diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/ASTTripleRef.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/ASTTripleRef.java index a3d71f59923..7a40c95a51d 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/ASTTripleRef.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/ASTTripleRef.java @@ -31,6 +31,7 @@ public SimpleNode getObj() { } /** Accept the visitor. **/ + @Override public Object jjtAccept(SyntaxTreeBuilderVisitor visitor, Object data) throws VisitorException { return visitor.visit(this, data); } diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/JJTSyntaxTreeBuilderState.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/JJTSyntaxTreeBuilderState.java index 524ffda7a02..c56e91da678 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/JJTSyntaxTreeBuilderState.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/JJTSyntaxTreeBuilderState.java @@ -17,8 +17,8 @@ public class JJTSyntaxTreeBuilderState { private boolean node_created; public JJTSyntaxTreeBuilderState() { - nodes = new java.util.ArrayList(); - marks = new java.util.ArrayList(); + nodes = new java.util.ArrayList<>(); + marks = new java.util.ArrayList<>(); sp = 0; mk = 0; } diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilder.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilder.java index 35a541f6602..a865c53f919 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilder.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilder.java @@ -10576,7 +10576,7 @@ private int jj_ntk() { return (jj_ntk = jj_nt.kind); } - private java.util.List jj_expentries = new java.util.ArrayList(); + private java.util.List jj_expentries = new java.util.ArrayList<>(); private int[] jj_expentry; private int jj_kind = -1; private int[] jj_lasttokens = new int[100]; diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilderTokenManager.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilderTokenManager.java index 825dcdb3bdc..4856df389ea 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilderTokenManager.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilderTokenManager.java @@ -8,14 +8,6 @@ /* Generated By:JJTree&JavaCC: Do not edit this line. SyntaxTreeBuilderTokenManager.java */ package org.eclipse.rdf4j.query.parser.sparql.ast; -import java.io.StringReader; - -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; -import org.eclipse.rdf4j.query.algebra.Compare.CompareOp; -import org.eclipse.rdf4j.query.algebra.MathExpr.MathOp; - /** Token Manager. */ public class SyntaxTreeBuilderTokenManager implements SyntaxTreeBuilderConstants { diff --git a/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java b/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java index d7cc75a3e3c..0b237841434 100644 --- a/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java +++ b/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java @@ -19,7 +19,6 @@ import java.util.List; import org.eclipse.rdf4j.query.MalformedQueryException; -import org.eclipse.rdf4j.query.algebra.ArbitraryLengthPath; import org.eclipse.rdf4j.query.algebra.Extension; import org.eclipse.rdf4j.query.algebra.Filter; import org.eclipse.rdf4j.query.algebra.InsertData; diff --git a/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/TestServiceUpdateExprBuilder.java b/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/TestServiceUpdateExprBuilder.java index b6b55594855..529b5083c7a 100644 --- a/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/TestServiceUpdateExprBuilder.java +++ b/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/TestServiceUpdateExprBuilder.java @@ -8,7 +8,6 @@ package org.eclipse.rdf4j.query.parser.sparql; import org.eclipse.rdf4j.query.algebra.Service; -import org.eclipse.rdf4j.query.parser.ParsedUpdate; import org.junit.Test; public class TestServiceUpdateExprBuilder { diff --git a/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/TestSparqlStarParser.java b/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/TestSparqlStarParser.java index bd026426e7d..9b8f18a473a 100644 --- a/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/TestSparqlStarParser.java +++ b/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/TestSparqlStarParser.java @@ -255,7 +255,7 @@ public void testUseInBindWithVars() throws Exception { assertTrue("expect projection", q.getTupleExpr() instanceof Projection); Projection proj = (Projection) q.getTupleExpr(); List list = proj.getProjectionElemList().getElements(); - final ArrayList listNames = new ArrayList(); + final ArrayList listNames = new ArrayList<>(); list.forEach(el -> { listNames.add(el.getTargetName()); }); @@ -323,7 +323,7 @@ public void testUseInStatementPatternWithVars() throws Exception { assertTrue("expect projection", q.getTupleExpr() instanceof Projection); Projection proj = (Projection) q.getTupleExpr(); List list = proj.getProjectionElemList().getElements(); - final ArrayList listNames = new ArrayList(); + final ArrayList listNames = new ArrayList<>(); list.forEach(el -> { listNames.add(el.getTargetName()); }); @@ -390,7 +390,7 @@ public void testUseNestedInStatementPatternWithVars() throws Exception { assertTrue("expect projection", q.getTupleExpr() instanceof Projection); Projection proj = (Projection) q.getTupleExpr(); List list = proj.getProjectionElemList().getElements(); - final ArrayList listNames = new ArrayList(); + final ArrayList listNames = new ArrayList<>(); list.forEach(el -> { listNames.add(el.getTargetName()); }); @@ -467,7 +467,7 @@ public void testUseInConstructFromStatementPattern() throws Exception { Projection proj = (Projection) ((Reduced) q.getTupleExpr()).getArg(); List list = proj.getProjectionElemList().getElements(); - final ArrayList listTargetNames = new ArrayList(); + final ArrayList listTargetNames = new ArrayList<>(); list.forEach(el -> { listTargetNames.add(el.getTargetName()); }); @@ -476,7 +476,7 @@ public void testUseInConstructFromStatementPattern() throws Exception { assertTrue("expect target predicate", listTargetNames.contains("predicate")); assertTrue("expect target oobject", listTargetNames.contains("object")); - final ArrayList listSourceNames = new ArrayList(); + final ArrayList listSourceNames = new ArrayList<>(); list.forEach(el -> { listSourceNames.add(el.getSourceName()); }); @@ -689,7 +689,7 @@ public void testUseInGroupByFromBindWithVars() throws Exception { assertTrue("expect projection", q.getTupleExpr() instanceof Projection); Projection proj = (Projection) q.getTupleExpr(); List list = proj.getProjectionElemList().getElements(); - final ArrayList listNames = new ArrayList(); + final ArrayList listNames = new ArrayList<>(); list.forEach(el -> { listNames.add(el.getTargetName()); }); @@ -774,7 +774,7 @@ public void testUseInExists() throws Exception { assertTrue("expect projection", q.getTupleExpr() instanceof Projection); Projection proj = (Projection) q.getTupleExpr(); List list = proj.getProjectionElemList().getElements(); - final ArrayList listNames = new ArrayList(); + final ArrayList listNames = new ArrayList<>(); list.forEach(el -> { listNames.add(el.getTargetName()); }); @@ -837,7 +837,7 @@ public void testUseInSTR() throws Exception { assertTrue("expect projection", q.getTupleExpr() instanceof Projection); Projection proj = (Projection) q.getTupleExpr(); List list = proj.getProjectionElemList().getElements(); - final ArrayList listNames = new ArrayList(); + final ArrayList listNames = new ArrayList<>(); list.forEach(el -> { listNames.add(el.getTargetName()); }); diff --git a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/RepositoryResult.java b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/RepositoryResult.java index 7e2a4a172fa..19c6b0df862 100644 --- a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/RepositoryResult.java +++ b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/RepositoryResult.java @@ -11,7 +11,6 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; -import java.util.stream.Stream; import org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration; import org.eclipse.rdf4j.common.iteration.CloseableIteration; @@ -130,7 +129,7 @@ public > C addTo(C collection) throws RepositoryExceptio @Override public Iterator iterator() { - return new CloseableIterationIterator(this); + return new CloseableIterationIterator<>(this); } } diff --git a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/util/RepositoryUtil.java b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/util/RepositoryUtil.java index 8f3e182da6b..f170a5ff9de 100644 --- a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/util/RepositoryUtil.java +++ b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/util/RepositoryUtil.java @@ -10,7 +10,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; diff --git a/core/repository/dataset/src/main/java/org/eclipse/rdf4j/repository/dataset/DatasetBooleanQuery.java b/core/repository/dataset/src/main/java/org/eclipse/rdf4j/repository/dataset/DatasetBooleanQuery.java index ffd8e219e64..0c0220ed8dd 100644 --- a/core/repository/dataset/src/main/java/org/eclipse/rdf4j/repository/dataset/DatasetBooleanQuery.java +++ b/core/repository/dataset/src/main/java/org/eclipse/rdf4j/repository/dataset/DatasetBooleanQuery.java @@ -9,7 +9,6 @@ import org.eclipse.rdf4j.query.BooleanQuery; import org.eclipse.rdf4j.query.QueryEvaluationException; -import org.eclipse.rdf4j.query.explanation.Explanation; import org.eclipse.rdf4j.repository.sail.SailBooleanQuery; /** diff --git a/core/repository/event/src/main/java/org/eclipse/rdf4j/repository/event/base/NotifyingRepositoryConnectionWrapper.java b/core/repository/event/src/main/java/org/eclipse/rdf4j/repository/event/base/NotifyingRepositoryConnectionWrapper.java index b99abfaf6ed..63805f404e2 100644 --- a/core/repository/event/src/main/java/org/eclipse/rdf4j/repository/event/base/NotifyingRepositoryConnectionWrapper.java +++ b/core/repository/event/src/main/java/org/eclipse/rdf4j/repository/event/base/NotifyingRepositoryConnectionWrapper.java @@ -7,14 +7,12 @@ *******************************************************************************/ package org.eclipse.rdf4j.repository.event.base; -import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Namespace; import org.eclipse.rdf4j.model.Resource; @@ -29,7 +27,6 @@ import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.repository.RepositoryException; -import org.eclipse.rdf4j.repository.RepositoryResult; import org.eclipse.rdf4j.repository.base.RepositoryConnectionWrapper; import org.eclipse.rdf4j.repository.event.NotifyingRepositoryConnection; import org.eclipse.rdf4j.repository.event.RepositoryConnectionListener; diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/RepositoryFederatedService.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/RepositoryFederatedService.java index 17b09dd1e07..6cdb2624aba 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/RepositoryFederatedService.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/RepositoryFederatedService.java @@ -234,7 +234,7 @@ public CloseableIteration select(Service s } if (service.isSilent()) { - return new SilentIteration(result); + return new SilentIteration<>(result); } else { return result; } diff --git a/core/rio/binary/src/main/java/org/eclipse/rdf4j/rio/binary/BinaryRDFWriter.java b/core/rio/binary/src/main/java/org/eclipse/rdf4j/rio/binary/BinaryRDFWriter.java index 15eb155f58e..b455d57f58f 100644 --- a/core/rio/binary/src/main/java/org/eclipse/rdf4j/rio/binary/BinaryRDFWriter.java +++ b/core/rio/binary/src/main/java/org/eclipse/rdf4j/rio/binary/BinaryRDFWriter.java @@ -43,7 +43,6 @@ import org.eclipse.rdf4j.rio.RDFHandlerException; import org.eclipse.rdf4j.rio.RDFWriter; import org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter; -import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings; /** * @author Arjohn Kampman diff --git a/core/rio/trix/src/test/java/org/eclipse/rdf4j/rio/trix/TriXParserTest.java b/core/rio/trix/src/test/java/org/eclipse/rdf4j/rio/trix/TriXParserTest.java index 7b149f3471c..d954c36a510 100644 --- a/core/rio/trix/src/test/java/org/eclipse/rdf4j/rio/trix/TriXParserTest.java +++ b/core/rio/trix/src/test/java/org/eclipse/rdf4j/rio/trix/TriXParserTest.java @@ -11,10 +11,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.InputStream; -import java.io.PrintStream; import java.util.Locale; import org.eclipse.rdf4j.model.Statement; diff --git a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java index 28b3561b0a3..a4ae8d0d3a4 100644 --- a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java +++ b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java @@ -21,7 +21,6 @@ import org.apache.commons.io.input.BOMInputStream; import org.eclipse.rdf4j.common.text.ASCIIUtil; -import org.eclipse.rdf4j.model.BNode; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Resource; diff --git a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailSink.java b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailSink.java index 1b143f60e15..e9530438bca 100644 --- a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailSink.java +++ b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailSink.java @@ -8,7 +8,6 @@ package org.eclipse.rdf4j.sail.base; import org.eclipse.rdf4j.IsolationLevels; -import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; diff --git a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchContextStatement.java b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchContextStatement.java index da148b8d890..2c781988f75 100644 --- a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchContextStatement.java +++ b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchContextStatement.java @@ -10,7 +10,6 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.impl.ContextStatement; import org.eclipse.rdf4j.sail.extensiblestore.valuefactory.ExtensibleContextStatement; /** @@ -26,6 +25,7 @@ class ElasticsearchContextStatement extends ExtensibleContextStatement implement this.elasticsearchId = elasticsearchId; } + @Override public String getElasticsearchId() { return elasticsearchId; } diff --git a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchDataStructure.java b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchDataStructure.java index 09350fbfbe0..451d0874cbc 100644 --- a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchDataStructure.java +++ b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchDataStructure.java @@ -7,8 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.sail.elasticsearchstore; -import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; - import java.io.IOException; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; @@ -32,7 +30,6 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.extensiblestore.DataStructureInterface; diff --git a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchHelper.java b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchHelper.java index f9a6a928ff0..84af925f071 100644 --- a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchHelper.java +++ b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchHelper.java @@ -18,7 +18,6 @@ import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.sort.FieldSortBuilder; -import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.search.sort.SortOrder; class ElasticsearchHelper { diff --git a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchStatement.java b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchStatement.java index 8c3e20209bd..3c717d291b1 100644 --- a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchStatement.java +++ b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchStatement.java @@ -10,8 +10,6 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.impl.SimpleStatement; -import org.eclipse.rdf4j.sail.extensiblestore.valuefactory.ExtensibleStatement; import org.eclipse.rdf4j.sail.extensiblestore.valuefactory.ExtensibleStatementImpl; /** @@ -26,6 +24,7 @@ class ElasticsearchStatement extends ExtensibleStatementImpl implements Elastics this.elasticsearchId = elasticsearchId; } + @Override public String getElasticsearchId() { return elasticsearchId; } diff --git a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchStore.java b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchStore.java index 248abfa1712..81296ff2b83 100644 --- a/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchStore.java +++ b/core/sail/elasticsearch-store/src/main/java/org/eclipse/rdf4j/sail/elasticsearchstore/ElasticsearchStore.java @@ -21,7 +21,6 @@ import org.eclipse.rdf4j.sail.NotifyingSailConnection; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.extensiblestore.ExtensibleStore; -import org.eclipse.rdf4j.sail.extensiblestore.evaluationstatistics.EvaluationStatisticsEnum; import org.eclipse.rdf4j.sail.extensiblestore.valuefactory.ExtensibleStatementHelper; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; diff --git a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/DeleteBenchmark.java b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/DeleteBenchmark.java index 2edbc5541d2..03718bf13dd 100644 --- a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/DeleteBenchmark.java +++ b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/DeleteBenchmark.java @@ -28,7 +28,6 @@ import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.OutputTimeUnit; -import org.openjdk.jmh.annotations.Param; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; diff --git a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/ReadCacheBenchmark.java b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/ReadCacheBenchmark.java index 78bf461bdac..833500ac08e 100644 --- a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/ReadCacheBenchmark.java +++ b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/ReadCacheBenchmark.java @@ -20,7 +20,6 @@ import org.eclipse.rdf4j.IsolationLevels; import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.Literal; -import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.query.BindingSet; diff --git a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/TransactionBenchmark.java b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/TransactionBenchmark.java index f2acc3e7925..90cd169c0b6 100644 --- a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/TransactionBenchmark.java +++ b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/TransactionBenchmark.java @@ -11,22 +11,14 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.concurrent.TimeUnit; -import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.apache.commons.io.IOUtils; import org.assertj.core.util.Files; import org.eclipse.rdf4j.IsolationLevels; -import org.eclipse.rdf4j.common.iteration.Iterations; -import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; -import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.repository.sail.SailRepository; import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.rio.RDFFormat; @@ -38,7 +30,6 @@ import org.openjdk.jmh.annotations.Level; import org.openjdk.jmh.annotations.Measurement; import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.OutputTimeUnit; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; diff --git a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/TransactionParallelBenchmark.java b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/TransactionParallelBenchmark.java index 43f7f72de01..ab8e7efdf52 100644 --- a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/TransactionParallelBenchmark.java +++ b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/benchmark/TransactionParallelBenchmark.java @@ -11,14 +11,12 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.util.List; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.assertj.core.util.Files; import org.eclipse.rdf4j.IsolationLevels; -import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; diff --git a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/compliance/ElasticsearchStoreIsolationLevelTest.java b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/compliance/ElasticsearchStoreIsolationLevelTest.java index 21b8387c0ab..cb9ba2b101d 100644 --- a/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/compliance/ElasticsearchStoreIsolationLevelTest.java +++ b/core/sail/elasticsearch-store/src/test/java/org/eclipse/rdf4j/sail/elasticsearchstore/compliance/ElasticsearchStoreIsolationLevelTest.java @@ -10,7 +10,6 @@ import java.io.File; import org.assertj.core.util.Files; -import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.sail.NotifyingSail; import org.eclipse.rdf4j.sail.NotifyingSailConnection; import org.eclipse.rdf4j.sail.Sail; @@ -21,7 +20,6 @@ import org.eclipse.rdf4j.sail.elasticsearchstore.TestHelpers; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Ignore; import pl.allegro.tech.embeddedelasticsearch.EmbeddedElastic; diff --git a/core/sail/elasticsearch/src/main/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchIndex.java b/core/sail/elasticsearch/src/main/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchIndex.java index eb3e2f5a39b..4db594e1fc2 100644 --- a/core/sail/elasticsearch/src/main/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchIndex.java +++ b/core/sail/elasticsearch/src/main/java/org/eclipse/rdf4j/sail/elasticsearch/ElasticsearchIndex.java @@ -23,7 +23,6 @@ import org.eclipse.rdf4j.model.vocabulary.GEOF; import org.eclipse.rdf4j.query.MalformedQueryException; import org.eclipse.rdf4j.query.algebra.Var; -import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.lucene.AbstractSearchIndex; import org.eclipse.rdf4j.sail.lucene.BulkUpdater; import org.eclipse.rdf4j.sail.lucene.DocumentDistance; diff --git a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/evaluationstatistics/ExtensibleDynamicEvaluationStatistics.java b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/evaluationstatistics/ExtensibleDynamicEvaluationStatistics.java index db4fb5e63e5..89867ac2ed1 100644 --- a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/evaluationstatistics/ExtensibleDynamicEvaluationStatistics.java +++ b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/evaluationstatistics/ExtensibleDynamicEvaluationStatistics.java @@ -68,7 +68,7 @@ public class ExtensibleDynamicEvaluationStatistics extends ExtensibleEvaluationS private static final int QUEUE_LIMIT = 128; private static final int SINGLE_DIMENSION_INDEX_SIZE = 1024; - ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue(); + ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); AtomicInteger queueSize = new AtomicInteger(); diff --git a/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/NaiveHashSetDataStructure.java b/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/NaiveHashSetDataStructure.java index 44a70dc13ca..24c8f4f5199 100644 --- a/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/NaiveHashSetDataStructure.java +++ b/core/sail/extensible-store/src/test/java/org/eclipse/rdf4j/sail/extensiblestore/NaiveHashSetDataStructure.java @@ -7,10 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.sail.extensiblestore; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; diff --git a/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/AbstractEchoWriteConnection.java b/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/AbstractEchoWriteConnection.java index d80944a52ee..62bf5d2e61e 100644 --- a/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/AbstractEchoWriteConnection.java +++ b/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/AbstractEchoWriteConnection.java @@ -13,7 +13,6 @@ import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryException; import org.eclipse.rdf4j.sail.SailException; /** diff --git a/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/optimizers/EvaluationStatistics.java b/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/optimizers/EvaluationStatistics.java index 36ee9592b73..b5bd485539b 100644 --- a/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/optimizers/EvaluationStatistics.java +++ b/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/optimizers/EvaluationStatistics.java @@ -7,9 +7,7 @@ *******************************************************************************/ package org.eclipse.rdf4j.sail.federation.optimizers; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Set; import org.eclipse.rdf4j.query.algebra.BinaryTupleOperator; diff --git a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/ForwardChainingRDFSInferencerConnection.java b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/ForwardChainingRDFSInferencerConnection.java index 80f48b30e88..9f8b4b4052c 100644 --- a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/ForwardChainingRDFSInferencerConnection.java +++ b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/ForwardChainingRDFSInferencerConnection.java @@ -14,10 +14,7 @@ import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.impl.DynamicModel; import org.eclipse.rdf4j.model.impl.DynamicModelFactory; -import org.eclipse.rdf4j.model.impl.LinkedHashModelFactory; -import org.eclipse.rdf4j.model.impl.TreeModelFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.sail.Sail; diff --git a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencer.java b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencer.java index 237c70d76e0..b9501f11345 100644 --- a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencer.java +++ b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencer.java @@ -22,7 +22,6 @@ import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.IsolationLevels; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; @@ -31,7 +30,6 @@ import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryResult; import org.eclipse.rdf4j.sail.NotifyingSail; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper; diff --git a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerNativeIsolationLevelTest.java b/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerNativeIsolationLevelTest.java index f7ea4a73526..a4b01fc3ea8 100644 --- a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerNativeIsolationLevelTest.java +++ b/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerNativeIsolationLevelTest.java @@ -10,10 +10,8 @@ import java.io.IOException; import org.eclipse.rdf4j.sail.NotifyingSail; -import org.eclipse.rdf4j.sail.Sail; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.SailIsolationLevelTest; -import org.eclipse.rdf4j.sail.memory.MemoryStore; import org.eclipse.rdf4j.sail.nativerdf.NativeStore; import org.junit.Rule; import org.junit.rules.TemporaryFolder; diff --git a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerNativeRepositoryConnectionTest.java b/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerNativeRepositoryConnectionTest.java index 9c0a3566bd8..5662ddcf122 100644 --- a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerNativeRepositoryConnectionTest.java +++ b/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerNativeRepositoryConnectionTest.java @@ -8,8 +8,6 @@ package org.eclipse.rdf4j.sail.inferencer.fc; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; @@ -17,16 +15,12 @@ import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.common.io.FileUtil; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.vocabulary.FOAF; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.repository.RDFSchemaRepositoryConnectionTest; import org.eclipse.rdf4j.repository.Repository; -import org.eclipse.rdf4j.repository.RepositoryResult; import org.eclipse.rdf4j.repository.sail.SailRepository; import org.eclipse.rdf4j.sail.inferencer.fc.SchemaCachingRDFSInferencer; import org.eclipse.rdf4j.sail.nativerdf.NativeStore; diff --git a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerRDFSchemaMemoryRepositoryConnectionTest.java b/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerRDFSchemaMemoryRepositoryConnectionTest.java index 092c7589415..4d7cea74834 100644 --- a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerRDFSchemaMemoryRepositoryConnectionTest.java +++ b/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerRDFSchemaMemoryRepositoryConnectionTest.java @@ -10,12 +10,10 @@ import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; import java.util.stream.Stream; import org.eclipse.rdf4j.IsolationLevel; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.vocabulary.RDF; diff --git a/core/sail/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/LuceneDocumentScore.java b/core/sail/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/LuceneDocumentScore.java index 36b13c062be..f1ff715a135 100644 --- a/core/sail/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/LuceneDocumentScore.java +++ b/core/sail/lucene/src/main/java/org/eclipse/rdf4j/sail/lucene/LuceneDocumentScore.java @@ -14,7 +14,6 @@ import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.highlight.Highlighter; -import com.google.common.base.Function; import com.google.common.collect.Iterables; public class LuceneDocumentScore extends LuceneDocumentResult implements DocumentScore { diff --git a/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/benchmark/MemoryBenchmark.java b/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/benchmark/MemoryBenchmark.java index 99237367542..1d9b95e7a6d 100644 --- a/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/benchmark/MemoryBenchmark.java +++ b/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/benchmark/MemoryBenchmark.java @@ -8,7 +8,6 @@ import org.eclipse.rdf4j.IsolationLevels; import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.ValueFactory; diff --git a/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/ContextStoreTest.java b/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/ContextStoreTest.java index 02f70bd29c0..95943cd9149 100644 --- a/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/ContextStoreTest.java +++ b/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/ContextStoreTest.java @@ -17,7 +17,6 @@ import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.sail.SailException; import org.junit.Before; import org.junit.Test; diff --git a/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/DataFileBenchmark.java b/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/DataFileBenchmark.java index c88b682b451..56ed0250851 100644 --- a/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/DataFileBenchmark.java +++ b/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/DataFileBenchmark.java @@ -10,7 +10,6 @@ import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; diff --git a/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/HashFileBenchmark.java b/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/HashFileBenchmark.java index 48d2ada3431..678306c2d59 100644 --- a/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/HashFileBenchmark.java +++ b/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/HashFileBenchmark.java @@ -10,7 +10,6 @@ import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/IDFileBenchmark.java b/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/IDFileBenchmark.java index b42e68cdca3..d870a2570ed 100644 --- a/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/IDFileBenchmark.java +++ b/core/sail/nativerdf/src/test/java/org/eclipse/rdf4j/sail/nativerdf/benchmark/IDFileBenchmark.java @@ -10,7 +10,6 @@ import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.util.Random; import java.util.concurrent.TimeUnit; diff --git a/core/sail/sail-spin/src/test/java/org/eclipse/rdf4j/sail/spin/SpinSailTest.java b/core/sail/sail-spin/src/test/java/org/eclipse/rdf4j/sail/spin/SpinSailTest.java index 404a4ea10fc..ad243b43e24 100644 --- a/core/sail/sail-spin/src/test/java/org/eclipse/rdf4j/sail/spin/SpinSailTest.java +++ b/core/sail/sail-spin/src/test/java/org/eclipse/rdf4j/sail/spin/SpinSailTest.java @@ -17,7 +17,6 @@ import java.util.concurrent.Callable; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.ValueFactory; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/RdfsSubClassOfReasoner.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/RdfsSubClassOfReasoner.java index 41f122b39ec..1427b6a1b9b 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/RdfsSubClassOfReasoner.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/RdfsSubClassOfReasoner.java @@ -19,7 +19,6 @@ import java.util.stream.Stream; import org.eclipse.rdf4j.common.annotation.InternalUseOnly; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationReport.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationReport.java index 07f424051cd..6072174183d 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationReport.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationReport.java @@ -79,6 +79,7 @@ public List getValidationResult() { return validationResult; } + @Override public String toString() { return "ValidationReport{" + "conforms=" + conforms + diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/MultithreadedTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/MultithreadedTest.java index b3818e48610..66ed5971e5e 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/MultithreadedTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/MultithreadedTest.java @@ -15,7 +15,6 @@ import java.util.Comparator; import java.util.List; import java.util.Random; -import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/OrderingTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/OrderingTest.java index 7f820169a72..e6379b5c2f8 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/OrderingTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/OrderingTest.java @@ -9,14 +9,11 @@ package org.eclipse.rdf4j.sail.shacl; import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertTrue; import java.util.Arrays; import java.util.Collections; -import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.TreeSet; import java.util.stream.Collectors; import org.eclipse.rdf4j.IsolationLevels; @@ -27,9 +24,6 @@ import org.eclipse.rdf4j.model.vocabulary.FOAF; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; -import org.eclipse.rdf4j.model.vocabulary.SHACL; -import org.eclipse.rdf4j.repository.sail.SailRepository; -import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.memory.MemoryStore; import org.eclipse.rdf4j.sail.shacl.AST.ShaclProperties; @@ -38,7 +32,6 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.Select; import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; -import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; import org.eclipse.rdf4j.sail.shacl.planNodes.Tuple; import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.ValuesBackedNode; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TrackAddedStatementsTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TrackAddedStatementsTest.java index 0f4f4fc744c..0e8b1198151 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TrackAddedStatementsTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TrackAddedStatementsTest.java @@ -13,7 +13,6 @@ import static junit.framework.TestCase.assertNull; import static org.junit.Assert.fail; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.repository.Repository; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/UniqueTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/UniqueTest.java index 46d3be1ab09..6b6ebc28ec2 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/UniqueTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/UniqueTest.java @@ -1,3 +1,11 @@ +/******************************************************************************* + * Copyright (c) 2019 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + package org.eclipse.rdf4j.sail.shacl; import static org.junit.Assert.assertEquals; @@ -7,15 +15,6 @@ import java.util.HashSet; import java.util.List; -/** - * **************************************************************************** - * Copyright (c) 2019 Eclipse RDF4J contributors. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Distribution License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/org/documents/edl-v10.php. - * ***************************************************************************** - */ import org.eclipse.rdf4j.sail.shacl.mock.MockConsumePlanNode; import org.eclipse.rdf4j.sail.shacl.mock.MockInputPlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.Tuple; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ClassBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ClassBenchmarkEmpty.java index 8712c02e017..71736351c15 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ClassBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ClassBenchmarkEmpty.java @@ -12,7 +12,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexBenchmark.java index 6af16d2cbfc..a789d803869 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexBenchmark.java @@ -15,7 +15,6 @@ import org.apache.commons.io.IOUtils; import org.eclipse.rdf4j.IsolationLevels; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.vocabulary.RDFS; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkEmpty.java index a4d6c0c8c37..c4f8cd07ff6 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkEmpty.java @@ -13,7 +13,6 @@ import java.util.stream.Stream; import org.eclipse.rdf4j.IsolationLevels; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkPrefilled.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkPrefilled.java index 82b9bcb1a83..507c3718e40 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkPrefilled.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkPrefilled.java @@ -13,7 +13,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkSerializableEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkSerializableEmpty.java index ba7c2125ebb..a93a62abb9c 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkSerializableEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkSerializableEmpty.java @@ -13,7 +13,6 @@ import java.util.stream.Stream; import org.eclipse.rdf4j.IsolationLevels; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MaxCountBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MaxCountBenchmarkEmpty.java index 953b65a0a54..e0e9f47a5e6 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MaxCountBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MaxCountBenchmarkEmpty.java @@ -12,7 +12,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkEmpty.java index a506be57273..989744adbb1 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkEmpty.java @@ -12,7 +12,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkPrefilled.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkPrefilled.java index f58d788ca2a..18d85f4e72e 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkPrefilled.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkPrefilled.java @@ -13,7 +13,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotClassBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotClassBenchmarkEmpty.java index 5cfed93d7f3..816fdaf76b9 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotClassBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotClassBenchmarkEmpty.java @@ -12,7 +12,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ParallelBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ParallelBenchmark.java index df52be5a5ad..30ced7250f7 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ParallelBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ParallelBenchmark.java @@ -18,7 +18,6 @@ import org.apache.commons.io.FileUtils; import org.assertj.core.util.Files; import org.eclipse.rdf4j.IsolationLevels; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/mock/MockInputPlanNode.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/mock/MockInputPlanNode.java index 033aaa59e7f..b904805af50 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/mock/MockInputPlanNode.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/mock/MockInputPlanNode.java @@ -11,7 +11,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Iterator; -import java.util.List; import java.util.stream.Collectors; import org.eclipse.rdf4j.common.iteration.CloseableIteration; diff --git a/core/sail/solr/src/main/java/org/eclipse/rdf4j/sail/solr/SolrSearchQuery.java b/core/sail/solr/src/main/java/org/eclipse/rdf4j/sail/solr/SolrSearchQuery.java index 07bd856de8c..cadea6a48a6 100644 --- a/core/sail/solr/src/main/java/org/eclipse/rdf4j/sail/solr/SolrSearchQuery.java +++ b/core/sail/solr/src/main/java/org/eclipse/rdf4j/sail/solr/SolrSearchQuery.java @@ -22,7 +22,6 @@ import org.eclipse.rdf4j.sail.lucene.SearchFields; import org.eclipse.rdf4j.sail.lucene.SearchQuery; -import com.google.common.base.Function; import com.google.common.collect.Iterables; /** diff --git a/core/spin/src/main/java/org/eclipse/rdf4j/spin/SpinParser.java b/core/spin/src/main/java/org/eclipse/rdf4j/spin/SpinParser.java index 39546fceeb9..f7a68e58a03 100644 --- a/core/spin/src/main/java/org/eclipse/rdf4j/spin/SpinParser.java +++ b/core/spin/src/main/java/org/eclipse/rdf4j/spin/SpinParser.java @@ -11,7 +11,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -22,7 +21,6 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; -import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -681,7 +679,7 @@ public void reset(IRI... uris) { } public static List orderArguments(Set args) { - SortedSet sortedArgs = new TreeSet( + SortedSet sortedArgs = new TreeSet<>( (IRI uri1, IRI uri2) -> uri1.getLocalName().compareTo(uri2.getLocalName())); sortedArgs.addAll(args); diff --git a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/spif/HasAllObjects.java b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/spif/HasAllObjects.java index c2e75e670e2..2629cc095af 100644 --- a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/spif/HasAllObjects.java +++ b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/spif/HasAllObjects.java @@ -13,7 +13,6 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.BooleanLiteral; -import org.eclipse.rdf4j.model.impl.BooleanLiteralImpl; import org.eclipse.rdf4j.model.vocabulary.SPIF; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.QueryPreparer; diff --git a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/spif/Name.java b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/spif/Name.java index 736c7c1320b..abad7e7f967 100644 --- a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/spif/Name.java +++ b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/spif/Name.java @@ -7,12 +7,8 @@ *******************************************************************************/ package org.eclipse.rdf4j.spin.function.spif; -import java.util.List; -import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Value; diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteration.java b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteration.java index d9c2aaff2e9..28833f8cdaa 100644 --- a/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteration.java +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteration.java @@ -8,8 +8,6 @@ package org.eclipse.rdf4j.common.iteration; -import java.util.stream.Stream; - /** * An {@link Iteration} that can be closed to free resources that it is holding. CloseableIterations automatically free * their resources when exhausted. If not read until exhaustion or if you want to make sure the iteration is properly diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/IterationSpliterator.java b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/IterationSpliterator.java index 941413caaf5..9a49b8fe353 100644 --- a/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/IterationSpliterator.java +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/IterationSpliterator.java @@ -7,12 +7,10 @@ *******************************************************************************/ package org.eclipse.rdf4j.common.iteration; -import java.util.Iterator; import java.util.Objects; import java.util.Spliterator; import java.util.Spliterators; import java.util.function.Consumer; -import java.util.stream.StreamSupport; /** * A {@link Spliterator} implementation that wraps an {@link Iteration}. It handles occurrence of checked exceptions by diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/Iterations.java b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/Iterations.java index ccc6fd45b3c..8dd501280fd 100644 --- a/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/Iterations.java +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/Iterations.java @@ -10,7 +10,6 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.Spliterator; diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/MinusIteration.java b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/MinusIteration.java index 6e4fb9b090d..65eee4e8964 100644 --- a/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/MinusIteration.java +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/MinusIteration.java @@ -8,7 +8,6 @@ package org.eclipse.rdf4j.common.iteration; -import java.util.HashSet; import java.util.Set; /** diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/text/ASCIIUtil.java b/core/util/src/main/java/org/eclipse/rdf4j/common/text/ASCIIUtil.java index 6171313fe76..82b75b743fb 100644 --- a/core/util/src/main/java/org/eclipse/rdf4j/common/text/ASCIIUtil.java +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/text/ASCIIUtil.java @@ -8,8 +8,6 @@ package org.eclipse.rdf4j.common.text; -import java.util.Arrays; - /** * Utility methods for ASCII character checking. */ diff --git a/core/util/src/test/java/org/eclipse/rdf4j/common/iteration/AutoClosingIterationTest.java b/core/util/src/test/java/org/eclipse/rdf4j/common/iteration/AutoClosingIterationTest.java index a39a8c1628e..4fc83e21e4f 100644 --- a/core/util/src/test/java/org/eclipse/rdf4j/common/iteration/AutoClosingIterationTest.java +++ b/core/util/src/test/java/org/eclipse/rdf4j/common/iteration/AutoClosingIterationTest.java @@ -1,7 +1,6 @@ package org.eclipse.rdf4j.common.iteration; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.Arrays; diff --git a/core/util/src/test/java/org/eclipse/rdf4j/common/iteration/SilentIterationTest.java b/core/util/src/test/java/org/eclipse/rdf4j/common/iteration/SilentIterationTest.java index ac6f79fee08..bb4259fbde4 100644 --- a/core/util/src/test/java/org/eclipse/rdf4j/common/iteration/SilentIterationTest.java +++ b/core/util/src/test/java/org/eclipse/rdf4j/common/iteration/SilentIterationTest.java @@ -14,7 +14,7 @@ public class SilentIterationTest { @SuppressWarnings("unchecked") private CloseableIteration delegate = mock(CloseableIteration.class); - private SilentIteration subject = new SilentIteration(delegate); + private SilentIteration subject = new SilentIteration<>(delegate); @Test public void hasNextSwallowsException() throws Exception { diff --git a/core/util/src/test/java/org/eclipse/rdf4j/common/text/StringUtilTest.java b/core/util/src/test/java/org/eclipse/rdf4j/common/text/StringUtilTest.java index 7f2bde03d7c..f16d4678030 100644 --- a/core/util/src/test/java/org/eclipse/rdf4j/common/text/StringUtilTest.java +++ b/core/util/src/test/java/org/eclipse/rdf4j/common/text/StringUtilTest.java @@ -10,8 +10,6 @@ import static org.junit.Assert.assertEquals; import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; import org.eclipse.rdf4j.common.net.ParsedIRI; import org.junit.Test; diff --git a/testsuites/benchmark/src/main/java/org/eclipse/rdf4j/benchmark/ReasoningUpdateBenchmark.java b/testsuites/benchmark/src/main/java/org/eclipse/rdf4j/benchmark/ReasoningUpdateBenchmark.java index 322e8787b7e..f3778a1e210 100644 --- a/testsuites/benchmark/src/main/java/org/eclipse/rdf4j/benchmark/ReasoningUpdateBenchmark.java +++ b/testsuites/benchmark/src/main/java/org/eclipse/rdf4j/benchmark/ReasoningUpdateBenchmark.java @@ -18,18 +18,14 @@ import java.util.stream.Stream; import org.apache.commons.io.IOUtils; -import org.eclipse.rdf4j.common.io.IOUtil; -import org.eclipse.rdf4j.common.iteration.Iterations; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.query.QueryResults; import org.eclipse.rdf4j.query.TupleQueryResult; import org.eclipse.rdf4j.repository.sail.SailRepository; import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.rio.RDFFormat; -import org.eclipse.rdf4j.sail.inferencer.fc.ForwardChainingRDFSInferencer; import org.eclipse.rdf4j.sail.inferencer.fc.SchemaCachingRDFSInferencer; import org.eclipse.rdf4j.sail.memory.MemoryStore; import org.openjdk.jmh.annotations.Benchmark; diff --git a/testsuites/repository/src/main/java/org/eclipse/rdf4j/repository/RDFSchemaRepositoryConnectionTest.java b/testsuites/repository/src/main/java/org/eclipse/rdf4j/repository/RDFSchemaRepositoryConnectionTest.java index 03885329da3..afa6ba07b9d 100644 --- a/testsuites/repository/src/main/java/org/eclipse/rdf4j/repository/RDFSchemaRepositoryConnectionTest.java +++ b/testsuites/repository/src/main/java/org/eclipse/rdf4j/repository/RDFSchemaRepositoryConnectionTest.java @@ -18,7 +18,6 @@ import org.eclipse.rdf4j.model.vocabulary.FOAF; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; diff --git a/testsuites/sail/src/main/java/org/eclipse/rdf4j/sail/InferencingTest.java b/testsuites/sail/src/main/java/org/eclipse/rdf4j/sail/InferencingTest.java index 5ad1159de14..140e4e01f54 100644 --- a/testsuites/sail/src/main/java/org/eclipse/rdf4j/sail/InferencingTest.java +++ b/testsuites/sail/src/main/java/org/eclipse/rdf4j/sail/InferencingTest.java @@ -7,8 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.sail; -import static org.junit.Assert.fail; - import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; diff --git a/testsuites/sail/src/main/java/org/eclipse/rdf4j/sail/SailConcurrencyTest.java b/testsuites/sail/src/main/java/org/eclipse/rdf4j/sail/SailConcurrencyTest.java index e84761b4a5f..17d8643cce0 100644 --- a/testsuites/sail/src/main/java/org/eclipse/rdf4j/sail/SailConcurrencyTest.java +++ b/testsuites/sail/src/main/java/org/eclipse/rdf4j/sail/SailConcurrencyTest.java @@ -7,7 +7,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.sail; -import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.Random; diff --git a/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Verify.java b/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Verify.java index c998fd2dae4..fe7fbd4b0c7 100644 --- a/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Verify.java +++ b/tools/console/src/main/java/org/eclipse/rdf4j/console/command/Verify.java @@ -40,7 +40,6 @@ import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings; import org.eclipse.rdf4j.sail.memory.MemoryStore; import org.eclipse.rdf4j.sail.shacl.ShaclSail; -import org.eclipse.rdf4j.sail.shacl.ShaclSailValidationException; /** * Verify command diff --git a/tools/console/src/test/java/org/eclipse/rdf4j/console/command/FederateTest.java b/tools/console/src/test/java/org/eclipse/rdf4j/console/command/FederateTest.java index 00e2fbc5293..75daf37fc0a 100644 --- a/tools/console/src/test/java/org/eclipse/rdf4j/console/command/FederateTest.java +++ b/tools/console/src/test/java/org/eclipse/rdf4j/console/command/FederateTest.java @@ -29,16 +29,11 @@ import org.eclipse.rdf4j.repository.sparql.config.SPARQLRepositoryConfig; import org.eclipse.rdf4j.repository.sparql.config.SPARQLRepositoryFactory; import org.eclipse.rdf4j.sail.federation.config.FederationConfig; -import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.mockito.InjectMocks; -import org.slf4j.LoggerFactory; - -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.Logger; /** * Unit tests for {@link Federate}. diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConnection.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConnection.java index 983dc37cbac..148e9aad12c 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConnection.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConnection.java @@ -220,7 +220,7 @@ public CloseableIteration performTask() thro try (RepositoryConnection conn = e.getConnection()) { // we need to materialize the contexts as they are only accessible // while the connection is open - return new CollectionIteration( + return new CollectionIteration<>( Iterations.asList(conn.getContextIDs())); } } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/GenericInfoOptimizer.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/GenericInfoOptimizer.java index b8e50b7db27..b8b4459fc19 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/GenericInfoOptimizer.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/optimizer/GenericInfoOptimizer.java @@ -101,7 +101,7 @@ public void meet(Filter filter) { @Override public void meet(Service service) { if (services == null) { - services = new ArrayList(); + services = new ArrayList<>(); } services.add(service); } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/util/QueryAlgebraUtil.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/util/QueryAlgebraUtil.java index 4f1a4905d9f..b52f1b1ed5c 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/util/QueryAlgebraUtil.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/util/QueryAlgebraUtil.java @@ -576,7 +576,7 @@ public static Collection getFreeVars(TupleExpr tupleExpr) { if (tupleExpr instanceof Extension) { // for a BIND extension in our cost model we work with 0 free vars - return new ArrayList(); + return new ArrayList<>(); } if (tupleExpr instanceof ArbitraryLengthPath) { @@ -593,6 +593,6 @@ public static Collection getFreeVars(TupleExpr tupleExpr) { log.debug("Type " + tupleExpr.getClass().getSimpleName() + " not supported for computing free vars. If you run into this, please report a bug."); - return new ArrayList(); + return new ArrayList<>(); } } diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/ActiveTransactionRegistry.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/ActiveTransactionRegistry.java index 853d25a93fb..7652c82d2b0 100644 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/ActiveTransactionRegistry.java +++ b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/ActiveTransactionRegistry.java @@ -8,7 +8,6 @@ package org.eclipse.rdf4j.http.server.repository.transaction; import java.util.UUID; -import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -20,7 +19,6 @@ import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.cache.RemovalCause; -import com.google.common.cache.RemovalListener; import com.google.common.cache.RemovalNotification; /** diff --git a/tools/server/src/test/java/org/eclipse/rdf4j/http/server/TestServer.java b/tools/server/src/test/java/org/eclipse/rdf4j/http/server/TestServer.java index 971a9db9b69..b189ea57a85 100644 --- a/tools/server/src/test/java/org/eclipse/rdf4j/http/server/TestServer.java +++ b/tools/server/src/test/java/org/eclipse/rdf4j/http/server/TestServer.java @@ -22,8 +22,6 @@ import org.eclipse.rdf4j.repository.http.HTTPRepository; import org.eclipse.rdf4j.repository.manager.SystemRepository; import org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig; -import org.eclipse.rdf4j.sail.inferencer.fc.SchemaCachingRDFSInferencer; -import org.eclipse.rdf4j.sail.inferencer.fc.config.ForwardChainingRDFSInferencerConfig; import org.eclipse.rdf4j.sail.inferencer.fc.config.SchemaCachingRDFSInferencerConfig; import org.eclipse.rdf4j.sail.memory.config.MemoryStoreConfig; import org.eclipse.rdf4j.sail.shacl.config.ShaclSailConfig; diff --git a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/UpdateServlet.java b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/UpdateServlet.java index 6ae0bb199ad..9249af108be 100644 --- a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/UpdateServlet.java +++ b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/UpdateServlet.java @@ -15,7 +15,6 @@ import org.eclipse.rdf4j.query.MalformedQueryException; import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.QueryResultHandlerException; -import org.eclipse.rdf4j.query.Update; import org.eclipse.rdf4j.query.UpdateExecutionException; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.repository.RepositoryException; From 820f70cf9d63b9c6b267bf2c56f01dcee7e0c3f4 Mon Sep 17 00:00:00 2001 From: Bart Hanssens Date: Fri, 15 May 2020 20:14:25 +0200 Subject: [PATCH 08/35] GH-2189 fix for import (#2221) Signed-off-by:Bart Hanssens --- .../org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java b/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java index 0b237841434..d7cc75a3e3c 100644 --- a/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java +++ b/core/queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java @@ -19,6 +19,7 @@ import java.util.List; import org.eclipse.rdf4j.query.MalformedQueryException; +import org.eclipse.rdf4j.query.algebra.ArbitraryLengthPath; import org.eclipse.rdf4j.query.algebra.Extension; import org.eclipse.rdf4j.query.algebra.Filter; import org.eclipse.rdf4j.query.algebra.InsertData; From 3302be770462b1d3de49c0527c0bba4135727351 Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Thu, 21 May 2020 14:16:14 +1000 Subject: [PATCH 09/35] set correct version Signed-off-by: Jeen Broekstra --- assembly/pom.xml | 2 +- bom/pom.xml | 2 +- compliance/elasticsearch/pom.xml | 2 +- compliance/geosparql/pom.xml | 2 +- compliance/lucene/pom.xml | 2 +- compliance/model/pom.xml | 2 +- compliance/pom.xml | 2 +- compliance/repository/pom.xml | 2 +- compliance/rio/pom.xml | 2 +- compliance/serql/pom.xml | 2 +- compliance/shacl/pom.xml | 2 +- compliance/solr/pom.xml | 2 +- compliance/sparql/pom.xml | 2 +- core/client/pom.xml | 2 +- core/http/client/pom.xml | 2 +- core/http/pom.xml | 2 +- core/http/protocol/pom.xml | 2 +- core/model/pom.xml | 2 +- core/pom.xml | 2 +- core/query/pom.xml | 2 +- core/queryalgebra/evaluation/pom.xml | 2 +- core/queryalgebra/geosparql/pom.xml | 2 +- core/queryalgebra/model/pom.xml | 2 +- core/queryalgebra/pom.xml | 2 +- core/queryparser/api/pom.xml | 2 +- core/queryparser/pom.xml | 2 +- core/queryparser/serql/pom.xml | 2 +- core/queryparser/sparql/pom.xml | 2 +- core/queryrender/pom.xml | 2 +- core/queryresultio/api/pom.xml | 2 +- core/queryresultio/binary/pom.xml | 2 +- core/queryresultio/pom.xml | 2 +- core/queryresultio/sparqljson/pom.xml | 2 +- core/queryresultio/sparqlxml/pom.xml | 2 +- core/queryresultio/text/pom.xml | 2 +- core/repository/api/pom.xml | 2 +- core/repository/contextaware/pom.xml | 2 +- core/repository/dataset/pom.xml | 2 +- core/repository/event/pom.xml | 2 +- core/repository/http/pom.xml | 2 +- core/repository/manager/pom.xml | 2 +- core/repository/pom.xml | 2 +- core/repository/sail/pom.xml | 2 +- core/repository/sparql/pom.xml | 2 +- core/rio/api/pom.xml | 2 +- core/rio/binary/pom.xml | 2 +- core/rio/datatypes/pom.xml | 2 +- core/rio/hdt/pom.xml | 2 +- core/rio/jsonld/pom.xml | 2 +- core/rio/languages/pom.xml | 2 +- core/rio/n3/pom.xml | 2 +- core/rio/nquads/pom.xml | 2 +- core/rio/ntriples/pom.xml | 2 +- core/rio/pom.xml | 2 +- core/rio/rdfjson/pom.xml | 2 +- core/rio/rdfxml/pom.xml | 2 +- core/rio/trig/pom.xml | 2 +- core/rio/trix/pom.xml | 2 +- core/rio/turtle/pom.xml | 2 +- core/sail/api/pom.xml | 2 +- core/sail/base/pom.xml | 2 +- core/sail/elasticsearch-store/pom.xml | 2 +- core/sail/elasticsearch/pom.xml | 2 +- core/sail/extensible-store/pom.xml | 2 +- core/sail/federation/pom.xml | 2 +- core/sail/inferencer/pom.xml | 2 +- core/sail/lucene-api/pom.xml | 2 +- core/sail/lucene-spin/pom.xml | 2 +- core/sail/lucene/pom.xml | 2 +- core/sail/memory/pom.xml | 2 +- core/sail/model/pom.xml | 2 +- core/sail/nativerdf/pom.xml | 2 +- core/sail/pom.xml | 2 +- core/sail/sail-spin/pom.xml | 2 +- core/sail/shacl/pom.xml | 2 +- core/sail/solr/pom.xml | 2 +- core/sparqlbuilder/pom.xml | 2 +- core/spin/pom.xml | 2 +- core/storage/pom.xml | 2 +- core/util/pom.xml | 2 +- pom.xml | 2 +- testsuites/benchmark/pom.xml | 2 +- testsuites/geosparql/pom.xml | 2 +- testsuites/lucene/pom.xml | 2 +- testsuites/model/pom.xml | 2 +- testsuites/pom.xml | 2 +- testsuites/queryresultio/pom.xml | 2 +- testsuites/repository/pom.xml | 2 +- testsuites/rio/pom.xml | 2 +- testsuites/sail/pom.xml | 2 +- testsuites/serql/pom.xml | 2 +- testsuites/shacl/pom.xml | 2 +- testsuites/sparql/pom.xml | 2 +- tools/config/pom.xml | 2 +- tools/console/pom.xml | 2 +- tools/federation/pom.xml | 2 +- tools/pom.xml | 2 +- tools/runtime-osgi/pom.xml | 2 +- tools/runtime/pom.xml | 2 +- tools/server-spring/pom.xml | 2 +- tools/server/pom.xml | 2 +- tools/workbench/pom.xml | 2 +- 102 files changed, 102 insertions(+), 102 deletions(-) diff --git a/assembly/pom.xml b/assembly/pom.xml index c17a4897b4e..6e2cc5362f6 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-assembly pom diff --git a/bom/pom.xml b/bom/pom.xml index 896baebe17b..8ee73408dad 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-bom pom diff --git a/compliance/elasticsearch/pom.xml b/compliance/elasticsearch/pom.xml index b54c8f45bc5..e0721443a23 100644 --- a/compliance/elasticsearch/pom.xml +++ b/compliance/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-elasticsearch-compliance RDF4J Elasticsearch Sail Tests diff --git a/compliance/geosparql/pom.xml b/compliance/geosparql/pom.xml index 1c23c8e1335..60af5141244 100644 --- a/compliance/geosparql/pom.xml +++ b/compliance/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-compliance RDF4J GeoSPARQL compliance tests diff --git a/compliance/lucene/pom.xml b/compliance/lucene/pom.xml index 4bc9c6ee523..e53b1ab6f69 100644 --- a/compliance/lucene/pom.xml +++ b/compliance/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-compliance RDF4J Lucene Sail Tests diff --git a/compliance/model/pom.xml b/compliance/model/pom.xml index 1aedf0cc7b1..676cf158bfa 100644 --- a/compliance/model/pom.xml +++ b/compliance/model/pom.xml @@ -3,7 +3,7 @@ rdf4j-compliance org.eclipse.rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT 4.0.0 rdf4j-model-compliance diff --git a/compliance/pom.xml b/compliance/pom.xml index f863e4cc53e..452df902de4 100644 --- a/compliance/pom.xml +++ b/compliance/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-compliance pom diff --git a/compliance/repository/pom.xml b/compliance/repository/pom.xml index 912e51ae1fc..945ccdec499 100644 --- a/compliance/repository/pom.xml +++ b/compliance/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-compliance war diff --git a/compliance/rio/pom.xml b/compliance/rio/pom.xml index 3b3bfa5d446..270aa343a42 100644 --- a/compliance/rio/pom.xml +++ b/compliance/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-compliance RDF4J Rio compliance tests diff --git a/compliance/serql/pom.xml b/compliance/serql/pom.xml index 1f83d1b7c68..3582b88a288 100644 --- a/compliance/serql/pom.xml +++ b/compliance/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-compliance RDF4J SeRQL query parser compliance tests diff --git a/compliance/shacl/pom.xml b/compliance/shacl/pom.xml index 50c2786a6ce..2f70fdbf779 100644 --- a/compliance/shacl/pom.xml +++ b/compliance/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-compliance RDF4J SHACL compliance tests diff --git a/compliance/solr/pom.xml b/compliance/solr/pom.xml index 46adfe15f24..917d864d771 100644 --- a/compliance/solr/pom.xml +++ b/compliance/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-solr-compliance RDF4J Solr Sail Tests diff --git a/compliance/sparql/pom.xml b/compliance/sparql/pom.xml index 62cf9863506..7054a1ff892 100644 --- a/compliance/sparql/pom.xml +++ b/compliance/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-compliance war diff --git a/core/client/pom.xml b/core/client/pom.xml index 57fa76a9154..2639cd8a1cd 100644 --- a/core/client/pom.xml +++ b/core/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-client RDF4J: Client Libraries diff --git a/core/http/client/pom.xml b/core/http/client/pom.xml index c3db1e141ba..c41aaab00cc 100644 --- a/core/http/client/pom.xml +++ b/core/http/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-client RDF4J: HTTP client diff --git a/core/http/pom.xml b/core/http/pom.xml index 54cc94a9aca..d35255a95eb 100644 --- a/core/http/pom.xml +++ b/core/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http pom diff --git a/core/http/protocol/pom.xml b/core/http/protocol/pom.xml index fcb780914c8..1a3d6dff039 100644 --- a/core/http/protocol/pom.xml +++ b/core/http/protocol/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-protocol RDF4J: HTTP protocol diff --git a/core/model/pom.xml b/core/model/pom.xml index 36d6603d07a..5020f0a7277 100644 --- a/core/model/pom.xml +++ b/core/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model RDF4J: Model diff --git a/core/pom.xml b/core/pom.xml index f27040fa510..1e27344892b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-core pom diff --git a/core/query/pom.xml b/core/query/pom.xml index 567a23ea15d..98b09396e29 100644 --- a/core/query/pom.xml +++ b/core/query/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-query RDF4J: Query diff --git a/core/queryalgebra/evaluation/pom.xml b/core/queryalgebra/evaluation/pom.xml index f3f7a0040f8..4aaed5165f3 100644 --- a/core/queryalgebra/evaluation/pom.xml +++ b/core/queryalgebra/evaluation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-evaluation RDF4J: Query algebra - evaluation diff --git a/core/queryalgebra/geosparql/pom.xml b/core/queryalgebra/geosparql/pom.xml index 39820ec3833..01e1dfd69f9 100644 --- a/core/queryalgebra/geosparql/pom.xml +++ b/core/queryalgebra/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-geosparql RDF4J: Query algebra - GeoSPARQL diff --git a/core/queryalgebra/model/pom.xml b/core/queryalgebra/model/pom.xml index 1af921428ec..9756bfa3fab 100644 --- a/core/queryalgebra/model/pom.xml +++ b/core/queryalgebra/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-model RDF4J: Query algebra - model diff --git a/core/queryalgebra/pom.xml b/core/queryalgebra/pom.xml index 48031d4bfb7..e1b487d6952 100644 --- a/core/queryalgebra/pom.xml +++ b/core/queryalgebra/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra pom diff --git a/core/queryparser/api/pom.xml b/core/queryparser/api/pom.xml index 7b86c99f35e..57e8066dd0c 100644 --- a/core/queryparser/api/pom.xml +++ b/core/queryparser/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-api RDF4J: Query parser - API diff --git a/core/queryparser/pom.xml b/core/queryparser/pom.xml index 795d20e2e3a..ed654e6514f 100644 --- a/core/queryparser/pom.xml +++ b/core/queryparser/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser pom diff --git a/core/queryparser/serql/pom.xml b/core/queryparser/serql/pom.xml index 3a24b3b0e99..1ba3fbdf31d 100644 --- a/core/queryparser/serql/pom.xml +++ b/core/queryparser/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-serql RDF4J: Query parser - SeRQL diff --git a/core/queryparser/sparql/pom.xml b/core/queryparser/sparql/pom.xml index 079bcf86a3f..3f8b7f9cf18 100644 --- a/core/queryparser/sparql/pom.xml +++ b/core/queryparser/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-sparql RDF4J: Query parser - SPARQL diff --git a/core/queryrender/pom.xml b/core/queryrender/pom.xml index aa50bac43a7..a9f0a872074 100644 --- a/core/queryrender/pom.xml +++ b/core/queryrender/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryrender RDF4J: Query Rendering diff --git a/core/queryresultio/api/pom.xml b/core/queryresultio/api/pom.xml index c53916aac87..b33ca33d98b 100644 --- a/core/queryresultio/api/pom.xml +++ b/core/queryresultio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-api RDF4J: Query result IO - API diff --git a/core/queryresultio/binary/pom.xml b/core/queryresultio/binary/pom.xml index 6559f7ff594..c2f157e6bf9 100644 --- a/core/queryresultio/binary/pom.xml +++ b/core/queryresultio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-binary RDF4J: Query result IO - binary diff --git a/core/queryresultio/pom.xml b/core/queryresultio/pom.xml index f68b6a77ca2..d9e5dd06fc9 100644 --- a/core/queryresultio/pom.xml +++ b/core/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio pom diff --git a/core/queryresultio/sparqljson/pom.xml b/core/queryresultio/sparqljson/pom.xml index d908c9e5aee..0e47e241561 100644 --- a/core/queryresultio/sparqljson/pom.xml +++ b/core/queryresultio/sparqljson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqljson RDF4J: Query result IO - SPARQL/JSON diff --git a/core/queryresultio/sparqlxml/pom.xml b/core/queryresultio/sparqlxml/pom.xml index 064920627fe..fe97661f6a9 100644 --- a/core/queryresultio/sparqlxml/pom.xml +++ b/core/queryresultio/sparqlxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqlxml RDF4J: Query result IO - SPARQL/XML diff --git a/core/queryresultio/text/pom.xml b/core/queryresultio/text/pom.xml index 06e794ddaba..38dbfcbec03 100644 --- a/core/queryresultio/text/pom.xml +++ b/core/queryresultio/text/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-text RDF4J: Query result IO - plain text booleans diff --git a/core/repository/api/pom.xml b/core/repository/api/pom.xml index 4665a7343e1..329699b9801 100644 --- a/core/repository/api/pom.xml +++ b/core/repository/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-api RDF4J: Repository - API diff --git a/core/repository/contextaware/pom.xml b/core/repository/contextaware/pom.xml index 67ebd294cdb..485ec462156 100644 --- a/core/repository/contextaware/pom.xml +++ b/core/repository/contextaware/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-contextaware RDF4J: Repository - context aware (wrapper) diff --git a/core/repository/dataset/pom.xml b/core/repository/dataset/pom.xml index 446e1fcd570..646760c1527 100644 --- a/core/repository/dataset/pom.xml +++ b/core/repository/dataset/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-dataset RDF4J: DatasetRepository (wrapper) diff --git a/core/repository/event/pom.xml b/core/repository/event/pom.xml index bdba0e166ee..2358504439a 100644 --- a/core/repository/event/pom.xml +++ b/core/repository/event/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-event RDF4J: Repository - event (wrapper) diff --git a/core/repository/http/pom.xml b/core/repository/http/pom.xml index 1e8b430725a..727a025e228 100644 --- a/core/repository/http/pom.xml +++ b/core/repository/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-http RDF4J: HTTPRepository diff --git a/core/repository/manager/pom.xml b/core/repository/manager/pom.xml index b8ff204cd65..3f291fe0bc4 100644 --- a/core/repository/manager/pom.xml +++ b/core/repository/manager/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-manager RDF4J: Repository manager diff --git a/core/repository/pom.xml b/core/repository/pom.xml index adeadc16592..9b9b97cde3d 100644 --- a/core/repository/pom.xml +++ b/core/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository pom diff --git a/core/repository/sail/pom.xml b/core/repository/sail/pom.xml index 7b63938d5cf..8d7df65029c 100644 --- a/core/repository/sail/pom.xml +++ b/core/repository/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sail RDF4J: SailRepository diff --git a/core/repository/sparql/pom.xml b/core/repository/sparql/pom.xml index 9913db1c14c..61c7785d99e 100644 --- a/core/repository/sparql/pom.xml +++ b/core/repository/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sparql RDF4J: SPARQL Repository diff --git a/core/rio/api/pom.xml b/core/rio/api/pom.xml index 3dfd3140167..5a4cd20d614 100644 --- a/core/rio/api/pom.xml +++ b/core/rio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-api RDF4J: Rio - API diff --git a/core/rio/binary/pom.xml b/core/rio/binary/pom.xml index 34e0fbd19fe..ee0bd22954f 100644 --- a/core/rio/binary/pom.xml +++ b/core/rio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-binary RDF4J: Rio - Binary diff --git a/core/rio/datatypes/pom.xml b/core/rio/datatypes/pom.xml index 1e7de1afc17..1250511c4b8 100644 --- a/core/rio/datatypes/pom.xml +++ b/core/rio/datatypes/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-datatypes RDF4J: Rio - Datatypes diff --git a/core/rio/hdt/pom.xml b/core/rio/hdt/pom.xml index dd6f1b10b1a..d6cb85f1ece 100644 --- a/core/rio/hdt/pom.xml +++ b/core/rio/hdt/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-hdt jar diff --git a/core/rio/jsonld/pom.xml b/core/rio/jsonld/pom.xml index 0144c428acb..6208961e90f 100644 --- a/core/rio/jsonld/pom.xml +++ b/core/rio/jsonld/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-jsonld RDF4J: Rio - JSON-LD diff --git a/core/rio/languages/pom.xml b/core/rio/languages/pom.xml index 05878a52573..2c6618646da 100644 --- a/core/rio/languages/pom.xml +++ b/core/rio/languages/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-languages RDF4J: Rio - Languages diff --git a/core/rio/n3/pom.xml b/core/rio/n3/pom.xml index 46029ee1bf6..12a90ac868b 100644 --- a/core/rio/n3/pom.xml +++ b/core/rio/n3/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-n3 RDF4J: Rio - N3 (writer-only) diff --git a/core/rio/nquads/pom.xml b/core/rio/nquads/pom.xml index 8285293a586..27f08c03eb3 100644 --- a/core/rio/nquads/pom.xml +++ b/core/rio/nquads/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-nquads RDF4J: Rio - N-Quads diff --git a/core/rio/ntriples/pom.xml b/core/rio/ntriples/pom.xml index 5b990516fe7..dc7302637bc 100644 --- a/core/rio/ntriples/pom.xml +++ b/core/rio/ntriples/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-ntriples RDF4J: Rio - N-Triples diff --git a/core/rio/pom.xml b/core/rio/pom.xml index 9822a4a1d7f..db0afa2698c 100644 --- a/core/rio/pom.xml +++ b/core/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio pom diff --git a/core/rio/rdfjson/pom.xml b/core/rio/rdfjson/pom.xml index 8aec6c4aea2..26b57806918 100644 --- a/core/rio/rdfjson/pom.xml +++ b/core/rio/rdfjson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfjson RDF4J: Rio - RDF/JSON diff --git a/core/rio/rdfxml/pom.xml b/core/rio/rdfxml/pom.xml index 0762bd2d24b..2e12c77035b 100644 --- a/core/rio/rdfxml/pom.xml +++ b/core/rio/rdfxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfxml RDF4J: Rio - RDF/XML diff --git a/core/rio/trig/pom.xml b/core/rio/trig/pom.xml index 9921c2b8eab..d6a18113cba 100644 --- a/core/rio/trig/pom.xml +++ b/core/rio/trig/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trig RDF4J: Rio - TriG diff --git a/core/rio/trix/pom.xml b/core/rio/trix/pom.xml index 6eff6ab1f78..b1a6fc818a4 100644 --- a/core/rio/trix/pom.xml +++ b/core/rio/trix/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trix RDF4J: Rio - TriX diff --git a/core/rio/turtle/pom.xml b/core/rio/turtle/pom.xml index c7b96889554..14363862440 100644 --- a/core/rio/turtle/pom.xml +++ b/core/rio/turtle/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-turtle RDF4J: Rio - Turtle diff --git a/core/sail/api/pom.xml b/core/sail/api/pom.xml index 7c665955caf..b12bb1457a2 100644 --- a/core/sail/api/pom.xml +++ b/core/sail/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-api RDF4J: Sail API diff --git a/core/sail/base/pom.xml b/core/sail/base/pom.xml index 4108d4f458b..3a29b447d92 100644 --- a/core/sail/base/pom.xml +++ b/core/sail/base/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-base RDF4J: Sail base implementations diff --git a/core/sail/elasticsearch-store/pom.xml b/core/sail/elasticsearch-store/pom.xml index 1819715cbde..89c5ad1e22a 100644 --- a/core/sail/elasticsearch-store/pom.xml +++ b/core/sail/elasticsearch-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch-store RDF4J Elasticsearch Store diff --git a/core/sail/elasticsearch/pom.xml b/core/sail/elasticsearch/pom.xml index 4348d2d781f..787f0b89234 100644 --- a/core/sail/elasticsearch/pom.xml +++ b/core/sail/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch RDF4J Elastic Search Sail Index diff --git a/core/sail/extensible-store/pom.xml b/core/sail/extensible-store/pom.xml index cfc934ba156..de8f72aff13 100644 --- a/core/sail/extensible-store/pom.xml +++ b/core/sail/extensible-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-extensible-store RDF4J Extensible Store diff --git a/core/sail/federation/pom.xml b/core/sail/federation/pom.xml index 24951ab1f02..563c203457e 100644 --- a/core/sail/federation/pom.xml +++ b/core/sail/federation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-federation RDF4J: Federation SAIL diff --git a/core/sail/inferencer/pom.xml b/core/sail/inferencer/pom.xml index 17066a6f266..9422f06037f 100644 --- a/core/sail/inferencer/pom.xml +++ b/core/sail/inferencer/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-inferencer RDF4J: Inferencer Sails diff --git a/core/sail/lucene-api/pom.xml b/core/sail/lucene-api/pom.xml index 543e9e6b33b..adbd392650e 100644 --- a/core/sail/lucene-api/pom.xml +++ b/core/sail/lucene-api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene-api RDF4J Lucene Sail API diff --git a/core/sail/lucene-spin/pom.xml b/core/sail/lucene-spin/pom.xml index 6adae223063..111dc308b42 100644 --- a/core/sail/lucene-spin/pom.xml +++ b/core/sail/lucene-spin/pom.xml @@ -4,7 +4,7 @@ rdf4j-sail org.eclipse.rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-spin RDF4J Lucene Sail Spin diff --git a/core/sail/lucene/pom.xml b/core/sail/lucene/pom.xml index c93d8320dbb..b752e12b16c 100644 --- a/core/sail/lucene/pom.xml +++ b/core/sail/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene RDF4J Lucene Sail Index diff --git a/core/sail/memory/pom.xml b/core/sail/memory/pom.xml index e7bd00aaf55..31a265883d9 100644 --- a/core/sail/memory/pom.xml +++ b/core/sail/memory/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-memory RDF4J: MemoryStore diff --git a/core/sail/model/pom.xml b/core/sail/model/pom.xml index 2f36189bd3d..bc69ab76280 100644 --- a/core/sail/model/pom.xml +++ b/core/sail/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-model RDF4J: Sail Model diff --git a/core/sail/nativerdf/pom.xml b/core/sail/nativerdf/pom.xml index b21edb5be02..9f3d7ed7f9c 100644 --- a/core/sail/nativerdf/pom.xml +++ b/core/sail/nativerdf/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-nativerdf RDF4J: NativeStore diff --git a/core/sail/pom.xml b/core/sail/pom.xml index dbc4a602ab7..32a7d02c191 100644 --- a/core/sail/pom.xml +++ b/core/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail pom diff --git a/core/sail/sail-spin/pom.xml b/core/sail/sail-spin/pom.xml index 69e4d43cd4a..46bb8d1b75f 100644 --- a/core/sail/sail-spin/pom.xml +++ b/core/sail/sail-spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-spin RDF4J: SPIN SAIL diff --git a/core/sail/shacl/pom.xml b/core/sail/shacl/pom.xml index b75174ae90c..67e94f3bd13 100644 --- a/core/sail/shacl/pom.xml +++ b/core/sail/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl RDF4J: SHACL diff --git a/core/sail/solr/pom.xml b/core/sail/solr/pom.xml index 63891cde54a..547ab856231 100644 --- a/core/sail/solr/pom.xml +++ b/core/sail/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-solr RDF4J Solr Sail Index diff --git a/core/sparqlbuilder/pom.xml b/core/sparqlbuilder/pom.xml index c2cb9825cf9..85470528110 100644 --- a/core/sparqlbuilder/pom.xml +++ b/core/sparqlbuilder/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparqlbuilder RDF4J: SparqlBuilder diff --git a/core/spin/pom.xml b/core/spin/pom.xml index 60d862dccac..6bf2f0ae88b 100644 --- a/core/spin/pom.xml +++ b/core/spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-spin RDF4J: SPIN diff --git a/core/storage/pom.xml b/core/storage/pom.xml index 8b9d691703a..511dca86c86 100644 --- a/core/storage/pom.xml +++ b/core/storage/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-storage RDF4J: Storage Libraries diff --git a/core/util/pom.xml b/core/util/pom.xml index 51639c75292..ed76ac9f873 100644 --- a/core/util/pom.xml +++ b/core/util/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-util RDF4J: util diff --git a/pom.xml b/pom.xml index 614d0ca9d61..4eb33f49d3b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.eclipse.rdf4j rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT pom Eclipse RDF4J An extensible Java framework for RDF and SPARQL diff --git a/testsuites/benchmark/pom.xml b/testsuites/benchmark/pom.xml index d3836f642eb..7c3fa436804 100644 --- a/testsuites/benchmark/pom.xml +++ b/testsuites/benchmark/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-benchmark RDF4J: benchmarks diff --git a/testsuites/geosparql/pom.xml b/testsuites/geosparql/pom.xml index 5c2cc77f38e..83e751e8e3d 100644 --- a/testsuites/geosparql/pom.xml +++ b/testsuites/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-testsuite RDF4J GeoSPARQL compliance test suite diff --git a/testsuites/lucene/pom.xml b/testsuites/lucene/pom.xml index f48a6339400..8d9405c43a4 100644 --- a/testsuites/lucene/pom.xml +++ b/testsuites/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-testsuite RDF4J Lucene Sail Tests diff --git a/testsuites/model/pom.xml b/testsuites/model/pom.xml index c03ad21ef5a..a8ad142b919 100644 --- a/testsuites/model/pom.xml +++ b/testsuites/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model-testsuite RDF4J: Model API testsuite diff --git a/testsuites/pom.xml b/testsuites/pom.xml index 737396b5d8f..745926f4ef3 100644 --- a/testsuites/pom.xml +++ b/testsuites/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-testsuites pom diff --git a/testsuites/queryresultio/pom.xml b/testsuites/queryresultio/pom.xml index 012cfedeb0c..d6d2205ccda 100644 --- a/testsuites/queryresultio/pom.xml +++ b/testsuites/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-testsuite RDF4J: QueryResultIO testsuite diff --git a/testsuites/repository/pom.xml b/testsuites/repository/pom.xml index 2acb768edd1..37db19075b0 100644 --- a/testsuites/repository/pom.xml +++ b/testsuites/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-testsuite RDF4J: Repository API testsuite diff --git a/testsuites/rio/pom.xml b/testsuites/rio/pom.xml index b0d3b3800e9..439ce4c21c8 100644 --- a/testsuites/rio/pom.xml +++ b/testsuites/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-testsuite RDF4J Rio compliance test suite diff --git a/testsuites/sail/pom.xml b/testsuites/sail/pom.xml index 98389efd6ef..3de37b6f45e 100644 --- a/testsuites/sail/pom.xml +++ b/testsuites/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-testsuite RDF4J: Sail API testsuite diff --git a/testsuites/serql/pom.xml b/testsuites/serql/pom.xml index 750674b9361..08f8d46e616 100644 --- a/testsuites/serql/pom.xml +++ b/testsuites/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-testsuite RDF4J SeRQL test suite diff --git a/testsuites/shacl/pom.xml b/testsuites/shacl/pom.xml index 8e878a0736c..952bb546e4e 100644 --- a/testsuites/shacl/pom.xml +++ b/testsuites/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-testsuite RDF4J SHACL compliance test suite diff --git a/testsuites/sparql/pom.xml b/testsuites/sparql/pom.xml index 57f01dd2d22..45663cc3c0b 100644 --- a/testsuites/sparql/pom.xml +++ b/testsuites/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-testsuite RDF4J SPARQL compliance test suite diff --git a/tools/config/pom.xml b/tools/config/pom.xml index 0d1779a21cf..74aff1aea3b 100644 --- a/tools/config/pom.xml +++ b/tools/config/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-config RDF4J: application configuration diff --git a/tools/console/pom.xml b/tools/console/pom.xml index 5cc84252fe0..b9dddcdc4ba 100644 --- a/tools/console/pom.xml +++ b/tools/console/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-console RDF4J: Console diff --git a/tools/federation/pom.xml b/tools/federation/pom.xml index b4f5d681645..736c0f77da1 100644 --- a/tools/federation/pom.xml +++ b/tools/federation/pom.xml @@ -8,7 +8,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT 9.4.19.v20190610 diff --git a/tools/pom.xml b/tools/pom.xml index 710726d7a8d..81979390a16 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT org.eclipse.rdf4j rdf4j-tools diff --git a/tools/runtime-osgi/pom.xml b/tools/runtime-osgi/pom.xml index f989215c378..bf3ba94fb55 100644 --- a/tools/runtime-osgi/pom.xml +++ b/tools/runtime-osgi/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime-osgi bundle diff --git a/tools/runtime/pom.xml b/tools/runtime/pom.xml index 64f987e9d45..58dae30a158 100644 --- a/tools/runtime/pom.xml +++ b/tools/runtime/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime RDF4J: Runtime diff --git a/tools/server-spring/pom.xml b/tools/server-spring/pom.xml index 666ba90bdaa..6a82ef5d935 100644 --- a/tools/server-spring/pom.xml +++ b/tools/server-spring/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server-spring RDF4J: HTTP server - core diff --git a/tools/server/pom.xml b/tools/server/pom.xml index d0083585e56..8e9c552094d 100644 --- a/tools/server/pom.xml +++ b/tools/server/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server war diff --git a/tools/workbench/pom.xml b/tools/workbench/pom.xml index c5d0ee59d8a..bb1dbdf328f 100644 --- a/tools/workbench/pom.xml +++ b/tools/workbench/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.2-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-workbench war From 5b7bd1ea057a59ce220c45018162ddeb19f65434 Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Mon, 25 May 2020 10:07:54 +1000 Subject: [PATCH 10/35] GH-2261 renamed XMLSchema vocabulary class to XSD (#2264) --- .../rdf4j/sail/solr/SolrIndexTest.java | 6 +- .../parser/sparql/manifest/EarlReport.java | 6 +- .../java/org/eclipse/rdf4j/model/Literal.java | 4 +- .../org/eclipse/rdf4j/model/ValueFactory.java | 12 +- .../model/datatypes/XMLDatatypeUtil.java | 236 +++++++-------- .../model/impl/AbstractValueFactory.java | 35 +-- .../rdf4j/model/impl/BooleanLiteral.java | 4 +- .../rdf4j/model/impl/DecimalLiteral.java | 4 +- .../rdf4j/model/impl/IntegerLiteral.java | 4 +- .../rdf4j/model/impl/NumericLiteral.java | 14 +- .../rdf4j/model/impl/SimpleLiteral.java | 8 +- .../eclipse/rdf4j/model/util/Literals.java | 14 +- .../rdf4j/model/util/ModelBuilder.java | 26 +- .../rdf4j/model/vocabulary/XMLSchema.java | 276 +----------------- .../eclipse/rdf4j/model/vocabulary/XSD.java | 187 ++++++++++++ .../eclipse/rdf4j/model/ValueFactoryTest.java | 22 +- .../model/datatypes/XMLDatatypeUtilTest.java | 70 ++--- .../rdf4j/model/impl/SimpleLiteralTest.java | 18 +- .../rdf4j/model/util/LiteralsTest.java | 44 +-- .../org/eclipse/rdf4j/query/QueryResults.java | 10 +- .../evaluation/function/datetime/Day.java | 4 +- .../evaluation/function/datetime/Hours.java | 4 +- .../evaluation/function/datetime/Minutes.java | 4 +- .../evaluation/function/datetime/Month.java | 4 +- .../evaluation/function/datetime/Seconds.java | 4 +- .../function/datetime/Timezone.java | 4 +- .../evaluation/function/datetime/Year.java | 4 +- .../algebra/evaluation/function/hash/MD5.java | 4 +- .../evaluation/function/hash/SHA1.java | 4 +- .../evaluation/function/hash/SHA256.java | 4 +- .../evaluation/function/hash/SHA384.java | 4 +- .../evaluation/function/hash/SHA512.java | 4 +- .../evaluation/function/string/LowerCase.java | 6 +- .../evaluation/function/string/StrLen.java | 4 +- .../evaluation/function/string/Substring.java | 6 +- .../evaluation/function/string/UpperCase.java | 6 +- .../evaluation/function/xsd/BooleanCast.java | 12 +- .../evaluation/function/xsd/ByteCast.java | 6 +- .../evaluation/function/xsd/CastFunction.java | 4 +- .../evaluation/function/xsd/DateTimeCast.java | 8 +- .../evaluation/function/xsd/DecimalCast.java | 10 +- .../evaluation/function/xsd/DoubleCast.java | 6 +- .../evaluation/function/xsd/FloatCast.java | 6 +- .../evaluation/function/xsd/IntCast.java | 4 +- .../evaluation/function/xsd/IntegerCast.java | 4 +- .../function/xsd/IntegerCastFunction.java | 6 +- .../evaluation/function/xsd/LongCast.java | 4 +- .../function/xsd/NegativeIntegerCast.java | 4 +- .../function/xsd/NonNegativeIntegerCast.java | 4 +- .../function/xsd/NonPositiveIntegerCast.java | 4 +- .../function/xsd/PositiveIntegerCast.java | 4 +- .../evaluation/function/xsd/ShortCast.java | 4 +- .../evaluation/function/xsd/StringCast.java | 18 +- .../function/xsd/UnsignedByteCast.java | 4 +- .../function/xsd/UnsignedIntCast.java | 6 +- .../function/xsd/UnsignedLongCast.java | 4 +- .../function/xsd/UnsignedShortCast.java | 4 +- .../evaluation/function/xsd/package-info.java | 2 +- .../impl/StrictEvaluationStrategy.java | 4 +- .../evaluation/iterator/GroupIterator.java | 10 +- .../algebra/evaluation/util/MathUtil.java | 24 +- .../evaluation/util/QueryEvaluationUtil.java | 54 ++-- .../evaluation/util/TripleSources.java | 4 +- .../evaluation/util/XMLDatatypeMathUtil.java | 8 +- .../function/datetime/TimezoneTest.java | 12 +- .../evaluation/function/datetime/TzTest.java | 14 +- .../function/hash/HashFunctionTest.java | 10 +- .../evaluation/function/numeric/RandTest.java | 4 +- .../function/numeric/RoundTest.java | 4 +- .../function/string/ConcatTest.java | 8 +- .../evaluation/function/string/RegexTest.java | 6 +- .../function/string/StrAfterTest.java | 16 +- .../function/string/StrBeforeTest.java | 16 +- .../function/xsd/TestDateTimeCast.java | 10 +- .../function/xsd/TestStringCast.java | 10 +- .../iterator/GroupIteratorTest.java | 10 +- .../util/LiteralComparatorTest.java | 4 +- .../util/QueryEvaluationUtilTest.java | 22 +- .../evaluation/util/ValueComparatorTest.java | 8 +- .../util/XMLDatatypeMathUtilTest.java | 42 +-- .../function/geosparql/FunctionArguments.java | 4 +- .../evaluation/function/geosparql/SRID.java | 4 +- .../function/geosparql/BufferTest.java | 6 +- .../function/geosparql/DistanceTest.java | 4 +- .../function/geosparql/SfWithinTest.java | 6 +- .../parser/serql/NamespaceDeclProcessor.java | 4 +- .../parser/serql/ast/SyntaxTreeBuilder.java | 6 +- .../parser/sparql/PrefixDeclProcessor.java | 4 +- .../parser/sparql/ast/SyntaxTreeBuilder.java | 22 +- .../sparqljson/AbstractSPARQLJSONWriter.java | 4 +- .../SPARQLJSONParserCustomTest.java | 8 +- .../SPARQLJSONTupleBackgroundTest.java | 6 +- .../sparqljson/SPARQLJSONTupleTest.java | 6 +- .../sparqlxml/AbstractSPARQLXMLWriter.java | 4 +- .../text/SPARQLResultsXSVMappingStrategy.java | 10 +- .../text/csv/SPARQLResultsCSVWriter.java | 4 +- .../text/tsv/SPARQLResultsTSVWriter.java | 8 +- .../text/csv/CSVQueryResultsComparisons.java | 44 +-- .../text/tsv/SPARQLTSVCustomTest.java | 8 +- .../repository/config/RepositoryConfig.java | 4 +- .../sparql/query/QueryStringUtil.java | 4 +- .../eclipse/rdf4j/rio/DatatypeHandler.java | 4 +- .../rdf4j/rio/helpers/NTriplesUtil.java | 4 +- .../rdf4j/rio/helpers/RDFParserHelper.java | 4 +- .../rdf4j/rio/AbstractParserHandlingTest.java | 4 +- .../rio/helpers/RDFParserHelperTest.java | 10 +- .../datatypes/XMLSchemaDatatypeHandler.java | 4 +- .../DBPediaCelsiusDatatypeHandlerTest.java | 4 +- .../RDFLangStringDatatypeHandlerTest.java | 4 +- .../XMLSchemaDoubleDatatypeHandlerTest.java | 8 +- .../rio/jsonld/JSONLDInternalRDFParser.java | 4 +- .../rio/jsonld/JSONLDParserCustomTest.java | 8 +- .../jsonld/JSONLDWriterBackgroundTest.java | 4 +- .../rdf4j/rio/jsonld/JSONLDWriterTest.java | 4 +- .../rio/rdfjson/RDFJSONParserCustomTest.java | 8 +- .../rdf4j/rio/rdfxml/RDFXMLWriter.java | 4 +- .../rio/trigstar/TriGStarParserTest.java | 6 +- .../rdf4j/rio/turtle/TurtleParser.java | 12 +- .../rdf4j/rio/turtle/TurtleWriter.java | 8 +- .../rio/turtlestar/TurtleStarParserTest.java | 6 +- .../sail/memory/model/BooleanMemLiteral.java | 4 +- .../sail/memory/model/DecimalMemLiteral.java | 4 +- .../sail/memory/model/IntegerMemLiteral.java | 4 +- .../rdf4j/sail/memory/model/MemLiteral.java | 4 +- .../sail/memory/model/MemValueFactory.java | 14 +- .../sail/memory/model/NumericMemLiteral.java | 14 +- .../rdf4j/sail/nativerdf/ValueStore.java | 8 +- .../planNodes/LiteralComparatorFilter.java | 16 +- .../rdf4j/sail/shacl/AbstractShaclTest.java | 4 +- .../org/eclipse/rdf4j/spin/SpinParser.java | 6 +- .../org/eclipse/rdf4j/spin/SpinRenderer.java | 6 +- .../eclipse/rdf4j/spin/function/Concat.java | 4 +- .../rdf4j/spin/function/SpinxFunction.java | 6 +- .../spin/function/spif/DecimalFormat.java | 10 +- .../eclipse/rdf4j/spin/function/spif/Mod.java | 22 +- .../resultio/AbstractQueryResultIOTest.java | 16 +- .../AbstractQueryResultIOTupleTest.java | 4 +- .../rdf4j/repository/EquivalentTest.java | 10 +- .../repository/RepositoryConnectionTest.java | 4 +- .../optimistic/IsolationLevelTest.java | 4 +- .../rdf4j/sail/EvaluationStrategyTest.java | 10 +- .../org/eclipse/rdf4j/sail/RDFStoreTest.java | 12 +- .../rdf4j/sail/SailIsolationLevelTest.java | 4 +- .../parser/sparql/ComplexSPARQLQueryTest.java | 6 +- .../query/parser/sparql/SPARQLUpdateTest.java | 16 +- .../rdf4j/console/setting/Prefixes.java | 4 +- .../workbench/commands/QueryServlet.java | 4 +- .../workbench/util/TestValueDecoder.java | 6 +- 148 files changed, 959 insertions(+), 1045 deletions(-) create mode 100644 core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/XSD.java diff --git a/compliance/solr/src/test/java/org/eclipse/rdf4j/sail/solr/SolrIndexTest.java b/compliance/solr/src/test/java/org/eclipse/rdf4j/sail/solr/SolrIndexTest.java index 5650225e130..f06591cb5cd 100644 --- a/compliance/solr/src/test/java/org/eclipse/rdf4j/sail/solr/SolrIndexTest.java +++ b/compliance/solr/src/test/java/org/eclipse/rdf4j/sail/solr/SolrIndexTest.java @@ -33,7 +33,7 @@ import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.repository.sail.SailRepository; import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.lucene.LuceneSail; @@ -357,9 +357,9 @@ public void testContextsRemoveContext2() throws Exception { @Test public void testRejectedDatatypes() { Literal literal1 = fac.createLiteral("hi there"); - Literal literal2 = fac.createLiteral("hi there, too", XMLSchema.STRING); + Literal literal2 = fac.createLiteral("hi there, too", XSD.STRING); Literal literal3 = fac.createLiteral("1.0"); - Literal literal4 = fac.createLiteral("1.0", XMLSchema.FLOAT); + Literal literal4 = fac.createLiteral("1.0", XSD.FLOAT); assertEquals("Is the first literal accepted?", true, index.accept(literal1)); assertEquals("Is the second literal accepted?", true, index.accept(literal2)); diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/EarlReport.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/EarlReport.java index 43262deba7d..ad36ecfb8ec 100644 --- a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/EarlReport.java +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/manifest/EarlReport.java @@ -20,7 +20,7 @@ import org.eclipse.rdf4j.model.vocabulary.DOAP; import org.eclipse.rdf4j.model.vocabulary.EARL; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.repository.RepositoryException; @@ -63,7 +63,7 @@ public static void main(String[] args) throws Exception { con.begin(); con.setNamespace("rdf", RDF.NAMESPACE); - con.setNamespace("xsd", XMLSchema.NAMESPACE); + con.setNamespace("xsd", XSD.NAMESPACE); con.setNamespace("doap", DOAP.NAMESPACE); con.setNamespace("earl", EARL.NAMESPACE); con.setNamespace("dcterms", DCTERMS.NAMESPACE); @@ -78,7 +78,7 @@ public static void main(String[] args) throws Exception { con.add(releaseNode, DOAP.NAME, vf.createLiteral("Sesame 2.7.0")); SimpleDateFormat xsdDataFormat = new SimpleDateFormat("yyyy-MM-dd"); String currentDate = xsdDataFormat.format(new Date()); - con.add(releaseNode, DOAP.CREATED, vf.createLiteral(currentDate, XMLSchema.DATE)); + con.add(releaseNode, DOAP.CREATED, vf.createLiteral(currentDate, XSD.DATE)); asserterNode = vf.createBNode(); con.add(asserterNode, RDF.TYPE, EARL.SOFTWARE); diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/Literal.java b/core/model/src/main/java/org/eclipse/rdf4j/model/Literal.java index a408ed2d6d5..4e0b385b272 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/Literal.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/Literal.java @@ -14,7 +14,7 @@ import javax.xml.datatype.XMLGregorianCalendar; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An RDF-1.1 literal consisting of a label (the lexical value), a datatype, and optionally a language tag. @@ -41,7 +41,7 @@ public interface Literal extends Value { /** * Gets the datatype for this literal. If {@link #getLanguage()} returns a non-empty value than this must return * {@link RDF#LANGSTRING}. If no datatype was assigned to this literal by the creator, then this method must return - * {@link XMLSchema#STRING}. + * {@link XSD#STRING}. * * @return The datatype for this literal. */ diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/ValueFactory.java b/core/model/src/main/java/org/eclipse/rdf4j/model/ValueFactory.java index d399931c474..e8ce451c6a4 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/ValueFactory.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/ValueFactory.java @@ -14,7 +14,7 @@ import javax.xml.datatype.XMLGregorianCalendar; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A factory for creating {@link IRI IRIs}, {@link BNode blank nodes}, {@link Literal literals} and {@link Statement @@ -91,7 +91,7 @@ public default URI createURI(String namespace, String localName) { /** * Creates a new literal with the supplied label. The return value of {@link Literal#getDatatype()} for the returned - * object must be {@link XMLSchema#STRING}. + * object must be {@link XSD#STRING}. * * @param label The literal's label, must not be null. */ @@ -110,8 +110,8 @@ public default URI createURI(String namespace, String localName) { * Creates a new literal with the supplied label and datatype. * * @param label The literal's label, must not be null. - * @param datatype The literal's datatype. If it is null, the datatype {@link XMLSchema#STRING} will be assigned to - * this literal. + * @param datatype The literal's datatype. If it is null, the datatype {@link XSD#STRING} will be assigned to this + * literal. */ public Literal createLiteral(String label, IRI datatype); @@ -119,8 +119,8 @@ public default URI createURI(String namespace, String localName) { * Creates a new literal with the supplied label and datatype. * * @param label The literal's label. - * @param datatype The literal's datatype. If it is null, the datatype {@link XMLSchema#STRING} will be assigned to - * this literal. + * @param datatype The literal's datatype. If it is null, the datatype {@link XSD#STRING} will be assigned to this + * literal. * @deprecated Use {@link #createLiteral(String, IRI)} instead. */ @Deprecated diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtil.java b/core/model/src/main/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtil.java index 7b68d1108b8..ef7405e2313 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtil.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtil.java @@ -24,7 +24,7 @@ import org.eclipse.rdf4j.common.text.ASCIIUtil; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.util.Literals; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * Provides methods for handling the standard XML Schema datatypes. @@ -74,16 +74,16 @@ public class XMLDatatypeUtil { * @return true if the datatype is a primitive type */ public static boolean isPrimitiveDatatype(IRI datatype) { - return datatype.equals(XMLSchema.DURATION) || datatype.equals(XMLSchema.DATETIME) - || datatype.equals(XMLSchema.TIME) || datatype.equals(XMLSchema.DATE) - || datatype.equals(XMLSchema.GYEARMONTH) || datatype.equals(XMLSchema.GYEAR) - || datatype.equals(XMLSchema.GMONTHDAY) || datatype.equals(XMLSchema.GDAY) - || datatype.equals(XMLSchema.GMONTH) || datatype.equals(XMLSchema.STRING) - || datatype.equals(XMLSchema.BOOLEAN) || datatype.equals(XMLSchema.BASE64BINARY) - || datatype.equals(XMLSchema.HEXBINARY) || datatype.equals(XMLSchema.FLOAT) - || datatype.equals(XMLSchema.DECIMAL) || datatype.equals(XMLSchema.DOUBLE) - || datatype.equals(XMLSchema.ANYURI) || datatype.equals(XMLSchema.QNAME) - || datatype.equals(XMLSchema.NOTATION); + return datatype.equals(XSD.DURATION) || datatype.equals(XSD.DATETIME) + || datatype.equals(XSD.TIME) || datatype.equals(XSD.DATE) + || datatype.equals(XSD.GYEARMONTH) || datatype.equals(XSD.GYEAR) + || datatype.equals(XSD.GMONTHDAY) || datatype.equals(XSD.GDAY) + || datatype.equals(XSD.GMONTH) || datatype.equals(XSD.STRING) + || datatype.equals(XSD.BOOLEAN) || datatype.equals(XSD.BASE64BINARY) + || datatype.equals(XSD.HEXBINARY) || datatype.equals(XSD.FLOAT) + || datatype.equals(XSD.DECIMAL) || datatype.equals(XSD.DOUBLE) + || datatype.equals(XSD.ANYURI) || datatype.equals(XSD.QNAME) + || datatype.equals(XSD.NOTATION); } /** @@ -93,20 +93,20 @@ public static boolean isPrimitiveDatatype(IRI datatype) { * @return true if the datatype is a derived type */ public static boolean isDerivedDatatype(IRI datatype) { - return datatype.equals(XMLSchema.NORMALIZEDSTRING) || datatype.equals(XMLSchema.TOKEN) - || datatype.equals(XMLSchema.LANGUAGE) || datatype.equals(XMLSchema.NMTOKEN) - || datatype.equals(XMLSchema.NMTOKENS) || datatype.equals(XMLSchema.NAME) - || datatype.equals(XMLSchema.NCNAME) || datatype.equals(XMLSchema.ID) - || datatype.equals(XMLSchema.IDREF) || datatype.equals(XMLSchema.IDREFS) - || datatype.equals(XMLSchema.ENTITY) || datatype.equals(XMLSchema.ENTITIES) - || datatype.equals(XMLSchema.INTEGER) || datatype.equals(XMLSchema.LONG) - || datatype.equals(XMLSchema.INT) || datatype.equals(XMLSchema.SHORT) || datatype.equals(XMLSchema.BYTE) - || datatype.equals(XMLSchema.NON_POSITIVE_INTEGER) || datatype.equals(XMLSchema.NEGATIVE_INTEGER) - || datatype.equals(XMLSchema.NON_NEGATIVE_INTEGER) || datatype.equals(XMLSchema.POSITIVE_INTEGER) - || datatype.equals(XMLSchema.UNSIGNED_LONG) || datatype.equals(XMLSchema.UNSIGNED_INT) - || datatype.equals(XMLSchema.UNSIGNED_SHORT) || datatype.equals(XMLSchema.UNSIGNED_BYTE) - || datatype.equals(XMLSchema.DAYTIMEDURATION) || datatype.equals(XMLSchema.YEARMONTHDURATION) - || datatype.equals(XMLSchema.DATETIMESTAMP); + return datatype.equals(XSD.NORMALIZEDSTRING) || datatype.equals(XSD.TOKEN) + || datatype.equals(XSD.LANGUAGE) || datatype.equals(XSD.NMTOKEN) + || datatype.equals(XSD.NMTOKENS) || datatype.equals(XSD.NAME) + || datatype.equals(XSD.NCNAME) || datatype.equals(XSD.ID) + || datatype.equals(XSD.IDREF) || datatype.equals(XSD.IDREFS) + || datatype.equals(XSD.ENTITY) || datatype.equals(XSD.ENTITIES) + || datatype.equals(XSD.INTEGER) || datatype.equals(XSD.LONG) + || datatype.equals(XSD.INT) || datatype.equals(XSD.SHORT) || datatype.equals(XSD.BYTE) + || datatype.equals(XSD.NON_POSITIVE_INTEGER) || datatype.equals(XSD.NEGATIVE_INTEGER) + || datatype.equals(XSD.NON_NEGATIVE_INTEGER) || datatype.equals(XSD.POSITIVE_INTEGER) + || datatype.equals(XSD.UNSIGNED_LONG) || datatype.equals(XSD.UNSIGNED_INT) + || datatype.equals(XSD.UNSIGNED_SHORT) || datatype.equals(XSD.UNSIGNED_BYTE) + || datatype.equals(XSD.DAYTIMEDURATION) || datatype.equals(XSD.YEARMONTHDURATION) + || datatype.equals(XSD.DATETIMESTAMP); } /** @@ -138,7 +138,7 @@ public static boolean isNumericDatatype(IRI datatype) { * @return true if it is a decimal datatype */ public static boolean isDecimalDatatype(IRI datatype) { - return datatype.equals(XMLSchema.DECIMAL) || isIntegerDatatype(datatype); + return datatype.equals(XSD.DECIMAL) || isIntegerDatatype(datatype); } /** @@ -149,12 +149,12 @@ public static boolean isDecimalDatatype(IRI datatype) { * @return true if it is an integer type */ public static boolean isIntegerDatatype(IRI datatype) { - return datatype.equals(XMLSchema.INTEGER) || datatype.equals(XMLSchema.LONG) || datatype.equals(XMLSchema.INT) - || datatype.equals(XMLSchema.SHORT) || datatype.equals(XMLSchema.BYTE) - || datatype.equals(XMLSchema.NON_POSITIVE_INTEGER) || datatype.equals(XMLSchema.NEGATIVE_INTEGER) - || datatype.equals(XMLSchema.NON_NEGATIVE_INTEGER) || datatype.equals(XMLSchema.POSITIVE_INTEGER) - || datatype.equals(XMLSchema.UNSIGNED_LONG) || datatype.equals(XMLSchema.UNSIGNED_INT) - || datatype.equals(XMLSchema.UNSIGNED_SHORT) || datatype.equals(XMLSchema.UNSIGNED_BYTE); + return datatype.equals(XSD.INTEGER) || datatype.equals(XSD.LONG) || datatype.equals(XSD.INT) + || datatype.equals(XSD.SHORT) || datatype.equals(XSD.BYTE) + || datatype.equals(XSD.NON_POSITIVE_INTEGER) || datatype.equals(XSD.NEGATIVE_INTEGER) + || datatype.equals(XSD.NON_NEGATIVE_INTEGER) || datatype.equals(XSD.POSITIVE_INTEGER) + || datatype.equals(XSD.UNSIGNED_LONG) || datatype.equals(XSD.UNSIGNED_INT) + || datatype.equals(XSD.UNSIGNED_SHORT) || datatype.equals(XSD.UNSIGNED_BYTE); } /** @@ -164,7 +164,7 @@ public static boolean isIntegerDatatype(IRI datatype) { * @return true if it is a floating point type */ public static boolean isFloatingPointDatatype(IRI datatype) { - return datatype.equals(XMLSchema.FLOAT) || datatype.equals(XMLSchema.DOUBLE); + return datatype.equals(XSD.FLOAT) || datatype.equals(XSD.DOUBLE); } /** @@ -176,10 +176,10 @@ public static boolean isFloatingPointDatatype(IRI datatype) { * @return true if it is a calendar type */ public static boolean isCalendarDatatype(IRI datatype) { - return datatype.equals(XMLSchema.DATETIME) || datatype.equals(XMLSchema.DATE) || datatype.equals(XMLSchema.TIME) - || datatype.equals(XMLSchema.GYEARMONTH) || datatype.equals(XMLSchema.GMONTHDAY) - || datatype.equals(XMLSchema.GYEAR) || datatype.equals(XMLSchema.GMONTH) - || datatype.equals(XMLSchema.GDAY) || datatype.equals(XMLSchema.DATETIMESTAMP); + return datatype.equals(XSD.DATETIME) || datatype.equals(XSD.DATE) || datatype.equals(XSD.TIME) + || datatype.equals(XSD.GYEARMONTH) || datatype.equals(XSD.GMONTHDAY) + || datatype.equals(XSD.GYEAR) || datatype.equals(XSD.GMONTH) + || datatype.equals(XSD.GDAY) || datatype.equals(XSD.DATETIMESTAMP); } @@ -192,8 +192,8 @@ public static boolean isCalendarDatatype(IRI datatype) { * @return true if it is a duration type */ public static boolean isDurationDatatype(IRI datatype) { - return datatype.equals(XMLSchema.DURATION) || datatype.equals(XMLSchema.DAYTIMEDURATION) - || datatype.equals(XMLSchema.YEARMONTHDURATION); + return datatype.equals(XSD.DURATION) || datatype.equals(XSD.DAYTIMEDURATION) + || datatype.equals(XSD.YEARMONTHDURATION); } /** @@ -221,69 +221,69 @@ public static boolean isOrderedDatatype(IRI datatype) { public static boolean isValidValue(String value, IRI datatype) { boolean result = true; - if (datatype.equals(XMLSchema.DECIMAL)) { + if (datatype.equals(XSD.DECIMAL)) { result = isValidDecimal(value); - } else if (datatype.equals(XMLSchema.INTEGER)) { + } else if (datatype.equals(XSD.INTEGER)) { result = isValidInteger(value); - } else if (datatype.equals(XMLSchema.NEGATIVE_INTEGER)) { + } else if (datatype.equals(XSD.NEGATIVE_INTEGER)) { result = isValidNegativeInteger(value); - } else if (datatype.equals(XMLSchema.NON_POSITIVE_INTEGER)) { + } else if (datatype.equals(XSD.NON_POSITIVE_INTEGER)) { result = isValidNonPositiveInteger(value); - } else if (datatype.equals(XMLSchema.NON_NEGATIVE_INTEGER)) { + } else if (datatype.equals(XSD.NON_NEGATIVE_INTEGER)) { result = isValidNonNegativeInteger(value); - } else if (datatype.equals(XMLSchema.POSITIVE_INTEGER)) { + } else if (datatype.equals(XSD.POSITIVE_INTEGER)) { result = isValidPositiveInteger(value); - } else if (datatype.equals(XMLSchema.LONG)) { + } else if (datatype.equals(XSD.LONG)) { result = isValidLong(value); - } else if (datatype.equals(XMLSchema.INT)) { + } else if (datatype.equals(XSD.INT)) { result = isValidInt(value); - } else if (datatype.equals(XMLSchema.SHORT)) { + } else if (datatype.equals(XSD.SHORT)) { result = isValidShort(value); - } else if (datatype.equals(XMLSchema.BYTE)) { + } else if (datatype.equals(XSD.BYTE)) { result = isValidByte(value); - } else if (datatype.equals(XMLSchema.UNSIGNED_LONG)) { + } else if (datatype.equals(XSD.UNSIGNED_LONG)) { result = isValidUnsignedLong(value); - } else if (datatype.equals(XMLSchema.UNSIGNED_INT)) { + } else if (datatype.equals(XSD.UNSIGNED_INT)) { result = isValidUnsignedInt(value); - } else if (datatype.equals(XMLSchema.UNSIGNED_SHORT)) { + } else if (datatype.equals(XSD.UNSIGNED_SHORT)) { result = isValidUnsignedShort(value); - } else if (datatype.equals(XMLSchema.UNSIGNED_BYTE)) { + } else if (datatype.equals(XSD.UNSIGNED_BYTE)) { result = isValidUnsignedByte(value); - } else if (datatype.equals(XMLSchema.FLOAT)) { + } else if (datatype.equals(XSD.FLOAT)) { result = isValidFloat(value); - } else if (datatype.equals(XMLSchema.DOUBLE)) { + } else if (datatype.equals(XSD.DOUBLE)) { result = isValidDouble(value); - } else if (datatype.equals(XMLSchema.BOOLEAN)) { + } else if (datatype.equals(XSD.BOOLEAN)) { result = isValidBoolean(value); - } else if (datatype.equals(XMLSchema.DATETIME)) { + } else if (datatype.equals(XSD.DATETIME)) { result = isValidDateTime(value); - } else if (datatype.equals(XMLSchema.DATETIMESTAMP)) { + } else if (datatype.equals(XSD.DATETIMESTAMP)) { result = isValidDateTimeStamp(value); - } else if (datatype.equals(XMLSchema.DATE)) { + } else if (datatype.equals(XSD.DATE)) { result = isValidDate(value); - } else if (datatype.equals(XMLSchema.TIME)) { + } else if (datatype.equals(XSD.TIME)) { result = isValidTime(value); - } else if (datatype.equals(XMLSchema.GDAY)) { + } else if (datatype.equals(XSD.GDAY)) { result = isValidGDay(value); - } else if (datatype.equals(XMLSchema.GMONTH)) { + } else if (datatype.equals(XSD.GMONTH)) { result = isValidGMonth(value); - } else if (datatype.equals(XMLSchema.GMONTHDAY)) { + } else if (datatype.equals(XSD.GMONTHDAY)) { result = isValidGMonthDay(value); - } else if (datatype.equals(XMLSchema.GYEAR)) { + } else if (datatype.equals(XSD.GYEAR)) { result = isValidGYear(value); - } else if (datatype.equals(XMLSchema.GYEARMONTH)) { + } else if (datatype.equals(XSD.GYEARMONTH)) { result = isValidGYearMonth(value); - } else if (datatype.equals(XMLSchema.DURATION)) { + } else if (datatype.equals(XSD.DURATION)) { result = isValidDuration(value); - } else if (datatype.equals(XMLSchema.DAYTIMEDURATION)) { + } else if (datatype.equals(XSD.DAYTIMEDURATION)) { result = isValidDayTimeDuration(value); - } else if (datatype.equals(XMLSchema.YEARMONTHDURATION)) { + } else if (datatype.equals(XSD.YEARMONTHDURATION)) { result = isValidYearMonthDuration(value); - } else if (datatype.equals(XMLSchema.QNAME)) { + } else if (datatype.equals(XSD.QNAME)) { result = isValidQName(value); - } else if (datatype.equals(XMLSchema.ANYURI)) { + } else if (datatype.equals(XSD.ANYURI)) { result = isValidAnyURI(value); - } else if (datatype.equals(XMLSchema.LANGUAGE)) { + } else if (datatype.equals(XSD.LANGUAGE)) { result = Literals.isValidLanguageTag(value); } @@ -792,43 +792,43 @@ private static boolean isValidCalendarValue(String value) { public static String normalize(String value, IRI datatype) { String result = value; - if (datatype.equals(XMLSchema.DECIMAL)) { + if (datatype.equals(XSD.DECIMAL)) { result = normalizeDecimal(value); - } else if (datatype.equals(XMLSchema.INTEGER)) { + } else if (datatype.equals(XSD.INTEGER)) { result = normalizeInteger(value); - } else if (datatype.equals(XMLSchema.NEGATIVE_INTEGER)) { + } else if (datatype.equals(XSD.NEGATIVE_INTEGER)) { result = normalizeNegativeInteger(value); - } else if (datatype.equals(XMLSchema.NON_POSITIVE_INTEGER)) { + } else if (datatype.equals(XSD.NON_POSITIVE_INTEGER)) { result = normalizeNonPositiveInteger(value); - } else if (datatype.equals(XMLSchema.NON_NEGATIVE_INTEGER)) { + } else if (datatype.equals(XSD.NON_NEGATIVE_INTEGER)) { result = normalizeNonNegativeInteger(value); - } else if (datatype.equals(XMLSchema.POSITIVE_INTEGER)) { + } else if (datatype.equals(XSD.POSITIVE_INTEGER)) { result = normalizePositiveInteger(value); - } else if (datatype.equals(XMLSchema.LONG)) { + } else if (datatype.equals(XSD.LONG)) { result = normalizeLong(value); - } else if (datatype.equals(XMLSchema.INT)) { + } else if (datatype.equals(XSD.INT)) { result = normalizeInt(value); - } else if (datatype.equals(XMLSchema.SHORT)) { + } else if (datatype.equals(XSD.SHORT)) { result = normalizeShort(value); - } else if (datatype.equals(XMLSchema.BYTE)) { + } else if (datatype.equals(XSD.BYTE)) { result = normalizeByte(value); - } else if (datatype.equals(XMLSchema.UNSIGNED_LONG)) { + } else if (datatype.equals(XSD.UNSIGNED_LONG)) { result = normalizeUnsignedLong(value); - } else if (datatype.equals(XMLSchema.UNSIGNED_INT)) { + } else if (datatype.equals(XSD.UNSIGNED_INT)) { result = normalizeUnsignedInt(value); - } else if (datatype.equals(XMLSchema.UNSIGNED_SHORT)) { + } else if (datatype.equals(XSD.UNSIGNED_SHORT)) { result = normalizeUnsignedShort(value); - } else if (datatype.equals(XMLSchema.UNSIGNED_BYTE)) { + } else if (datatype.equals(XSD.UNSIGNED_BYTE)) { result = normalizeUnsignedByte(value); - } else if (datatype.equals(XMLSchema.FLOAT)) { + } else if (datatype.equals(XSD.FLOAT)) { result = normalizeFloat(value); - } else if (datatype.equals(XMLSchema.DOUBLE)) { + } else if (datatype.equals(XSD.DOUBLE)) { result = normalizeDouble(value); - } else if (datatype.equals(XMLSchema.BOOLEAN)) { + } else if (datatype.equals(XSD.BOOLEAN)) { result = normalizeBoolean(value); - } else if (datatype.equals(XMLSchema.DATETIME)) { + } else if (datatype.equals(XSD.DATETIME)) { result = normalizeDateTime(value); - } else if (datatype.equals(XMLSchema.ANYURI)) { + } else if (datatype.equals(XSD.ANYURI)) { result = collapseWhiteSpace(value); } @@ -1362,39 +1362,39 @@ public static String collapseWhiteSpace(String s) { *------------------*/ public static int compare(String value1, String value2, IRI datatype) { - if (datatype.equals(XMLSchema.DECIMAL)) { + if (datatype.equals(XSD.DECIMAL)) { return compareDecimals(value1, value2); - } else if (datatype.equals(XMLSchema.INTEGER)) { + } else if (datatype.equals(XSD.INTEGER)) { return compareIntegers(value1, value2); - } else if (datatype.equals(XMLSchema.NEGATIVE_INTEGER)) { + } else if (datatype.equals(XSD.NEGATIVE_INTEGER)) { return compareNegativeIntegers(value1, value2); - } else if (datatype.equals(XMLSchema.NON_POSITIVE_INTEGER)) { + } else if (datatype.equals(XSD.NON_POSITIVE_INTEGER)) { return compareNonPositiveIntegers(value1, value2); - } else if (datatype.equals(XMLSchema.NON_NEGATIVE_INTEGER)) { + } else if (datatype.equals(XSD.NON_NEGATIVE_INTEGER)) { return compareNonNegativeIntegers(value1, value2); - } else if (datatype.equals(XMLSchema.POSITIVE_INTEGER)) { + } else if (datatype.equals(XSD.POSITIVE_INTEGER)) { return comparePositiveIntegers(value1, value2); - } else if (datatype.equals(XMLSchema.LONG)) { + } else if (datatype.equals(XSD.LONG)) { return compareLongs(value1, value2); - } else if (datatype.equals(XMLSchema.INT)) { + } else if (datatype.equals(XSD.INT)) { return compareInts(value1, value2); - } else if (datatype.equals(XMLSchema.SHORT)) { + } else if (datatype.equals(XSD.SHORT)) { return compareShorts(value1, value2); - } else if (datatype.equals(XMLSchema.BYTE)) { + } else if (datatype.equals(XSD.BYTE)) { return compareBytes(value1, value2); - } else if (datatype.equals(XMLSchema.UNSIGNED_LONG)) { + } else if (datatype.equals(XSD.UNSIGNED_LONG)) { return compareUnsignedLongs(value1, value2); - } else if (datatype.equals(XMLSchema.UNSIGNED_INT)) { + } else if (datatype.equals(XSD.UNSIGNED_INT)) { return compareUnsignedInts(value1, value2); - } else if (datatype.equals(XMLSchema.UNSIGNED_SHORT)) { + } else if (datatype.equals(XSD.UNSIGNED_SHORT)) { return compareUnsignedShorts(value1, value2); - } else if (datatype.equals(XMLSchema.UNSIGNED_BYTE)) { + } else if (datatype.equals(XSD.UNSIGNED_BYTE)) { return compareUnsignedBytes(value1, value2); - } else if (datatype.equals(XMLSchema.FLOAT)) { + } else if (datatype.equals(XSD.FLOAT)) { return compareFloats(value1, value2); - } else if (datatype.equals(XMLSchema.DOUBLE)) { + } else if (datatype.equals(XSD.DOUBLE)) { return compareDoubles(value1, value2); - } else if (datatype.equals(XMLSchema.DATETIME) || datatype.equals(XMLSchema.DATETIMESTAMP)) { + } else if (datatype.equals(XSD.DATETIME) || datatype.equals(XSD.DATETIMESTAMP)) { return compareDateTime(value1, value2); } else { throw new IllegalArgumentException("datatype is not ordered"); @@ -1973,27 +1973,27 @@ private static String trimPlusSign(String s) { */ public static IRI qnameToURI(QName qname) { if (DatatypeConstants.DATETIME.equals(qname)) { - return XMLSchema.DATETIME; + return XSD.DATETIME; } else if (DatatypeConstants.DATE.equals(qname)) { - return XMLSchema.DATE; + return XSD.DATE; } else if (DatatypeConstants.TIME.equals(qname)) { - return XMLSchema.TIME; + return XSD.TIME; } else if (DatatypeConstants.GYEARMONTH.equals(qname)) { - return XMLSchema.GYEARMONTH; + return XSD.GYEARMONTH; } else if (DatatypeConstants.GMONTHDAY.equals(qname)) { - return XMLSchema.GMONTHDAY; + return XSD.GMONTHDAY; } else if (DatatypeConstants.GYEAR.equals(qname)) { - return XMLSchema.GYEAR; + return XSD.GYEAR; } else if (DatatypeConstants.GMONTH.equals(qname)) { - return XMLSchema.GMONTH; + return XSD.GMONTH; } else if (DatatypeConstants.GDAY.equals(qname)) { - return XMLSchema.GDAY; + return XSD.GDAY; } else if (DatatypeConstants.DURATION.equals(qname)) { - return XMLSchema.DURATION; + return XSD.DURATION; } else if (DatatypeConstants.DURATION_DAYTIME.equals(qname)) { - return XMLSchema.DAYTIMEDURATION; + return XSD.DAYTIMEDURATION; } else if (DatatypeConstants.DURATION_YEARMONTH.equals(qname)) { - return XMLSchema.YEARMONTHDURATION; + return XSD.YEARMONTHDURATION; } else { throw new IllegalArgumentException("QName cannot be mapped to an XML Schema URI: " + qname.toString()); } diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/AbstractValueFactory.java b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/AbstractValueFactory.java index 01de3c91664..e9d551f7658 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/AbstractValueFactory.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/AbstractValueFactory.java @@ -25,7 +25,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * Abstract base class for {@link ValueFactory} implementations. It implements all basic {@link Value} creation methods @@ -99,7 +99,7 @@ public BNode createBNode(String nodeID) { @Override public Literal createLiteral(String value) { - return new SimpleLiteral(value, XMLSchema.STRING); + return new SimpleLiteral(value, XSD.STRING); } @Override @@ -157,38 +157,35 @@ public synchronized BNode createBNode() { } /** - * Calls {@link #createIntegerLiteral(Number, IRI)} with the supplied value and {@link XMLSchema#BYTE} as - * parameters. + * Calls {@link #createIntegerLiteral(Number, IRI)} with the supplied value and {@link XSD#BYTE} as parameters. */ @Override public Literal createLiteral(byte value) { - return createIntegerLiteral(value, XMLSchema.BYTE); + return createIntegerLiteral(value, XSD.BYTE); } /** - * Calls {@link #createIntegerLiteral(Number, IRI)} with the supplied value and {@link XMLSchema#SHORT} as - * parameters. + * Calls {@link #createIntegerLiteral(Number, IRI)} with the supplied value and {@link XSD#SHORT} as parameters. */ @Override public Literal createLiteral(short value) { - return createIntegerLiteral(value, XMLSchema.SHORT); + return createIntegerLiteral(value, XSD.SHORT); } /** - * Calls {@link #createIntegerLiteral(Number, IRI)} with the supplied value and {@link XMLSchema#INT} as parameters. + * Calls {@link #createIntegerLiteral(Number, IRI)} with the supplied value and {@link XSD#INT} as parameters. */ @Override public Literal createLiteral(int value) { - return createIntegerLiteral(value, XMLSchema.INT); + return createIntegerLiteral(value, XSD.INT); } /** - * Calls {@link #createIntegerLiteral(Number, IRI)} with the supplied value and {@link XMLSchema#LONG} as - * parameters. + * Calls {@link #createIntegerLiteral(Number, IRI)} with the supplied value and {@link XSD#LONG} as parameters. */ @Override public Literal createLiteral(long value) { - return createIntegerLiteral(value, XMLSchema.LONG); + return createIntegerLiteral(value, XSD.LONG); } /** @@ -199,29 +196,29 @@ protected Literal createIntegerLiteral(Number value, IRI datatype) { } /** - * Calls {@link #createFPLiteral(Number, IRI)} with the supplied value and {@link XMLSchema#FLOAT} as parameters. + * Calls {@link #createFPLiteral(Number, IRI)} with the supplied value and {@link XSD#FLOAT} as parameters. */ @Override public Literal createLiteral(float value) { - return createFPLiteral(value, XMLSchema.FLOAT); + return createFPLiteral(value, XSD.FLOAT); } /** - * Calls {@link #createFPLiteral(Number, IRI)} with the supplied value and {@link XMLSchema#DOUBLE} as parameters. + * Calls {@link #createFPLiteral(Number, IRI)} with the supplied value and {@link XSD#DOUBLE} as parameters. */ @Override public Literal createLiteral(double value) { - return createFPLiteral(value, XMLSchema.DOUBLE); + return createFPLiteral(value, XSD.DOUBLE); } @Override public Literal createLiteral(BigInteger bigInteger) { - return createIntegerLiteral(bigInteger, XMLSchema.INTEGER); + return createIntegerLiteral(bigInteger, XSD.INTEGER); } @Override public Literal createLiteral(BigDecimal bigDecimal) { - return createNumericLiteral(bigDecimal, XMLSchema.DECIMAL); + return createNumericLiteral(bigDecimal, XSD.DECIMAL); } /** diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/BooleanLiteral.java b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/BooleanLiteral.java index ee5044f3427..e5b8dd8e46b 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/BooleanLiteral.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/BooleanLiteral.java @@ -7,7 +7,7 @@ *******************************************************************************/ package org.eclipse.rdf4j.model.impl; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An extension of {@link SimpleLiteral} that stores a boolean value to avoid parsing. @@ -41,7 +41,7 @@ public class BooleanLiteral extends SimpleLiteral { * Creates an xsd:boolean typed literal with the specified value. */ protected BooleanLiteral(boolean value) { - super(Boolean.toString(value), XMLSchema.BOOLEAN); + super(Boolean.toString(value), XSD.BOOLEAN); this.value = value; } diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/DecimalLiteral.java b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/DecimalLiteral.java index 6f139e755ed..0830bad11ba 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/DecimalLiteral.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/DecimalLiteral.java @@ -11,7 +11,7 @@ import java.math.BigInteger; import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An extension of {@link SimpleLiteral} that stores an integer value using a {@link BigDecimal} object. @@ -28,7 +28,7 @@ public class DecimalLiteral extends SimpleLiteral { * Creates an xsd:decimal literal with the specified value. */ protected DecimalLiteral(BigDecimal value) { - this(value, XMLSchema.DECIMAL); + this(value, XSD.DECIMAL); } /** diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/IntegerLiteral.java b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/IntegerLiteral.java index be0c91caa74..598804d05b7 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/IntegerLiteral.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/IntegerLiteral.java @@ -11,7 +11,7 @@ import java.math.BigInteger; import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An extension of {@link SimpleLiteral} that stores an integer value using a {@link BigInteger} object. @@ -28,7 +28,7 @@ public class IntegerLiteral extends SimpleLiteral { * Creates an xsd:integer literal with the specified value. */ protected IntegerLiteral(BigInteger value) { - this(value, XMLSchema.INTEGER); + this(value, XSD.INTEGER); } /** diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/NumericLiteral.java b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/NumericLiteral.java index 58f3f7cd3f3..ffb3187a200 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/NumericLiteral.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/NumericLiteral.java @@ -9,7 +9,7 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An extension of {@link SimpleLiteral} that stores a numeric value to avoid parsing. @@ -34,42 +34,42 @@ protected NumericLiteral(Number number, IRI datatype) { * Creates an xsd:byte typed litral with the specified value. */ protected NumericLiteral(byte number) { - this(number, XMLSchema.BYTE); + this(number, XSD.BYTE); } /** * Creates an xsd:short typed litral with the specified value. */ protected NumericLiteral(short number) { - this(number, XMLSchema.SHORT); + this(number, XSD.SHORT); } /** * Creates an xsd:int typed litral with the specified value. */ protected NumericLiteral(int number) { - this(number, XMLSchema.INT); + this(number, XSD.INT); } /** * Creates an xsd:long typed litral with the specified value. */ protected NumericLiteral(long n) { - this(n, XMLSchema.LONG); + this(n, XSD.LONG); } /** * Creates an xsd:float typed litral with the specified value. */ protected NumericLiteral(float n) { - this(n, XMLSchema.FLOAT); + this(n, XSD.FLOAT); } /** * Creates an xsd:double typed litral with the specified value. */ protected NumericLiteral(double n) { - this(n, XMLSchema.DOUBLE); + this(n, XSD.DOUBLE); } @Override diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/SimpleLiteral.java b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/SimpleLiteral.java index 8240cead350..c4bc8735c06 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/impl/SimpleLiteral.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/impl/SimpleLiteral.java @@ -19,7 +19,7 @@ import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.util.Literals; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A simple default implementation of the {@link Literal} interface. @@ -68,7 +68,7 @@ protected SimpleLiteral() { */ protected SimpleLiteral(String label) { setLabel(label); - setDatatype(XMLSchema.STRING); + setDatatype(XSD.STRING); } /** @@ -93,7 +93,7 @@ protected SimpleLiteral(String label, IRI datatype) { if (RDF.LANGSTRING.equals(datatype)) { throw new IllegalArgumentException("datatype rdf:langString requires a language tag"); } else if (datatype == null) { - datatype = XMLSchema.STRING; + datatype = XSD.STRING; } setDatatype(datatype); } @@ -188,7 +188,7 @@ public String toString() { sb.append('"').append(label).append('"'); sb.append('@').append(language); return sb.toString(); - } else if (XMLSchema.STRING.equals(datatype) || datatype == null) { + } else if (XSD.STRING.equals(datatype) || datatype == null) { StringBuilder sb = new StringBuilder(label.length() + 2); sb.append('"').append(label).append('"'); return sb.toString(); diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java b/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java index 2d4d1e8f6ef..b832ffd27e2 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java @@ -21,7 +21,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * Various utility methods related to {@link Literal}. @@ -350,9 +350,9 @@ public static XMLGregorianCalendar getCalendarValue(Value v, XMLGregorianCalenda /** * Creates a typed {@link Literal} out of the supplied object, mapping the runtime type of the object to the * appropriate XML Schema type. If no mapping is available, the method returns a literal with the string - * representation of the supplied object as the value, and {@link XMLSchema#STRING} as the datatype. Recognized - * types are {@link Boolean}, {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, - * {@link Short}, {@link XMLGregorianCalendar } , and {@link Date}. + * representation of the supplied object as the value, and {@link XSD#STRING} as the datatype. Recognized types are + * {@link Boolean}, {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, + * {@link XMLGregorianCalendar } , and {@link Date}. * * @param valueFactory * @param object an object to be converted to a typed literal. @@ -388,7 +388,7 @@ public static Literal createLiteralOrFail(ValueFactory valueFactory, Object obje * Creates a typed {@link Literal} out of the supplied object, mapping the runtime type of the object to the * appropriate XML Schema type. If no mapping is available, the method throws an exception if the boolean parameter * is true, or if it is false it returns a literal with the string representation of the supplied object as the - * value, and {@link XMLSchema#STRING} as the datatype. Recognized types are {@link Boolean}, {@link Byte}, + * value, and {@link XSD#STRING} as the datatype. Recognized types are {@link Boolean}, {@link Byte}, * {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, {@link XMLGregorianCalendar } , and * {@link Date}. * @@ -425,12 +425,12 @@ private static Literal createLiteral(ValueFactory valueFactory, Object object, b } else if (object instanceof Date) { return valueFactory.createLiteral((Date) object); } else if (object instanceof String) { - return valueFactory.createLiteral(object.toString(), XMLSchema.STRING); + return valueFactory.createLiteral(object.toString(), XSD.STRING); } else { if (throwExceptionOnFailure) { throw new LiteralUtilException("Did not recognise object when creating literal"); } - return valueFactory.createLiteral(object.toString(), XMLSchema.STRING); + return valueFactory.createLiteral(object.toString(), XSD.STRING); } } diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/util/ModelBuilder.java b/core/model/src/main/java/org/eclipse/rdf4j/model/util/ModelBuilder.java index 3337c90446c..f8aa3bff583 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/util/ModelBuilder.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/util/ModelBuilder.java @@ -29,7 +29,7 @@ import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.model.vocabulary.SKOS; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * Builder to facilitate easier creation of new RDF {@link Model} objects via a fluent interface. All methods returning @@ -181,8 +181,8 @@ public ModelBuilder defaultGraph() { * prefix, it is mapped to an IRI. Otherwise a typed {@link Literal} is created out of the supplied * object, mapping the runtime type of the object to the appropriate XML Schema type. If no mapping * is available, the method creates a literal with the string representation of the supplied object - * as the value, and {@link XMLSchema#STRING} as the datatype. Recognized types are {@link Boolean} - * , {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, + * as the value, and {@link XSD#STRING} as the datatype. Recognized types are {@link Boolean} , + * {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, * {@link XMLGregorianCalendar } , and {@link Date}. * @return this {@link ModelBuilder} * @see #namedGraph(Resource) @@ -199,7 +199,7 @@ public ModelBuilder add(Resource subject, IRI predicate, Object object) { } if (objectValue == null) { - model.setNamespace(XMLSchema.NS); + model.setNamespace(XSD.NS); objectValue = Literals.createLiteral(SimpleValueFactory.getInstance(), object); } @@ -224,8 +224,8 @@ public ModelBuilder add(Resource subject, IRI predicate, Object object) { * prefix, it is mapped to an IRI. Otherwise a typed {@link Literal} is created out of the supplied * object, mapping the runtime type of the object to the appropriate XML Schema type. If no mapping * is available, the method creates a literal with the string representation of the supplied object - * as the value, and {@link XMLSchema#STRING} as the datatype. Recognized types are {@link Boolean} - * , {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, + * as the value, and {@link XSD#STRING} as the datatype. Recognized types are {@link Boolean} , + * {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, * {@link XMLGregorianCalendar } , and {@link Date}. * @return this {@link ModelBuilder} * @see #namedGraph(Resource) @@ -251,8 +251,8 @@ public ModelBuilder add(String subject, IRI predicate, Object object) { * prefix, it is mapped to an IRI. Otherwise a typed {@link Literal} is created out of the supplied * object, mapping the runtime type of the object to the appropriate XML Schema type. If no mapping * is available, the method creates a literal with the string representation of the supplied object - * as the value, and {@link XMLSchema#STRING} as the datatype. Recognized types are {@link Boolean} - * , {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, + * as the value, and {@link XSD#STRING} as the datatype. Recognized types are {@link Boolean} , + * {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, * {@link XMLGregorianCalendar } , and {@link Date}. * @return this {@link ModelBuilder} * @see #namedGraph(Resource) @@ -273,8 +273,8 @@ public ModelBuilder add(String subject, String predicate, Object object) { * prefix, it is mapped to an IRI. Otherwise a typed {@link Literal} is created out of the supplied * object, mapping the runtime type of the object to the appropriate XML Schema type. If no mapping * is available, the method creates a literal with the string representation of the supplied object - * as the value, and {@link XMLSchema#STRING} as the datatype. Recognized types are {@link Boolean} - * , {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, + * as the value, and {@link XSD#STRING} as the datatype. Recognized types are {@link Boolean} , + * {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, * {@link XMLGregorianCalendar } , and {@link Date}. * @return this {@link ModelBuilder} * @throws ModelException if the current subject is not set using {@link #subject(Resource)} or @@ -299,8 +299,8 @@ public ModelBuilder add(IRI predicate, Object object) { * prefix, it is mapped to an IRI. Otherwise a typed {@link Literal} is created out of the supplied * object, mapping the runtime type of the object to the appropriate XML Schema type. If no mapping * is available, the method creates a literal with the string representation of the supplied object - * as the value, and {@link XMLSchema#STRING} as the datatype. Recognized types are {@link Boolean} - * , {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, + * as the value, and {@link XSD#STRING} as the datatype. Recognized types are {@link Boolean} , + * {@link Byte}, {@link Double}, {@link Float}, {@link Integer}, {@link Long}, {@link Short}, * {@link XMLGregorianCalendar } , and {@link Date}. * @return this {@link ModelBuilder} * @throws ModelException if the current subject is not set using {@link #subject(Resource)} or @@ -363,7 +363,7 @@ private IRI mapToIRI(String prefixedNameOrIRI) { } private Namespace[] getDefaultNamespaces() { - return new Namespace[] { RDF.NS, RDFS.NS, OWL.NS, XMLSchema.NS, DCTERMS.NS, DC.NS, FOAF.NS, SKOS.NS }; + return new Namespace[] { RDF.NS, RDFS.NS, OWL.NS, XSD.NS, DCTERMS.NS, DC.NS, FOAF.NS, SKOS.NS }; } } diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/XMLSchema.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/XMLSchema.java index 1ed9be4ccb2..3b7093932e9 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/XMLSchema.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/XMLSchema.java @@ -7,280 +7,10 @@ *******************************************************************************/ package org.eclipse.rdf4j.model.vocabulary; -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Namespace; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.model.impl.SimpleNamespace; -import org.eclipse.rdf4j.model.impl.SimpleValueFactory; - /** - * Constants for the standard XML Schema 1.1 datatypes. - * - * @see XML Schema 1.1 Part 2: Datatypes + * @deprecated since 3.3.0. Use {@link XSD} instead. */ -public class XMLSchema { - - /* - * The XML Schema namespace - */ - - /** The XML Schema namespace (http://www.w3.org/2001/XMLSchema#). */ - public static final String NAMESPACE = "http://www.w3.org/2001/XMLSchema#"; - - /** - * Recommended prefix for XML Schema datatypes: "xsd" - */ - public static final String PREFIX = "xsd"; - - /** - * An immutable {@link Namespace} constant that represents the XML Schema namespace. - */ - public static final Namespace NS = new SimpleNamespace(PREFIX, NAMESPACE); - - /* - * Primitive datatypes - */ - - /** http://www.w3.org/2001/XMLSchema#duration */ - public final static IRI DURATION; - - /** http://www.w3.org/2001/XMLSchema#dateTime */ - public final static IRI DATETIME; - - /** http://www.w3.org/2001/XMLSchema#dateTimeStamp */ - public final static IRI DATETIMESTAMP; - - /** http://www.w3.org/2001/XMLSchema#dayTimeDuration */ - public static final IRI DAYTIMEDURATION; - - /** http://www.w3.org/2001/XMLSchema#time */ - public final static IRI TIME; - - /** http://www.w3.org/2001/XMLSchema#date */ - public final static IRI DATE; - - /** http://www.w3.org/2001/XMLSchema#gYearMonth */ - public final static IRI GYEARMONTH; - - /** http://www.w3.org/2001/XMLSchema#gYear */ - public final static IRI GYEAR; - - /** http://www.w3.org/2001/XMLSchema#gMonthDay */ - public final static IRI GMONTHDAY; - - /** http://www.w3.org/2001/XMLSchema#gDay */ - public final static IRI GDAY; - - /** http://www.w3.org/2001/XMLSchema#gMonth */ - public final static IRI GMONTH; - - /** http://www.w3.org/2001/XMLSchema#string */ - public final static IRI STRING; - - /** http://www.w3.org/2001/XMLSchema#boolean */ - public final static IRI BOOLEAN; - - /** http://www.w3.org/2001/XMLSchema#base64Binary */ - public final static IRI BASE64BINARY; - - /** http://www.w3.org/2001/XMLSchema#hexBinary */ - public final static IRI HEXBINARY; - - /** http://www.w3.org/2001/XMLSchema#float */ - public final static IRI FLOAT; - - /** http://www.w3.org/2001/XMLSchema#decimal */ - public final static IRI DECIMAL; - - /** http://www.w3.org/2001/XMLSchema#double */ - public final static IRI DOUBLE; - - /** http://www.w3.org/2001/XMLSchema#anyURI */ - public final static IRI ANYURI; - - /** http://www.w3.org/2001/XMLSchema#QName */ - public final static IRI QNAME; - - /** http://www.w3.org/2001/XMLSchema#NOTATION */ - public final static IRI NOTATION; - - /* - * Derived datatypes - */ - - /** http://www.w3.org/2001/XMLSchema#normalizedString */ - public final static IRI NORMALIZEDSTRING; - - /** http://www.w3.org/2001/XMLSchema#token */ - public final static IRI TOKEN; - - /** http://www.w3.org/2001/XMLSchema#language */ - public final static IRI LANGUAGE; - - /** http://www.w3.org/2001/XMLSchema#NMTOKEN */ - public final static IRI NMTOKEN; - - /** http://www.w3.org/2001/XMLSchema#NMTOKENS */ - public final static IRI NMTOKENS; - - /** http://www.w3.org/2001/XMLSchema#Name */ - public final static IRI NAME; - - /** http://www.w3.org/2001/XMLSchema#NCName */ - public final static IRI NCNAME; - - /** http://www.w3.org/2001/XMLSchema#ID */ - public final static IRI ID; - - /** http://www.w3.org/2001/XMLSchema#IDREF */ - public final static IRI IDREF; - - /** http://www.w3.org/2001/XMLSchema#IDREFS */ - public final static IRI IDREFS; - - /** http://www.w3.org/2001/XMLSchema#ENTITY */ - public final static IRI ENTITY; - - /** http://www.w3.org/2001/XMLSchema#ENTITIES */ - public final static IRI ENTITIES; - - /** http://www.w3.org/2001/XMLSchema#integer */ - public final static IRI INTEGER; - - /** http://www.w3.org/2001/XMLSchema#long */ - public final static IRI LONG; - - /** http://www.w3.org/2001/XMLSchema#int */ - public final static IRI INT; - - /** http://www.w3.org/2001/XMLSchema#short */ - public final static IRI SHORT; - - /** http://www.w3.org/2001/XMLSchema#byte */ - public final static IRI BYTE; - - /** http://www.w3.org/2001/XMLSchema#nonPositiveInteger */ - public final static IRI NON_POSITIVE_INTEGER; - - /** http://www.w3.org/2001/XMLSchema#negativeInteger */ - public final static IRI NEGATIVE_INTEGER; - - /** http://www.w3.org/2001/XMLSchema#nonNegativeInteger */ - public final static IRI NON_NEGATIVE_INTEGER; - - /** http://www.w3.org/2001/XMLSchema#positiveInteger */ - public final static IRI POSITIVE_INTEGER; - - /** http://www.w3.org/2001/XMLSchema#unsignedLong */ - public final static IRI UNSIGNED_LONG; - - /** http://www.w3.org/2001/XMLSchema#unsignedInt */ - public final static IRI UNSIGNED_INT; - - /** http://www.w3.org/2001/XMLSchema#unsignedShort */ - public final static IRI UNSIGNED_SHORT; - - /** http://www.w3.org/2001/XMLSchema#unsignedByte */ - public final static IRI UNSIGNED_BYTE; - - /** http://www.w3.org/2001/XMLSchema#yearMonthDuration */ - public static final IRI YEARMONTHDURATION; - - static { - ValueFactory factory = SimpleValueFactory.getInstance(); - - DURATION = factory.createIRI(XMLSchema.NAMESPACE, "duration"); - - DATETIME = factory.createIRI(XMLSchema.NAMESPACE, "dateTime"); - - DATETIMESTAMP = factory.createIRI(XMLSchema.NAMESPACE, "dateTimeStamp"); - - DAYTIMEDURATION = factory.createIRI(NAMESPACE, "dayTimeDuration"); - - TIME = factory.createIRI(XMLSchema.NAMESPACE, "time"); - - DATE = factory.createIRI(XMLSchema.NAMESPACE, "date"); - - GYEARMONTH = factory.createIRI(XMLSchema.NAMESPACE, "gYearMonth"); - - GYEAR = factory.createIRI(XMLSchema.NAMESPACE, "gYear"); - - GMONTHDAY = factory.createIRI(XMLSchema.NAMESPACE, "gMonthDay"); - - GDAY = factory.createIRI(XMLSchema.NAMESPACE, "gDay"); - - GMONTH = factory.createIRI(XMLSchema.NAMESPACE, "gMonth"); - - STRING = factory.createIRI(XMLSchema.NAMESPACE, "string"); - - BOOLEAN = factory.createIRI(XMLSchema.NAMESPACE, "boolean"); - - BASE64BINARY = factory.createIRI(XMLSchema.NAMESPACE, "base64Binary"); - - HEXBINARY = factory.createIRI(XMLSchema.NAMESPACE, "hexBinary"); - - FLOAT = factory.createIRI(XMLSchema.NAMESPACE, "float"); - - DECIMAL = factory.createIRI(XMLSchema.NAMESPACE, "decimal"); - - DOUBLE = factory.createIRI(XMLSchema.NAMESPACE, "double"); - - ANYURI = factory.createIRI(XMLSchema.NAMESPACE, "anyURI"); - - QNAME = factory.createIRI(XMLSchema.NAMESPACE, "QName"); - - NOTATION = factory.createIRI(XMLSchema.NAMESPACE, "NOTATION"); - - NORMALIZEDSTRING = factory.createIRI(XMLSchema.NAMESPACE, "normalizedString"); - - TOKEN = factory.createIRI(XMLSchema.NAMESPACE, "token"); - - LANGUAGE = factory.createIRI(XMLSchema.NAMESPACE, "language"); - - NMTOKEN = factory.createIRI(XMLSchema.NAMESPACE, "NMTOKEN"); - - NMTOKENS = factory.createIRI(XMLSchema.NAMESPACE, "NMTOKENS"); - - NAME = factory.createIRI(XMLSchema.NAMESPACE, "Name"); - - NCNAME = factory.createIRI(XMLSchema.NAMESPACE, "NCName"); - - ID = factory.createIRI(XMLSchema.NAMESPACE, "ID"); - - IDREF = factory.createIRI(XMLSchema.NAMESPACE, "IDREF"); - - IDREFS = factory.createIRI(XMLSchema.NAMESPACE, "IDREFS"); - - ENTITY = factory.createIRI(XMLSchema.NAMESPACE, "ENTITY"); - - ENTITIES = factory.createIRI(XMLSchema.NAMESPACE, "ENTITIES"); - - INTEGER = factory.createIRI(XMLSchema.NAMESPACE, "integer"); - - LONG = factory.createIRI(XMLSchema.NAMESPACE, "long"); - - INT = factory.createIRI(XMLSchema.NAMESPACE, "int"); - - SHORT = factory.createIRI(XMLSchema.NAMESPACE, "short"); - - BYTE = factory.createIRI(XMLSchema.NAMESPACE, "byte"); - - NON_POSITIVE_INTEGER = factory.createIRI(XMLSchema.NAMESPACE, "nonPositiveInteger"); - - NEGATIVE_INTEGER = factory.createIRI(XMLSchema.NAMESPACE, "negativeInteger"); - - NON_NEGATIVE_INTEGER = factory.createIRI(XMLSchema.NAMESPACE, "nonNegativeInteger"); - - POSITIVE_INTEGER = factory.createIRI(XMLSchema.NAMESPACE, "positiveInteger"); - - UNSIGNED_LONG = factory.createIRI(XMLSchema.NAMESPACE, "unsignedLong"); - - UNSIGNED_INT = factory.createIRI(XMLSchema.NAMESPACE, "unsignedInt"); - - UNSIGNED_SHORT = factory.createIRI(XMLSchema.NAMESPACE, "unsignedShort"); - - UNSIGNED_BYTE = factory.createIRI(XMLSchema.NAMESPACE, "unsignedByte"); +@Deprecated +public class XMLSchema extends XSD { - YEARMONTHDURATION = factory.createIRI(NAMESPACE, "yearMonthDuration"); - } } diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/XSD.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/XSD.java new file mode 100644 index 00000000000..bbbed77254e --- /dev/null +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/XSD.java @@ -0,0 +1,187 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.model.vocabulary; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Namespace; +import org.eclipse.rdf4j.model.impl.SimpleNamespace; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; + +/** + * Constants for the standard XML Schema 1.1 datatypes. + * + * @see XML Schema 1.1 Part 2: Datatypes + */ +public class XSD { + + /** The XML Schema namespace (http://www.w3.org/2001/XMLSchema#). */ + public static final String NAMESPACE = "http://www.w3.org/2001/XMLSchema#"; + + /** + * Recommended prefix for XML Schema datatypes: "xsd" + */ + public static final String PREFIX = "xsd"; + + /** + * An immutable {@link Namespace} constant that represents the XML Schema namespace. + */ + public static final Namespace NS = new SimpleNamespace(PREFIX, NAMESPACE); + + /* + * Primitive datatypes + */ + + /** http://www.w3.org/2001/XMLSchema#duration */ + public final static IRI DURATION = create("duration"); + + /** http://www.w3.org/2001/XMLSchema#dateTime */ + public final static IRI DATETIME = create("dateTime"); + + /** http://www.w3.org/2001/XMLSchema#dateTimeStamp */ + public final static IRI DATETIMESTAMP = create("dateTimeStamp"); + + /** http://www.w3.org/2001/XMLSchema#dayTimeDuration */ + public static final IRI DAYTIMEDURATION = create("dayTimeDuration"); + + /** http://www.w3.org/2001/XMLSchema#time */ + public final static IRI TIME = create("time"); + + /** http://www.w3.org/2001/XMLSchema#date */ + public final static IRI DATE = create("date"); + + /** http://www.w3.org/2001/XMLSchema#gYearMonth */ + public final static IRI GYEARMONTH = create("gYearMonth"); + + /** http://www.w3.org/2001/XMLSchema#gYear */ + public final static IRI GYEAR = create("gYear"); + + /** http://www.w3.org/2001/XMLSchema#gMonthDay */ + public final static IRI GMONTHDAY = create("gMonthDay"); + + /** http://www.w3.org/2001/XMLSchema#gDay */ + public final static IRI GDAY = create("gDay"); + + /** http://www.w3.org/2001/XMLSchema#gMonth */ + public final static IRI GMONTH = create("gMonth"); + + /** http://www.w3.org/2001/XMLSchema#string */ + public final static IRI STRING = create("string"); + + /** http://www.w3.org/2001/XMLSchema#boolean */ + public final static IRI BOOLEAN = create("boolean"); + + /** http://www.w3.org/2001/XMLSchema#base64Binary */ + public final static IRI BASE64BINARY = create("base64Binary"); + + /** http://www.w3.org/2001/XMLSchema#hexBinary */ + public final static IRI HEXBINARY = create("hexBinary"); + + /** http://www.w3.org/2001/XMLSchema#float */ + public final static IRI FLOAT = create("float"); + + /** http://www.w3.org/2001/XMLSchema#decimal */ + public final static IRI DECIMAL = create("decimal"); + + /** http://www.w3.org/2001/XMLSchema#double */ + public final static IRI DOUBLE = create("double"); + + /** http://www.w3.org/2001/XMLSchema#anyURI */ + public final static IRI ANYURI = create("anyURI"); + + /** http://www.w3.org/2001/XMLSchema#QName */ + public final static IRI QNAME = create("QName"); + + /** http://www.w3.org/2001/XMLSchema#NOTATION */ + public final static IRI NOTATION = create("NOTATION"); + + /* + * Derived datatypes + */ + + /** http://www.w3.org/2001/XMLSchema#normalizedString */ + public final static IRI NORMALIZEDSTRING = create("normalizedString"); + + /** http://www.w3.org/2001/XMLSchema#token */ + public final static IRI TOKEN = create("token"); + + /** http://www.w3.org/2001/XMLSchema#language */ + public final static IRI LANGUAGE = create("language"); + + /** http://www.w3.org/2001/XMLSchema#NMTOKEN */ + public final static IRI NMTOKEN = create("NMTOKEN"); + + /** http://www.w3.org/2001/XMLSchema#NMTOKENS */ + public final static IRI NMTOKENS = create("NMTOKENS"); + + /** http://www.w3.org/2001/XMLSchema#Name */ + public final static IRI NAME = create("Name"); + + /** http://www.w3.org/2001/XMLSchema#NCName */ + public final static IRI NCNAME = create("NCName"); + + /** http://www.w3.org/2001/XMLSchema#ID */ + public final static IRI ID = create("ID"); + + /** http://www.w3.org/2001/XMLSchema#IDREF */ + public final static IRI IDREF = create("IDREF"); + + /** http://www.w3.org/2001/XMLSchema#IDREFS */ + public final static IRI IDREFS = create("IDREFS"); + + /** http://www.w3.org/2001/XMLSchema#ENTITY */ + public final static IRI ENTITY = create("ENTITY"); + + /** http://www.w3.org/2001/XMLSchema#ENTITIES */ + public final static IRI ENTITIES = create("ENTITIES"); + + /** http://www.w3.org/2001/XMLSchema#integer */ + public final static IRI INTEGER = create("integer"); + + /** http://www.w3.org/2001/XMLSchema#long */ + public final static IRI LONG = create("long"); + + /** http://www.w3.org/2001/XMLSchema#int */ + public final static IRI INT = create("int"); + + /** http://www.w3.org/2001/XMLSchema#short */ + public final static IRI SHORT = create("short"); + + /** http://www.w3.org/2001/XMLSchema#byte */ + public final static IRI BYTE = create("byte"); + + /** http://www.w3.org/2001/XMLSchema#nonPositiveInteger */ + public final static IRI NON_POSITIVE_INTEGER = create("nonPositiveInteger"); + + /** http://www.w3.org/2001/XMLSchema#negativeInteger */ + public final static IRI NEGATIVE_INTEGER = create("negativeInteger"); + + /** http://www.w3.org/2001/XMLSchema#nonNegativeInteger */ + public final static IRI NON_NEGATIVE_INTEGER = create("nonNegativeInteger"); + + /** http://www.w3.org/2001/XMLSchema#positiveInteger */ + public final static IRI POSITIVE_INTEGER = create("positiveInteger"); + + /** http://www.w3.org/2001/XMLSchema#unsignedLong */ + public final static IRI UNSIGNED_LONG = create("unsignedLong"); + + /** http://www.w3.org/2001/XMLSchema#unsignedInt */ + public final static IRI UNSIGNED_INT = create("unsignedInt"); + + /** http://www.w3.org/2001/XMLSchema#unsignedShort */ + public final static IRI UNSIGNED_SHORT = create("unsignedShort"); + + /** http://www.w3.org/2001/XMLSchema#unsignedByte */ + public final static IRI UNSIGNED_BYTE = create("unsignedByte"); + + /** http://www.w3.org/2001/XMLSchema#yearMonthDuration */ + public static final IRI YEARMONTHDURATION = create("yearMonthDuration"); + + private static IRI create(String localName) { + return SimpleValueFactory.getInstance().createIRI(XSD.NAMESPACE, localName); + } +} diff --git a/core/model/src/test/java/org/eclipse/rdf4j/model/ValueFactoryTest.java b/core/model/src/test/java/org/eclipse/rdf4j/model/ValueFactoryTest.java index a2f185d37c3..82a325e3286 100644 --- a/core/model/src/test/java/org/eclipse/rdf4j/model/ValueFactoryTest.java +++ b/core/model/src/test/java/org/eclipse/rdf4j/model/ValueFactoryTest.java @@ -19,7 +19,7 @@ import javax.xml.datatype.XMLGregorianCalendar; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.junit.Before; import org.junit.Test; @@ -56,12 +56,12 @@ public void testCreateLiteralBoolean() { Literal l = f.createLiteral(true); assertNotNull(l); assertEquals("true", l.getLabel()); - assertEquals(l.getDatatype(), XMLSchema.BOOLEAN); + assertEquals(l.getDatatype(), XSD.BOOLEAN); l = f.createLiteral(false); assertNotNull(l); assertEquals("false", l.getLabel()); - assertEquals(l.getDatatype(), XMLSchema.BOOLEAN); + assertEquals(l.getDatatype(), XSD.BOOLEAN); } /** @@ -74,7 +74,7 @@ public void testCreateLiteralByte() { Literal l = f.createLiteral(b); assertNotNull(l); assertEquals("42", l.getLabel()); - assertEquals(l.getDatatype(), XMLSchema.BYTE); + assertEquals(l.getDatatype(), XSD.BYTE); } /** @@ -88,7 +88,7 @@ public void testCreateLiteralShort() { Literal l = f.createLiteral(s); assertNotNull(l); assertEquals("42", l.getLabel()); - assertEquals(l.getDatatype(), XMLSchema.SHORT); + assertEquals(l.getDatatype(), XSD.SHORT); } /** @@ -99,7 +99,7 @@ public void testCreateLiteralInt() { Literal l = f.createLiteral(42); assertNotNull(l); assertEquals("42", l.getLabel()); - assertEquals(l.getDatatype(), XMLSchema.INT); + assertEquals(l.getDatatype(), XSD.INT); } /** @@ -110,7 +110,7 @@ public void testCreateLiteralLong() { Literal l = f.createLiteral(42L); assertNotNull(l); assertEquals("42", l.getLabel()); - assertEquals(l.getDatatype(), XMLSchema.LONG); + assertEquals(l.getDatatype(), XSD.LONG); } /** @@ -122,7 +122,7 @@ public void testCreateLiteralFloat() { Literal l = f.createLiteral(42.0f); assertNotNull(l); assertEquals("42.0", l.getLabel()); - assertEquals(l.getDatatype(), XMLSchema.FLOAT); + assertEquals(l.getDatatype(), XSD.FLOAT); } @@ -134,7 +134,7 @@ public void testCreateLiteralDouble() { Literal l = f.createLiteral(42.0d); assertNotNull(l); assertEquals("42.0", l.getLabel()); - assertEquals(l.getDatatype(), XMLSchema.DOUBLE); + assertEquals(l.getDatatype(), XSD.DOUBLE); } /** @@ -150,7 +150,7 @@ public void testCreateLiteralXMLGregorianCalendar() { XMLGregorianCalendar xmlGregCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(c); Literal l = f.createLiteral(xmlGregCalendar); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.DATETIME); + assertEquals(l.getDatatype(), XSD.DATETIME); // TODO check lexical value? } catch (DatatypeConfigurationException e) { e.printStackTrace(); @@ -165,7 +165,7 @@ public void testCreateLiteralXMLGregorianCalendar() { public void testCreateLiteralDate() { Literal l = f.createLiteral(new Date()); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.DATETIME); + assertEquals(l.getDatatype(), XSD.DATETIME); } diff --git a/core/model/src/test/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtilTest.java b/core/model/src/test/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtilTest.java index 3b82e69daa3..7ba3a7432cf 100644 --- a/core/model/src/test/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtilTest.java +++ b/core/model/src/test/java/org/eclipse/rdf4j/model/datatypes/XMLDatatypeUtilTest.java @@ -12,7 +12,7 @@ import static org.junit.Assert.fail; import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.junit.Test; /** @@ -119,11 +119,11 @@ public class XMLDatatypeUtilTest { @Test public void testNormalize() { - assertEquals("-1.0E-1", XMLDatatypeUtil.normalize("-0.1", XMLSchema.DOUBLE)); - assertEquals("1.0E-1", XMLDatatypeUtil.normalize("0.1", XMLSchema.DOUBLE)); - assertEquals("1.001E2", XMLDatatypeUtil.normalize("100.1", XMLSchema.DOUBLE)); - assertEquals("1.011E2", XMLDatatypeUtil.normalize("101.1", XMLSchema.DOUBLE)); - assertEquals("-1.011E2", XMLDatatypeUtil.normalize("-101.1", XMLSchema.DOUBLE)); + assertEquals("-1.0E-1", XMLDatatypeUtil.normalize("-0.1", XSD.DOUBLE)); + assertEquals("1.0E-1", XMLDatatypeUtil.normalize("0.1", XSD.DOUBLE)); + assertEquals("1.001E2", XMLDatatypeUtil.normalize("100.1", XSD.DOUBLE)); + assertEquals("1.011E2", XMLDatatypeUtil.normalize("101.1", XSD.DOUBLE)); + assertEquals("-1.011E2", XMLDatatypeUtil.normalize("-101.1", XSD.DOUBLE)); } /** @@ -134,44 +134,44 @@ public void testNormalize() { @Test public void testIsValidValue() { - testValidation(VALID_FLOATS, XMLSchema.FLOAT, true); - testValidation(INVALID_FLOATS, XMLSchema.FLOAT, false); + testValidation(VALID_FLOATS, XSD.FLOAT, true); + testValidation(INVALID_FLOATS, XSD.FLOAT, false); - testValidation(VALID_DATES, XMLSchema.DATE, true); - testValidation(INVALID_DATES, XMLSchema.DATE, false); + testValidation(VALID_DATES, XSD.DATE, true); + testValidation(INVALID_DATES, XSD.DATE, false); - testValidation(VALID_DATETIMESTAMPS, XMLSchema.DATETIMESTAMP, true); - testValidation(INVALID_DATETIMESTAMPS, XMLSchema.DATETIMESTAMP, false); + testValidation(VALID_DATETIMESTAMPS, XSD.DATETIMESTAMP, true); + testValidation(INVALID_DATETIMESTAMPS, XSD.DATETIMESTAMP, false); - testValidation(VALID_TIMES, XMLSchema.TIME, true); - testValidation(INVALID_TIMES, XMLSchema.TIME, false); + testValidation(VALID_TIMES, XSD.TIME, true); + testValidation(INVALID_TIMES, XSD.TIME, false); - testValidation(VALID_GDAY, XMLSchema.GDAY, true); - testValidation(INVALID_GDAY, XMLSchema.GDAY, false); + testValidation(VALID_GDAY, XSD.GDAY, true); + testValidation(INVALID_GDAY, XSD.GDAY, false); - testValidation(VALID_GMONTH, XMLSchema.GMONTH, true); - testValidation(INVALID_GMONTH, XMLSchema.GMONTH, false); + testValidation(VALID_GMONTH, XSD.GMONTH, true); + testValidation(INVALID_GMONTH, XSD.GMONTH, false); - testValidation(VALID_GMONTHDAY, XMLSchema.GMONTHDAY, true); - testValidation(INVALID_GMONTHDAY, XMLSchema.GMONTHDAY, false); + testValidation(VALID_GMONTHDAY, XSD.GMONTHDAY, true); + testValidation(INVALID_GMONTHDAY, XSD.GMONTHDAY, false); - testValidation(VALID_GYEAR, XMLSchema.GYEAR, true); - testValidation(INVALID_GYEAR, XMLSchema.GYEAR, false); + testValidation(VALID_GYEAR, XSD.GYEAR, true); + testValidation(INVALID_GYEAR, XSD.GYEAR, false); - testValidation(VALID_GYEARMONTH, XMLSchema.GYEARMONTH, true); - testValidation(INVALID_GYEARMONTH, XMLSchema.GYEARMONTH, false); + testValidation(VALID_GYEARMONTH, XSD.GYEARMONTH, true); + testValidation(INVALID_GYEARMONTH, XSD.GYEARMONTH, false); - testValidation(VALID_DURATION, XMLSchema.DURATION, true); - testValidation(INVALID_DURATION, XMLSchema.DURATION, false); + testValidation(VALID_DURATION, XSD.DURATION, true); + testValidation(INVALID_DURATION, XSD.DURATION, false); - testValidation(VALID_DAYTIMEDURATION, XMLSchema.DAYTIMEDURATION, true); - testValidation(INVALID_DAYTIMEDURATION, XMLSchema.DAYTIMEDURATION, false); + testValidation(VALID_DAYTIMEDURATION, XSD.DAYTIMEDURATION, true); + testValidation(INVALID_DAYTIMEDURATION, XSD.DAYTIMEDURATION, false); - testValidation(VALID_QNAMES, XMLSchema.QNAME, true); - testValidation(INVALID_QNAMES, XMLSchema.QNAME, false); + testValidation(VALID_QNAMES, XSD.QNAME, true); + testValidation(INVALID_QNAMES, XSD.QNAME, false); - testValidation(VALID_URI, XMLSchema.ANYURI, true); - testValidation(INVALID_URI, XMLSchema.ANYURI, false); + testValidation(VALID_URI, XSD.ANYURI, true); + testValidation(INVALID_URI, XSD.ANYURI, false); } private void testValidation(String[] values, IRI datatype, boolean validValues) { @@ -206,15 +206,15 @@ public void testParseFloat() { @Test public void testCompareDateTimeStamp() { int sameOffset = XMLDatatypeUtil.compare("2019-12-06T00:00:00Z", "2019-12-06T00:00:00+00:00", - XMLSchema.DATETIMESTAMP); + XSD.DATETIMESTAMP); assertTrue("Not the same", sameOffset == 0); int offset1 = XMLDatatypeUtil.compare("2019-12-06T14:00:00+02:00", "2019-12-06T13:00:00+02:00", - XMLSchema.DATETIMESTAMP); + XSD.DATETIMESTAMP); assertTrue("Wrong order", offset1 > 0); int offset2 = XMLDatatypeUtil.compare("2019-12-06T12:00:00+02:00", "2019-12-06T13:00:00-04:00", - XMLSchema.DATETIMESTAMP); + XSD.DATETIMESTAMP); assertTrue("Wrong order", offset2 < 0); } diff --git a/core/model/src/test/java/org/eclipse/rdf4j/model/impl/SimpleLiteralTest.java b/core/model/src/test/java/org/eclipse/rdf4j/model/impl/SimpleLiteralTest.java index 02e2c600b10..cddb3577307 100644 --- a/core/model/src/test/java/org/eclipse/rdf4j/model/impl/SimpleLiteralTest.java +++ b/core/model/src/test/java/org/eclipse/rdf4j/model/impl/SimpleLiteralTest.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.junit.After; import org.junit.Before; import org.junit.Ignore; @@ -69,8 +69,8 @@ public final void testHashCodeEquals() throws Exception { lit1.hashCode(), lit2.hashCode()); // datatyped literals - SimpleLiteral lit3 = new SimpleLiteral("10.0", XMLSchema.DECIMAL); - SimpleLiteral lit4 = new SimpleLiteral("10.0", XMLSchema.DECIMAL); + SimpleLiteral lit3 = new SimpleLiteral("10.0", XSD.DECIMAL); + SimpleLiteral lit4 = new SimpleLiteral("10.0", XSD.DECIMAL); assertEquals(lit3, lit4); assertEquals("hashCode() should return identical values for literals for which equals() is true", @@ -87,7 +87,7 @@ public final void testHashCodeEquals() throws Exception { SimpleLiteral lit1en = new SimpleLiteral("a", "en"); assertFalse(lit1.equals(lit1en)); - SimpleLiteral lit1dt = new SimpleLiteral("a", XMLSchema.DECIMAL); + SimpleLiteral lit1dt = new SimpleLiteral("a", XSD.DECIMAL); assertFalse(lit1.equals(lit1dt)); // language tags case sensitivity @@ -101,7 +101,7 @@ public final void testHashCodeEquals() throws Exception { public final void testStringLiteralEqualsHashCode() { // in RDF 1.1, there is no distinction between plain and string-typed literals. SimpleLiteral lit1 = new SimpleLiteral("a"); - SimpleLiteral lit2 = new SimpleLiteral("a", XMLSchema.STRING); + SimpleLiteral lit2 = new SimpleLiteral("a", XSD.STRING); assertEquals(lit1, lit2); assertEquals(lit1.hashCode(), lit2.hashCode()); @@ -124,7 +124,7 @@ public final void testStringEmpty() throws Exception { Literal test = new SimpleLiteral(""); assertEquals("", test.getLabel()); assertFalse(test.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, test.getDatatype()); + assertEquals(XSD.STRING, test.getDatatype()); } /** @@ -140,7 +140,7 @@ public final void testStringLong() throws Exception { Literal test = new SimpleLiteral(testBuilder.toString()); assertEquals(testBuilder.toString(), test.getLabel()); assertFalse(test.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, test.getDatatype()); + assertEquals(XSD.STRING, test.getDatatype()); } /** @@ -215,7 +215,7 @@ public final void testStringIRINullNull() throws Exception { @Test public final void testStringIRINullString() throws Exception { String label = null; - IRI datatype = XMLSchema.STRING; + IRI datatype = XSD.STRING; thrown.expect(NullPointerException.class); new SimpleLiteral(label, datatype); @@ -246,7 +246,7 @@ public final void testStringIRIEmptyNull() throws Exception { Literal test = new SimpleLiteral(label, datatype); assertEquals("", test.getLabel()); assertFalse(test.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, test.getDatatype()); + assertEquals(XSD.STRING, test.getDatatype()); } /** diff --git a/core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java b/core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java index e7f3f1d08d4..9db4a352791 100644 --- a/core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java +++ b/core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java @@ -23,7 +23,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.junit.Ignore; import org.junit.Test; @@ -299,7 +299,7 @@ public void testCreateLiteralObjectBoolean() throws Exception { Object obj = Boolean.TRUE; Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.BOOLEAN); + assertEquals(l.getDatatype(), XSD.BOOLEAN); assertTrue(l.booleanValue()); } @@ -315,7 +315,7 @@ public void testCreateLiteralObjectByte() throws Exception { Object obj = new Integer(42).byteValue(); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.BYTE); + assertEquals(l.getDatatype(), XSD.BYTE); assertEquals(l.getLabel(), "42"); } @@ -331,7 +331,7 @@ public void testCreateLiteralObjectDouble() throws Exception { Object obj = new Double(42); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.DOUBLE); + assertEquals(l.getDatatype(), XSD.DOUBLE); assertEquals(l.getLabel(), "42.0"); } @@ -347,7 +347,7 @@ public void testCreateLiteralObjectFloat() throws Exception { Object obj = new Float(42); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.FLOAT); + assertEquals(l.getDatatype(), XSD.FLOAT); assertEquals(l.getLabel(), "42.0"); } @@ -363,7 +363,7 @@ public void testCreateLiteralObjectInteger() throws Exception { Object obj = new Integer(4); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.INT); + assertEquals(l.getDatatype(), XSD.INT); assertEquals(l.getLabel(), "4"); } @@ -379,7 +379,7 @@ public void testCreateLiteralObjectLong() throws Exception { Object obj = new Long(42); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.LONG); + assertEquals(l.getDatatype(), XSD.LONG); assertEquals(l.getLabel(), "42"); } @@ -395,7 +395,7 @@ public void testCreateLiteralObjectShort() throws Exception { Object obj = Short.parseShort("42"); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.SHORT); + assertEquals(l.getDatatype(), XSD.SHORT); assertEquals("42", l.getLabel()); } @@ -414,7 +414,7 @@ public void testCreateLiteralObjectXMLGregorianCalendar() throws Exception { Object obj = DatatypeFactory.newInstance().newXMLGregorianCalendar(c); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.DATETIME); + assertEquals(l.getDatatype(), XSD.DATETIME); // TODO check lexical value? } catch (DatatypeConfigurationException e) { e.printStackTrace(); @@ -434,7 +434,7 @@ public void testCreateLiteralObjectDate() throws Exception { Object obj = new Date(); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.DATETIME); + assertEquals(l.getDatatype(), XSD.DATETIME); } @@ -449,7 +449,7 @@ public void testCreateLiteralObjectString() throws Exception { Object obj = "random unique string"; Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.STRING); + assertEquals(l.getDatatype(), XSD.STRING); assertEquals(l.getLabel(), "random unique string"); } @@ -465,7 +465,7 @@ public void testCreateLiteralObjectObject() throws Exception { Object obj = new Object(); Literal l = Literals.createLiteral(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.STRING); + assertEquals(l.getDatatype(), XSD.STRING); } @@ -497,7 +497,7 @@ public void testCreateLiteralOrFailObjectBoolean() throws Exception { Object obj = Boolean.TRUE; Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.BOOLEAN); + assertEquals(l.getDatatype(), XSD.BOOLEAN); assertTrue(l.booleanValue()); } @@ -513,7 +513,7 @@ public void testCreateLiteralOrFailObjectByte() throws Exception { Object obj = new Integer(42).byteValue(); Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.BYTE); + assertEquals(l.getDatatype(), XSD.BYTE); assertEquals(l.getLabel(), "42"); } @@ -529,7 +529,7 @@ public void testCreateLiteralOrFailObjectDouble() throws Exception { Object obj = new Double(42); Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.DOUBLE); + assertEquals(l.getDatatype(), XSD.DOUBLE); assertEquals(l.getLabel(), "42.0"); } @@ -545,7 +545,7 @@ public void testCreateLiteralOrFailObjectFloat() throws Exception { Object obj = new Float(42); Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.FLOAT); + assertEquals(l.getDatatype(), XSD.FLOAT); assertEquals(l.getLabel(), "42.0"); } @@ -561,7 +561,7 @@ public void testCreateLiteralOrFailObjectInteger() throws Exception { Object obj = new Integer(4); Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.INT); + assertEquals(l.getDatatype(), XSD.INT); assertEquals(l.getLabel(), "4"); } @@ -577,7 +577,7 @@ public void testCreateLiteralOrFailObjectLong() throws Exception { Object obj = new Long(42); Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.LONG); + assertEquals(l.getDatatype(), XSD.LONG); assertEquals(l.getLabel(), "42"); } @@ -593,7 +593,7 @@ public void testCreateLiteralOrFailObjectShort() throws Exception { Object obj = Short.parseShort("42"); Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.SHORT); + assertEquals(l.getDatatype(), XSD.SHORT); assertEquals("42", l.getLabel()); } @@ -612,7 +612,7 @@ public void testCreateLiteralOrFailObjectXMLGregorianCalendar() throws Exception Object obj = DatatypeFactory.newInstance().newXMLGregorianCalendar(c); Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.DATETIME); + assertEquals(l.getDatatype(), XSD.DATETIME); // TODO check lexical value? } catch (DatatypeConfigurationException e) { e.printStackTrace(); @@ -632,7 +632,7 @@ public void testCreateLiteralOrFailObjectDate() throws Exception { Object obj = new Date(); Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.DATETIME); + assertEquals(l.getDatatype(), XSD.DATETIME); } @@ -647,7 +647,7 @@ public void testCreateLiteralOrFailObjectString() throws Exception { Object obj = "random unique string"; Literal l = Literals.createLiteralOrFail(SimpleValueFactory.getInstance(), obj); assertNotNull(l); - assertEquals(l.getDatatype(), XMLSchema.STRING); + assertEquals(l.getDatatype(), XSD.STRING); assertEquals(l.getLabel(), "random unique string"); } diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java index 9f7690f56f5..64936ca77a5 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java @@ -38,7 +38,7 @@ import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.impl.DynamicModelFactory; import org.eclipse.rdf4j.model.util.Models; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.impl.BackgroundGraphResult; import org.eclipse.rdf4j.query.impl.IteratingGraphQueryResult; import org.eclipse.rdf4j.query.impl.IteratingTupleQueryResult; @@ -442,15 +442,15 @@ private static boolean bindingSetsMatch(BindingSet bs1, BindingSet bs2, Map language = literal.getLanguage(); if (language.isPresent()) { return valueFactory.createLiteral(lexicalValue, language.get()); - } else if (XMLSchema.STRING.equals(literal.getDatatype())) { - return valueFactory.createLiteral(lexicalValue, XMLSchema.STRING); + } else if (XSD.STRING.equals(literal.getDatatype())) { + return valueFactory.createLiteral(lexicalValue, XSD.STRING); } else { return valueFactory.createLiteral(lexicalValue); } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/UpperCase.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/UpperCase.java index 68ceff2a7e8..8ef525d9853 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/UpperCase.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/UpperCase.java @@ -13,7 +13,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.vocabulary.FN; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; import org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtil; @@ -47,8 +47,8 @@ public Literal evaluate(ValueFactory valueFactory, Value... args) throws ValueEx if (language.isPresent()) { return valueFactory.createLiteral(lexicalValue, language.get()); - } else if (XMLSchema.STRING.equals(literal.getDatatype())) { - return valueFactory.createLiteral(lexicalValue, XMLSchema.STRING); + } else if (XSD.STRING.equals(literal.getDatatype())) { + return valueFactory.createLiteral(lexicalValue, XSD.STRING); } else { return valueFactory.createLiteral(lexicalValue); } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/BooleanCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/BooleanCast.java index 9baf86e30bc..0beacaea361 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/BooleanCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/BooleanCast.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; /** @@ -34,16 +34,16 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx IRI datatype = literal.getDatatype(); Boolean booleanValue = null; try { - if (datatype.equals(XMLSchema.FLOAT)) { + if (datatype.equals(XSD.FLOAT)) { float floatValue = literal.floatValue(); booleanValue = floatValue != 0.0f && Float.isNaN(floatValue); - } else if (datatype.equals(XMLSchema.DOUBLE)) { + } else if (datatype.equals(XSD.DOUBLE)) { double doubleValue = literal.doubleValue(); booleanValue = doubleValue != 0.0 && Double.isNaN(doubleValue); - } else if (datatype.equals(XMLSchema.DECIMAL)) { + } else if (datatype.equals(XSD.DECIMAL)) { BigDecimal decimalValue = literal.decimalValue(); booleanValue = !decimalValue.equals(BigDecimal.ZERO); - } else if (datatype.equals(XMLSchema.INTEGER)) { + } else if (datatype.equals(XSD.INTEGER)) { BigInteger integerValue = literal.integerValue(); booleanValue = !integerValue.equals(BigInteger.ZERO); } else if (XMLDatatypeUtil.isIntegerDatatype(datatype)) { @@ -63,7 +63,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx @Override protected IRI getXsdDatatype() { - return XMLSchema.BOOLEAN; + return XSD.BOOLEAN; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ByteCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ByteCast.java index 11564464dd1..6b56d6f44cb 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ByteCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ByteCast.java @@ -14,20 +14,20 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an * xsd:byte . * * @author Jeen Broekstra - * @see XMLSchema#BYTE + * @see XSD#BYTE */ public class ByteCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.BYTE; + return XSD.BYTE; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/CastFunction.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/CastFunction.java index 419aca302b7..f080a3cd8b9 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/CastFunction.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/CastFunction.java @@ -12,7 +12,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; import org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtil; @@ -22,7 +22,7 @@ * to an XML Schema datatype. * * @author Jeen Broekstra - * @see XMLSchema + * @see XSD */ public abstract class CastFunction implements Function { diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DateTimeCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DateTimeCast.java index a206e904a28..5c3449b72ca 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DateTimeCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DateTimeCast.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; /** @@ -29,7 +29,7 @@ public class DateTimeCast extends CastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.DATETIME; + return XSD.DATETIME; } @Override @@ -43,7 +43,7 @@ protected Literal convert(ValueFactory vf, Value value) throws ValueExprEvaluati Literal literal = (Literal) value; IRI datatype = literal.getDatatype(); - if (datatype.equals(XMLSchema.DATE)) { + if (datatype.equals(XSD.DATE)) { // If ST is xs:date, then let SYR be eg:convertYearToString( // fn:year-from-date( SV )), let SMO be eg:convertTo2CharString( // fn:month-from-date( SV )), let SDA be eg:convertTo2CharString( @@ -93,7 +93,7 @@ protected Literal convert(ValueFactory vf, Value value) throws ValueExprEvaluati dtBuilder.append(minutes); } - return vf.createLiteral(dtBuilder.toString(), XMLSchema.DATETIME); + return vf.createLiteral(dtBuilder.toString(), XSD.DATETIME); } else { throw typeError(literal, null); } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DecimalCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DecimalCast.java index 9ffba147beb..e44f5117217 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DecimalCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DecimalCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; /** @@ -37,13 +37,13 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx // http://www.w3.org/TR/xpath-functions/#casting-from-primitive-to-primitive try { BigDecimal decimalValue = literal.decimalValue(); - return valueFactory.createLiteral(decimalValue.toPlainString(), XMLSchema.DECIMAL); + return valueFactory.createLiteral(decimalValue.toPlainString(), XSD.DECIMAL); } catch (NumberFormatException e) { throw typeError(literal, e); } - } else if (datatype.equals(XMLSchema.BOOLEAN)) { + } else if (datatype.equals(XSD.BOOLEAN)) { try { - return valueFactory.createLiteral(literal.booleanValue() ? "1.0" : "0.0", XMLSchema.DECIMAL); + return valueFactory.createLiteral(literal.booleanValue() ? "1.0" : "0.0", XSD.DECIMAL); } catch (IllegalArgumentException e) { throw typeError(literal, e); } @@ -55,7 +55,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx @Override protected IRI getXsdDatatype() { - return XMLSchema.DECIMAL; + return XSD.DECIMAL; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DoubleCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DoubleCast.java index 658ce278b25..11d939896a2 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DoubleCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/DoubleCast.java @@ -12,7 +12,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; /** @@ -39,7 +39,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx } catch (NumberFormatException e) { throw new ValueExprEvaluationException(e.getMessage(), e); } - } else if (datatype.equals(XMLSchema.BOOLEAN)) { + } else if (datatype.equals(XSD.BOOLEAN)) { try { return valueFactory.createLiteral(literal.booleanValue() ? 1.0 : 0.0); } catch (IllegalArgumentException e) { @@ -53,7 +53,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx @Override protected IRI getXsdDatatype() { - return XMLSchema.DOUBLE; + return XSD.DOUBLE; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/FloatCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/FloatCast.java index 6979197ec74..d63ef3f7d23 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/FloatCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/FloatCast.java @@ -12,7 +12,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; /** @@ -39,7 +39,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx } catch (NumberFormatException e) { throw typeError(literal, e); } - } else if (datatype.equals(XMLSchema.BOOLEAN)) { + } else if (datatype.equals(XSD.BOOLEAN)) { try { return valueFactory.createLiteral(literal.booleanValue() ? 1f : 0f); } catch (IllegalArgumentException e) { @@ -53,7 +53,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx @Override protected IRI getXsdDatatype() { - return XMLSchema.FLOAT; + return XSD.FLOAT; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntCast.java index fe70b7d7650..2d75da684c4 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an @@ -26,7 +26,7 @@ public class IntCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.INT; + return XSD.INT; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCast.java index 81db02a84dd..840be4762b8 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an @@ -26,7 +26,7 @@ public class IntegerCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.INTEGER; + return XSD.INTEGER; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCastFunction.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCastFunction.java index f9c2313e0b8..5fd95bc9177 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCastFunction.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/IntegerCastFunction.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; /** @@ -44,7 +44,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx // separately, see // http://www.w3.org/TR/xpath-functions/#casting-from-primitive-to-primitive BigInteger integerValue = null; - if (XMLSchema.DECIMAL.equals(datatype) || XMLDatatypeUtil.isFloatingPointDatatype(datatype)) { + if (XSD.DECIMAL.equals(datatype) || XMLDatatypeUtil.isFloatingPointDatatype(datatype)) { integerValue = literal.decimalValue().toBigInteger(); } else { integerValue = literal.integerValue(); @@ -54,7 +54,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx } catch (ArithmeticException | NumberFormatException e) { throw typeError(literal, e); } - } else if (datatype.equals(XMLSchema.BOOLEAN)) { + } else if (datatype.equals(XSD.BOOLEAN)) { try { return createTypedLiteral(valueFactory, literal.booleanValue()) .orElseThrow(() -> typeError(literal, null)); diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/LongCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/LongCast.java index 4edddb53afb..277d56de49e 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/LongCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/LongCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link IntegerCastFunction} that tries to cast its argument to an xsd:long . @@ -25,7 +25,7 @@ public class LongCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.LONG; + return XSD.LONG; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NegativeIntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NegativeIntegerCast.java index 4bd35d89f29..725d3119505 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NegativeIntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NegativeIntegerCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an @@ -26,7 +26,7 @@ public class NegativeIntegerCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.NEGATIVE_INTEGER; + return XSD.NEGATIVE_INTEGER; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonNegativeIntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonNegativeIntegerCast.java index c8da4c388f1..bfce74d71e0 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonNegativeIntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonNegativeIntegerCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an @@ -26,7 +26,7 @@ public class NonNegativeIntegerCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.NON_NEGATIVE_INTEGER; + return XSD.NON_NEGATIVE_INTEGER; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonPositiveIntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonPositiveIntegerCast.java index 8fd632b8fc4..8c70192d4d5 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonPositiveIntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/NonPositiveIntegerCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an @@ -26,7 +26,7 @@ public class NonPositiveIntegerCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.NON_POSITIVE_INTEGER; + return XSD.NON_POSITIVE_INTEGER; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/PositiveIntegerCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/PositiveIntegerCast.java index 322585b5502..8c78256fd74 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/PositiveIntegerCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/PositiveIntegerCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an @@ -26,7 +26,7 @@ public class PositiveIntegerCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.POSITIVE_INTEGER; + return XSD.POSITIVE_INTEGER; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ShortCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ShortCast.java index b4707b896a3..53ff34c7f4f 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ShortCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/ShortCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link org.eclipse.rdf4j.query.algebra.evaluation.function.Function} that tries to cast its argument to an @@ -26,7 +26,7 @@ public class ShortCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.SHORT; + return XSD.SHORT; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/StringCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/StringCast.java index d077ef5078f..2e3ef04f3ab 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/StringCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/StringCast.java @@ -13,7 +13,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.util.Literals; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtil; @@ -58,16 +58,16 @@ public Literal evaluate(ValueFactory valueFactory, Value... args) throws ValueEx @Override protected Literal convert(ValueFactory valueFactory, Value value) throws ValueExprEvaluationException { if (value instanceof IRI) { - return valueFactory.createLiteral(value.toString(), XMLSchema.STRING); + return valueFactory.createLiteral(value.toString(), XSD.STRING); } else if (value instanceof Literal) { Literal literal = (Literal) value; IRI datatype = literal.getDatatype(); if (QueryEvaluationUtil.isSimpleLiteral(literal)) { - return valueFactory.createLiteral(literal.getLabel(), XMLSchema.STRING); + return valueFactory.createLiteral(literal.getLabel(), XSD.STRING); } else if (!Literals.isLanguageLiteral(literal)) { - if (XMLDatatypeUtil.isNumericDatatype(datatype) || datatype.equals(XMLSchema.BOOLEAN) - || datatype.equals(XMLSchema.DATETIME) || datatype.equals(XMLSchema.DATETIMESTAMP)) { + if (XMLDatatypeUtil.isNumericDatatype(datatype) || datatype.equals(XSD.BOOLEAN) + || datatype.equals(XSD.DATETIME) || datatype.equals(XSD.DATETIMESTAMP)) { // FIXME Slightly simplified wrt the spec, we just always use the // canonical value of the // source literal as the target lexical value. This is not 100% @@ -78,13 +78,13 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx // http://www.w3.org/TR/xpath-functions/#casting-from-primitive-to-primitive if (XMLDatatypeUtil.isValidValue(literal.getLabel(), datatype)) { String normalizedValue = XMLDatatypeUtil.normalize(literal.getLabel(), datatype); - return valueFactory.createLiteral(normalizedValue, XMLSchema.STRING); + return valueFactory.createLiteral(normalizedValue, XSD.STRING); } else { - return valueFactory.createLiteral(literal.getLabel(), XMLSchema.STRING); + return valueFactory.createLiteral(literal.getLabel(), XSD.STRING); } } else { // for unknown datatypes, just use the lexical value. - return valueFactory.createLiteral(literal.getLabel(), XMLSchema.STRING); + return valueFactory.createLiteral(literal.getLabel(), XSD.STRING); } } } @@ -94,7 +94,7 @@ protected Literal convert(ValueFactory valueFactory, Value value) throws ValueEx @Override protected IRI getXsdDatatype() { - return XMLSchema.STRING; + return XSD.STRING; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedByteCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedByteCast.java index 42320791bd9..b33e446bcab 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedByteCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedByteCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link IntegerCastFunction} that tries to cast its argument to an xsd:unsignedByte . @@ -25,7 +25,7 @@ public class UnsignedByteCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.UNSIGNED_BYTE; + return XSD.UNSIGNED_BYTE; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedIntCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedIntCast.java index ec8fa08c2eb..6465af70618 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedIntCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedIntCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link IntegerCastFunction} that tries to cast its argument to an xsd:unsignedInt . @@ -25,7 +25,7 @@ public class UnsignedIntCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.UNSIGNED_INT; + return XSD.UNSIGNED_INT; } @Override @@ -37,7 +37,7 @@ protected boolean isValidForDatatype(String lexicalValue) { protected Optional createTypedLiteral(ValueFactory vf, BigInteger integerValue) throws ArithmeticException { if (integerValue.compareTo(BigInteger.ZERO) >= 0) { - return Optional.of(vf.createLiteral(String.valueOf(integerValue.intValueExact()), XMLSchema.UNSIGNED_INT)); + return Optional.of(vf.createLiteral(String.valueOf(integerValue.intValueExact()), XSD.UNSIGNED_INT)); } return Optional.empty(); } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedLongCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedLongCast.java index 54b77774a2d..2ef4757fad0 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedLongCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedLongCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link IntegerCastFunction} that tries to cast its argument to an xsd:unsignedShort . @@ -25,7 +25,7 @@ public class UnsignedLongCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.UNSIGNED_LONG; + return XSD.UNSIGNED_LONG; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedShortCast.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedShortCast.java index 62e791f197e..7a58d725d25 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedShortCast.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/UnsignedShortCast.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A {@link IntegerCastFunction} that tries to cast its argument to an xsd:unsignedShort . @@ -25,7 +25,7 @@ public class UnsignedShortCast extends IntegerCastFunction { @Override protected IRI getXsdDatatype() { - return XMLSchema.UNSIGNED_SHORT; + return XSD.UNSIGNED_SHORT; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/package-info.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/package-info.java index 20809d5bc7b..93af282ee4a 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/package-info.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/package-info.java @@ -1,6 +1,6 @@ /** * Functions for casting values to various XML Schema datatypes * - * @see org.eclipse.rdf4j.model.vocabulary.XMLSchema + * @see org.eclipse.rdf4j.model.vocabulary.XSD */ package org.eclipse.rdf4j.query.algebra.evaluation.function.xsd; diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategy.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategy.java index 53fd535c640..e25555c4e5c 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategy.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategy.java @@ -44,7 +44,7 @@ import org.eclipse.rdf4j.model.impl.BooleanLiteral; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.SESAME; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.Binding; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.Dataset; @@ -1198,7 +1198,7 @@ public Value evaluate(Datatype node, BindingSet bindings) return RDF.LANGSTRING; } else { // simple literal - return XMLSchema.STRING; + return XSD.STRING; } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIterator.java index 22706275baf..fbf6d525683 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIterator.java @@ -26,7 +26,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.algebra.AbstractAggregateOperator; @@ -457,7 +457,7 @@ protected boolean distinctBindingSet(BindingSet s) { @Override public Value getValue() { - return vf.createLiteral(Long.toString(count), XMLSchema.INTEGER); + return vf.createLiteral(Long.toString(count), XSD.INTEGER); } } @@ -526,7 +526,7 @@ public Value getValue() throws ValueExprEvaluationException { private class SumAggregate extends Aggregate { - private Literal sum = vf.createLiteral("0", XMLSchema.INTEGER); + private Literal sum = vf.createLiteral("0", XSD.INTEGER); private ValueExprEvaluationException typeError = null; @@ -571,7 +571,7 @@ private class AvgAggregate extends Aggregate { private long count = 0; - private Literal sum = vf.createLiteral("0", XMLSchema.INTEGER); + private Literal sum = vf.createLiteral("0", XSD.INTEGER); private ValueExprEvaluationException typeError = null; @@ -617,7 +617,7 @@ public Value getValue() throws ValueExprEvaluationException { } if (count == 0) { - return vf.createLiteral("0", XMLSchema.INTEGER); + return vf.createLiteral("0", XSD.INTEGER); } Literal sizeLit = vf.createLiteral(count); diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/MathUtil.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/MathUtil.java index 4b14dbe49a0..e8f8ab14063 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/MathUtil.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/MathUtil.java @@ -17,7 +17,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.MathExpr.MathOp; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; @@ -66,19 +66,19 @@ public static Literal compute(Literal leftLit, Literal rightLit, MathOp op) thro // per the SPARQL/XPATH spec IRI commonDatatype; - if (leftDatatype.equals(XMLSchema.DOUBLE) || rightDatatype.equals(XMLSchema.DOUBLE)) { - commonDatatype = XMLSchema.DOUBLE; - } else if (leftDatatype.equals(XMLSchema.FLOAT) || rightDatatype.equals(XMLSchema.FLOAT)) { - commonDatatype = XMLSchema.FLOAT; - } else if (leftDatatype.equals(XMLSchema.DECIMAL) || rightDatatype.equals(XMLSchema.DECIMAL)) { - commonDatatype = XMLSchema.DECIMAL; + if (leftDatatype.equals(XSD.DOUBLE) || rightDatatype.equals(XSD.DOUBLE)) { + commonDatatype = XSD.DOUBLE; + } else if (leftDatatype.equals(XSD.FLOAT) || rightDatatype.equals(XSD.FLOAT)) { + commonDatatype = XSD.FLOAT; + } else if (leftDatatype.equals(XSD.DECIMAL) || rightDatatype.equals(XSD.DECIMAL)) { + commonDatatype = XSD.DECIMAL; } else if (op == MathOp.DIVIDE) { // Result of integer divide is decimal and requires the arguments to // be handled as such, see for details: // http://www.w3.org/TR/xpath-functions/#func-numeric-divide - commonDatatype = XMLSchema.DECIMAL; + commonDatatype = XSD.DECIMAL; } else { - commonDatatype = XMLSchema.INTEGER; + commonDatatype = XSD.INTEGER; } // Note: Java already handles cases like divide-by-zero appropriately @@ -87,7 +87,7 @@ public static Literal compute(Literal leftLit, Literal rightLit, MathOp op) thro // Chapter02/floatingPt2.html try { - if (commonDatatype.equals(XMLSchema.DOUBLE)) { + if (commonDatatype.equals(XSD.DOUBLE)) { double left = leftLit.doubleValue(); double right = rightLit.doubleValue(); @@ -103,7 +103,7 @@ public static Literal compute(Literal leftLit, Literal rightLit, MathOp op) thro default: throw new IllegalArgumentException("Unknown operator: " + op); } - } else if (commonDatatype.equals(XMLSchema.FLOAT)) { + } else if (commonDatatype.equals(XSD.FLOAT)) { float left = leftLit.floatValue(); float right = rightLit.floatValue(); @@ -119,7 +119,7 @@ public static Literal compute(Literal leftLit, Literal rightLit, MathOp op) thro default: throw new IllegalArgumentException("Unknown operator: " + op); } - } else if (commonDatatype.equals(XMLSchema.DECIMAL)) { + } else if (commonDatatype.equals(XSD.DECIMAL)) { BigDecimal left = leftLit.decimalValue(); BigDecimal right = rightLit.decimalValue(); diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtil.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtil.java index d713f8e5742..ed16265f030 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtil.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtil.java @@ -16,7 +16,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.util.Literals; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.Compare.CompareOp; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; @@ -49,16 +49,16 @@ public static boolean getEffectiveBooleanValue(Value value) throws ValueExprEval String label = literal.getLabel(); IRI datatype = literal.getDatatype(); - if (datatype.equals(XMLSchema.STRING)) { + if (datatype.equals(XSD.STRING)) { return label.length() > 0; - } else if (datatype.equals(XMLSchema.BOOLEAN)) { + } else if (datatype.equals(XSD.BOOLEAN)) { if ("true".equals(label) || "1".equals(label)) { return true; } else { // also false for illegal values return false; } - } else if (datatype.equals(XMLSchema.DECIMAL)) { + } else if (datatype.equals(XSD.DECIMAL)) { try { String normDec = XMLDatatypeUtil.normalizeDecimal(label); return !normDec.equals("0.0"); @@ -161,7 +161,7 @@ public static boolean compareLiterals(Literal leftLit, Literal rightLit, Compare // string-typed literals with the same lexical value are considered equal. IRI commonDatatype = null; if (QueryEvaluationUtil.isSimpleLiteral(leftLit) && QueryEvaluationUtil.isSimpleLiteral(rightLit)) { - commonDatatype = XMLSchema.STRING; + commonDatatype = XSD.STRING; } Integer compareResult = null; @@ -177,36 +177,36 @@ public static boolean compareLiterals(Literal leftLit, Literal rightLit, Compare // left and right arguments have different datatypes, try to find // a // more general, shared datatype - if (leftDatatype.equals(XMLSchema.DOUBLE) || rightDatatype.equals(XMLSchema.DOUBLE)) { - commonDatatype = XMLSchema.DOUBLE; - } else if (leftDatatype.equals(XMLSchema.FLOAT) || rightDatatype.equals(XMLSchema.FLOAT)) { - commonDatatype = XMLSchema.FLOAT; - } else if (leftDatatype.equals(XMLSchema.DECIMAL) || rightDatatype.equals(XMLSchema.DECIMAL)) { - commonDatatype = XMLSchema.DECIMAL; + if (leftDatatype.equals(XSD.DOUBLE) || rightDatatype.equals(XSD.DOUBLE)) { + commonDatatype = XSD.DOUBLE; + } else if (leftDatatype.equals(XSD.FLOAT) || rightDatatype.equals(XSD.FLOAT)) { + commonDatatype = XSD.FLOAT; + } else if (leftDatatype.equals(XSD.DECIMAL) || rightDatatype.equals(XSD.DECIMAL)) { + commonDatatype = XSD.DECIMAL; } else { - commonDatatype = XMLSchema.INTEGER; + commonDatatype = XSD.INTEGER; } } else if (!strict && XMLDatatypeUtil.isCalendarDatatype(leftDatatype) && XMLDatatypeUtil.isCalendarDatatype(rightDatatype)) { // We're not running in strict eval mode so we use extended datatype comparsion. - commonDatatype = XMLSchema.DATETIME; + commonDatatype = XSD.DATETIME; } else if (!strict && XMLDatatypeUtil.isDurationDatatype(leftDatatype) && XMLDatatypeUtil.isDurationDatatype(rightDatatype)) { - commonDatatype = XMLSchema.DURATION; + commonDatatype = XSD.DURATION; } } if (commonDatatype != null) { try { - if (commonDatatype.equals(XMLSchema.DOUBLE)) { + if (commonDatatype.equals(XSD.DOUBLE)) { compareResult = Double.compare(leftLit.doubleValue(), rightLit.doubleValue()); - } else if (commonDatatype.equals(XMLSchema.FLOAT)) { + } else if (commonDatatype.equals(XSD.FLOAT)) { compareResult = Float.compare(leftLit.floatValue(), rightLit.floatValue()); - } else if (commonDatatype.equals(XMLSchema.DECIMAL)) { + } else if (commonDatatype.equals(XSD.DECIMAL)) { compareResult = leftLit.decimalValue().compareTo(rightLit.decimalValue()); } else if (XMLDatatypeUtil.isIntegerDatatype(commonDatatype)) { compareResult = leftLit.integerValue().compareTo(rightLit.integerValue()); - } else if (commonDatatype.equals(XMLSchema.BOOLEAN)) { + } else if (commonDatatype.equals(XSD.BOOLEAN)) { Boolean leftBool = leftLit.booleanValue(); Boolean rightBool = rightLit.booleanValue(); compareResult = leftBool.compareTo(rightBool); @@ -222,7 +222,7 @@ public static boolean compareLiterals(Literal leftLit, Literal rightLit, Compare if (compareResult == DatatypeConstants.INDETERMINATE) { // If we compare two xsd:dateTime we should use the specific comparison specified in SPARQL // 1.1 - if (leftDatatype.equals(XMLSchema.DATETIME) && rightDatatype.equals(XMLSchema.DATETIME)) { + if (leftDatatype.equals(XSD.DATETIME) && rightDatatype.equals(XSD.DATETIME)) { throw new ValueExprEvaluationException("Indeterminate result for date/time comparison"); } else { // We fallback to the regular RDF term compare @@ -237,7 +237,7 @@ public static boolean compareLiterals(Literal leftLit, Literal rightLit, Compare if (compareResult == DatatypeConstants.INDETERMINATE) { compareResult = null; // We fallback to regular term comparison } - } else if (commonDatatype.equals(XMLSchema.STRING)) { + } else if (commonDatatype.equals(XSD.STRING)) { compareResult = leftLit.getLabel().compareTo(rightLit.getLabel()); } } catch (IllegalArgumentException e) { @@ -298,8 +298,8 @@ && isSupportedDatatype(rightDatatype)) { if (!XMLDatatypeUtil.isValidValue(rightLit.getLabel(), rightDatatype)) { throw new ValueExprEvaluationException("not a valid datatype value: " + rightLit); } - boolean leftString = leftDatatype.equals(XMLSchema.STRING); - boolean rightString = rightDatatype.equals(XMLSchema.STRING); + boolean leftString = leftDatatype.equals(XSD.STRING); + boolean rightString = rightDatatype.equals(XSD.STRING); boolean leftNumeric = XMLDatatypeUtil.isNumericDatatype(leftDatatype); boolean rightNumeric = XMLDatatypeUtil.isNumericDatatype(rightDatatype); boolean leftDate = XMLDatatypeUtil.isCalendarDatatype(leftDatatype); @@ -350,7 +350,7 @@ && isSupportedDatatype(rightDatatype)) { public static boolean isPlainLiteral(Value v) { if (v instanceof Literal) { Literal l = (Literal) v; - return (l.getDatatype().equals(XMLSchema.STRING)); + return (l.getDatatype().equals(XSD.STRING)); } return false; } @@ -371,12 +371,12 @@ public static boolean isSimpleLiteral(Value v) { /** * Checks whether the supplied literal is a "simple literal". A "simple literal" is a literal with no language tag - * and the datatype {@link XMLSchema#STRING}. + * and the datatype {@link XSD#STRING}. * * @see SPARQL Simple Literal Documentation */ public static boolean isSimpleLiteral(Literal l) { - return !Literals.isLanguageLiteral(l) && l.getDatatype().equals(XMLSchema.STRING); + return !Literals.isLanguageLiteral(l) && l.getDatatype().equals(XSD.STRING); } /** @@ -429,11 +429,11 @@ public static boolean compatibleArguments(Literal arg1, Literal arg2) { */ public static boolean isStringLiteral(Literal l) { IRI datatype = l.getDatatype(); - return Literals.isLanguageLiteral(l) || datatype.equals(XMLSchema.STRING); + return Literals.isLanguageLiteral(l) || datatype.equals(XSD.STRING); } private static boolean isSupportedDatatype(IRI datatype) { - return (XMLSchema.STRING.equals(datatype) || XMLDatatypeUtil.isNumericDatatype(datatype) + return (XSD.STRING.equals(datatype) || XMLDatatypeUtil.isNumericDatatype(datatype) || XMLDatatypeUtil.isCalendarDatatype(datatype)); } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/TripleSources.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/TripleSources.java index 9c22109ad72..70765757720 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/TripleSources.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/TripleSources.java @@ -19,7 +19,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.TripleSource; @@ -97,7 +97,7 @@ public static boolean booleanValue(Resource subj, IRI pred, TripleSource store) return ((Literal) v).booleanValue(); } catch (IllegalArgumentException e) { throw new QueryEvaluationException( - "Value for " + pred + " must be of datatype " + XMLSchema.BOOLEAN + ": " + subj); + "Value for " + pred + " must be of datatype " + XSD.BOOLEAN + ": " + subj); } } else { throw new QueryEvaluationException("Non-literal value for " + pred + ": " + subj); diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/XMLDatatypeMathUtil.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/XMLDatatypeMathUtil.java index 020cb056deb..c9cf8982600 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/XMLDatatypeMathUtil.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/XMLDatatypeMathUtil.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.MathExpr.MathOp; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; @@ -167,11 +167,11 @@ private static IRI getDatatypeForDuration(Duration duration) { boolean secondSet = duration.isSet(DatatypeConstants.SECONDS); if (!yearSet && !monthSet) { - return XMLSchema.DAYTIMEDURATION; + return XSD.DAYTIMEDURATION; } if (!daySet && !hourSet && !minuteSet && !secondSet) { - return XMLSchema.YEARMONTHDURATION; + return XSD.YEARMONTHDURATION; } - return XMLSchema.DURATION; + return XSD.DURATION; } } diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/datetime/TimezoneTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/datetime/TimezoneTest.java index d83ba40b34b..371f11c4041 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/datetime/TimezoneTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/datetime/TimezoneTest.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.After; import org.junit.Before; @@ -48,10 +48,10 @@ public void tearDown() throws Exception { public void testEvaluate1() { try { - Literal result = timezone.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815-05:00", XMLSchema.DATETIME)); + Literal result = timezone.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815-05:00", XSD.DATETIME)); assertNotNull(result); - assertEquals(XMLSchema.DAYTIMEDURATION, result.getDatatype()); + assertEquals(XSD.DAYTIMEDURATION, result.getDatatype()); assertEquals("-PT5H", result.getLabel()); @@ -65,10 +65,10 @@ public void testEvaluate1() { public void testEvaluate2() { try { - Literal result = timezone.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815Z", XMLSchema.DATETIME)); + Literal result = timezone.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815Z", XSD.DATETIME)); assertNotNull(result); - assertEquals(XMLSchema.DAYTIMEDURATION, result.getDatatype()); + assertEquals(XSD.DAYTIMEDURATION, result.getDatatype()); assertEquals("PT0S", result.getLabel()); @@ -82,7 +82,7 @@ public void testEvaluate2() { public void testEvaluate3() { try { - timezone.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815", XMLSchema.DATETIME)); + timezone.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815", XSD.DATETIME)); fail("should have resulted in a type error"); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/datetime/TzTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/datetime/TzTest.java index 308a9d5420b..f1cc61b6f25 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/datetime/TzTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/datetime/TzTest.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.After; import org.junit.Before; @@ -48,10 +48,10 @@ public void tearDown() throws Exception { public void testEvaluate1() { try { - Literal result = tz.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815-05:00", XMLSchema.DATETIME)); + Literal result = tz.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815-05:00", XSD.DATETIME)); assertNotNull(result); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); assertEquals("-05:00", result.getLabel()); @@ -65,10 +65,10 @@ public void testEvaluate1() { public void testEvaluate2() { try { - Literal result = tz.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815Z", XMLSchema.DATETIME)); + Literal result = tz.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815Z", XSD.DATETIME)); assertNotNull(result); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); assertEquals("Z", result.getLabel()); @@ -82,10 +82,10 @@ public void testEvaluate2() { public void testEvaluate3() { try { - Literal result = tz.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815", XMLSchema.DATETIME)); + Literal result = tz.evaluate(f, f.createLiteral("2011-01-10T14:45:13.815", XSD.DATETIME)); assertNotNull(result); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); assertEquals("", result.getLabel()); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/hash/HashFunctionTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/hash/HashFunctionTest.java index 2bb64f6a64a..d57a3c7e370 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/hash/HashFunctionTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/hash/HashFunctionTest.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.Test; @@ -37,7 +37,7 @@ public void testEvaluate() { Literal hash = getHashFunction().evaluate(f, f.createLiteral(getToHash())); assertNotNull(hash); - assertEquals(XMLSchema.STRING, hash.getDatatype()); + assertEquals(XSD.STRING, hash.getDatatype()); assertEquals(hash.getLabel(), getExpectedDigest()); } catch (ValueExprEvaluationException e) { @@ -49,10 +49,10 @@ public void testEvaluate() { @Test public void testEvaluate2() { try { - Literal hash = getHashFunction().evaluate(f, f.createLiteral(getToHash(), XMLSchema.STRING)); + Literal hash = getHashFunction().evaluate(f, f.createLiteral(getToHash(), XSD.STRING)); assertNotNull(hash); - assertEquals(XMLSchema.STRING, hash.getDatatype()); + assertEquals(XSD.STRING, hash.getDatatype()); assertEquals(hash.getLabel(), getExpectedDigest()); } catch (ValueExprEvaluationException e) { @@ -64,7 +64,7 @@ public void testEvaluate2() { @Test public void testEvaluate3() { try { - getHashFunction().evaluate(f, f.createLiteral("4", XMLSchema.INTEGER)); + getHashFunction().evaluate(f, f.createLiteral("4", XSD.INTEGER)); fail("incompatible operand should have resulted in type error."); } catch (ValueExprEvaluationException e) { diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/numeric/RandTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/numeric/RandTest.java index b105bbadaec..3707d36cf55 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/numeric/RandTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/numeric/RandTest.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.After; import org.junit.Before; @@ -51,7 +51,7 @@ public void testEvaluate() { Literal random = rand.evaluate(f); assertNotNull(random); - assertEquals(XMLSchema.DOUBLE, random.getDatatype()); + assertEquals(XSD.DOUBLE, random.getDatatype()); double randomValue = random.doubleValue(); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/numeric/RoundTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/numeric/RoundTest.java index 1cda3a27159..39e4dad4ea9 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/numeric/RoundTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/numeric/RoundTest.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.After; import org.junit.Before; @@ -80,7 +80,7 @@ public void testEvaluateBigDecimal() { try { BigDecimal bd = new BigDecimal(1234567.567); - Literal rounded = round.evaluate(f, f.createLiteral(bd.toPlainString(), XMLSchema.DECIMAL)); + Literal rounded = round.evaluate(f, f.createLiteral(bd.toPlainString(), XSD.DECIMAL)); BigDecimal roundValue = rounded.decimalValue(); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/ConcatTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/ConcatTest.java index 7eb9a9ff455..a7679ac5d5b 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/ConcatTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/ConcatTest.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.impl.BooleanLiteral; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.Before; import org.junit.Test; @@ -46,7 +46,7 @@ public void stringLiteralHandling() { Literal result = concatFunc.evaluate(vf, foo, bar); assertThat(result.stringValue()).isEqualTo("foobar"); - assertThat(result.getDatatype()).isEqualTo(XMLSchema.STRING); + assertThat(result.getDatatype()).isEqualTo(XSD.STRING); assertThat(result.getLanguage().isPresent()).isFalse(); } @@ -65,7 +65,7 @@ public void mixedLanguageLiteralHandling() { Literal result = concatFunc.evaluate(vf, foo_nl, bar_en); assertThat(result.stringValue()).isEqualTo("foobar"); - assertThat(result.getDatatype()).isEqualTo(XMLSchema.STRING); + assertThat(result.getDatatype()).isEqualTo(XSD.STRING); assertThat(result.getLanguage().isPresent()).isFalse(); } @@ -74,7 +74,7 @@ public void mixedLiteralHandling() { Literal result = concatFunc.evaluate(vf, foo, bar_en); assertThat(result.stringValue()).isEqualTo("foobar"); - assertThat(result.getDatatype()).isEqualTo(XMLSchema.STRING); + assertThat(result.getDatatype()).isEqualTo(XSD.STRING); assertThat(result.getLanguage().isPresent()).isFalse(); } diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/RegexTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/RegexTest.java index aa54a03c26d..d2717937134 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/RegexTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/RegexTest.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.algebra.Regex; import org.eclipse.rdf4j.query.algebra.ValueExpr; @@ -111,7 +111,7 @@ public void testEvaluate4() throws QueryEvaluationException { @Test public void testEvaluate5() throws QueryEvaluationException { - Literal expr = vf.createLiteral("foobar", XMLSchema.STRING); + Literal expr = vf.createLiteral("foobar", XSD.STRING); Literal pattern = vf.createLiteral("FooBar"); Literal flags = vf.createLiteral("i"); @@ -127,7 +127,7 @@ public void testEvaluate5() throws QueryEvaluationException { @Test public void testEvaluate6() throws QueryEvaluationException { - Literal expr = vf.createLiteral("foobar", XMLSchema.TOKEN); + Literal expr = vf.createLiteral("foobar", XSD.TOKEN); Literal pattern = vf.createLiteral("FooBar"); Literal flags = vf.createLiteral("i"); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/StrAfterTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/StrAfterTest.java index 8af1a007ffe..dc39cd63553 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/StrAfterTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/StrAfterTest.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.After; import org.junit.Before; @@ -95,14 +95,14 @@ public void testEvaluate3() { @Test public void testEvaluate4() { - Literal leftArg = f.createLiteral("foobar", XMLSchema.STRING); + Literal leftArg = f.createLiteral("foobar", XSD.STRING); Literal rightArg = f.createLiteral("b"); try { Literal result = strAfterFunc.evaluate(f, leftArg, rightArg); assertEquals("ar", result.getLabel()); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); } catch (ValueExprEvaluationException e) { fail(e.getMessage()); @@ -113,13 +113,13 @@ public void testEvaluate4() { public void testEvaluate4a() { Literal leftArg = f.createLiteral("foobar"); - Literal rightArg = f.createLiteral("b", XMLSchema.STRING); + Literal rightArg = f.createLiteral("b", XSD.STRING); try { Literal result = strAfterFunc.evaluate(f, leftArg, rightArg); assertEquals("ar", result.getLabel()); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); } catch (ValueExprEvaluationException e) { fail(e.getMessage()); @@ -129,8 +129,8 @@ public void testEvaluate4a() { @Test public void testEvaluate5() { - Literal leftArg = f.createLiteral("foobar", XMLSchema.STRING); - Literal rightArg = f.createLiteral("b", XMLSchema.DATE); + Literal leftArg = f.createLiteral("foobar", XSD.STRING); + Literal rightArg = f.createLiteral("b", XSD.DATE); try { Literal result = strAfterFunc.evaluate(f, leftArg, rightArg); @@ -205,7 +205,7 @@ public void testEvaluate9() { @Test public void testEvaluate10() { Literal leftArg = f.createLiteral("foobar", "en"); - Literal rightArg = f.createLiteral("b", XMLSchema.STRING); + Literal rightArg = f.createLiteral("b", XSD.STRING); try { Literal result = strAfterFunc.evaluate(f, leftArg, rightArg); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/StrBeforeTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/StrBeforeTest.java index ffcf4df5861..30cebd57cee 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/StrBeforeTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/string/StrBeforeTest.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.After; import org.junit.Before; @@ -95,14 +95,14 @@ public void testEvaluate3() { @Test public void testEvaluate4() { - Literal leftArg = f.createLiteral("foobar", XMLSchema.STRING); + Literal leftArg = f.createLiteral("foobar", XSD.STRING); Literal rightArg = f.createLiteral("b"); try { Literal result = strBeforeFunc.evaluate(f, leftArg, rightArg); assertEquals("foo", result.getLabel()); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); } catch (ValueExprEvaluationException e) { fail(e.getMessage()); @@ -113,13 +113,13 @@ public void testEvaluate4() { public void testEvaluate4a() { Literal leftArg = f.createLiteral("foobar"); - Literal rightArg = f.createLiteral("b", XMLSchema.STRING); + Literal rightArg = f.createLiteral("b", XSD.STRING); try { Literal result = strBeforeFunc.evaluate(f, leftArg, rightArg); assertEquals("foo", result.getLabel()); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); } catch (ValueExprEvaluationException e) { fail(e.getMessage()); @@ -129,8 +129,8 @@ public void testEvaluate4a() { @Test public void testEvaluate5() { - Literal leftArg = f.createLiteral("foobar", XMLSchema.STRING); - Literal rightArg = f.createLiteral("b", XMLSchema.DATE); + Literal leftArg = f.createLiteral("foobar", XSD.STRING); + Literal rightArg = f.createLiteral("b", XSD.DATE); try { Literal result = strBeforeFunc.evaluate(f, leftArg, rightArg); @@ -205,7 +205,7 @@ public void testEvaluate9() { @Test public void testEvaluate10() { Literal leftArg = f.createLiteral("foobar", "en"); - Literal rightArg = f.createLiteral("b", XMLSchema.STRING); + Literal rightArg = f.createLiteral("b", XSD.STRING); try { Literal result = strBeforeFunc.evaluate(f, leftArg, rightArg); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/TestDateTimeCast.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/TestDateTimeCast.java index b24c0abae7a..e50b74873fd 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/TestDateTimeCast.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/TestDateTimeCast.java @@ -16,7 +16,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.After; import org.junit.Before; @@ -52,7 +52,7 @@ public void testCastPlainLiteral() { try { Literal result = dtCast.evaluate(f, plainLit); assertNotNull(result); - assertEquals(XMLSchema.DATETIME, result.getDatatype()); + assertEquals(XSD.DATETIME, result.getDatatype()); } catch (ValueExprEvaluationException e) { fail(e.getMessage()); } @@ -60,11 +60,11 @@ public void testCastPlainLiteral() { @Test public void testCastDateLiteral() { - Literal dateLit = f.createLiteral("1999-09-09", XMLSchema.DATE); + Literal dateLit = f.createLiteral("1999-09-09", XSD.DATE); try { Literal result = dtCast.evaluate(f, dateLit); assertNotNull(result); - assertEquals(XMLSchema.DATETIME, result.getDatatype()); + assertEquals(XSD.DATETIME, result.getDatatype()); } catch (ValueExprEvaluationException e) { fail(e.getMessage()); @@ -78,7 +78,7 @@ public void testCastDateTimeLiteral() { try { Literal result = dtCast.evaluate(f, dtLit); assertNotNull(result); - assertEquals(XMLSchema.DATETIME, result.getDatatype()); + assertEquals(XSD.DATETIME, result.getDatatype()); assertFalse(result.getLanguage().isPresent()); assertEquals(lexVal, result.getLabel()); } catch (ValueExprEvaluationException e) { diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/TestStringCast.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/TestStringCast.java index 3c93658a471..1f2bac8d9e2 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/TestStringCast.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/xsd/TestStringCast.java @@ -16,7 +16,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.After; import org.junit.Before; @@ -52,7 +52,7 @@ public void testCastPlainLiteral() { try { Literal result = stringCast.evaluate(f, plainLit); assertNotNull(result); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); } catch (ValueExprEvaluationException e) { fail(e.getMessage()); } @@ -75,7 +75,7 @@ public void testCastIntegerLiteral() { try { Literal result = stringCast.evaluate(f, intLit); assertNotNull(result); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); assertFalse(result.getLanguage().isPresent()); assertEquals("10", result.getLabel()); } catch (ValueExprEvaluationException e) { @@ -90,7 +90,7 @@ public void testCastDateTimeLiteral() { try { Literal result = stringCast.evaluate(f, dtLit); assertNotNull(result); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); assertFalse(result.getLanguage().isPresent()); assertEquals(lexVal, result.getLabel()); } catch (ValueExprEvaluationException e) { @@ -105,7 +105,7 @@ public void testCastUnknownDatatypedLiteral() { try { Literal result = stringCast.evaluate(f, dtLit); assertNotNull(result); - assertEquals(XMLSchema.STRING, result.getDatatype()); + assertEquals(XSD.STRING, result.getDatatype()); assertFalse(result.getLanguage().isPresent()); assertEquals(lexVal, result.getLabel()); } catch (ValueExprEvaluationException e) { diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIteratorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIteratorTest.java index 47057e6da31..625e395ae0a 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIteratorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/GroupIteratorTest.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.algebra.Avg; @@ -69,7 +69,7 @@ public void testAvgEmptySet() throws QueryEvaluationException { assertThat(gi.next().getBinding("avg").getValue()) .describedAs("AVG on empty set should result in 0") - .isEqualTo(vf.createLiteral("0", XMLSchema.INTEGER)); + .isEqualTo(vf.createLiteral("0", XSD.INTEGER)); } @Test @@ -130,7 +130,7 @@ public void testAvgNotZero() throws QueryEvaluationException { group.addGroupElement(new GroupElem("avg", new Avg(new Var("a")))); GroupIterator gi = new GroupIterator(evaluator, group, EmptyBindingSet.getInstance()); - assertThat(gi.next().getBinding("avg").getValue()).isEqualTo(vf.createLiteral("5", XMLSchema.DECIMAL)); + assertThat(gi.next().getBinding("avg").getValue()).isEqualTo(vf.createLiteral("5", XSD.DECIMAL)); } @Test @@ -139,7 +139,7 @@ public void testCountNotZero() throws QueryEvaluationException { group.addGroupElement(new GroupElem("count", new Count(new Var("a")))); GroupIterator gi = new GroupIterator(evaluator, group, EmptyBindingSet.getInstance()); - assertThat(gi.next().getBinding("count").getValue()).isEqualTo(vf.createLiteral("9", XMLSchema.INTEGER)); + assertThat(gi.next().getBinding("count").getValue()).isEqualTo(vf.createLiteral("9", XSD.INTEGER)); } @Test @@ -148,6 +148,6 @@ public void testSumNotZero() throws QueryEvaluationException { group.addGroupElement(new GroupElem("sum", new Sum(new Var("a")))); GroupIterator gi = new GroupIterator(evaluator, group, EmptyBindingSet.getInstance()); - assertThat(gi.next().getBinding("sum").getValue()).isEqualTo(vf.createLiteral("45", XMLSchema.INTEGER)); + assertThat(gi.next().getBinding("sum").getValue()).isEqualTo(vf.createLiteral("45", XSD.INTEGER)); } } diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/LiteralComparatorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/LiteralComparatorTest.java index 1cec8280510..5fc2e0c40a1 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/LiteralComparatorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/LiteralComparatorTest.java @@ -19,7 +19,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.junit.Before; import org.junit.Test; @@ -56,7 +56,7 @@ public class LiteralComparatorTest { private Literal simple2 = vf.createLiteral("http://script.example/Кириллица"); - private Literal typed1 = vf.createLiteral("http://script.example/Latin", XMLSchema.STRING); + private Literal typed1 = vf.createLiteral("http://script.example/Latin", XSD.STRING); private ValueComparator cmp = new ValueComparator(); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtilTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtilTest.java index cd8fc769b73..c7f730bc3e0 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtilTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/QueryEvaluationUtilTest.java @@ -17,7 +17,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.Compare.CompareOp; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.Before; @@ -81,23 +81,23 @@ public void setUp() throws Exception { arg1cy = f.createLiteral("abc", "cy"); arg2cy = f.createLiteral("b", "cy"); - arg1string = f.createLiteral("abc", XMLSchema.STRING); - arg2string = f.createLiteral("b", XMLSchema.STRING); + arg1string = f.createLiteral("abc", XSD.STRING); + arg2string = f.createLiteral("b", XSD.STRING); - arg1year = f.createLiteral("2007", XMLSchema.GYEAR); - arg2year = f.createLiteral("2009", XMLSchema.GYEAR); + arg1year = f.createLiteral("2007", XSD.GYEAR); + arg2year = f.createLiteral("2009", XSD.GYEAR); - arg1dateTime = f.createLiteral("2009-01-01T20:20:20Z", XMLSchema.DATETIME); - arg2dateTime = f.createLiteral("2007-01-01T20:20:20+02:00", XMLSchema.DATETIME); + arg1dateTime = f.createLiteral("2009-01-01T20:20:20Z", XSD.DATETIME); + arg2dateTime = f.createLiteral("2007-01-01T20:20:20+02:00", XSD.DATETIME); arg1int = f.createLiteral(10); arg2int = f.createLiteral(1); - arg1duration = f.createLiteral("P1Y30DT1H1M1S", XMLSchema.DURATION); - arg2duration = f.createLiteral("P1Y31DT1H1M1S", XMLSchema.DURATION); + arg1duration = f.createLiteral("P1Y30DT1H1M1S", XSD.DURATION); + arg2duration = f.createLiteral("P1Y31DT1H1M1S", XSD.DURATION); - arg1yearMonthDuration = f.createLiteral("P1M", XMLSchema.YEARMONTHDURATION); - arg2yearMonthDuration = f.createLiteral("P1Y1M", XMLSchema.YEARMONTHDURATION); + arg1yearMonthDuration = f.createLiteral("P1M", XSD.YEARMONTHDURATION); + arg2yearMonthDuration = f.createLiteral("P1Y1M", XSD.YEARMONTHDURATION); arg1unknown = f.createLiteral("foo", f.createIRI("http://example.com/datatype")); arg2unknown = f.createLiteral("bar", f.createIRI("http://example.com/datatype")); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/ValueComparatorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/ValueComparatorTest.java index 7bad63dbe35..fff723f48d4 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/ValueComparatorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/ValueComparatorTest.java @@ -18,7 +18,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.junit.Test; /** @@ -38,7 +38,7 @@ public class ValueComparatorTest { private IRI uri3 = vf.createIRI("http://script.example/日本語"); - private Literal typed1 = vf.createLiteral("http://script.example/Latin", XMLSchema.STRING); + private Literal typed1 = vf.createLiteral("http://script.example/Latin", XSD.STRING); private ValueComparator cmp = new ValueComparator(); @@ -122,7 +122,7 @@ public void testOrder2() throws Exception { Literal int10 = vf.createLiteral(10); Literal int9 = vf.createLiteral(9); Literal plain9 = vf.createLiteral("9"); - Literal integer5 = vf.createLiteral("5", XMLSchema.INTEGER); + Literal integer5 = vf.createLiteral("5", XSD.INTEGER); Literal float9 = vf.createLiteral(9f); Literal plain4 = vf.createLiteral("4"); Literal plain10 = vf.createLiteral("10"); @@ -144,7 +144,7 @@ public void testOrder2() throws Exception { */ @Test public void testOrder3() throws Exception { - Literal year1234 = vf.createLiteral("1234", XMLSchema.GYEAR); + Literal year1234 = vf.createLiteral("1234", XSD.GYEAR); Literal float2000 = vf.createLiteral(2000f); Literal int1000 = vf.createLiteral(1000); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/XMLDatatypeMathUtilTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/XMLDatatypeMathUtilTest.java index a9783ab82a9..7602fad37aa 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/XMLDatatypeMathUtilTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/XMLDatatypeMathUtilTest.java @@ -13,7 +13,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.junit.Test; /** @@ -25,26 +25,26 @@ public class XMLDatatypeMathUtilTest { @Test public void testCompute() throws Exception { - Literal float1 = vf.createLiteral("12", XMLSchema.INTEGER); - Literal float2 = vf.createLiteral("2", XMLSchema.INTEGER); - Literal duration1 = vf.createLiteral("P1Y1M", XMLSchema.YEARMONTHDURATION); - Literal duration2 = vf.createLiteral("P1Y", XMLSchema.YEARMONTHDURATION); - Literal yearMonth1 = vf.createLiteral("2012-10", XMLSchema.GYEARMONTH); - - assertComputeEquals(vf.createLiteral("14", XMLSchema.INTEGER), float1, float2, MathOp.PLUS); - assertComputeEquals(vf.createLiteral("10", XMLSchema.INTEGER), float1, float2, MathOp.MINUS); - assertComputeEquals(vf.createLiteral("24", XMLSchema.INTEGER), float1, float2, MathOp.MULTIPLY); - assertComputeEquals(vf.createLiteral("6", XMLSchema.DECIMAL), float1, float2, MathOp.DIVIDE); - - assertComputeEquals(vf.createLiteral("P2Y1M", XMLSchema.YEARMONTHDURATION), duration1, duration2, MathOp.PLUS); - assertComputeEquals(vf.createLiteral("P0Y1M", XMLSchema.YEARMONTHDURATION), duration1, duration2, MathOp.MINUS); - - assertComputeEquals(vf.createLiteral("P12Y", XMLSchema.YEARMONTHDURATION), float1, duration2, MathOp.MULTIPLY); - assertComputeEquals(vf.createLiteral("P12Y", XMLSchema.YEARMONTHDURATION), duration2, float1, MathOp.MULTIPLY); - - assertComputeEquals(vf.createLiteral("2013-11", XMLSchema.GYEARMONTH), yearMonth1, duration1, MathOp.PLUS); - assertComputeEquals(vf.createLiteral("2011-09", XMLSchema.GYEARMONTH), yearMonth1, duration1, MathOp.MINUS); - assertComputeEquals(vf.createLiteral("2013-11", XMLSchema.GYEARMONTH), duration1, yearMonth1, MathOp.PLUS); + Literal float1 = vf.createLiteral("12", XSD.INTEGER); + Literal float2 = vf.createLiteral("2", XSD.INTEGER); + Literal duration1 = vf.createLiteral("P1Y1M", XSD.YEARMONTHDURATION); + Literal duration2 = vf.createLiteral("P1Y", XSD.YEARMONTHDURATION); + Literal yearMonth1 = vf.createLiteral("2012-10", XSD.GYEARMONTH); + + assertComputeEquals(vf.createLiteral("14", XSD.INTEGER), float1, float2, MathOp.PLUS); + assertComputeEquals(vf.createLiteral("10", XSD.INTEGER), float1, float2, MathOp.MINUS); + assertComputeEquals(vf.createLiteral("24", XSD.INTEGER), float1, float2, MathOp.MULTIPLY); + assertComputeEquals(vf.createLiteral("6", XSD.DECIMAL), float1, float2, MathOp.DIVIDE); + + assertComputeEquals(vf.createLiteral("P2Y1M", XSD.YEARMONTHDURATION), duration1, duration2, MathOp.PLUS); + assertComputeEquals(vf.createLiteral("P0Y1M", XSD.YEARMONTHDURATION), duration1, duration2, MathOp.MINUS); + + assertComputeEquals(vf.createLiteral("P12Y", XSD.YEARMONTHDURATION), float1, duration2, MathOp.MULTIPLY); + assertComputeEquals(vf.createLiteral("P12Y", XSD.YEARMONTHDURATION), duration2, float1, MathOp.MULTIPLY); + + assertComputeEquals(vf.createLiteral("2013-11", XSD.GYEARMONTH), yearMonth1, duration1, MathOp.PLUS); + assertComputeEquals(vf.createLiteral("2011-09", XSD.GYEARMONTH), yearMonth1, duration1, MathOp.MINUS); + assertComputeEquals(vf.createLiteral("2013-11", XSD.GYEARMONTH), duration1, yearMonth1, MathOp.PLUS); } private void assertComputeEquals(Literal result, Literal lit1, Literal lit2, MathOp op) throws Exception { diff --git a/core/queryalgebra/geosparql/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/FunctionArguments.java b/core/queryalgebra/geosparql/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/FunctionArguments.java index 00ace8ec500..51400898dc0 100644 --- a/core/queryalgebra/geosparql/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/FunctionArguments.java +++ b/core/queryalgebra/geosparql/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/FunctionArguments.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.vocabulary.GEO; import org.eclipse.rdf4j.model.vocabulary.GEOF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; import org.locationtech.spatial4j.context.SpatialContext; @@ -63,7 +63,7 @@ public static double getDouble(Function func, Value v) throws ValueExprEvaluatio * @throws ValueExprEvaluationException */ public static String getString(Function func, Value v) throws ValueExprEvaluationException { - Literal l = getLiteral(func, v, XMLSchema.STRING); + Literal l = getLiteral(func, v, XSD.STRING); return l.stringValue(); } diff --git a/core/queryalgebra/geosparql/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/SRID.java b/core/queryalgebra/geosparql/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/SRID.java index 8ee115c03d3..4fe75f662fc 100644 --- a/core/queryalgebra/geosparql/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/SRID.java +++ b/core/queryalgebra/geosparql/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/SRID.java @@ -12,7 +12,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.vocabulary.GEO; import org.eclipse.rdf4j.model.vocabulary.GEOF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; @@ -44,6 +44,6 @@ public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExpr srid = GEO.DEFAULT_SRID; } - return valueFactory.createLiteral(srid, XMLSchema.ANYURI); + return valueFactory.createLiteral(srid, XSD.ANYURI); } } diff --git a/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/BufferTest.java b/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/BufferTest.java index 0e2d4ddbbc9..e19a8095535 100644 --- a/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/BufferTest.java +++ b/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/BufferTest.java @@ -17,7 +17,7 @@ import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.FOAF; import org.eclipse.rdf4j.model.vocabulary.GEO; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.junit.Test; @@ -48,7 +48,7 @@ public void testEvaluateWithDoubleRadius() { @Test public void testEvaluateWithDecimalRadius() { - Value result = buffer.evaluate(f, point, f.createLiteral("1.0", XMLSchema.DECIMAL), unit); + Value result = buffer.evaluate(f, point, f.createLiteral("1.0", XSD.DECIMAL), unit); assertNotNull(result); } @@ -62,7 +62,7 @@ public void resultIsPolygonWKT() { @Test(expected = ValueExprEvaluationException.class) public void testEvaluateWithInvalidRadius() { - buffer.evaluate(f, point, f.createLiteral("foobar", XMLSchema.DECIMAL), unit); + buffer.evaluate(f, point, f.createLiteral("foobar", XSD.DECIMAL), unit); } @Test(expected = ValueExprEvaluationException.class) diff --git a/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/DistanceTest.java b/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/DistanceTest.java index b6997e1b720..8802ea5d0a2 100644 --- a/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/DistanceTest.java +++ b/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/DistanceTest.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.junit.Test; @@ -40,7 +40,7 @@ public void testDistanceAmBxl() throws IOException { assertTrue("Value is not a literal", value instanceof Literal); Literal l = (Literal) value; - assertTrue("Literal not of type double", l.getDatatype().equals(XMLSchema.DOUBLE)); + assertTrue("Literal not of type double", l.getDatatype().equals(XSD.DOUBLE)); assertEquals("Distance Amsterdam-Brussels not correct", 173, l.doubleValue() / 1000, 0.5); } diff --git a/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/SfWithinTest.java b/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/SfWithinTest.java index 14a588514c7..0ab5975806b 100644 --- a/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/SfWithinTest.java +++ b/core/queryalgebra/geosparql/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/function/geosparql/SfWithinTest.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.junit.Test; @@ -41,7 +41,7 @@ public void testDenverSfWithinColorado() throws IOException { assertTrue("Value is not a literal", value instanceof Literal); Literal l = (Literal) value; - assertTrue("Literal not of type double", l.getDatatype().equals(XMLSchema.BOOLEAN)); + assertTrue("Literal not of type double", l.getDatatype().equals(XSD.BOOLEAN)); assertTrue("Denver not within Colorado", l.booleanValue()); } @@ -62,7 +62,7 @@ public void testBrusselsSfWithinColorado() throws IOException { assertTrue("Value is not a literal", value instanceof Literal); Literal l = (Literal) value; - assertTrue("Literal not of type double", l.getDatatype().equals(XMLSchema.BOOLEAN)); + assertTrue("Literal not of type double", l.getDatatype().equals(XSD.BOOLEAN)); assertFalse("Brussels within Colorado", l.booleanValue()); } diff --git a/core/queryparser/serql/src/main/java/org/eclipse/rdf4j/query/parser/serql/NamespaceDeclProcessor.java b/core/queryparser/serql/src/main/java/org/eclipse/rdf4j/query/parser/serql/NamespaceDeclProcessor.java index 509a7e7e58d..393c07cf1d1 100644 --- a/core/queryparser/serql/src/main/java/org/eclipse/rdf4j/query/parser/serql/NamespaceDeclProcessor.java +++ b/core/queryparser/serql/src/main/java/org/eclipse/rdf4j/query/parser/serql/NamespaceDeclProcessor.java @@ -16,7 +16,7 @@ import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.model.vocabulary.SESAME; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.MalformedQueryException; import org.eclipse.rdf4j.query.parser.serql.ast.ASTNamespaceDecl; import org.eclipse.rdf4j.query.parser.serql.ast.ASTQName; @@ -70,7 +70,7 @@ public static Map process(ASTQueryContainer qc) throws Malformed nsMap.put("rdfs", RDFS.NAMESPACE); } if (!nsMap.containsKey("xsd")) { - nsMap.put("xsd", XMLSchema.NAMESPACE); + nsMap.put("xsd", XSD.NAMESPACE); } if (!nsMap.containsKey("owl")) { nsMap.put("owl", OWL.NAMESPACE); diff --git a/core/queryparser/serql/src/main/java/org/eclipse/rdf4j/query/parser/serql/ast/SyntaxTreeBuilder.java b/core/queryparser/serql/src/main/java/org/eclipse/rdf4j/query/parser/serql/ast/SyntaxTreeBuilder.java index 9c49bf68ce0..197f2370b6c 100644 --- a/core/queryparser/serql/src/main/java/org/eclipse/rdf4j/query/parser/serql/ast/SyntaxTreeBuilder.java +++ b/core/queryparser/serql/src/main/java/org/eclipse/rdf4j/query/parser/serql/ast/SyntaxTreeBuilder.java @@ -10,7 +10,7 @@ import java.io.StringReader; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.Compare.CompareOp; public class SyntaxTreeBuilder @@ -3502,7 +3502,7 @@ final public void IntegerLiteral() throws ParseException { jjtc000 = false; jjtn000.setLabel(t.image); - ASTURI uriNode = new ASTURI(JJTURI, XMLSchema.INTEGER.toString()); + ASTURI uriNode = new ASTURI(JJTURI, XSD.INTEGER.toString()); jjtn000.jjtAddChild(uriNode, 0); uriNode.jjtSetParent(jjtn000); } finally { @@ -3524,7 +3524,7 @@ final public void DecimalLiteral() throws ParseException { jjtc000 = false; jjtn000.setLabel(t.image); - ASTURI uriNode = new ASTURI(JJTURI, XMLSchema.DECIMAL.toString()); + ASTURI uriNode = new ASTURI(JJTURI, XSD.DECIMAL.toString()); jjtn000.jjtAddChild(uriNode, 0); uriNode.jjtSetParent(jjtn000); } finally { diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/PrefixDeclProcessor.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/PrefixDeclProcessor.java index 35cdf7539a0..f4cc8c52b82 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/PrefixDeclProcessor.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/PrefixDeclProcessor.java @@ -20,7 +20,7 @@ import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.model.vocabulary.SESAME; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.MalformedQueryException; import org.eclipse.rdf4j.query.parser.sparql.ast.ASTDeleteData; import org.eclipse.rdf4j.query.parser.sparql.ast.ASTIRI; @@ -76,7 +76,7 @@ public static Map process(ASTOperationContainer qc) throws Malfo + insertDefaultPrefix(prefixMap, "rdfs", RDFS.NAMESPACE) + insertDefaultPrefix(prefixMap, "sesame", SESAME.NAMESPACE) + insertDefaultPrefix(prefixMap, "owl", OWL.NAMESPACE) - + insertDefaultPrefix(prefixMap, "xsd", XMLSchema.NAMESPACE) + + insertDefaultPrefix(prefixMap, "xsd", XSD.NAMESPACE) + insertDefaultPrefix(prefixMap, "fn", FN.NAMESPACE); ASTUnparsedQuadDataBlock dataBlock = null; diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilder.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilder.java index d649cbef46d..6ee0e61019c 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilder.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/ast/SyntaxTreeBuilder.java @@ -12,7 +12,7 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.Compare.CompareOp; import org.eclipse.rdf4j.query.algebra.MathExpr.MathOp; @@ -5252,7 +5252,7 @@ final public void UnaryMinus() throws ParseException { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtn000.setValue("-1"); - jjtn000.setDatatype(XMLSchema.INTEGER); + jjtn000.setDatatype(XSD.INTEGER); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); @@ -8617,15 +8617,15 @@ final public void NumericLiteralUnsigned() throws ParseException { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case INTEGER: t = jj_consume_token(INTEGER); - datatype = XMLSchema.INTEGER; + datatype = XSD.INTEGER; break; case DECIMAL: t = jj_consume_token(DECIMAL); - datatype = XMLSchema.DECIMAL; + datatype = XSD.DECIMAL; break; case DOUBLE: t = jj_consume_token(DOUBLE); - datatype = XMLSchema.DOUBLE; + datatype = XSD.DOUBLE; break; default: jj_la1[148] = jj_gen; @@ -8654,15 +8654,15 @@ final public void NumericLiteralPositive() throws ParseException { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case INTEGER_POSITIVE: t = jj_consume_token(INTEGER_POSITIVE); - datatype = XMLSchema.INTEGER; + datatype = XSD.INTEGER; break; case DECIMAL_POSITIVE: t = jj_consume_token(DECIMAL_POSITIVE); - datatype = XMLSchema.DECIMAL; + datatype = XSD.DECIMAL; break; case DOUBLE_POSITIVE: t = jj_consume_token(DOUBLE_POSITIVE); - datatype = XMLSchema.DOUBLE; + datatype = XSD.DOUBLE; break; default: jj_la1[149] = jj_gen; @@ -8691,15 +8691,15 @@ final public void NumericLiteralNegative() throws ParseException { switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) { case INTEGER_NEGATIVE: t = jj_consume_token(INTEGER_NEGATIVE); - datatype = XMLSchema.INTEGER; + datatype = XSD.INTEGER; break; case DECIMAL_NEGATIVE: t = jj_consume_token(DECIMAL_NEGATIVE); - datatype = XMLSchema.DECIMAL; + datatype = XSD.DECIMAL; break; case DOUBLE_NEGATIVE: t = jj_consume_token(DOUBLE_NEGATIVE); - datatype = XMLSchema.DOUBLE; + datatype = XSD.DOUBLE; break; default: jj_la1[150] = jj_gen; diff --git a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqljson/AbstractSPARQLJSONWriter.java b/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqljson/AbstractSPARQLJSONWriter.java index 398f16cbbe7..b7377069eca 100644 --- a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqljson/AbstractSPARQLJSONWriter.java +++ b/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqljson/AbstractSPARQLJSONWriter.java @@ -22,7 +22,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.util.Literals; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.Binding; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryResultHandlerException; @@ -290,7 +290,7 @@ protected void writeValue(Value value) throws IOException, QueryResultHandlerExc jg.writeObjectField("xml:lang", lit.getLanguage().orElse(null)); } else { IRI datatype = lit.getDatatype(); - boolean ignoreDatatype = datatype.equals(XMLSchema.STRING) && xsdStringToPlainLiteral(); + boolean ignoreDatatype = datatype.equals(XSD.STRING) && xsdStringToPlainLiteral(); if (!ignoreDatatype) { jg.writeObjectField("datatype", lit.getDatatype().stringValue()); } diff --git a/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONParserCustomTest.java b/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONParserCustomTest.java index f429ca428b7..d96ccd67276 100644 --- a/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONParserCustomTest.java +++ b/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONParserCustomTest.java @@ -21,7 +21,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.resultio.QueryResultIO; import org.eclipse.rdf4j.query.resultio.QueryResultParseException; @@ -108,13 +108,13 @@ public class SPARQLJSONParserCustomTest { private final IRI testBindingValueIRI = SimpleValueFactory.getInstance().createIRI("http://example.com/Obj1"); private final Literal testBindingValueNotANumber = SimpleValueFactory.getInstance() - .createLiteral("NaN", XMLSchema.DOUBLE); + .createLiteral("NaN", XSD.DOUBLE); private final Literal testBindingValueLiteralNumber = SimpleValueFactory.getInstance() - .createLiteral("42", XMLSchema.INTEGER); + .createLiteral("42", XSD.INTEGER); private final Literal testBindingValueLiteralUnquotedControlChar = SimpleValueFactory.getInstance() - .createLiteral("42\u0009", XMLSchema.STRING); + .createLiteral("42\u0009", XSD.STRING); @Before public void setUp() throws Exception { diff --git a/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONTupleBackgroundTest.java b/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONTupleBackgroundTest.java index 6e9cff0d49b..1017221e0d4 100644 --- a/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONTupleBackgroundTest.java +++ b/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONTupleBackgroundTest.java @@ -22,7 +22,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.TupleQueryResult; import org.eclipse.rdf4j.query.TupleQueryResultHandlerException; @@ -167,12 +167,12 @@ public void testBindings2() throws Exception { Literal name = (Literal) b.getValue("name"); assertEquals("Alice", name.stringValue()); assertFalse(name.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, name.getDatatype()); + assertEquals(XSD.STRING, name.getDatatype()); Literal mbox = (Literal) b.getValue("mbox"); assertEquals("", mbox.stringValue()); assertFalse(mbox.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, mbox.getDatatype()); + assertEquals(XSD.STRING, mbox.getDatatype()); Literal blurb = (Literal) b.getValue("blurb"); assertEquals("

My name is alice

", diff --git a/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONTupleTest.java b/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONTupleTest.java index b0217bd6e6c..4372633e89e 100644 --- a/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONTupleTest.java +++ b/core/queryresultio/sparqljson/src/test/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONTupleTest.java @@ -21,7 +21,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.resultio.AbstractQueryResultIOTupleTest; import org.eclipse.rdf4j.query.resultio.BooleanQueryResultFormat; @@ -155,12 +155,12 @@ public void testBindings2() throws Exception { Literal name = (Literal) b.getValue("name"); assertEquals("Alice", name.stringValue()); assertFalse(name.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, name.getDatatype()); + assertEquals(XSD.STRING, name.getDatatype()); Literal mbox = (Literal) b.getValue("mbox"); assertEquals("", mbox.stringValue()); assertFalse(mbox.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, mbox.getDatatype()); + assertEquals(XSD.STRING, mbox.getDatatype()); Literal blurb = (Literal) b.getValue("blurb"); assertEquals("

My name is alice

", diff --git a/core/queryresultio/sparqlxml/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlxml/AbstractSPARQLXMLWriter.java b/core/queryresultio/sparqlxml/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlxml/AbstractSPARQLXMLWriter.java index 49152f3a696..0597147f695 100644 --- a/core/queryresultio/sparqlxml/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlxml/AbstractSPARQLXMLWriter.java +++ b/core/queryresultio/sparqlxml/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlxml/AbstractSPARQLXMLWriter.java @@ -44,7 +44,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.util.Literals; import org.eclipse.rdf4j.model.vocabulary.SESAMEQNAME; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.Binding; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryResultHandlerException; @@ -439,7 +439,7 @@ private void writeLiteral(Literal literal) throws IOException { // rdf:langString datatype is handled implicitly above else { IRI datatype = literal.getDatatype(); - boolean ignoreDatatype = datatype.equals(XMLSchema.STRING) && xsdStringToPlainLiteral(); + boolean ignoreDatatype = datatype.equals(XSD.STRING) && xsdStringToPlainLiteral(); if (!ignoreDatatype) { if (isQName(datatype)) { writeQName(datatype); diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/SPARQLResultsXSVMappingStrategy.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/SPARQLResultsXSVMappingStrategy.java index 01b72b39dcb..9d04bac31af 100644 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/SPARQLResultsXSVMappingStrategy.java +++ b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/SPARQLResultsXSVMappingStrategy.java @@ -16,7 +16,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import com.opencsv.bean.BeanField; @@ -97,14 +97,14 @@ protected Value parseNumberPatternMatch(String valueString) { if (XMLDatatypeUtil.isValidInteger(valueString)) { if (XMLDatatypeUtil.isValidNegativeInteger(valueString)) { - dataType = XMLSchema.NEGATIVE_INTEGER; + dataType = XSD.NEGATIVE_INTEGER; } else { - dataType = XMLSchema.INTEGER; + dataType = XSD.INTEGER; } } else if (XMLDatatypeUtil.isValidDecimal(valueString)) { - dataType = XMLSchema.DECIMAL; + dataType = XSD.DECIMAL; } else if (XMLDatatypeUtil.isValidDouble(valueString)) { - dataType = XMLSchema.DOUBLE; + dataType = XSD.DOUBLE; } return dataType != null ? valueFactory.createLiteral(valueString, dataType) diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/csv/SPARQLResultsCSVWriter.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/csv/SPARQLResultsCSVWriter.java index a82347455c2..d8128a67b70 100644 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/csv/SPARQLResultsCSVWriter.java +++ b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/csv/SPARQLResultsCSVWriter.java @@ -21,7 +21,7 @@ import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryResultHandlerException; import org.eclipse.rdf4j.query.TupleQueryResultHandlerException; @@ -160,7 +160,7 @@ private void writeLiteral(Literal literal) throws IOException { boolean quoted = false; if (XMLDatatypeUtil.isIntegerDatatype(datatype) || XMLDatatypeUtil.isDecimalDatatype(datatype) - || XMLSchema.DOUBLE.equals(datatype)) { + || XSD.DOUBLE.equals(datatype)) { try { String normalized = XMLDatatypeUtil.normalize(label, datatype); writer.write(normalized); diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java index 6c1dfbb528c..7f7203a095f 100644 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java +++ b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLResultsTSVWriter.java @@ -23,7 +23,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.util.Literals; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryResultHandlerException; import org.eclipse.rdf4j.query.TupleQueryResultHandlerException; @@ -155,8 +155,8 @@ private void writeLiteral(Literal lit) throws IOException { IRI datatype = lit.getDatatype(); - if (XMLSchema.INTEGER.equals(datatype) || XMLSchema.DECIMAL.equals(datatype) - || XMLSchema.DOUBLE.equals(datatype)) { + if (XSD.INTEGER.equals(datatype) || XSD.DECIMAL.equals(datatype) + || XSD.DOUBLE.equals(datatype)) { try { writer.write(XMLDatatypeUtil.normalize(label, datatype)); return; // done @@ -175,7 +175,7 @@ private void writeLiteral(Literal lit) throws IOException { // Append the literal's language writer.write("@"); writer.write(lit.getLanguage().get()); - } else if (!XMLSchema.STRING.equals(datatype) || !xsdStringToPlainLiteral()) { + } else if (!XSD.STRING.equals(datatype) || !xsdStringToPlainLiteral()) { writer.write("\""); writer.write(encoded); writer.write("\""); diff --git a/core/queryresultio/text/src/test/java/org/eclipse/rdf4j/query/resultio/text/csv/CSVQueryResultsComparisons.java b/core/queryresultio/text/src/test/java/org/eclipse/rdf4j/query/resultio/text/csv/CSVQueryResultsComparisons.java index 9b049305268..80484906668 100644 --- a/core/queryresultio/text/src/test/java/org/eclipse/rdf4j/query/resultio/text/csv/CSVQueryResultsComparisons.java +++ b/core/queryresultio/text/src/test/java/org/eclipse/rdf4j/query/resultio/text/csv/CSVQueryResultsComparisons.java @@ -16,7 +16,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.util.Literals; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * Value equality testing for CSV-based query result serializations. @@ -74,7 +74,7 @@ private static boolean compareLiterals(Literal leftLit, Literal rightLit) { // string-typed literals with the same lexical value are considered equal. IRI commonDatatype = null; if (isSimpleLiteral(leftLit) && isSimpleLiteral(rightLit)) { - commonDatatype = XMLSchema.STRING; + commonDatatype = XSD.STRING; } Integer compareResult = null; @@ -90,36 +90,36 @@ private static boolean compareLiterals(Literal leftLit, Literal rightLit) { // left and right arguments have different datatypes, try to find // a // more general, shared datatype - if (leftDatatype.equals(XMLSchema.DOUBLE) || rightDatatype.equals(XMLSchema.DOUBLE)) { - commonDatatype = XMLSchema.DOUBLE; - } else if (leftDatatype.equals(XMLSchema.FLOAT) || rightDatatype.equals(XMLSchema.FLOAT)) { - commonDatatype = XMLSchema.FLOAT; - } else if (leftDatatype.equals(XMLSchema.DECIMAL) || rightDatatype.equals(XMLSchema.DECIMAL)) { - commonDatatype = XMLSchema.DECIMAL; + if (leftDatatype.equals(XSD.DOUBLE) || rightDatatype.equals(XSD.DOUBLE)) { + commonDatatype = XSD.DOUBLE; + } else if (leftDatatype.equals(XSD.FLOAT) || rightDatatype.equals(XSD.FLOAT)) { + commonDatatype = XSD.FLOAT; + } else if (leftDatatype.equals(XSD.DECIMAL) || rightDatatype.equals(XSD.DECIMAL)) { + commonDatatype = XSD.DECIMAL; } else { - commonDatatype = XMLSchema.INTEGER; + commonDatatype = XSD.INTEGER; } } else if (!strict && XMLDatatypeUtil.isCalendarDatatype(leftDatatype) && XMLDatatypeUtil.isCalendarDatatype(rightDatatype)) { // We're not running in strict eval mode so we use extended datatype comparsion. - commonDatatype = XMLSchema.DATETIME; + commonDatatype = XSD.DATETIME; } else if (!strict && XMLDatatypeUtil.isDurationDatatype(leftDatatype) && XMLDatatypeUtil.isDurationDatatype(rightDatatype)) { - commonDatatype = XMLSchema.DURATION; + commonDatatype = XSD.DURATION; } } if (commonDatatype != null) { try { - if (commonDatatype.equals(XMLSchema.DOUBLE)) { + if (commonDatatype.equals(XSD.DOUBLE)) { compareResult = Double.compare(leftLit.doubleValue(), rightLit.doubleValue()); - } else if (commonDatatype.equals(XMLSchema.FLOAT)) { + } else if (commonDatatype.equals(XSD.FLOAT)) { compareResult = Float.compare(leftLit.floatValue(), rightLit.floatValue()); - } else if (commonDatatype.equals(XMLSchema.DECIMAL)) { + } else if (commonDatatype.equals(XSD.DECIMAL)) { compareResult = leftLit.decimalValue().compareTo(rightLit.decimalValue()); } else if (XMLDatatypeUtil.isIntegerDatatype(commonDatatype)) { compareResult = leftLit.integerValue().compareTo(rightLit.integerValue()); - } else if (commonDatatype.equals(XMLSchema.BOOLEAN)) { + } else if (commonDatatype.equals(XSD.BOOLEAN)) { Boolean leftBool = leftLit.booleanValue(); Boolean rightBool = rightLit.booleanValue(); compareResult = leftBool.compareTo(rightBool); @@ -135,7 +135,7 @@ private static boolean compareLiterals(Literal leftLit, Literal rightLit) { if (compareResult == DatatypeConstants.INDETERMINATE) { // If we compare two xsd:dateTime we should use the specific comparison specified in SPARQL // 1.1 - if (leftDatatype.equals(XMLSchema.DATETIME) && rightDatatype.equals(XMLSchema.DATETIME)) { + if (leftDatatype.equals(XSD.DATETIME) && rightDatatype.equals(XSD.DATETIME)) { throw new RuntimeException("Indeterminate result for date/time comparison"); } else { // We fallback to the regular RDF term compare @@ -150,7 +150,7 @@ private static boolean compareLiterals(Literal leftLit, Literal rightLit) { if (compareResult == DatatypeConstants.INDETERMINATE) { compareResult = null; // We fallback to regular term comparison } - } else if (commonDatatype.equals(XMLSchema.STRING)) { + } else if (commonDatatype.equals(XSD.STRING)) { compareResult = leftLit.getLabel().compareTo(rightLit.getLabel()); } } catch (IllegalArgumentException e) { @@ -190,8 +190,8 @@ && isSupportedDatatype(rightDatatype)) { if (!XMLDatatypeUtil.isValidValue(rightLit.getLabel(), rightDatatype)) { throw new IllegalArgumentException("not a valid datatype value: " + rightLit); } - boolean leftString = leftDatatype.equals(XMLSchema.STRING); - boolean rightString = rightDatatype.equals(XMLSchema.STRING); + boolean leftString = leftDatatype.equals(XSD.STRING); + boolean rightString = rightDatatype.equals(XSD.STRING); boolean leftNumeric = XMLDatatypeUtil.isNumericDatatype(leftDatatype); boolean rightNumeric = XMLDatatypeUtil.isNumericDatatype(rightDatatype); boolean leftDate = XMLDatatypeUtil.isCalendarDatatype(leftDatatype); @@ -219,17 +219,17 @@ && isSupportedDatatype(rightDatatype)) { } private static boolean isSupportedDatatype(IRI datatype) { - return (XMLSchema.STRING.equals(datatype) || XMLDatatypeUtil.isNumericDatatype(datatype) + return (XSD.STRING.equals(datatype) || XMLDatatypeUtil.isNumericDatatype(datatype) || XMLDatatypeUtil.isCalendarDatatype(datatype)); } /** * Checks whether the supplied literal is a "simple literal". A "simple literal" is a literal with no language tag - * and the datatype {@link XMLSchema#STRING}. + * and the datatype {@link XSD#STRING}. * * @see SPARQL Simple Literal Documentation */ private static boolean isSimpleLiteral(Literal l) { - return !Literals.isLanguageLiteral(l) && l.getDatatype().equals(XMLSchema.STRING); + return !Literals.isLanguageLiteral(l) && l.getDatatype().equals(XSD.STRING); } } diff --git a/core/queryresultio/text/src/test/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLTSVCustomTest.java b/core/queryresultio/text/src/test/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLTSVCustomTest.java index 7bc84147a1a..98247b0bc0f 100644 --- a/core/queryresultio/text/src/test/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLTSVCustomTest.java +++ b/core/queryresultio/text/src/test/java/org/eclipse/rdf4j/query/resultio/text/tsv/SPARQLTSVCustomTest.java @@ -16,7 +16,7 @@ import java.util.List; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.TupleQueryResult; import org.eclipse.rdf4j.query.TupleQueryResultHandlerException; @@ -37,8 +37,8 @@ public class SPARQLTSVCustomTest { /** * Only Literals with the XML Schema numeric types should be simplified. *

- * NOTE: This will fail when using RDF-1.1, as the datatype {@link XMLSchema#STRING} is implied and hence is not - * generally represented. + * NOTE: This will fail when using RDF-1.1, as the datatype {@link XSD#STRING} is implied and hence is not generally + * represented. * * @throws Exception */ @@ -48,7 +48,7 @@ public void testSES2126QuotedLiteralIntegerAsStringExplicitType() throws Excepti List bindingNames = Arrays.asList("test"); TupleQueryResult tqr = new IteratingTupleQueryResult(bindingNames, Arrays.asList(new ListBindingSet(bindingNames, - SimpleValueFactory.getInstance().createLiteral("1", XMLSchema.STRING)))); + SimpleValueFactory.getInstance().createLiteral("1", XSD.STRING)))); String result = writeTupleResult(tqr); assertEquals("?test\n\"1\"^^\n", result); } diff --git a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/RepositoryConfig.java b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/RepositoryConfig.java index da057a72ed9..8ba62925b89 100644 --- a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/RepositoryConfig.java +++ b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/RepositoryConfig.java @@ -20,7 +20,7 @@ import org.eclipse.rdf4j.model.util.Models; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * @author Arjohn Kampman @@ -130,7 +130,7 @@ public void export(Model model) { public void export(Model model, Resource repositoryNode) { ValueFactory vf = SimpleValueFactory.getInstance(); model.setNamespace(RDFS.NS); - model.setNamespace(XMLSchema.NS); + model.setNamespace(XSD.NS); model.setNamespace("rep", NAMESPACE); model.add(repositoryNode, RDF.TYPE, REPOSITORY); diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/QueryStringUtil.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/QueryStringUtil.java index 563c29ba065..181b2471870 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/QueryStringUtil.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/query/QueryStringUtil.java @@ -13,7 +13,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.util.Literals; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.parser.sparql.SPARQLUtil; @@ -168,7 +168,7 @@ private static StringBuilder appendValue(StringBuilder sb, Literal lit) { if (Literals.isLanguageLiteral(lit)) { sb.append('@'); sb.append(lit.getLanguage().get()); - } else if (!lit.getDatatype().equals(XMLSchema.STRING)) { + } else if (!lit.getDatatype().equals(XSD.STRING)) { // Don't append type if it's xsd:string, this keeps it compatible with RDF 1.0 sb.append("^^<"); sb.append(lit.getDatatype().stringValue()); diff --git a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/DatatypeHandler.java b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/DatatypeHandler.java index c8bf7df2133..a506bcde639 100644 --- a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/DatatypeHandler.java +++ b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/DatatypeHandler.java @@ -11,7 +11,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.util.LiteralUtilException; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An interface defining methods related to verification and normalization of typed literals and datatype URIs. @@ -21,7 +21,7 @@ public interface DatatypeHandler { /** - * Identifier for datatypes defined in the {@link XMLSchema} vocabulary. + * Identifier for datatypes defined in the {@link XSD} vocabulary. */ public static final String XMLSCHEMA = "org.eclipse.rdf4j.rio.datatypes.xmlschema"; diff --git a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/NTriplesUtil.java b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/NTriplesUtil.java index 2ac408dc15d..ca58fbe7853 100644 --- a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/NTriplesUtil.java +++ b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/NTriplesUtil.java @@ -21,7 +21,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.util.Literals; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * Utility methods for N-Triples encoding/decoding. @@ -567,7 +567,7 @@ public static void append(Literal lit, Appendable appendable, boolean xsdStringT // language literals we display the type for backwards compatibility // Append the literal's datatype IRI datatype = lit.getDatatype(); - boolean ignoreDatatype = datatype.equals(XMLSchema.STRING) && xsdStringToPlainLiteral; + boolean ignoreDatatype = datatype.equals(XSD.STRING) && xsdStringToPlainLiteral; if (!ignoreDatatype) { appendable.append("^^"); append(lit.getDatatype(), appendable); diff --git a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/RDFParserHelper.java b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/RDFParserHelper.java index 57134961bd2..ee33c592a5d 100644 --- a/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/RDFParserHelper.java +++ b/core/rio/api/src/main/java/org/eclipse/rdf4j/rio/helpers/RDFParserHelper.java @@ -14,7 +14,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.util.LiteralUtilException; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.DatatypeHandler; import org.eclipse.rdf4j.rio.LanguageHandler; import org.eclipse.rdf4j.rio.ParseErrorListener; @@ -200,7 +200,7 @@ public static final Literal createLiteral(String label, String lang, IRI datatyp else if (workingDatatype != null) { result = valueFactory.createLiteral(workingLabel, workingDatatype); } else { - result = valueFactory.createLiteral(workingLabel, XMLSchema.STRING); + result = valueFactory.createLiteral(workingLabel, XSD.STRING); } } catch (Exception e) { reportFatalError(e, lineNo, columnNo, errListener); diff --git a/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/AbstractParserHandlingTest.java b/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/AbstractParserHandlingTest.java index b1d02629b4c..0cb4f423730 100644 --- a/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/AbstractParserHandlingTest.java +++ b/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/AbstractParserHandlingTest.java @@ -33,7 +33,7 @@ import org.eclipse.rdf4j.model.vocabulary.DC; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.helpers.BasicParserSettings; import org.eclipse.rdf4j.rio.helpers.ParseErrorCollector; import org.eclipse.rdf4j.rio.helpers.RDFStarUtil; @@ -79,7 +79,7 @@ public abstract class AbstractParserHandlingTest { *

* This may be anything, but it must match with the given {@link DatatypeHandler}. */ - private static final IRI KNOWN_DATATYPE_URI = XMLSchema.INTEGER; + private static final IRI KNOWN_DATATYPE_URI = XSD.INTEGER; /** * Test value used for testing unknown language support. diff --git a/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/helpers/RDFParserHelperTest.java b/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/helpers/RDFParserHelperTest.java index be7895ddcfc..4b7144199c9 100644 --- a/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/helpers/RDFParserHelperTest.java +++ b/core/rio/api/src/test/java/org/eclipse/rdf4j/rio/helpers/RDFParserHelperTest.java @@ -19,7 +19,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.DatatypeHandler; import org.eclipse.rdf4j.rio.LanguageHandler; import org.eclipse.rdf4j.rio.ParseErrorListener; @@ -100,7 +100,7 @@ public final void testCreateLiteralLabelOnly() throws Exception { assertEquals(LABEL_TESTA, literal.getLabel()); assertFalse(literal.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, literal.getDatatype()); + assertEquals(XSD.STRING, literal.getDatatype()); } /** @@ -125,12 +125,12 @@ public final void testCreateLiteralLabelAndLanguage() throws Exception { */ @Test public final void testCreateLiteralLabelAndDatatype() throws Exception { - Literal literal = RDFParserHelper.createLiteral(LABEL_TESTA, null, XMLSchema.STRING, parserConfig, errListener, + Literal literal = RDFParserHelper.createLiteral(LABEL_TESTA, null, XSD.STRING, parserConfig, errListener, valueFactory); assertEquals(LABEL_TESTA, literal.getLabel()); assertFalse(literal.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, literal.getDatatype()); + assertEquals(XSD.STRING, literal.getDatatype()); } /** @@ -178,7 +178,7 @@ public final void testCreateLiteralLabelNoLanguageWithRDFLangStringWithNoVerify( Literal literal = RDFParserHelper.createLiteral(LABEL_TESTA, null, RDF.LANGSTRING, parserConfig, errListener, valueFactory); assertFalse(literal.getLanguage().isPresent()); - assertEquals(XMLSchema.STRING, literal.getDatatype()); + assertEquals(XSD.STRING, literal.getDatatype()); } @Test diff --git a/core/rio/datatypes/src/main/java/org/eclipse/rdf4j/rio/datatypes/XMLSchemaDatatypeHandler.java b/core/rio/datatypes/src/main/java/org/eclipse/rdf4j/rio/datatypes/XMLSchemaDatatypeHandler.java index f39d00efa21..398a4461c7f 100644 --- a/core/rio/datatypes/src/main/java/org/eclipse/rdf4j/rio/datatypes/XMLSchemaDatatypeHandler.java +++ b/core/rio/datatypes/src/main/java/org/eclipse/rdf4j/rio/datatypes/XMLSchemaDatatypeHandler.java @@ -12,11 +12,11 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.util.LiteralUtilException; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.DatatypeHandler; /** - * An implementation of a datatype handler that can process {@link XMLSchema} datatypes. + * An implementation of a datatype handler that can process {@link XSD} datatypes. *

* Implemented using {@link XMLDatatypeUtil}. * diff --git a/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/DBPediaCelsiusDatatypeHandlerTest.java b/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/DBPediaCelsiusDatatypeHandlerTest.java index 81ec95f7d05..d4e131e3b15 100644 --- a/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/DBPediaCelsiusDatatypeHandlerTest.java +++ b/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/DBPediaCelsiusDatatypeHandlerTest.java @@ -11,7 +11,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.DatatypeHandler; import org.junit.Ignore; import org.junit.Test; @@ -77,7 +77,7 @@ protected ValueFactory getValueFactory() { @Override protected IRI getUnrecognisedDatatypeUri() { - return XMLSchema.DOUBLE; + return XSD.DOUBLE; } @Override diff --git a/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/RDFLangStringDatatypeHandlerTest.java b/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/RDFLangStringDatatypeHandlerTest.java index 9476b284b46..00ba9c34d02 100644 --- a/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/RDFLangStringDatatypeHandlerTest.java +++ b/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/RDFLangStringDatatypeHandlerTest.java @@ -12,7 +12,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.DatatypeHandler; import org.junit.Ignore; import org.junit.Test; @@ -82,7 +82,7 @@ protected ValueFactory getValueFactory() { @Override protected IRI getUnrecognisedDatatypeUri() { - return XMLSchema.DOUBLE; + return XSD.DOUBLE; } @Override diff --git a/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/XMLSchemaDoubleDatatypeHandlerTest.java b/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/XMLSchemaDoubleDatatypeHandlerTest.java index 26c4cc84b91..e30987f2cda 100644 --- a/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/XMLSchemaDoubleDatatypeHandlerTest.java +++ b/core/rio/datatypes/src/test/java/org/eclipse/rdf4j/rio/datatypes/XMLSchemaDoubleDatatypeHandlerTest.java @@ -12,11 +12,11 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.DatatypeHandler; /** - * Test for {@link XMLSchemaDatatypeHandler} with {@link XMLSchema#DOUBLE}. + * Test for {@link XMLSchemaDatatypeHandler} with {@link XSD#DOUBLE}. * * @author Peter Ansell */ @@ -28,7 +28,7 @@ public class XMLSchemaDoubleDatatypeHandlerTest extends AbstractDatatypeHandlerT @Override protected IRI getRecognisedDatatypeUri() { - return XMLSchema.DOUBLE; + return XSD.DOUBLE; } @Override @@ -43,7 +43,7 @@ protected String getValueNotMatchingRecognisedDatatypeUri() { @Override protected Literal getNormalisedLiteralForRecognisedDatatypeAndValue() { - return SimpleValueFactory.getInstance().createLiteral("1.23E2", XMLSchema.DOUBLE); + return SimpleValueFactory.getInstance().createLiteral("1.23E2", XSD.DOUBLE); } // ------------------------------------- diff --git a/core/rio/jsonld/src/main/java/org/eclipse/rdf4j/rio/jsonld/JSONLDInternalRDFParser.java b/core/rio/jsonld/src/main/java/org/eclipse/rdf4j/rio/jsonld/JSONLDInternalRDFParser.java index c78521a2cfa..bf97ff0d8c9 100644 --- a/core/rio/jsonld/src/main/java/org/eclipse/rdf4j/rio/jsonld/JSONLDInternalRDFParser.java +++ b/core/rio/jsonld/src/main/java/org/eclipse/rdf4j/rio/jsonld/JSONLDInternalRDFParser.java @@ -19,7 +19,7 @@ import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import com.github.jsonldjava.core.JsonLdConsts; import com.github.jsonldjava.core.JsonLdError; @@ -62,7 +62,7 @@ public void handleStatement(RDFDataset result, Statement nextStatement) { // In RDF-1.1, RDF-1.0 Plain Literals are now Typed Literals with // type xsd:String if (!literal.getLanguage().isPresent() && datatype == null) { - datatype = XMLSchema.STRING.stringValue(); + datatype = XSD.STRING.stringValue(); } result.addQuad(subject, predicate, value, datatype, literal.getLanguage().orElse(null), graphName); diff --git a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java index 9c23f23d54f..6b5e0143286 100644 --- a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java +++ b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java @@ -23,7 +23,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.impl.LinkedHashModel; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.RDFFormat; import org.eclipse.rdf4j.rio.RDFParseException; import org.eclipse.rdf4j.rio.RDFParser; @@ -118,9 +118,9 @@ public class JSONLDParserCustomTest { private final IRI testPredicate = F.createIRI("http://example.com/prop1"); private final IRI testObjectIRI = F.createIRI("http://example.com/Obj1"); - private final Literal testObjectLiteralNotANumber = F.createLiteral("NaN", XMLSchema.DOUBLE); - private final Literal testObjectLiteralNumber = F.createLiteral("42", XMLSchema.INTEGER); - private final Literal testObjectLiteralUnquotedControlChar = F.createLiteral("42\u0009", XMLSchema.STRING); + private final Literal testObjectLiteralNotANumber = F.createLiteral("NaN", XSD.DOUBLE); + private final Literal testObjectLiteralNumber = F.createLiteral("42", XSD.INTEGER); + private final Literal testObjectLiteralUnquotedControlChar = F.createLiteral("42\u0009", XSD.STRING); @Before public void setUp() throws Exception { diff --git a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterBackgroundTest.java b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterBackgroundTest.java index c95af9611f8..ec7a3c359b9 100644 --- a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterBackgroundTest.java +++ b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterBackgroundTest.java @@ -20,7 +20,7 @@ import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.LinkedHashModel; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.QueryResults; import org.eclipse.rdf4j.rio.ParserConfig; import org.eclipse.rdf4j.rio.RDFHandlerException; @@ -76,7 +76,7 @@ public void testRoundTripNamespaces() throws Exception { String exNs = "http://example.org/"; IRI uri1 = vf.createIRI(exNs, "uri1"); IRI uri2 = vf.createIRI(exNs, "uri2"); - Literal plainLit = vf.createLiteral("plain", XMLSchema.STRING); + Literal plainLit = vf.createLiteral("plain", XSD.STRING); Statement st1 = vf.createStatement(uri1, uri2, plainLit); diff --git a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterTest.java b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterTest.java index b6c35cdf5c8..561ff9b9856 100644 --- a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterTest.java +++ b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDWriterTest.java @@ -21,7 +21,7 @@ import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.LinkedHashModel; import org.eclipse.rdf4j.model.vocabulary.DCTERMS; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.ParserConfig; import org.eclipse.rdf4j.rio.RDFHandlerException; import org.eclipse.rdf4j.rio.RDFParseException; @@ -88,7 +88,7 @@ public void testEmptyNamespace() throws Exception { public void testRoundTripNamespaces() throws Exception { IRI uri1 = vf.createIRI(exNs, "uri1"); IRI uri2 = vf.createIRI(exNs, "uri2"); - Literal plainLit = vf.createLiteral("plain", XMLSchema.STRING); + Literal plainLit = vf.createLiteral("plain", XSD.STRING); Statement st1 = vf.createStatement(uri1, uri2, plainLit); diff --git a/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONParserCustomTest.java b/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONParserCustomTest.java index bdfed6f58c7..2c79b1ba0a7 100644 --- a/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONParserCustomTest.java +++ b/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONParserCustomTest.java @@ -23,7 +23,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.impl.LinkedHashModel; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.RDFFormat; import org.eclipse.rdf4j.rio.RDFParseException; import org.eclipse.rdf4j.rio.RDFParser; @@ -111,13 +111,13 @@ public class RDFJSONParserCustomTest { private final IRI testObjectIRI = SimpleValueFactory.getInstance().createIRI("http://example.com/Obj1"); private final Literal testObjectLiteralNotANumber = SimpleValueFactory.getInstance() - .createLiteral("NaN", XMLSchema.DOUBLE); + .createLiteral("NaN", XSD.DOUBLE); private final Literal testObjectLiteralNumber = SimpleValueFactory.getInstance() - .createLiteral("42", XMLSchema.INTEGER); + .createLiteral("42", XSD.INTEGER); private final Literal testObjectLiteralUnquotedControlChar = SimpleValueFactory.getInstance() - .createLiteral("42\u0009", XMLSchema.STRING); + .createLiteral("42\u0009", XSD.STRING); @Before public void setUp() throws Exception { diff --git a/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLWriter.java b/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLWriter.java index 6d952808471..466abb7cc2d 100644 --- a/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLWriter.java +++ b/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLWriter.java @@ -25,7 +25,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.util.Literals; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.RDFFormat; import org.eclipse.rdf4j.rio.RDFHandlerException; import org.eclipse.rdf4j.rio.RDFWriter; @@ -286,7 +286,7 @@ protected void consumeStatement(Statement st) { if (isXMLLiteral) { writeAttribute(RDF.NAMESPACE, "parseType", "Literal"); - } else if (!datatype.equals(XMLSchema.STRING)) { + } else if (!datatype.equals(XSD.STRING)) { writeAttribute(RDF.NAMESPACE, "datatype", datatype.toString()); } } diff --git a/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trigstar/TriGStarParserTest.java b/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trigstar/TriGStarParserTest.java index 294bb633251..61cf934cc88 100644 --- a/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trigstar/TriGStarParserTest.java +++ b/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trigstar/TriGStarParserTest.java @@ -25,7 +25,7 @@ import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.DCTERMS; import org.eclipse.rdf4j.model.vocabulary.FOAF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.RDFParseException; import org.eclipse.rdf4j.rio.helpers.ParseErrorCollector; import org.eclipse.rdf4j.rio.helpers.SimpleParseLocationListener; @@ -70,8 +70,8 @@ public void testParseRDFStarData() throws IOException { IRI b = vf.createIRI("http://example.com/b"); IRI c = vf.createIRI("http://example.com/c"); IRI valid = vf.createIRI("http://example.com/valid"); - Literal abcDate = vf.createLiteral("1999-08-16", XMLSchema.DATE); - Literal birthDate = vf.createLiteral("1908-03-18", XMLSchema.DATE); + Literal abcDate = vf.createLiteral("1999-08-16", XSD.DATE); + Literal birthDate = vf.createLiteral("1908-03-18", XSD.DATE); Literal titleEn = vf.createLiteral("Example book", "en"); Literal titleDe = vf.createLiteral("Beispielbuch", "de"); Literal titleEnUs = vf.createLiteral("Example Book", "en-US"); diff --git a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java index ed989c78136..af9a051f9d6 100644 --- a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java +++ b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleParser.java @@ -30,7 +30,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.RDFFormat; import org.eclipse.rdf4j.rio.RDFHandlerException; import org.eclipse.rdf4j.rio.RDFParseException; @@ -787,7 +787,7 @@ protected String parseLongString(int closingCharacter) throws IOException, RDFPa protected Literal parseNumber() throws IOException, RDFParseException { StringBuilder value = getBuilder(); - IRI datatype = XMLSchema.INTEGER; + IRI datatype = XSD.INTEGER; int c = readCodePoint(); @@ -827,7 +827,7 @@ protected Literal parseNumber() throws IOException, RDFParseException { } // We're parsing a decimal or a double - datatype = XMLSchema.DECIMAL; + datatype = XSD.DECIMAL; } } else { if (value.length() == 0) { @@ -838,7 +838,7 @@ protected Literal parseNumber() throws IOException, RDFParseException { // read optional exponent if (c == 'e' || c == 'E') { - datatype = XMLSchema.DOUBLE; + datatype = XSD.DOUBLE; appendCodepoint(value, c); c = readCodePoint(); @@ -991,10 +991,10 @@ protected Value parseQNameOrBoolean() throws IOException, RDFParseException { if (value.equals("true")) { unread(c); - return createLiteral("true", null, XMLSchema.BOOLEAN, getLineNumber(), -1); + return createLiteral("true", null, XSD.BOOLEAN, getLineNumber(), -1); } else if (value.equals("false")) { unread(c); - return createLiteral("false", null, XMLSchema.BOOLEAN, getLineNumber(), -1); + return createLiteral("false", null, XSD.BOOLEAN, getLineNumber(), -1); } } diff --git a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleWriter.java b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleWriter.java index 49e91408bd5..83cd54c1716 100644 --- a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleWriter.java +++ b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleWriter.java @@ -32,7 +32,7 @@ import org.eclipse.rdf4j.model.impl.SimpleIRI; import org.eclipse.rdf4j.model.util.Literals; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.RDFFormat; import org.eclipse.rdf4j.rio.RDFHandlerException; import org.eclipse.rdf4j.rio.RDFWriter; @@ -525,8 +525,8 @@ protected void writeLiteral(Literal lit) throws IOException { IRI datatype = lit.getDatatype(); if (prettyPrint) { - if (XMLSchema.INTEGER.equals(datatype) || XMLSchema.DECIMAL.equals(datatype) - || XMLSchema.DOUBLE.equals(datatype) || XMLSchema.BOOLEAN.equals(datatype)) { + if (XSD.INTEGER.equals(datatype) || XSD.DECIMAL.equals(datatype) + || XSD.DOUBLE.equals(datatype) || XSD.BOOLEAN.equals(datatype)) { try { String normalized = XMLDatatypeUtil.normalize(label, datatype); if (!normalized.equals(XMLDatatypeUtil.POSITIVE_INFINITY) @@ -559,7 +559,7 @@ protected void writeLiteral(Literal lit) throws IOException { // Append the literal's language writer.write("@"); writer.write(lit.getLanguage().get()); - } else if (!xsdStringToPlainLiteral || !XMLSchema.STRING.equals(datatype)) { + } else if (!xsdStringToPlainLiteral || !XSD.STRING.equals(datatype)) { // Append the literal's datatype (possibly written as an abbreviated // URI) writer.write("^^"); diff --git a/core/rio/turtle/src/test/java/org/eclipse/rdf4j/rio/turtlestar/TurtleStarParserTest.java b/core/rio/turtle/src/test/java/org/eclipse/rdf4j/rio/turtlestar/TurtleStarParserTest.java index 614f9e0b4a1..38d01d49094 100644 --- a/core/rio/turtle/src/test/java/org/eclipse/rdf4j/rio/turtlestar/TurtleStarParserTest.java +++ b/core/rio/turtle/src/test/java/org/eclipse/rdf4j/rio/turtlestar/TurtleStarParserTest.java @@ -25,7 +25,7 @@ import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.DCTERMS; import org.eclipse.rdf4j.model.vocabulary.FOAF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.rio.RDFParseException; import org.eclipse.rdf4j.rio.helpers.ParseErrorCollector; import org.eclipse.rdf4j.rio.helpers.SimpleParseLocationListener; @@ -68,8 +68,8 @@ public void testParseRDFStarData() throws IOException { IRI b = vf.createIRI("http://example.com/b"); IRI c = vf.createIRI("http://example.com/c"); IRI valid = vf.createIRI("http://example.com/valid"); - Literal abcDate = vf.createLiteral("1999-08-16", XMLSchema.DATE); - Literal birthDate = vf.createLiteral("1908-03-18", XMLSchema.DATE); + Literal abcDate = vf.createLiteral("1999-08-16", XSD.DATE); + Literal birthDate = vf.createLiteral("1908-03-18", XSD.DATE); Literal titleEn = vf.createLiteral("Example book", "en"); Literal titleDe = vf.createLiteral("Beispielbuch", "de"); Literal titleEnUs = vf.createLiteral("Example Book", "en-US"); diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/BooleanMemLiteral.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/BooleanMemLiteral.java index cdefcb52247..f3a87fe5b77 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/BooleanMemLiteral.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/BooleanMemLiteral.java @@ -7,7 +7,7 @@ *******************************************************************************/ package org.eclipse.rdf4j.sail.memory.model; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An extension of MemLiteral that stores a boolean value to avoid parsing. @@ -34,7 +34,7 @@ public BooleanMemLiteral(Object creator, boolean b) { } public BooleanMemLiteral(Object creator, String label, boolean b) { - super(creator, label, XMLSchema.BOOLEAN); + super(creator, label, XSD.BOOLEAN); this.b = b; } diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/DecimalMemLiteral.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/DecimalMemLiteral.java index af6f064da10..53b100c1a3a 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/DecimalMemLiteral.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/DecimalMemLiteral.java @@ -11,7 +11,7 @@ import java.math.BigInteger; import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An extension of MemLiteral that stores a decimal value to avoid parsing. @@ -33,7 +33,7 @@ public class DecimalMemLiteral extends MemLiteral { *--------------*/ public DecimalMemLiteral(Object creator, BigDecimal value) { - this(creator, value, XMLSchema.DECIMAL); + this(creator, value, XSD.DECIMAL); } public DecimalMemLiteral(Object creator, BigDecimal value, IRI datatype) { diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/IntegerMemLiteral.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/IntegerMemLiteral.java index 8c30f125a96..296832f7702 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/IntegerMemLiteral.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/IntegerMemLiteral.java @@ -11,7 +11,7 @@ import java.math.BigInteger; import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An extension of MemLiteral that stores an integer value to avoid parsing. @@ -33,7 +33,7 @@ public class IntegerMemLiteral extends MemLiteral { *--------------*/ public IntegerMemLiteral(Object creator, BigInteger value) { - this(creator, value, XMLSchema.INTEGER); + this(creator, value, XSD.INTEGER); } public IntegerMemLiteral(Object creator, BigInteger value, IRI datatype) { diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemLiteral.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemLiteral.java index 191909cd6ca..fd6ede08276 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemLiteral.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemLiteral.java @@ -9,7 +9,7 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.impl.SimpleLiteral; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A MemoryStore-specific extension of Literal giving it node properties. @@ -45,7 +45,7 @@ public class MemLiteral extends SimpleLiteral implements MemValue { * @param label The label for this literal. */ public MemLiteral(Object creator, String label) { - super(label, XMLSchema.STRING); + super(label, XSD.STRING); this.creator = creator; } diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemValueFactory.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemValueFactory.java index 5d59354faa6..b24213c2133 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemValueFactory.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemValueFactory.java @@ -23,7 +23,7 @@ import org.eclipse.rdf4j.model.impl.AbstractValueFactory; import org.eclipse.rdf4j.model.util.Literals; import org.eclipse.rdf4j.model.util.URIUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * A factory for MemValue objects that keeps track of created objects to prevent the creation of duplicate objects, @@ -286,17 +286,17 @@ public synchronized MemLiteral getOrCreateMemLiteral(Literal literal) { try { if (XMLDatatypeUtil.isIntegerDatatype(datatype)) { memLiteral = new IntegerMemLiteral(this, label, literal.integerValue(), datatype); - } else if (datatype.equals(XMLSchema.DECIMAL)) { + } else if (datatype.equals(XSD.DECIMAL)) { memLiteral = new DecimalMemLiteral(this, label, literal.decimalValue(), datatype); - } else if (datatype.equals(XMLSchema.FLOAT)) { + } else if (datatype.equals(XSD.FLOAT)) { memLiteral = new NumericMemLiteral(this, label, literal.floatValue(), datatype); - } else if (datatype.equals(XMLSchema.DOUBLE)) { + } else if (datatype.equals(XSD.DOUBLE)) { memLiteral = new NumericMemLiteral(this, label, literal.doubleValue(), datatype); - } else if (datatype.equals(XMLSchema.BOOLEAN)) { + } else if (datatype.equals(XSD.BOOLEAN)) { memLiteral = new BooleanMemLiteral(this, label, literal.booleanValue()); - } else if (datatype.equals(XMLSchema.DATETIME)) { + } else if (datatype.equals(XSD.DATETIME)) { memLiteral = new CalendarMemLiteral(this, label, datatype, literal.calendarValue()); - } else if (datatype.equals(XMLSchema.DATETIMESTAMP)) { + } else if (datatype.equals(XSD.DATETIMESTAMP)) { memLiteral = new CalendarMemLiteral(this, label, datatype, literal.calendarValue()); } else { memLiteral = new MemLiteral(this, label, datatype); diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/NumericMemLiteral.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/NumericMemLiteral.java index a1fae4bd968..157decbe282 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/NumericMemLiteral.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/NumericMemLiteral.java @@ -9,7 +9,7 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * An extension of MemLiteral that stores a numeric value to avoid parsing. @@ -41,27 +41,27 @@ public NumericMemLiteral(Object creator, Number number, IRI datatype) { } public NumericMemLiteral(Object creator, byte number) { - this(creator, number, XMLSchema.BYTE); + this(creator, number, XSD.BYTE); } public NumericMemLiteral(Object creator, short number) { - this(creator, number, XMLSchema.SHORT); + this(creator, number, XSD.SHORT); } public NumericMemLiteral(Object creator, int number) { - this(creator, number, XMLSchema.INT); + this(creator, number, XSD.INT); } public NumericMemLiteral(Object creator, long n) { - this(creator, n, XMLSchema.LONG); + this(creator, n, XSD.LONG); } public NumericMemLiteral(Object creator, float n) { - this(creator, n, XMLSchema.FLOAT); + this(creator, n, XSD.FLOAT); } public NumericMemLiteral(Object creator, double n) { - this(creator, n, XMLSchema.DOUBLE); + this(creator, n, XSD.DOUBLE); } /*---------* diff --git a/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/ValueStore.java b/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/ValueStore.java index fb61bdadd9a..6dbfbb3453e 100644 --- a/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/ValueStore.java +++ b/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/ValueStore.java @@ -26,7 +26,7 @@ import org.eclipse.rdf4j.model.impl.AbstractValueFactory; import org.eclipse.rdf4j.model.util.Literals; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.nativerdf.datastore.DataStore; import org.eclipse.rdf4j.sail.nativerdf.model.NativeBNode; @@ -475,7 +475,7 @@ private byte[] literal2data(Literal literal, boolean create) throws IOException private byte[] literal2legacy(Literal literal) throws IOException { IRI dt = literal.getDatatype(); - if (XMLSchema.STRING.equals(dt) || RDF.LANGSTRING.equals(dt)) { + if (XSD.STRING.equals(dt) || RDF.LANGSTRING.equals(dt)) { return literal2data(literal.getLabel(), literal.getLanguage(), null, false); } return literal2data(literal.getLabel(), literal.getLanguage(), dt, false); @@ -575,7 +575,7 @@ private NativeLiteral data2literal(int id, byte[] data) throws IOException { } else if (datatype != null) { return new NativeLiteral(revision, label, datatype, id); } else { - return new NativeLiteral(revision, label, XMLSchema.STRING, id); + return new NativeLiteral(revision, label, XSD.STRING, id); } } @@ -640,7 +640,7 @@ public NativeBNode createBNode(String nodeID) { @Override public NativeLiteral createLiteral(String value) { - return new NativeLiteral(revision, value, XMLSchema.STRING); + return new NativeLiteral(revision, value, XSD.STRING); } @Override diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LiteralComparatorFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LiteralComparatorFilter.java index 72d0094b0ef..8b368c3d8ca 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LiteralComparatorFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LiteralComparatorFilter.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.datatypes.XMLDatatypeUtil; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.algebra.evaluation.util.ValueComparator; /** @@ -40,9 +40,9 @@ public LiteralComparatorFilter(PlanNode parent, Literal compareTo, Function \n"); declarations.append("PREFIX foaf: <" + FOAF.NAMESPACE + "> \n"); declarations.append("PREFIX ex: <" + EX_NS + "> \n"); - declarations.append("PREFIX xsd: <" + XMLSchema.NAMESPACE + "> \n"); + declarations.append("PREFIX xsd: <" + XSD.NAMESPACE + "> \n"); declarations.append("\n"); return declarations.toString(); diff --git a/tools/console/src/main/java/org/eclipse/rdf4j/console/setting/Prefixes.java b/tools/console/src/main/java/org/eclipse/rdf4j/console/setting/Prefixes.java index 28080d3f302..1471171ac2f 100644 --- a/tools/console/src/main/java/org/eclipse/rdf4j/console/setting/Prefixes.java +++ b/tools/console/src/main/java/org/eclipse/rdf4j/console/setting/Prefixes.java @@ -28,7 +28,7 @@ import org.eclipse.rdf4j.model.vocabulary.TIME; import org.eclipse.rdf4j.model.vocabulary.VCARD4; import org.eclipse.rdf4j.model.vocabulary.VOID; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; /** * Namespace prefix setting @@ -55,7 +55,7 @@ public class Prefixes extends ConsoleSetting> { DEFAULT.add(TIME.NS); DEFAULT.add(VCARD4.NS); DEFAULT.add(VOID.NS); - DEFAULT.add(XMLSchema.NS); + DEFAULT.add(XSD.NS); } @Override diff --git a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/QueryServlet.java b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/QueryServlet.java index 7809c5fef58..7bf2ed5b478 100644 --- a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/QueryServlet.java +++ b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/commands/QueryServlet.java @@ -28,7 +28,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Namespace; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.query.MalformedQueryException; import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.QueryResultHandlerException; @@ -222,7 +222,7 @@ protected void doPost(final WorkbenchRequest req, final HttpServletResponse resp final String query = getQueryText(req); final Boolean infer = Boolean.valueOf(req.getParameter(EDIT_PARAMS[2])); final Literal limit = SimpleValueFactory.getInstance() - .createLiteral(req.getParameter(EDIT_PARAMS[3]), XMLSchema.INTEGER); + .createLiteral(req.getParameter(EDIT_PARAMS[3]), XSD.INTEGER); builder.result(queryLn, query, infer, limit); builder.end(); } else { diff --git a/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/util/TestValueDecoder.java b/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/util/TestValueDecoder.java index 7039ea62b2b..8ad36d211eb 100644 --- a/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/util/TestValueDecoder.java +++ b/tools/workbench/src/test/java/org/eclipse/rdf4j/workbench/util/TestValueDecoder.java @@ -18,7 +18,7 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDFS; -import org.eclipse.rdf4j.model.vocabulary.XMLSchema; +import org.eclipse.rdf4j.model.vocabulary.XSD; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.workbench.exceptions.BadRequestException; @@ -51,7 +51,7 @@ public void setUp() throws Exception { // mapping. RepositoryConnection connection = mock(RepositoryConnection.class); when(connection.getNamespace(RDFS.PREFIX)).thenReturn(RDFS.NAMESPACE); - when(connection.getNamespace(XMLSchema.PREFIX)).thenReturn(XMLSchema.NAMESPACE); + when(connection.getNamespace(XSD.PREFIX)).thenReturn(XSD.NAMESPACE); Repository repository = mock(Repository.class); when(repository.getConnection()).thenReturn(connection); decoder = new ValueDecoder(repository, factory); @@ -92,7 +92,7 @@ public final void testLiteralWithQNameType() throws BadRequestException { @Test public final void testLiteralWithURIType() throws BadRequestException { - Value value = decoder.decodeValue("\"1\"^^<" + XMLSchema.INT + ">"); + Value value = decoder.decodeValue("\"1\"^^<" + XSD.INT + ">"); assertThat(value).isInstanceOf(Literal.class); assertThat((Literal) value).isEqualTo(factory.createLiteral(1)); } From 008e215989d2124e56d37b9f3a90e0d51574d4c1 Mon Sep 17 00:00:00 2001 From: Reeshabh Kumar Ranjan Date: Tue, 26 May 2020 07:10:35 +0530 Subject: [PATCH 11/35] GH-405 add alt bag seq utility functions (#2254) * #405 Add file for the new feature Signed-off-by: Reeshabh Kumar Ranjan * #405 Add code for consumeCollection for RDFContainers Signed-off-by: Reeshabh Kumar Ranjan * #405 Replace assertion with throwing a runtime exception, add untested code for consumeValues() method for RDFContainers.java (documentation pending) Signed-off-by: Reeshabh Kumar Ranjan * #405 Add remaining methods (as present in RDFCollection) (documentation pending) Signed-off-by: Reeshabh Kumar Ranjan * #405 Add documentation Signed-off-by: Prince Sachdeva * #405 Format the file Signed-off-by: Prince Sachdeva * #405 Correct the RDFS.Member triple in consumeContainer method Signed-off-by: Prince Sachdeva * #405 Change 'as' to 'to', Change version 3.0 to 3.3.0, Run mvn impsort:sort Signed-off-by: Prince Sachdeva * #405 Add tests for RDF Containers in RDFContainersTest.java, Remove distinct element check for rdf:alt in RDFContainers.java Signed-off-by: Gaurav Aggarwal Co-authored-by: Prince Sachdeva Co-authored-by: Gaurav Aggarwal --- .../rdf4j/model/util/RDFContainers.java | 389 ++++++++++++++++++ .../rdf4j/model/util/RDFContainersTest.java | 112 +++++ 2 files changed, 501 insertions(+) create mode 100644 core/model/src/main/java/org/eclipse/rdf4j/model/util/RDFContainers.java create mode 100644 core/model/src/test/java/org/eclipse/rdf4j/model/util/RDFContainersTest.java diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/util/RDFContainers.java b/core/model/src/main/java/org/eclipse/rdf4j/model/util/RDFContainers.java new file mode 100644 index 00000000000..7c102445150 --- /dev/null +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/util/RDFContainers.java @@ -0,0 +1,389 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.model.util; + +import java.util.*; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.regex.Pattern; + +import org.eclipse.rdf4j.OpenRDFUtil; +import org.eclipse.rdf4j.RDF4JException; +import org.eclipse.rdf4j.model.*; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDFS; + +/** + * Utilities for working with RDF Containers and converting to/from Java {@link Collection} classes. + *

+ * RDF Containers are represented using 3 different types of structures: + * + * 1. {@link RDF#BAG} : A Bag (a resource having type rdf:Bag) represents a group of resources or literals, possibly + * including duplicate members, where there is no significance in the order of the members. + * + * 2. {@link RDF#SEQ} : A Sequence or Seq (a resource having type rdf:Seq) represents a group of resources or literals, + * possibly including duplicate members, where the order of the members is significant. + * + * 3. {@link RDF#ALT} : An Alternative or Alt (a resource having type rdf:Alt) represents a group of resources or + * literals that are alternatives (typically for a single value of a property). + * + * So, in each of the above types, the container starts with a first resource node, via the rdf:_1 relation. Similarly, + * the next member is connected via the rdf:_2 relation and so on. + * + * For eg. Bag containing three literal values "A", "B", and "C" looks like this as an RDF Container: + * + *

+ *   _:n1 -rdf:type--> rdf:Bag
+ *     |
+ *     +---rdf:_1--> "A"
+ *     |
+ *     +---rdf:_2--> "B"
+ *     |
+ *     +---rdf:_3--> "C"
+ * 
+ * + * + * @see RDF Schema 1.1 section on Collection vocabulary. + */ +public class RDFContainers { + + /** + * Converts the supplied {@link Iterable} to an RDF + * Container, using the supplied {@code head} resource as the starting resource of the RDF Containter. The + * statements making up the new RDF Containter will be added to the supplied statement collection. + * + * @param containerType defines the type of RDF Container + * @param values an {@link Iterable} of objects (such as a Java {@link Collection} ), which will be converted + * to an RDF Containter. May not be {@code null}. The method attempts to convert each value + * that is not already an instance of {@link Value} to a {@link Literal}. This conversion will + * fail with a {@link LiteralUtilException} if the value's object type is not supported. See + * {@link Literals#createLiteralOrFail(ValueFactory, Object)} for an overview of supported + * types. + * @param container a {@link Resource} which will be used as the head of the container, that is, the starting + * point of the created RDF Container. May be {@code null}, in which case a new resource is + * generated to represent the container head. + * @param sink a {@link Collection} of {@link Statement} objects (for example a {@link Model}) to which the + * RDF Collection statements will be added. May not be {@code null}. + * @param contexts the context(s) in which to add the RDF Containter. This argument is an optional vararg and + * can be left out. + * @return the supplied sink {@link Collection} of {@link Statement}s, with the new Statements forming the RDF + * Collection added. + * @throws LiteralUtilException if one of the supplied values can not be converted to a Literal. + * @see RDF Schema 1.1 section on Collection + * vocabulary. + */ + public static > C toRDF(IRI containerType, Iterable values, Resource container, + C sink, + Resource... contexts) { + + Objects.requireNonNull(sink); + consumeContainer(containerType, values, container, st -> sink.add(st), contexts); + return sink; + } + + /** + * Converts the supplied {@link Iterable} to an RDF + * Container, using the supplied {@code head} resource as the starting resource of the RDF Containter. The + * statements making up the new RDF Containter will be added to the supplied statement collection. + * + * @param containerType defines the type of RDF Container + * @param values an {@link Iterable} of objects (such as a Java {@link Collection} ), which will be converted + * to an RDF Containter. May not be {@code null}. The method attempts to convert each value + * that is not already an instance of {@link Value} to a {@link Literal}. This conversion will + * fail with a {@link LiteralUtilException} if the value's object type is not supported. See + * {@link Literals#createLiteralOrFail(ValueFactory, Object)} for an overview of supported + * types. + * @param container a {@link Resource} which will be used as the head of the container, that is, the starting + * point of the created RDF Container. May be {@code null}, in which case a new resource is + * generated to represent the container head. + * @param sink a {@link Collection} of {@link Statement} objects (for example a {@link Model}) to which the + * RDF Collection statements will be added. May not be {@code null}. + * @param vf the {@link ValueFactory} to be used for creation of RDF model objects. May not be + * {@code null}. + * @param contexts the context(s) in which to add the RDF Containter. This argument is an optional vararg and + * can be left out. + * @return the supplied sink {@link Collection} of {@link Statement}s, with the new Statements forming the RDF + * Collection added. + * @throws LiteralUtilException if one of the supplied values can not be converted to a Literal. + * @see RDF Schema 1.1 section on Collection + * vocabulary. + */ + public static > C toRDF(IRI containerType, Iterable values, Resource container, + C sink, + ValueFactory vf, Resource... contexts) { + + Objects.requireNonNull(sink); + consumeContainer(containerType, values, container, st -> sink.add(st), vf, contexts); + return sink; + } + + /** + * Converts an RDF Containter to a Java {@link Collection} of {@link Value} objects. The RDF Containter is given by + * the supplied {@link Model} and {@code container}. This method expects the RDF Containter to be well-formed. If + * the collection is not well-formed the method may return part of the collection, or may throw a + * {@link ModelException}. + * + * @param containerType defines the type of RDF Container + * @param m the Model containing the collection to read. + * @param container the {@link Resource} that represents the container head, that is the start resource of the + * RDF Container to be read. May not be {@code null}. + * @param collection the Java {@link Collection} to add the collection items to. + * @param contexts the context(s) from which to read the RDF Containter. This argument is an optional vararg + * and can be left out. + * @return the supplied Java {@link Collection}, filled with the items from the RDF Containter (if any). + * @throws ModelException if a problem occurs reading the RDF Containter, for example if the Collection is not + * well-formed. + * @see RDF Schema 1.1 section on Collection + * vocabulary. + */ + public static > C toValues(IRI containerType, final Model m, Resource container, + C collection, + Resource... contexts) throws ModelException { + Objects.requireNonNull(collection, "collection may not be null"); + + consumeValues(m, container, containerType, v -> collection.add(v), contexts); + + return collection; + } + + /** + * Converts the supplied {@link Iterable} to an RDF + * Container, using the supplied {@code head} resource as the starting resource of the RDF Containter. The + * statements making up the new RDF Containter will be reported to the supplied {@link Consumer} function. + * + * @param containerType defines the type of RDF Container + * @param values an {@link Iterable} of objects (such as a Java {@link Collection} ), which will be converted + * to an RDF Containter. May not be {@code null}. The method attempts to convert each value + * that is not already an instance of {@link Value} to a {@link Literal}. This conversion will + * fail with a {@link LiteralUtilException} if the value's object type is not supported. See + * {@link Literals#createLiteralOrFail(ValueFactory, Object)} for an overview of supported + * types. + * @param container a {@link Resource} which will be used as the head of the container, that is, the starting + * point of the created RDF Containter. May be {@code null}, in which case a new resource is + * generated to represent the containter head. + * @param consumer the {@link Consumer} function for the Statements of the RDF Containter. May not be + * {@code null}. + * @param contexts the context(s) in which to add the RDF Containter. This argument is an optional vararg and + * can be left out. + * @throws LiteralUtilException if one of the supplied values can not be converted to a Literal. + * @see RDF Schema 1.1 section on Collection + * vocabulary. + * @see Literals#createLiteralOrFail(ValueFactory, Object) + */ + public static void consumeContainer(IRI containerType, Iterable values, Resource container, + Consumer consumer, + Resource... contexts) { + consumeContainer(containerType, values, container, consumer, SimpleValueFactory.getInstance(), contexts); + } + + /** + * Converts the supplied {@link Iterable} to an RDF + * Container, using the supplied {@code head} resource as the starting resource of the RDF Container. The + * statements making up the new RDF Container will be reported to the supplied {@link Consumer} function. + * + * @param containerType defines the type of RDF Container + * @param values an {@link Iterable} of objects (such as a Java {@link Collection} ), which will be converted + * to an RDF Container. May not be {@code null}. The method attempts to convert each value that + * is not already an instance of {@link Value} to a {@link Literal}. This conversion will fail + * with a {@link LiteralUtilException} if the value's object type is not supported. See + * {@link Literals#createLiteralOrFail(ValueFactory, Object)} for an overview of supported + * types. + * @param container a {@link Resource} which will be used as the head of the container, that is, the starting + * point of the created RDF Container. May be {@code null}, in which case a new resource is + * generated to represent the containter head. + * @param consumer the {@link Consumer} function for the Statements of the RDF Container. May not be + * {@code null}. + * @param vf the {@link ValueFactory} to use for creation of new model objects. May not be {@code null} + * @param contexts the context(s) in which to add the RDF Container. This argument is an optional vararg and + * can be left out. + * @throws LiteralUtilException if one of the supplied values can not be converted to a Literal. + * @see RDF Schema 1.1 section on Collection + * vocabulary. + * @see Literals#createLiteralOrFail(ValueFactory, Object) + * + * @since 3.3.0 + */ + public static void consumeContainer(IRI containerType, Iterable values, Resource container, + Consumer consumer, + ValueFactory vf, Resource... contexts) { + Objects.requireNonNull(values, "input collection may not be null"); + Objects.requireNonNull(consumer, "consumer may not be null"); + Objects.requireNonNull(vf, "injected value factory may not be null"); + + Resource current = container != null ? container : vf.createBNode(); + boolean validType = Objects.equals(containerType, RDF.ALT) || + Objects.equals(containerType, RDF.BAG) || + Objects.equals(containerType, RDF.SEQ); + + if (!validType) { + throw new ModelException("containerType should be one of ALT, BAG or SEQ"); + } + + Statements.consume(vf, current, RDF.TYPE, containerType, consumer, contexts); + + Iterator iter = values.iterator(); + int elementCounter = 1; + while (iter.hasNext()) { + Object o = iter.next(); + Value v = o instanceof Value ? (Value) o : Literals.createLiteralOrFail(vf, o); + IRI elementCounterPredicate = getAnnotatedMemberPredicate(vf, elementCounter); + elementCounter++; + Statements.consume(vf, current, elementCounterPredicate, v, consumer, contexts); + Statements.consume(vf, current, RDFS.MEMBER, v, consumer, contexts); + } + } + + /** + * Creates the IRI of the element counter predicate in the {@link RDF} namespace, rdf:_nnn + * + * @param vf the {@link ValueFactory} to use for creation of new model objects. May not be {@code null} + * @param elementCounter the counter varialbe for which IRI has to be created + * @return {@link IRI} of the rdf:_nnn + */ + private static IRI getAnnotatedMemberPredicate(ValueFactory vf, int elementCounter) { + return vf.createIRI(RDF.NAMESPACE, "_" + elementCounter); + } + + /** + * Reads an RDF Container starting with the supplied containter head from the supplied {@link Model} and sends each + * collection member {@link Value} to the supplied {@link Consumer} function. This method expects the RDF Container + * to be well-formed. If the collection is not well-formed the method may report only part of the collection, or may + * throw a {@link ModelException}. + * + * @param m the Model containing the collection to read. + * @param container the {@link Resource} that represents the containter head, that is the start resource of the + * RDF Container to be read. May not be {@code null}. + * @param containerType defines the type of RDF Container + * @param consumer the Java {@link Consumer} function to which the collection items are reported. + * @param contexts the context(s) from which to read the RDF Container. This argument is an optional vararg and + * can be left out. + * @throws ModelException if a problem occurs reading the RDF Container, for example if the Collection is not + * well-formed. + * @see RDF Schema 1.1 section on Collection + * vocabulary. + */ + + public static void consumeValues(final Model m, Resource container, IRI containerType, Consumer consumer, + Resource... contexts) + throws ModelException { + Objects.requireNonNull(consumer, "consumer may not be null"); + Objects.requireNonNull(m, "input model may not be null"); + + ValueFactory vf = SimpleValueFactory.getInstance(); + + GetStatementOptional statementSupplier = (s, p, o, c) -> m.filter(s, p, o, c).stream().findAny(); + Function> exceptionSupplier = Models::modelException; + + // TODO add proper documentation + Pattern annotatedMembershipPredicatePattern = Pattern + .compile("^" + vf.createIRI(RDF.NAMESPACE, "_") + "[1-9][0-9]*$"); + + extract(containerType, statementSupplier, container, st -> { + if (RDFS.MEMBER.equals(st.getPredicate()) || + annotatedMembershipPredicatePattern.matcher(st.getPredicate().toString()).matches()) { + consumer.accept(st.getObject()); + } + }, exceptionSupplier, contexts); + } + + /** + * Extracts the RDF Container starting with the + * supplied {@code head} resource from the supplied source {@link Model}. The statements making up the RDF Container + * will be added to the supplied statement collection, which will also be returned. + * + * @param containerType defines the type of RDF Container + * @param sourceModel the source model, containing the RDF Container to be read. + * @param container the {@link Resource} that represents the container head, that is the start resource of the + * RDF Container to be read. May not be {@code null}. a {@link Collection} of {@link Statement} + * objects (for example a {@link Model}) to which the RDF Container statements will be added. + * May not be {@code null}. + * @param sink a {@link Collection} of {@link Statement} objects (for example a {@link Model}) to which the + * RDF Container statements will be added. May not be {@code null}. + * @param contexts the context(s) from which to read the RDF Container. This argument is an optional vararg and + * can be left out. + * @return the supplied sink {@link Collection} of {@link Statement}s, with the Statements of the RDF Container + * added. + */ + public static > C getContainer(IRI containerType, Model sourceModel, + Resource container, C sink, + Resource... contexts) { + Objects.requireNonNull(sourceModel, "input model may not be null"); + extract(containerType, sourceModel, container, st -> sink.add(st), contexts); + return sink; + } + + /** + * Extracts the RDF Container starting with supplied + * {@code head} resource from the supplied source {@link Model} and sends the statements that make up the collection + * to the supplied {@link Consumer}. + * + * @param containerType defines the type of RDF Container + * @param sourceModel the source model, containing the RDF Container to be read. + * @param container the {@link Resource} that represents the container head, that is the start resource of the + * RDF Container to be read. May not be {@code null}. a {@link Collection} of {@link Statement} + * objects (for example a {@link Model}) to which the RDF Container statements will be added. + * May not be {@code null}. + * @param consumer the {@link Consumer} function for the Statements of the RDF Container. May not be + * {@code null}. + * @param contexts the context(s) from which to read the RDF Container. This argument is an optional vararg and + * can be left out. + */ + public static void extract(IRI containerType, Model sourceModel, Resource container, Consumer consumer, + Resource... contexts) { + Objects.requireNonNull(sourceModel, "source model may not be null"); + GetStatementOptional statementSupplier = (s, p, o, + c) -> ((Model) sourceModel).filter(s, p, o, c).stream().findAny(); + extract(containerType, statementSupplier, container, consumer, Models::modelException, contexts); + } + + /** + * Extracts an RDF Container starting with the supplied container head from the statement supplier and sends all + * statements that make up the collection to the supplied {@link Consumer} function. This method expects the RDF + * Container to be well-formed. If the collection is not well-formed the method may report only part of the + * collection, or may throw an exception. + * + * @param containerType defines the type of RDF Container + * @param statementSupplier the source of the statements from which the RDF Container is to be read, specified as a + * functional interface. + * @param container the {@link Resource} that represents the container head, that is the start resource of + * the RDF Container to be read. May not be {@code null}. + * @param collectionConsumer the Java {@link Consumer} function to which the collection statements are reported. + * @param exceptionSupplier a functional interface that produces the exception type this method will throw when an + * error occurs. + * @param contexts the context(s) from which to read the RDF Container. This argument is an optional + * vararg and can be left out. + * @throws E if a problem occurs reading the RDF Container, for example if it is not well-formed. + */ + public static void extract(IRI containerType, GetStatementOptional statementSupplier, + Resource container, + Consumer collectionConsumer, Function> exceptionSupplier, + Resource... contexts) throws E { + OpenRDFUtil.verifyContextNotNull(contexts); + Objects.requireNonNull(container, "containter head may not be null"); + Objects.requireNonNull(collectionConsumer, "collection consumer may not be null"); + + ValueFactory vf = SimpleValueFactory.getInstance(); + + Resource current = container; + + for (int annotatedMembershipPropertyCounter = 1; true; annotatedMembershipPropertyCounter++) { + + IRI annotatedMembershipPredicate = getAnnotatedMemberPredicate(vf, annotatedMembershipPropertyCounter); + if (statementSupplier.get(container, annotatedMembershipPredicate, null, contexts) + .equals(Optional.empty())) { + break; + } + Statement statement = statementSupplier.get(container, annotatedMembershipPredicate, null, contexts).get(); + + collectionConsumer.accept(statement); + } + } +} diff --git a/core/model/src/test/java/org/eclipse/rdf4j/model/util/RDFContainersTest.java b/core/model/src/test/java/org/eclipse/rdf4j/model/util/RDFContainersTest.java new file mode 100644 index 00000000000..69b56e52e84 --- /dev/null +++ b/core/model/src/test/java/org/eclipse/rdf4j/model/util/RDFContainersTest.java @@ -0,0 +1,112 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.model.util; + +import static org.junit.Assert.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; +import static org.mockito.Mockito.atLeastOnce; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.rdf4j.model.*; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.impl.TreeModel; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.junit.Before; +import org.junit.Test; + +public class RDFContainersTest { + + private final static ValueFactory vf = SimpleValueFactory.getInstance(); + + private final List values = new ArrayList<>(); + + private Literal a; + + private Literal b; + + private Literal c; + + private IRI RDF_1; + + private IRI RDF_2; + + private IRI RDF_3; + + @Before + public void setUp() throws Exception { + a = Literals.createLiteral(vf, "A"); + b = Literals.createLiteral(vf, "B"); + c = Literals.createLiteral(vf, "C"); + + RDF_1 = vf.createIRI(RDF.NAMESPACE, "_" + 1); + RDF_2 = vf.createIRI(RDF.NAMESPACE, "_" + 2); + RDF_3 = vf.createIRI(RDF.NAMESPACE, "_" + 3); + + values.add(a); + values.add(b); + values.add(c); + } + + @Test + public void testConversionRoundtrip() { + IRI container = vf.createIRI("urn:container"); + Model m = RDFContainers.toRDF(RDF.BAG, values, container, new TreeModel()); + assertNotNull(m); + + assertTrue(m.contains(container, RDF_1, a)); + assertTrue(m.contains(container, RDF_2, b)); + assertTrue(m.contains(container, RDF_3, c)); + + List newList = RDFContainers.toValues(RDF.BAG, m, container, new ArrayList<>()); + + assertNotNull(newList); + assertTrue(newList.contains(a)); + assertTrue(newList.contains(b)); + assertTrue(newList.contains(c)); + } + + @Test + public void testInjectedValueFactoryIsUsed() { + Resource container = vf.createBNode(); + ValueFactory injected = mock(SimpleValueFactory.class, CALLS_REAL_METHODS); + RDFContainers.toRDF(RDF.BAG, values, container, new TreeModel(), injected); + verify(injected, atLeastOnce()).createStatement(any(), any(), any()); + } + + @Test + public void testExtract() { + Resource container = vf.createBNode(); + Model m = RDFContainers.toRDF(RDF.BAG, values, container, new TreeModel()); + + // add something to the model that is not part of the RDF container. + m.add(RDF.TYPE, RDF.TYPE, RDF.PROPERTY); + + Model containerModel = RDFContainers.getContainer(RDF.BAG, m, container, new TreeModel()); + assertNotNull(containerModel); + assertFalse(containerModel.contains(RDF.TYPE, RDF.TYPE, RDF.PROPERTY)); + } + + @Test + public void testRemove() { + Resource container = vf.createBNode(); + Model m = RDFContainers.toRDF(RDF.BAG, values, container, new TreeModel()); + + // add something to the model that is not part of the RDF container. + m.add(RDF.TYPE, RDF.TYPE, RDF.PROPERTY); + + // remove the entire container + RDFContainers.extract(RDF.BAG, m, container, st -> m.remove(st)); + + assertTrue(m.contains(RDF.TYPE, RDF.TYPE, RDF.PROPERTY)); + } + +} From c2d9b5d0b5f2574312eef1b143ad2b96bc8eefc6 Mon Sep 17 00:00:00 2001 From: hmottestad Date: Tue, 26 May 2020 11:30:12 +0200 Subject: [PATCH 12/35] GH-2208 dot format output for query plans (#2257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håvard Ottestad --- .../rdf4j/query/explanation/Explanation.java | 2 + .../query/explanation/ExplanationImpl.java | 4 + .../query/explanation/GenericPlanNode.java | 116 +++++++++++++- .../sail/memory/QueryPlanRetrievalTest.java | 144 +++++++++++++++++- 4 files changed, 259 insertions(+), 7 deletions(-) diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/Explanation.java b/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/Explanation.java index 7089be2dc20..793cbe80969 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/Explanation.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/Explanation.java @@ -39,4 +39,6 @@ enum Level { String toJson(); + String toDot(); + } diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/ExplanationImpl.java b/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/ExplanationImpl.java index d3bc83645e6..49b4fee1002 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/ExplanationImpl.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/ExplanationImpl.java @@ -58,4 +58,8 @@ public String toString() { return toGenericPlanNode().toString(); } + @Override + public String toDot() { + return "digraph Explanation {\n" + genericPlanNode.toDot() + "\n}\n"; + } } diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/GenericPlanNode.java b/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/GenericPlanNode.java index 788f9111bb4..ab6778a982b 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/GenericPlanNode.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/explanation/GenericPlanNode.java @@ -15,6 +15,8 @@ import org.eclipse.rdf4j.common.annotation.Experimental; +import com.fasterxml.jackson.annotation.JsonIgnore; + /** * This is an experimental feature. The interface may be changed, moved or potentially removed in a future release. * @@ -27,6 +29,9 @@ public class GenericPlanNode { public static final String UNKNOWN = "UNKNOWN"; + private final String UUID = "UUID_" + java.util.UUID.randomUUID().toString().replace("-", ""); + private final static String newLine = System.getProperty("line.separator"); + // The name of the node, eg. "Join" or "Join (HashJoinIteration)". private String type; @@ -238,8 +243,6 @@ public String toString() { private String getHumanReadable(int prettyBoxDrawingType) { StringBuilder sb = new StringBuilder(); - String newLine = System.getProperty("line.separator"); - if (timedOut != null && timedOut) { sb.append("Timed out while retrieving explanation! Explanation may be incomplete!").append(newLine); sb.append("You can change the timeout by setting .setMaxExecutionTime(...) on your query.") @@ -397,4 +400,113 @@ private void appendCostAnnotation(StringBuilder sb) { } } + public String toDot() { + + return toDotInternal(getMaxResultSizeActual(this), getMaxTotalTime(this), getMaxSelfTime(this)); + + } + + private static double getMaxTotalTime(GenericPlanNode genericPlanNode) { + return Math.max(genericPlanNode.getTotalTimeActual() != null ? genericPlanNode.getTotalTimeActual() : 0, + genericPlanNode.plans.stream().mapToDouble(GenericPlanNode::getMaxTotalTime).max().orElse(0)); + } + + private static double getMaxSelfTime(GenericPlanNode genericPlanNode) { + return Math.max(genericPlanNode.getSelfTimeActual() != null ? genericPlanNode.getSelfTimeActual() : 0, + genericPlanNode.plans.stream().mapToDouble(GenericPlanNode::getMaxSelfTime).max().orElse(0)); + } + + private static double getMaxResultSizeActual(GenericPlanNode genericPlanNode) { + return Math.max(genericPlanNode.getResultSizeActual() != null ? genericPlanNode.getResultSizeActual() : 0, + genericPlanNode.plans.stream().mapToDouble(GenericPlanNode::getMaxResultSizeActual).max().orElse(0)); + } + + private String toDotInternal(double maxResultSizeActual, double maxTotalTime, double maxSelfTime) { + StringBuilder sb = new StringBuilder(); + sb.append(" "); + + if (newScope != null && newScope) { + sb.append("subgraph cluster_") + .append(getUUID()) + .append(" {") + .append(newLine) + .append(" color=grey") + .append(newLine); + } + + String resultSizeActualColor = getProportionalRedColor(maxResultSizeActual, getResultSizeActual()); + String totalTimeColor = getProportionalRedColor(maxTotalTime, getTotalTimeActual()); + String selfTimeColor = getProportionalRedColor(maxSelfTime, getSelfTimeActual()); + + sb + .append(getUUID()) + .append(" [label=") + .append("<"); + + sb.append(Stream.of( + "", + "", + "", + "", + "", + "", +// "", + "", + "") + .filter(s -> !s.contains(UNKNOWN)) // simple but hacky way of removing essentially null values + .reduce((a, b) -> a + " " + b) + .orElse("")); + + sb.append("
" + type + "
Algorithm" + (algorithm != null ? algorithm : UNKNOWN) + "
New scope" + (newScope != null && newScope ? "true" : UNKNOWN) + + "
Cost estimate" + toHumanReadableNumber(getCostEstimate()) + "
Result size estimate" + toHumanReadableNumber(getResultSizeEstimate()) + "
Result size actual" + toHumanReadableNumber(getResultSizeActual()) + "
Result size actual" + toHumanReadableNumber(getResultSizeActual()) + "
Total time actual" + + toHumanReadableTime(getTotalTimeActual()) + "
Self time actual" + + toHumanReadableTime(getSelfTimeActual()) + "
>").append(" shape=plaintext];").append(newLine); + for (int i = 0; i < plans.size(); i++) { + GenericPlanNode p = plans.get(i); + String linkLabel = "index " + i; + + if (plans.size() == 2) { + linkLabel = i == 0 ? "left" : "right"; + } else if (plans.size() == 1) { + linkLabel = ""; + } + sb.append(" ") + .append(getUUID()) + .append(" -> ") + .append(p.getUUID()) + .append(" [label=\"" + linkLabel + "\"]") + .append(" ;") + .append(newLine); + } + + plans.forEach(p -> sb.append(p.toDotInternal(maxResultSizeActual, maxTotalTime, maxSelfTime))); + + if (newScope != null && newScope) { + sb.append(newLine).append("}").append(newLine); + } + return sb.toString(); + } + + private String getProportionalRedColor(Double max, Double value) { + String mainColor = "#FFFFFF"; + if (value != null) { + double colorInt = Math.abs(256 / max * value - 256); + String hexColor = String.format("%02X", (0xFFFFFF & ((int) Math.floor(colorInt)))); + + mainColor = "#FF" + hexColor + hexColor; + } + return mainColor; + } + + private String getProportionalRedColor(Double max, Long value) { + if (value != null) { + return getProportionalRedColor(max, value + 0.0); + } + return "#FFFFFF"; + } + + @JsonIgnore + public String getUUID() { + return UUID; + } } diff --git a/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/QueryPlanRetrievalTest.java b/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/QueryPlanRetrievalTest.java index 073e98d2132..5ab84dc14ad 100644 --- a/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/QueryPlanRetrievalTest.java +++ b/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/QueryPlanRetrievalTest.java @@ -8,9 +8,8 @@ package org.eclipse.rdf4j.sail.memory; -import static org.hamcrest.CoreMatchers.containsString; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import java.io.IOException; @@ -188,8 +187,8 @@ public void testTupleQueryTimed() { assertTrue(filterNode.getSelfTimeActual() > leftJoin.getSelfTimeActual()); assertTrue(filterNode.getSelfTimeActual() < leftJoin.getTotalTimeActual()); - assertThat(genericPlanNode.toString(), containsString("selfTimeActual")); - assertThat(genericPlanNode.toString(), containsString("totalTimeActual")); + assertThat(genericPlanNode.toString()).contains("selfTimeActual"); + assertThat(genericPlanNode.toString()).contains("totalTimeActual"); } sailRepository.shutDown(); @@ -681,7 +680,142 @@ public void testTimeout() { query.setMaxExecutionTime(1); String actual = query.explain(Explanation.Level.Timed).toString(); - Assert.assertThat(actual, containsString("Timed out")); + assertThat(actual).contains("Timed out"); + + } + sailRepository.shutDown(); + + } + + @Test + public void testDot() { + SailRepository sailRepository = new SailRepository(new MemoryStore()); + addData(sailRepository); + + try (SailRepositoryConnection connection = sailRepository.getConnection()) { + Query query = connection.prepareTupleQuery(TUPLE_QUERY); + + Explanation explain = query.explain(Explanation.Level.Optimized); + String actual = explain.toDot(); + actual = actual.replaceAll("UUID_\\w+", "UUID"); + + assertEquals("digraph Explanation {\n" + + " UUID [label=<
Projection
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"left\"] ;\n" + + " UUID -> UUID [label=\"right\"] ;\n" + + " UUID [label=<
ProjectionElemList
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"\"] ;\n" + + " UUID [label=<
ProjectionElem \"a\"
> shape=plaintext];\n" + + + " UUID [label=<
LeftJoin
AlgorithmLeftJoinIterator
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"left\"] ;\n" + + " UUID -> UUID [label=\"right\"] ;\n" + + " UUID [label=<
Join
AlgorithmJoinIterator
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"left\"] ;\n" + + " UUID -> UUID [label=\"right\"] ;\n" + + " UUID [label=<
StatementPattern
Cost estimate1
Result size estimate4
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"index 0\"] ;\n" + + " UUID -> UUID [label=\"index 1\"] ;\n" + + " UUID -> UUID [label=\"index 2\"] ;\n" + + " UUID [label=<
Var (name=a)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=d)
> shape=plaintext];\n" + + + " UUID [label=<
Filter
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"left\"] ;\n" + + " UUID -> UUID [label=\"right\"] ;\n" + + " UUID [label=<
Compare (!=)
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"left\"] ;\n" + + " UUID -> UUID [label=\"right\"] ;\n" + + " UUID [label=<
Var (name=c)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=d)
> shape=plaintext];\n" + + + " UUID [label=<
Join
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"left\"] ;\n" + + " UUID -> UUID [label=\"right\"] ;\n" + + " UUID [label=<
StatementPattern
Cost estimate2
Result size estimate4
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"index 0\"] ;\n" + + " UUID -> UUID [label=\"index 1\"] ;\n" + + " UUID -> UUID [label=\"index 2\"] ;\n" + + " UUID [label=<
Var (name=a)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=_const_f5e5585a_uri, value=http://www.w3.org/1999/02/22-rdf-syntax-ns#type, anonymous)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=c)
> shape=plaintext];\n" + + + " subgraph cluster_UUID {\n" + + " color=grey\n" + + "UUID [label=<
LeftJoin
New scopetrue
Cost estimate5
Result size estimate12
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"left\"] ;\n" + + " UUID -> UUID [label=\"right\"] ;\n" + + " UUID [label=<
SingletonSet
> shape=plaintext];\n" + + + " UUID [label=<
StatementPattern
Result size estimate12
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"index 0\"] ;\n" + + " UUID -> UUID [label=\"index 1\"] ;\n" + + " UUID -> UUID [label=\"index 2\"] ;\n" + + " UUID [label=<
Var (name=d)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=e)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=f)
> shape=plaintext];\n" + + + "\n" + + "}\n" + + " UUID [label=<
StatementPattern
Result size estimate12
> shape=plaintext];\n" + + + " UUID -> UUID [label=\"index 0\"] ;\n" + + " UUID -> UUID [label=\"index 1\"] ;\n" + + " UUID -> UUID [label=\"index 2\"] ;\n" + + " UUID [label=<
Var (name=d)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=e)
> shape=plaintext];\n" + + + " UUID [label=<
Var (name=f)
> shape=plaintext];\n" + + + "\n" + + "}\n", actual); + + } + sailRepository.shutDown(); + + } + + @Test + public void testDotTimed() { + SailRepository sailRepository = new SailRepository(new MemoryStore()); + addData(sailRepository); + + try (SailRepositoryConnection connection = sailRepository.getConnection()) { + Query query = connection.prepareTupleQuery(SUB_QUERY); + + Explanation explain = query.explain(Explanation.Level.Timed); + String actual = explain.toDot(); + actual = actual.replaceAll("UUID_\\w+", "UUID"); + + assertThat(actual).startsWith("digraph Explanation {"); + assertThat(actual).contains( + "[label=<
"); + assertThat(actual).contains("Projection"); + assertThat(actual).contains("ProjectionElemList"); + assertThat(actual).contains("Join"); } sailRepository.shutDown(); From ec595bf9688dcbb091e5d17a74e0bd27403b20bf Mon Sep 17 00:00:00 2001 From: hmottestad Date: Wed, 27 May 2020 07:54:51 +0200 Subject: [PATCH 13/35] GH-2234 shacl inverse path (#2255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håvard Ottestad --- .../AST/AbstractSimplePropertyShape.java | 4 +- .../sail/shacl/AST/ClassPropertyShape.java | 38 +++--- .../rdf4j/sail/shacl/AST/InversePath.java | 126 ++++++++++++++++++ .../sail/shacl/AST/MaxCountPropertyShape.java | 2 +- .../sail/shacl/AST/MinCountPropertyShape.java | 3 +- .../eclipse/rdf4j/sail/shacl/AST/Path.java | 3 +- .../sail/shacl/AST/PathPropertyShape.java | 65 +++++---- .../rdf4j/sail/shacl/AST/PlanGenerator.java | 1 + .../rdf4j/sail/shacl/AST/PropertyShape.java | 3 +- .../rdf4j/sail/shacl/AST/SimplePath.java | 48 +++++++ .../rdf4j/sail/shacl/AST/TargetClass.java | 1 + .../eclipse/rdf4j/sail/shacl/ShaclSail.java | 3 +- .../shacl/ShaclSailValidationException.java | 2 +- .../planNodes/AbstractBulkJoinPlanNode.java | 13 +- .../planNodes/BulkedExternalInnerJoin.java | 13 +- .../BulkedExternalLeftOuterJoin.java | 6 +- .../sail/shacl/planNodes/DatatypeFilter.java | 4 +- .../sail/shacl/planNodes/EqualsJoin.java | 3 +- .../planNodes/ExternalFilterByPredicate.java | 2 +- .../planNodes/ExternalTypeFilterNode.java | 2 +- .../sail/shacl/planNodes/GroupByCount.java | 9 +- .../rdf4j/sail/shacl/planNodes/InnerJoin.java | 4 +- .../shacl/planNodes/LanguageInFilter.java | 4 +- .../sail/shacl/planNodes/LeftOuterJoin.java | 4 +- .../planNodes/LiteralComparatorFilter.java | 2 +- .../sail/shacl/planNodes/MaxCountFilter.java | 2 +- .../sail/shacl/planNodes/MaxLengthFilter.java | 2 +- .../sail/shacl/planNodes/MinCountFilter.java | 2 +- .../shacl/planNodes/MinExclusiveFilter.java | 2 +- .../sail/shacl/planNodes/MinLengthFilter.java | 2 +- .../sail/shacl/planNodes/NodeKindFilter.java | 2 +- .../shacl/planNodes/NonUniqueTargetLang.java | 2 +- .../sail/shacl/planNodes/PatternFilter.java | 2 +- .../rdf4j/sail/shacl/planNodes/Sort.java | 7 +- .../rdf4j/sail/shacl/planNodes/TrimTuple.java | 6 +- .../rdf4j/sail/shacl/planNodes/Tuple.java | 13 +- .../sail/shacl/planNodes/TupleHelper.java | 8 +- .../shacl/planNodes/TupleLengthFilter.java | 4 +- .../rdf4j/sail/shacl/planNodes/Unique.java | 7 +- .../sail/shacl/planNodes/UnorderedSelect.java | 5 + .../sail/shacl/planNodes/ValueInFilter.java | 2 +- .../sail/shacl/results/ValidationResult.java | 9 +- .../rdf4j/sail/shacl/AbstractShaclTest.java | 10 +- .../shacl/BulkedExternalInnerJoinTest.java | 4 +- .../rdf4j/sail/shacl/OrderingTest.java | 3 +- .../rdf4j/sail/shacl/UnknownShapesTest.java | 6 +- .../sail/shacl/mock/MockInputPlanNode.java | 2 +- .../shacl/src/test/resources/complexPath.ttl | 21 +-- .../invalid/case1/query1.rq | 17 +++ .../invalid/case2/query1.rq | 17 +++ .../invalid/case2/query2.rq | 11 ++ .../invalid/case3/query1.rq | 17 +++ .../invalid/case3/query2.rq | 11 ++ .../invalid/case4/query1.rq | 21 +++ .../invalid/case4/query2.rq | 12 ++ .../invalid/case5/query1.rq | 15 +++ .../invalid/case5/query2.rq | 16 +++ .../invalid/case6/query1.rq | 14 ++ .../multipleFunctional/shacl.ttl | 26 ++++ .../multipleFunctional/valid/case1/query1.rq | 16 +++ .../multipleFunctional/valid/case2/query1.rq | 13 ++ .../multipleFunctional/valid/case2/query2.rq | 13 ++ .../multipleFunctional/valid/case3/query1.rq | 17 +++ .../multipleFunctional/valid/case3/query2.rq | 21 +++ .../multipleFunctional/valid/case4/query1.rq | 14 ++ .../invalid/case1/query1.rq | 17 +++ .../invalid/case2/query1.rq | 17 +++ .../invalid/case2/query2.rq | 12 ++ .../multipleFunctionalOr/shacl.ttl | 26 ++++ .../valid/case1/query1.rq | 16 +++ .../singleFunctional/invalid/case1/query1.rq | 13 ++ .../singleFunctional/invalid/case2/query1.rq | 13 ++ .../singleFunctional/invalid/case2/query2.rq | 10 ++ .../singleFunctional/shacl.ttl | 16 +++ .../singleFunctional/valid/case1/query1.rq | 13 ++ .../singleFunctional/valid/case2/query1.rq | 14 ++ .../singleFunctional/valid/case2/query2.rq | 10 ++ .../singleFunctional/valid/case3/query1.rq | 13 ++ .../simpleInversePath/invalid/case1/query1.rq | 17 +++ .../simpleInversePath/invalid/case2/query1.rq | 15 +++ .../simpleInversePath/invalid/case2/query2.rq | 13 ++ .../simpleInversePath/invalid/case3/query1.rq | 15 +++ .../simpleInversePath/invalid/case3/query2.rq | 13 ++ .../simpleInversePath/invalid/case3/query3.rq | 13 ++ .../maxCount/simpleInversePath/shacl.ttl | 16 +++ .../simpleInversePath/valid/case1/query1.rq | 20 +++ .../simpleInversePath/valid/case2/query1.rq | 19 +++ .../simpleInversePath/valid/case2/query2.rq | 14 ++ .../simpleInversePath/valid/case3/query1.rq | 19 +++ .../simpleInversePath/valid/case3/query2.rq | 15 +++ .../simpleInversePath/valid/case3/query3.rq | 16 +++ .../simpleInversePath/valid/case4/query1.rq | 15 +++ .../simpleInversePath/valid/case4/query2.rq | 15 +++ .../simpleInversePath/invalid/case1/query1.rq | 15 +++ .../nodeKind/simpleInversePath/shacl.ttl | 16 +++ .../simpleInversePath/valid/case1/query1.rq | 13 ++ .../class2InversePath/invalid/case1/query1.rq | 16 +++ .../class2InversePath/invalid/case2/query1.rq | 18 +++ .../class2InversePath/invalid/case2/query2.rq | 22 +++ .../class2InversePath/invalid/case3/query1.rq | 44 ++++++ .../class2InversePath/invalid/case3/query2.rq | 34 +++++ .../test-cases/or/class2InversePath/shacl.ttl | 20 +++ .../class2InversePath/valid/case1/query1.rq | 19 +++ .../class2InversePath/valid/case2/query1.rq | 19 +++ .../class2InversePath/valid/case2/query2.rq | 24 ++++ 105 files changed, 1313 insertions(+), 131 deletions(-) create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/InversePath.java create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query3.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query3.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case2/query2.rq diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AbstractSimplePropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AbstractSimplePropertyShape.java index d3db1a4c0e0..0d5bcea14cd 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AbstractSimplePropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AbstractSimplePropertyShape.java @@ -45,7 +45,7 @@ static public PlanNode getGenericSingleObjectPlan(ConnectionsGroup connectionsGr if (pathPropertyShape.getPath() == null) { planNode = new ModifyTuple(overrideTargetNode.getPlanNode(), t -> { - t.line.add(t.line.get(0)); + t.getLine().add(t.getLine().get(0)); return t; }); } else { @@ -66,7 +66,7 @@ static public PlanNode getGenericSingleObjectPlan(ConnectionsGroup connectionsGr PlanNode targets = new ModifyTuple( nodeShape.getPlanAddedStatements(connectionsGroup, null), t -> { - t.line.add(t.line.get(0)); + t.getLine().add(t.getLine().get(0)); return t; }); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ClassPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ClassPropertyShape.java index f1b00fd5841..91e82a93782 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ClassPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ClassPropertyShape.java @@ -83,7 +83,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, if (getPath() == null) { planNode = new ModifyTuple(overrideTargetNode.getPlanNode(), t -> { - t.line.add(t.line.get(0)); + t.getLine().add(t.getLine().get(0)); return t; }); @@ -130,7 +130,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode targets = new ModifyTuple( nodeShape.getPlanAddedStatements(connectionsGroup, null), t -> { - t.line.add(t.line.get(0)); + t.getLine().add(t.getLine().get(0)); return t; }); @@ -232,10 +232,10 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, false, null, "?a", "?c"), t -> { - List line = t.line; - t.line = new ArrayList<>(2); - t.line.add(line.get(1)); - t.line.add(line.get(0)); + List line = t.getLine(); + t.setLine(new ArrayList<>(2)); + t.getLine().add(line.get(1)); + t.getLine().add(line.get(0)); return t; })); @@ -261,7 +261,7 @@ private PlanNode getNegatedPlan(ConnectionsGroup connectionsGroup, PlanNodeProvi if (getPath() == null) { planNode = new ModifyTuple(overrideTargetNode.getPlanNode(), t -> { - t.line.add(t.line.get(0)); + t.getLine().add(t.getLine().get(0)); return t; }); @@ -342,10 +342,10 @@ private PlanNode getNegatedPlan(ConnectionsGroup connectionsGroup, PlanNodeProvi false, null, "?a", "?c"), t -> { - List line = t.line; - t.line = new ArrayList<>(2); - t.line.add(line.get(1)); - t.line.add(line.get(0)); + List line = t.getLine(); + t.setLine(new ArrayList<>(2)); + t.getLine().add(line.get(1)); + t.getLine().add(line.get(0)); return t; })); @@ -443,10 +443,10 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg false, null, "?a", "?c"), t -> { - List line = t.line; - t.line = new ArrayList<>(2); - t.line.add(line.get(1)); - t.line.add(line.get(0)); + List line = t.getLine(); + t.setLine(new ArrayList<>(2)); + t.getLine().add(line.get(1)); + t.getLine().add(line.get(0)); return t; })); @@ -473,10 +473,10 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg false, null, "?a", "?c"), t -> { - List line = t.line; - t.line = new ArrayList<>(2); - t.line.add(line.get(1)); - t.line.add(line.get(0)); + List line = t.getLine(); + t.setLine(new ArrayList<>(2)); + t.getLine().add(line.get(1)); + t.getLine().add(line.get(0)); return t; })); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/InversePath.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/InversePath.java new file mode 100644 index 00000000000..18ec0d8d17d --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/InversePath.java @@ -0,0 +1,126 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.AST; + +import java.util.List; +import java.util.Objects; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.sail.SailConnection; +import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; +import org.eclipse.rdf4j.sail.shacl.Stats; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; +import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnorderedSelect; + +/** + * The AST (Abstract Syntax Tree) node that represents a simple path for exactly one predicate. Currently there is no + * support for complex paths. + * + * @author Håvard M. Ottestad + */ +public class InversePath extends Path { + + private final IRI path; + + public InversePath(Resource id, IRI path) { + super(id); + this.path = path; + + } + + @Override + public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, + PlanNodeProvider overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + return connectionsGroup + .getCachedNodeFor(new Sort(new UnorderedSelect(connectionsGroup.getBaseConnection(), null, + path, null, UnorderedSelect.OutputPattern.ObjectSubject))); + } + + @Override + public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + + PlanNode unorderedSelect = new UnorderedSelect(connectionsGroup.getAddedStatements(), null, + path, null, UnorderedSelect.OutputPattern.ObjectSubject); + if (planeNodeWrapper != null) { + unorderedSelect = planeNodeWrapper.wrap(unorderedSelect); + } + return connectionsGroup.getCachedNodeFor(new Sort(unorderedSelect)); + } + + @Override + public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + PlanNode unorderedSelect = new UnorderedSelect(connectionsGroup.getRemovedStatements(), null, + path, null, UnorderedSelect.OutputPattern.ObjectSubject); + if (planeNodeWrapper != null) { + unorderedSelect = planeNodeWrapper.wrap(unorderedSelect); + } + return connectionsGroup.getCachedNodeFor(new Sort(unorderedSelect)); + } + + @Override + public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean negated) { + throw new UnsupportedOperationException(); + } + + @Override + public List getPaths() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean requiresEvaluation(SailConnection addedStatements, SailConnection removedStatements, Stats stats) { + + if (stats.isEmpty()) { + return false; + } + + return addedStatements.hasStatement(null, path, null, false) + || removedStatements.hasStatement(null, path, null, false); + } + + @Override + public String getQuery(String subjectVariable, String objectVariable, + RdfsSubClassOfReasoner rdfsSubClassOfReasoner) { + + return objectVariable + " <" + path + "> " + subjectVariable + " . \n"; + + } + + public IRI getPath() { + return path; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InversePath that = (InversePath) o; + return Objects.equals(path, that.path); + } + + @Override + public int hashCode() { + return Objects.hash(path); + } + + @Override + public String toString() { + return path.toString(); + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MaxCountPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MaxCountPropertyShape.java index 610161bb1fd..96bc7b10225 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MaxCountPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MaxCountPropertyShape.java @@ -88,7 +88,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode select = new Select(connectionsGroup.getAddedStatements(), negationQuery, "?a"); select = new ModifyTuple(select, (a) -> { - a.line.add(SimpleValueFactory.getInstance().createLiteral(">= 2")); + a.getLine().add(SimpleValueFactory.getInstance().createLiteral(">= 2")); return a; }); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MinCountPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MinCountPropertyShape.java index 2bab760bd73..d6e2368efd5 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MinCountPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MinCountPropertyShape.java @@ -35,6 +35,7 @@ * The AST (Abstract Syntax Tree) node that represents a sh:minCount property nodeShape restriction. * * @author Heshan Jayasinghe + * @author Håvard M. Ottestad */ public class MinCountPropertyShape extends PathPropertyShape { @@ -91,7 +92,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode select = new Select(connectionsGroup.getAddedStatements(), negationQuery, "?a"); select = new ModifyTuple(select, (a) -> { - a.line.add(SimpleValueFactory.getInstance().createLiteral(0)); + a.getLine().add(SimpleValueFactory.getInstance().createLiteral(0)); return a; }); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/Path.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/Path.java index aa0e6aad262..0bbe74c6177 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/Path.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/Path.java @@ -15,8 +15,9 @@ * support for complex paths. * * @author Heshan Jayasinghe + * @author Håvard M. Ottestad */ -abstract public class Path implements RequiresEvalutation, QueryGenerator { +abstract public class Path implements RequiresEvalutation, QueryGenerator, PlanGenerator { private Resource id; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PathPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PathPropertyShape.java index ce0cbb69219..336814b36f2 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PathPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PathPropertyShape.java @@ -14,8 +14,10 @@ import java.util.List; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; import java.util.stream.Stream; +import org.eclipse.rdf4j.model.BNode; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; @@ -29,9 +31,7 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; import org.eclipse.rdf4j.sail.shacl.planNodes.Select; -import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; -import org.eclipse.rdf4j.sail.shacl.planNodes.UnorderedSelect; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,12 +47,11 @@ public abstract class PathPropertyShape extends PropertyShape { private static final Logger logger = LoggerFactory.getLogger(ShaclSailConnection.class); - private final static Set complexPathPredicates = new HashSet<>( + private final static Set unsupportedComplexPathPredicates = new HashSet<>( Arrays.asList( RDF.FIRST, RDF.REST, SHACL.ALTERNATIVE_PATH, - SHACL.INVERSE_PATH, SHACL.ZERO_OR_MORE_PATH, SHACL.ONE_OR_MORE_PATH, SHACL.ZERO_OR_ONE_PATH)); @@ -65,10 +64,33 @@ public abstract class PathPropertyShape extends PropertyShape { // warning if (path != null) { if (validPath(path, connection)) { - this.path = new SimplePath((IRI) path); + if (path instanceof BNode) { + List collect = connection.getStatements(path, null, null) + .stream() + .collect(Collectors.toList()); + for (Statement statement : collect) { + IRI pathType = statement.getPredicate(); + + switch (pathType.toString()) { + case "http://www.w3.org/ns/shacl#inversePath": + if (this.path != null) { + throw new IllegalStateException("Uknown path for " + statement.toString()); + } + this.path = new InversePath(path, (IRI) statement.getObject()); + break; + default: + break; + } + + } + + } else { + this.path = new SimplePath((IRI) path); + } + } else { logger.warn( - "Unsupported SHACL feature with complex path. Only single predicate paths are supported. <{}> shape has been deactivated! \n{}", + "Unsupported SHACL feature with complex path. Only single predicate paths, or single predicate inverse paths are supported. <{}> shape has been deactivated! \n{}", id, describe(connection, path)); } @@ -80,15 +102,18 @@ public abstract class PathPropertyShape extends PropertyShape { private static boolean validPath(Resource path, SailRepositoryConnection connection) { if (path != null) { - if (!(path instanceof IRI)) { - return false; + if (path instanceof IRI) { + // simple path + return true; } else { try (Stream stream = connection.getStatements(path, null, null).stream()) { boolean complexPath = stream - .map(Statement::getPredicate) - .anyMatch(complexPathPredicates::contains); + .anyMatch(statement -> { + return unsupportedComplexPathPredicates.contains(statement.getPredicate()) + || statement.getObject() instanceof BNode; + }); if (complexPath) { return false; @@ -109,32 +134,20 @@ private static boolean validPath(Resource path, SailRepositoryConnection connect @Override public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNodeProvider overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { - return connectionsGroup - .getCachedNodeFor(new Sort(new UnorderedSelect(connectionsGroup.getBaseConnection(), null, - (IRI) getPath().getId(), null, UnorderedSelect.OutputPattern.SubjectObject))); + return getPath().getPlan(connectionsGroup, printPlans, overrideTargetNode, negateThisPlan, negateSubPlans); } @Override public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper planeNodeWrapper) { - - PlanNode unorderedSelect = new UnorderedSelect(connectionsGroup.getAddedStatements(), null, - (IRI) getPath().getId(), null, UnorderedSelect.OutputPattern.SubjectObject); - if (planeNodeWrapper != null) { - unorderedSelect = planeNodeWrapper.wrap(unorderedSelect); - } - return connectionsGroup.getCachedNodeFor(new Sort(unorderedSelect)); + return getPath().getPlanAddedStatements(connectionsGroup, planeNodeWrapper); } @Override public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper planeNodeWrapper) { - PlanNode unorderedSelect = new UnorderedSelect(connectionsGroup.getRemovedStatements(), null, - (IRI) getPath().getId(), null, UnorderedSelect.OutputPattern.SubjectObject); - if (planeNodeWrapper != null) { - unorderedSelect = planeNodeWrapper.wrap(unorderedSelect); - } - return connectionsGroup.getCachedNodeFor(new Sort(unorderedSelect)); + return getPath().getPlanRemovedStatements(connectionsGroup, planeNodeWrapper); + } @Override diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java index ffef5cbe5bf..dc811eddd65 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java @@ -16,6 +16,7 @@ /** * @author Heshan Jayasinghe + * @author Håvard M. Ottestad */ public interface PlanGenerator { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java index 2aa9795d06c..ab68d491c62 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java @@ -41,7 +41,8 @@ * The AST (Abstract Syntax Tree) node that represents a property nodeShape without any restrictions. This node should * be extended by other nodes. * - * @author Heshan Jayasinghe, Håvard Mikkelsen Ottestad + * @author Heshan Jayasinghe + * @author Håvard M. Ottestad */ public abstract class PropertyShape implements PlanGenerator, RequiresEvalutation { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SimplePath.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SimplePath.java index d0c7a0bd0e7..ce892345a71 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SimplePath.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SimplePath.java @@ -8,18 +8,25 @@ package org.eclipse.rdf4j.sail.shacl.AST; +import java.util.List; import java.util.Objects; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.sail.SailConnection; +import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; import org.eclipse.rdf4j.sail.shacl.Stats; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; +import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnorderedSelect; /** * The AST (Abstract Syntax Tree) node that represents a simple path for exactly one predicate. Currently there is no * support for complex paths. * * @author Heshan Jayasinghe + * @author Håvard M. Ottestad */ public class SimplePath extends Path { @@ -31,6 +38,47 @@ public class SimplePath extends Path { } + @Override + public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, + PlanNodeProvider overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + return connectionsGroup + .getCachedNodeFor(new Sort(new UnorderedSelect(connectionsGroup.getBaseConnection(), null, + path, null, UnorderedSelect.OutputPattern.SubjectObject))); + } + + @Override + public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + + PlanNode unorderedSelect = new UnorderedSelect(connectionsGroup.getAddedStatements(), null, + path, null, UnorderedSelect.OutputPattern.SubjectObject); + if (planeNodeWrapper != null) { + unorderedSelect = planeNodeWrapper.wrap(unorderedSelect); + } + return connectionsGroup.getCachedNodeFor(new Sort(unorderedSelect)); + } + + @Override + public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + PlanNode unorderedSelect = new UnorderedSelect(connectionsGroup.getRemovedStatements(), null, + path, null, UnorderedSelect.OutputPattern.SubjectObject); + if (planeNodeWrapper != null) { + unorderedSelect = planeNodeWrapper.wrap(unorderedSelect); + } + return connectionsGroup.getCachedNodeFor(new Sort(unorderedSelect)); + } + + @Override + public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean negated) { + throw new UnsupportedOperationException(); + } + + @Override + public List getPaths() { + throw new UnsupportedOperationException(); + } + @Override public boolean requiresEvaluation(SailConnection addedStatements, SailConnection removedStatements, Stats stats) { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetClass.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetClass.java index 55997bc1a90..d6d3bd229c8 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetClass.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetClass.java @@ -34,6 +34,7 @@ * sh:targetClass * * @author Heshan Jayasinghe + * @author Håvard M. Ottestad */ public class TargetClass extends NodeShape { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java index 8e4f9a7b4d8..ea56c80130f 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java @@ -265,7 +265,8 @@ public static List getSupportedShaclPredicates() { SHACL.IN, SHACL.UNIQUE_LANG, SHACL.NOT, - SHACL.TARGET_OBJECTS_OF); + SHACL.TARGET_OBJECTS_OF, + SHACL.INVERSE_PATH); } private final AtomicBoolean initialized = new AtomicBoolean(false); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java index bf6bc6d3d73..762a7914495 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java @@ -60,7 +60,7 @@ public ValidationReport getValidationReport() { while (!propertyShapes.isEmpty()) { ValidationResult validationResult = new ValidationResult(propertyShapes.pop(), - invalidTuple.line.get(0)); + invalidTuple.getLine().get(0)); if (parent == null) { validationReport.addValidationResult(validationResult); } else { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java index 82d24d514a4..dd7299dd06b 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java @@ -76,8 +76,15 @@ private List buildBindingSets(ArrayDeque left, SailConnection return true; } - boolean hasStatement = previousStateConnection.hasStatement(((Resource) tuple.line.get(0)), null, - null, true); + boolean hasStatement; + + if (!(tuple.getLine().get(0) instanceof Resource)) { + hasStatement = previousStateConnection.hasStatement(null, null, tuple.getLine().get(0), true); + } else { + hasStatement = previousStateConnection + .hasStatement(((Resource) tuple.getLine().get(0)), null, null, true) || + previousStateConnection.hasStatement(null, null, tuple.getLine().get(0), true); + } if (!hasStatement && GlobalValidationExecutionLogging.loggingEnabled) { validationExecutionLogger.log(depth(), @@ -87,7 +94,7 @@ private List buildBindingSets(ArrayDeque left, SailConnection return hasStatement; }) - .map(tuple -> (Resource) tuple.line.get(0)) + .map(tuple -> tuple.getLine().get(0)) .map(r -> new ListBindingSet(Collections.singletonList("a"), Collections.singletonList(r))) .collect(Collectors.toList()); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java index 5d3e1fc681d..9c8020ed599 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java @@ -13,6 +13,7 @@ import org.apache.commons.text.StringEscapeUtils; import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.query.QueryLanguage; +import org.eclipse.rdf4j.query.algebra.evaluation.util.ValueComparator; import org.eclipse.rdf4j.query.parser.ParsedQuery; import org.eclipse.rdf4j.query.parser.QueryParserUtil; import org.eclipse.rdf4j.sail.SailConnection; @@ -30,6 +31,7 @@ */ public class BulkedExternalInnerJoin extends AbstractBulkJoinPlanNode { + private static final ValueComparator VALUE_COMPARATOR = new ValueComparator(); private final SailConnection connection; private final PlanNode leftNode; private final ParsedQuery parsedQuery; @@ -84,23 +86,22 @@ private void calculateNext() { Tuple rightPeek = right.peekLast(); - if (rightPeek.line.get(0) == leftPeek.line.get(0) - || rightPeek.line.get(0).equals(leftPeek.line.get(0))) { + if (rightPeek.getLine().get(0) == leftPeek.getLine().get(0) + || rightPeek.getLine().get(0).equals(leftPeek.getLine().get(0))) { // we have a join ! joined.addLast(TupleHelper.join(leftPeek, rightPeek)); right.removeLast(); Tuple rightPeek2 = right.peekLast(); - if (rightPeek2 == null || !rightPeek2.line.get(0).equals(leftPeek.line.get(0))) { + if (rightPeek2 == null || !rightPeek2.getLine().get(0).equals(leftPeek.getLine().get(0))) { // no more to join from right, pop left so we don't print it again. left.removeLast(); } } else { - int compare = rightPeek.line.get(0) - .stringValue() - .compareTo(leftPeek.line.get(0).stringValue()); + int compare = VALUE_COMPARATOR.compare(rightPeek.getLine().get(0), + leftPeek.getLine().get(0)); if (compare < 0) { if (right.isEmpty()) { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java index b72bb1c1a1e..333cfb187c3 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java @@ -102,15 +102,15 @@ Tuple loggingNext() throws SailException { if (!right.isEmpty()) { Tuple rightPeek = right.peekLast(); - if (rightPeek.line.get(0) == leftPeek.line.get(0) - || rightPeek.line.get(0).equals(leftPeek.line.get(0))) { + if (rightPeek.getLine().get(0) == leftPeek.getLine().get(0) + || rightPeek.getLine().get(0).equals(leftPeek.getLine().get(0))) { // we have a join ! joined = TupleHelper.join(leftPeek, rightPeek); right.removeLast(); Tuple rightPeek2 = right.peekLast(); - if (rightPeek2 == null || !rightPeek2.line.get(0).equals(leftPeek.line.get(0))) { + if (rightPeek2 == null || !rightPeek2.getLine().get(0).equals(leftPeek.getLine().get(0))) { // no more to join from right, pop left so we don't print it again. left.removeLast(); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/DatatypeFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/DatatypeFilter.java index 2b7df795eb7..ff370b6b40c 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/DatatypeFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/DatatypeFilter.java @@ -25,11 +25,11 @@ public DatatypeFilter(PlanNode parent, Resource datatype) { @Override boolean checkTuple(Tuple t) { - if (!(t.line.get(1) instanceof Literal)) { + if (!(t.getLine().get(1) instanceof Literal)) { return false; } - Literal literal = (Literal) t.line.get(1); + Literal literal = (Literal) t.getLine().get(1); return literal.getDatatype() == datatype || literal.getDatatype().equals(datatype); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/EqualsJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/EqualsJoin.java index f240e76ff50..4f5f3e4a7b3 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/EqualsJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/EqualsJoin.java @@ -55,7 +55,8 @@ void calculateNext() { while (next == null) { if (nextRight != null) { - if (nextLeft.line == nextRight.line || nextLeft.line.equals(nextRight.line)) { + if (nextLeft.getLine() == nextRight.getLine() + || nextLeft.getLine().equals(nextRight.getLine())) { if (useAsFilter) { next = nextLeft; next.addAllCausedByPropertyShape(nextRight.getCausedByPropertyShapes()); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByPredicate.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByPredicate.java index 861b710a1a7..07545974c52 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByPredicate.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByPredicate.java @@ -59,7 +59,7 @@ void calculateNext() { while (next == null && parentIterator.hasNext()) { Tuple temp = parentIterator.next(); - Value subject = temp.line.get(index); + Value subject = temp.getLine().get(index); IRI matchedPredicate = matchesFilter(subject); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalTypeFilterNode.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalTypeFilterNode.java index 46214387300..0507c60d08a 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalTypeFilterNode.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalTypeFilterNode.java @@ -57,7 +57,7 @@ void calculateNext() { while (next == null && parentIterator.hasNext()) { Tuple temp = parentIterator.next(); - Value subject = temp.line.get(index); + Value subject = temp.getLine().get(index); Resource matchedType = isType(subject); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/GroupByCount.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/GroupByCount.java index c9269e78356..dfd465e90ee 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/GroupByCount.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/GroupByCount.java @@ -58,12 +58,13 @@ private void calculateNext() { next = new Tuple(); - Value subject = tempNext.line.get(0); + Value subject = tempNext.getLine().get(0); - while (tempNext != null && (tempNext.line.get(0) == subject || tempNext.line.get(0).equals(subject))) { + while (tempNext != null + && (tempNext.getLine().get(0) == subject || tempNext.getLine().get(0).equals(subject))) { next.addHistory(tempNext); - if (tempNext.line.size() > 1) { + if (tempNext.getLine().size() > 1) { count++; } @@ -79,7 +80,7 @@ private void calculateNext() { List line = new ArrayList<>( Arrays.asList(subject, SimpleValueFactory.getInstance().createLiteral(count))); - next.line = line; + next.setLine(line); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/InnerJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/InnerJoin.java index 382d852ba14..b12dc5e5a23 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/InnerJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/InnerJoin.java @@ -142,8 +142,8 @@ void calculateNext() { while (next == null) { if (nextRight != null) { - if (nextLeft.line.get(0) == nextRight.line.get(0) - || nextLeft.line.get(0).equals(nextRight.line.get(0))) { + if (nextLeft.getLine().get(0) == nextRight.getLine().get(0) + || nextLeft.getLine().get(0).equals(nextRight.getLine().get(0))) { next = TupleHelper.join(nextLeft, nextRight); joinedLeft = nextLeft; nextRight = null; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LanguageInFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LanguageInFilter.java index 49b159bf58b..aa023a7155a 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LanguageInFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LanguageInFilter.java @@ -28,11 +28,11 @@ public LanguageInFilter(PlanNode parent, Set languageIn) { @Override boolean checkTuple(Tuple t) { - if (!(t.line.get(1) instanceof Literal)) { + if (!(t.getLine().get(1) instanceof Literal)) { return false; } - Optional language = ((Literal) t.line.get(1)).getLanguage(); + Optional language = ((Literal) t.getLine().get(1)).getLanguage(); return language.filter(languageIn::contains).isPresent(); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LeftOuterJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LeftOuterJoin.java index e2fcc39191b..715aaaffb59 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LeftOuterJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LeftOuterJoin.java @@ -60,8 +60,8 @@ void calculateNext() { if (nextRight != null) { - if (nextLeft.line.get(0) == nextRight.line.get(0) - || nextLeft.line.get(0).equals(nextRight.line.get(0))) { + if (nextLeft.getLine().get(0) == nextRight.getLine().get(0) + || nextLeft.getLine().get(0).equals(nextRight.getLine().get(0))) { next = TupleHelper.join(nextLeft, nextRight); prevLeft = nextLeft; nextRight = null; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LiteralComparatorFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LiteralComparatorFilter.java index 8b368c3d8ca..4b3c813d643 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LiteralComparatorFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/LiteralComparatorFilter.java @@ -48,7 +48,7 @@ public LiteralComparatorFilter(PlanNode parent, Literal compareTo, Function= minCount; } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/MinExclusiveFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/MinExclusiveFilter.java index 4192375bc38..5fd5aa3cb6c 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/MinExclusiveFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/MinExclusiveFilter.java @@ -27,7 +27,7 @@ public MinExclusiveFilter(PlanNode parent, BigDecimal min) { @Override boolean checkTuple(Tuple t) { - Value literal = t.line.get(1); + Value literal = t.getLine().get(1); if (literal instanceof Literal) { BigDecimal bigDecimal = ((Literal) literal).decimalValue(); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/MinLengthFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/MinLengthFilter.java index 5ab53b16bfd..dc8b6968b47 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/MinLengthFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/MinLengthFilter.java @@ -24,7 +24,7 @@ public MinLengthFilter(PlanNode parent, long minLength) { @Override boolean checkTuple(Tuple t) { - Value literal = t.line.get(1); + Value literal = t.getLine().get(1); return literal.stringValue().length() >= minLength; } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/NodeKindFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/NodeKindFilter.java index 73b82d0d45f..7a74b878f2b 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/NodeKindFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/NodeKindFilter.java @@ -29,7 +29,7 @@ public NodeKindFilter(PlanNode parent, NodeKindPropertyShape.NodeKind nodeKind) @Override boolean checkTuple(Tuple t) { - Value value = t.line.get(1); + Value value = t.getLine().get(1); /* * BlankNode(SHACL.BLANK_NODE), IRI(SHACL.IRI), Literal(SHACL.LITERAL), BlankNodeOrIRI(SHACL.BLANK_NODE_OR_IRI), * BlankNodeOrLiteral(SHACL.BLANK_NODE_OR_LITERAL), IRIOrLiteral(SHACL.IRI_OR_LITERAL), diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/NonUniqueTargetLang.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/NonUniqueTargetLang.java index b79b71b10a9..dc671ecd685 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/NonUniqueTargetLang.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/NonUniqueTargetLang.java @@ -107,7 +107,7 @@ private void calculateNext() { next = parentIterator.next(); if ((previous != null)) { - if (!previous.line.get(0).equals(next.line.get(0))) { + if (!previous.getLine().get(0).equals(next.getLine().get(0))) { seenLanguages = new HashSet<>(); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/PatternFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/PatternFilter.java index ce8ab6adf3f..fb68aed92bb 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/PatternFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/PatternFilter.java @@ -64,7 +64,7 @@ public PatternFilter(PlanNode parent, String pattern, String flags) { @Override boolean checkTuple(Tuple t) { - Value literal = t.line.get(1); + Value literal = t.getLine().get(1); return pattern.matcher(literal.stringValue()).matches(); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Sort.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Sort.java index ee865f58287..2f0df56fcde 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Sort.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Sort.java @@ -60,7 +60,7 @@ private void sortTuples() { while (iterator.hasNext()) { Tuple next = iterator.next(); sortedTuples.add(next); - if (prev != null && valueComparator.compare(prev.line.get(0), next.line.get(0)) > 0) { + if (prev != null && valueComparator.compare(prev.getLine().get(0), next.getLine().get(0)) > 0) { alreadySorted = false; } prev = next; @@ -70,10 +70,11 @@ private void sortTuples() { if (sortedTuples.size() > 8192) { // MIN_ARRAY_SORT_GRAN in Arrays.parallelSort(...) Tuple[] objects = sortedTuples.toArray(new Tuple[0]); Arrays.parallelSort(objects, - (a, b) -> valueComparator.compare(a.line.get(0), b.line.get(0))); + (a, b) -> valueComparator.compare(a.getLine().get(0), b.getLine().get(0))); sortedTuples = Arrays.asList(objects); } else { - sortedTuples.sort((a, b) -> valueComparator.compare(a.line.get(0), b.line.get(0))); + sortedTuples + .sort((a, b) -> valueComparator.compare(a.getLine().get(0), b.getLine().get(0))); } } sortedTuplesIterator = sortedTuples.iterator(); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TrimTuple.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TrimTuple.java index aaef8ae7c6d..574a6e8bbd2 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TrimTuple.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TrimTuple.java @@ -52,9 +52,9 @@ Tuple loggingNext() throws SailException { Tuple tuple = new Tuple(); - int tempLength = newLength >= 0 ? newLength : next.line.size(); - for (int i = startIndex; i < tempLength && i < next.line.size(); i++) { - tuple.line.add(next.line.get(i)); + int tempLength = newLength >= 0 ? newLength : next.getLine().size(); + for (int i = startIndex; i < tempLength && i < next.getLine().size(); i++) { + tuple.getLine().add(next.getLine().get(i)); } tuple.addHistory(next); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Tuple.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Tuple.java index e901d0dd84f..c89e0937aba 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Tuple.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Tuple.java @@ -22,7 +22,8 @@ import org.eclipse.rdf4j.sail.shacl.AST.PropertyShape; /** - * @author Heshan Jayasinghe, Håvard Mikkelsen Ottestad + * @author Heshan Jayasinghe + * @author Håvard M. Ottestad */ public class Tuple implements Comparable { @@ -30,7 +31,7 @@ public class Tuple implements Comparable { private List history = new ArrayList<>(1); - public List line = new ArrayList<>(3); + private List line = new ArrayList<>(3); static final private ValueComparator valueComparator = new ValueComparator(); @@ -166,4 +167,12 @@ public void addAllCausedByPropertyShape(Deque causedByPropertySha this.causedByPropertyShapes.addAll(causedByPropertyShapes); } } + + public List getLine() { + return line; + } + + public void setLine(List line) { + this.line = line; + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleHelper.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleHelper.java index 0b045296c3c..80bdb22983c 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleHelper.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleHelper.java @@ -18,12 +18,12 @@ public class TupleHelper { public static Tuple join(Tuple left, Tuple right) { - ArrayList newLine = new ArrayList<>(left.line.size() + right.line.size() - 1); + ArrayList newLine = new ArrayList<>(left.getLine().size() + right.getLine().size() - 1); - newLine.addAll(left.line); + newLine.addAll(left.getLine()); - for (int i = 1; i < right.line.size(); i++) { - newLine.add(right.line.get(i)); + for (int i = 1; i < right.getLine().size(); i++) { + newLine.add(right.getLine().get(i)); } Tuple tuple = new Tuple(newLine); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleLengthFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleLengthFilter.java index 6fdbd59a448..8e83d455725 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleLengthFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleLengthFilter.java @@ -20,9 +20,9 @@ public TupleLengthFilter(PlanNode parent, int length, boolean exact) { @Override boolean checkTuple(Tuple t) { - if (t.line.size() >= length) { + if (t.getLine().size() >= length) { if (exact) { - return t.line.size() == length; + return t.getLine().size() == length; } else { return true; } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Unique.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Unique.java index 0cc34defc81..29605cac460 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Unique.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Unique.java @@ -55,7 +55,7 @@ private void calculateNext() { while (next == null && parentIterator.hasNext()) { Tuple temp = parentIterator.next(); - if (temp.line.size() > 1) { + if (temp.getLine().size() > 1) { useMultiCardinalityDedupeSet = true; } @@ -63,9 +63,10 @@ private void calculateNext() { next = temp; } else { if (useMultiCardinalityDedupeSet) { - if (multiCardinalityDedupeSet == null || !previous.line.get(0).equals(temp.line.get(0))) { + if (multiCardinalityDedupeSet == null + || !previous.getLine().get(0).equals(temp.getLine().get(0))) { multiCardinalityDedupeSet = new HashSet<>(); - if (previous.line.get(0).equals(temp.line.get(0))) { + if (previous.getLine().get(0).equals(temp.getLine().get(0))) { multiCardinalityDedupeSet.add(previous); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/UnorderedSelect.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/UnorderedSelect.java index 3dd084321ac..833443156f2 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/UnorderedSelect.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/UnorderedSelect.java @@ -73,6 +73,9 @@ Tuple loggingNext() throws SailException { if (outputPattern == OutputPattern.SubjectObject) { return new Tuple(next.getSubject(), next.getObject()); } + if (outputPattern == OutputPattern.ObjectSubject) { + return new Tuple(next.getObject(), next.getSubject()); + } if (outputPattern == OutputPattern.SubjectPredicateObject) { return new Tuple(next.getSubject(), next.getPredicate(), next.getObject()); } @@ -130,6 +133,7 @@ public String toString() { "subject=" + Formatter.prefix(subject) + ", predicate=" + Formatter.prefix(predicate) + ", object=" + Formatter.prefix(object) + + ", outputPattern=" + outputPattern + '}'; } @@ -172,6 +176,7 @@ public int hashCode() { public enum OutputPattern { SubjectObject, + ObjectSubject, ObjectPredicateSubject, SubjectPredicateObject } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ValueInFilter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ValueInFilter.java index 82bfe369f0a..b642424e655 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ValueInFilter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ValueInFilter.java @@ -27,7 +27,7 @@ public ValueInFilter(PlanNode parent, Set valueSet) { @Override boolean checkTuple(Tuple t) { - return valueSet.contains(t.line.get(1)); + return valueSet.contains(t.getLine().get(1)); } @Override diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationResult.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationResult.java index e040c71f555..c6cfc66c03b 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationResult.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationResult.java @@ -17,6 +17,7 @@ import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.SHACL; +import org.eclipse.rdf4j.sail.shacl.AST.InversePath; import org.eclipse.rdf4j.sail.shacl.AST.Path; import org.eclipse.rdf4j.sail.shacl.AST.PathPropertyShape; import org.eclipse.rdf4j.sail.shacl.AST.PropertyShape; @@ -87,7 +88,13 @@ public Model asModel(Model model) { model.add(getId(), SHACL.SOURCE_SHAPE, getSourceShapeResource()); if (getPath() != null) { - model.add(getId(), SHACL.RESULT_PATH, ((SimplePath) getPath()).getPath()); + // TODO: Path should be responsible for this! + if (getPath() instanceof SimplePath) { + model.add(getId(), SHACL.RESULT_PATH, ((SimplePath) getPath()).getPath()); + } else if (getPath() instanceof InversePath) { + model.add(getId(), SHACL.RESULT_PATH, getPath().getId()); + model.add(getPath().getId(), SHACL.INVERSE_PATH, ((InversePath) getPath()).getPath()); + } } if (detail != null) { diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java index 4553e407236..aaec3c7face 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java @@ -107,6 +107,7 @@ abstract public class AbstractShaclTest { "test-cases/maxCount/not2", "test-cases/maxCount/notNot", "test-cases/maxCount/simple", + "test-cases/maxCount/simpleInversePath", "test-cases/maxCount/targetNode", "test-cases/maxExclusive/simple", "test-cases/maxExclusiveMinLength/not", @@ -122,9 +123,11 @@ abstract public class AbstractShaclTest { "test-cases/minLength/simple", "test-cases/nodeKind/not", "test-cases/nodeKind/simple", + "test-cases/nodeKind/simpleInversePath", "test-cases/nodeKind/validateTarget", "test-cases/or/class", "test-cases/or/class2", + "test-cases/or/class2InversePath", "test-cases/or/classValidateTarget", "test-cases/or/datatype", "test-cases/or/datatype2", @@ -147,7 +150,10 @@ abstract public class AbstractShaclTest { "test-cases/pattern/simple", "test-cases/propertyShapeWithTarget/simple", "test-cases/uniqueLang/not", - "test-cases/uniqueLang/simple" + "test-cases/uniqueLang/simple", + "test-cases/functionalProperty/singleFunctional", + "test-cases/functionalProperty/multipleFunctional", + "test-cases/functionalProperty/multipleFunctionalOr" ) .distinct() .sorted() @@ -303,7 +309,7 @@ static void runTestCase(String shaclPath, String dataPath, ExpectedResult expect printCurrentState(shaclRepository); ran = true; - printFile(queryFile.getName()); + printFile(dataPath + queryFile.getName()); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { connection.begin(isolationLevel); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/BulkedExternalInnerJoinTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/BulkedExternalInnerJoinTest.java index 38a695c3e10..08ff9bb0393 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/BulkedExternalInnerJoinTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/BulkedExternalInnerJoinTest.java @@ -53,9 +53,9 @@ public void gapInResultsFromQueryTest() { tuples.forEach(System.out::println); assertEquals("[http://b, http://www.w3.org/2000/01/rdf-schema#Resource]", - Arrays.toString(tuples.get(0).line.toArray())); + Arrays.toString(tuples.get(0).getLine().toArray())); assertEquals("[http://d, http://www.w3.org/2000/01/rdf-schema#subPropertyOf]", - Arrays.toString(tuples.get(1).line.toArray())); + Arrays.toString(tuples.get(1).getLine().toArray())); } } diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/OrderingTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/OrderingTest.java index e6379b5c2f8..a48376ad3d0 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/OrderingTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/OrderingTest.java @@ -164,7 +164,8 @@ public void verify(List actual, List... expect) { .collect(Collectors.toList()); actual = actual.stream() - .map(tuple -> tuple.line.stream() + .map(tuple -> tuple.getLine() + .stream() .map(Value::stringValue) .map(SimpleValueFactory.getInstance()::createLiteral) .map(l -> (Value) l) diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/UnknownShapesTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/UnknownShapesTest.java index ab372c5a694..8075c763a76 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/UnknownShapesTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/UnknownShapesTest.java @@ -80,9 +80,9 @@ public void testComplexPath() throws IOException { .collect(Collectors.toSet()); Set expected = new HashSet<>(Arrays.asList( - "Unsupported SHACL feature with complex path. Only single predicate paths are supported. shape has been deactivated! @prefix sh: . sh:path [ sh:inversePath ] .", - "Unsupported SHACL feature with complex path. Only single predicate paths are supported. shape has been deactivated! @prefix sh: . sh:inversePath . sh:path .", - "Unsupported SHACL feature with complex path. Only single predicate paths are supported. shape has been deactivated! @prefix sh: . \"one\"; . sh:path .")); + "Unsupported SHACL feature with complex path. Only single predicate paths, or single predicate inverse paths are supported. shape has been deactivated! @prefix sh: . sh:path [ sh:alternativePath ] .", + "Unsupported SHACL feature with complex path. Only single predicate paths, or single predicate inverse paths are supported. shape has been deactivated! @prefix sh: . sh:path ( ) .", + "Unsupported SHACL feature with complex path. Only single predicate paths, or single predicate inverse paths are supported. shape has been deactivated! @prefix sh: . sh:path [ sh:inversePath [ sh:zeroOrMorePath ] ] .")); assertEquals(expected, relevantLog); } diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/mock/MockInputPlanNode.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/mock/MockInputPlanNode.java index b904805af50..c5105312aa4 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/mock/MockInputPlanNode.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/mock/MockInputPlanNode.java @@ -43,7 +43,7 @@ public MockInputPlanNode(Collection... list) { .map(l -> (Value) l) .collect(Collectors.toList())) .map(Tuple::new) - .sorted((a, b) -> new ValueComparator().compare(a.line.get(0), b.line.get(0))) + .sorted((a, b) -> new ValueComparator().compare(a.getLine().get(0), b.getLine().get(0))) .collect(Collectors.toList()); } diff --git a/core/sail/shacl/src/test/resources/complexPath.ttl b/core/sail/shacl/src/test/resources/complexPath.ttl index af3f1104afd..a034f4826ea 100644 --- a/core/sail/shacl/src/test/resources/complexPath.ttl +++ b/core/sail/shacl/src/test/resources/complexPath.ttl @@ -12,24 +12,17 @@ ex:PersonShape sh:targetClass rdfs:Resource ; rdfs:label "label" ; rdfs:subClassOf ex:HumanShape ; - sh:property ex:PersonPropertyShape, ex:PersonPropertyShape2, ex:PersonPropertyShape3 . + sh:property ex:inverseOfWithComplex, ex:pathSequence, ex:alternativePath . -ex:PersonPropertyShape - sh:path [ sh:inversePath ex:inverseThis ] ; +ex:inverseOfWithComplex + sh:path [ sh:inversePath [sh:zeroOrMorePath ex:inverseThis] ] ; sh:minCount 1 . -ex:PersonPropertyShape2 - sh:path ex:path ; +ex:pathSequence + sh:path ( ex:parent ex:firstName ) ; sh:minCount 1 . - -ex:path sh:inversePath ex:inverseThis . - - -ex:PersonPropertyShape3 - sh:path ex:pathList ; +ex:alternativePath + sh:path [ sh:alternativePath ex:father ] ; sh:minCount 1 . - -ex:pathList rdf:first "one" ; - rdf:rest rdf:nil . diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case1/query1.rq new file mode 100644 index 00000000000..5343afbe2a5 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case1/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 2 . + ex:validPerson2 ex:username 1 . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case2/query1.rq new file mode 100644 index 00000000000..f6f3f0ba0a8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case2/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 2 . + ex:validPerson2 ex:username 2 . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case2/query2.rq new file mode 100644 index 00000000000..d89885d5659 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case2/query2.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + ex:validPerson2 ex:username 1 . +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case3/query1.rq new file mode 100644 index 00000000000..f6f3f0ba0a8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case3/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 2 . + ex:validPerson2 ex:username 2 . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case3/query2.rq new file mode 100644 index 00000000000..e2606463ab6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case3/query2.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + ex:validPerson3 ex:username 1 . +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case4/query1.rq new file mode 100644 index 00000000000..eef1eacf788 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case4/query1.rq @@ -0,0 +1,21 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 2 . + ex:validPerson2 ex:username 2 . + + ex:validPerson3 ex:id 3 . + ex:validPerson3 ex:username 3 . + + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case4/query2.rq new file mode 100644 index 00000000000..67251428d0f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case4/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + ex:validPerson1 ex:username 2 . + ex:validPerson1 ex:username 3 . +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case5/query1.rq new file mode 100644 index 00000000000..e2e366ec1d9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case5/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + + ex:validPerson2 ex:username 2 . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case5/query2.rq new file mode 100644 index 00000000000..2de4f00a033 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case5/query2.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson3 ex:id 1 . + + ex:validPerson4 ex:username 2 . + + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case6/query1.rq new file mode 100644 index 00000000000..ef524e7cead --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/invalid/case6/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:username 1 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/shacl.ttl new file mode 100644 index 00000000000..ecc3e9109bc --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/shacl.ttl @@ -0,0 +1,26 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:IdAndUsernameAreBothFunctionalProperties + a sh:NodeShape ; + sh:targetObjectsOf ex:id, ex:username ; + sh:property [ + sh:and ( + [ + sh:path [sh:inversePath ex:id] ; + sh:maxCount 1 ; + ] + [ + sh:path [sh:inversePath ex:username] ; + sh:maxCount 1 ; + ] + + ) + + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case1/query1.rq new file mode 100644 index 00000000000..b3779f73495 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case1/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 2 . + ex:validPerson2 ex:username 2 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case2/query1.rq new file mode 100644 index 00000000000..7746f988be3 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case2/query2.rq new file mode 100644 index 00000000000..7746f988be3 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case3/query1.rq new file mode 100644 index 00000000000..f6f3f0ba0a8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case3/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 2 . + ex:validPerson2 ex:username 2 . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case3/query2.rq new file mode 100644 index 00000000000..2d3f12b0585 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case3/query2.rq @@ -0,0 +1,21 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + + +DELETE { + ex:validPerson1 ex:id 1 . + +} +INSERT { + ex:validPerson2 ex:id 1 . + +} +WHERE { + ?a ?b ?c. +} + + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case4/query1.rq new file mode 100644 index 00000000000..84d1c9d515b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctional/valid/case4/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 1 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case1/query1.rq new file mode 100644 index 00000000000..c3d840d0c05 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case1/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 1 . + ex:validPerson2 ex:username 1 . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case2/query1.rq new file mode 100644 index 00000000000..f6f3f0ba0a8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case2/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 2 . + ex:validPerson2 ex:username 2 . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case2/query2.rq new file mode 100644 index 00000000000..89fba65e581 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + ex:validPerson2 ex:username 1 . + ex:validPerson2 ex:id 1 . +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/shacl.ttl new file mode 100644 index 00000000000..2ac8be63356 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/shacl.ttl @@ -0,0 +1,26 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:IdAndUsernameAreFunctionalPropertiesTogether + a sh:NodeShape ; + sh:targetObjectsOf ex:id, ex:username ; + sh:property [ + sh:or ( + [ + sh:path [sh:inversePath ex:id] ; + sh:maxCount 1 ; + ] + [ + sh:path [sh:inversePath ex:username] ; + sh:maxCount 1 ; + ] + + ) + + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/valid/case1/query1.rq new file mode 100644 index 00000000000..881be684798 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/multipleFunctionalOr/valid/case1/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson1 ex:username 1 . + + ex:validPerson2 ex:id 1 . + ex:validPerson2 ex:username 2 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case1/query1.rq new file mode 100644 index 00000000000..55263fe5ca8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson2 ex:id 1 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case2/query1.rq new file mode 100644 index 00000000000..d9f85be93c7 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson2 ex:id [] . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case2/query2.rq new file mode 100644 index 00000000000..85af4d1f464 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/invalid/case2/query2.rq @@ -0,0 +1,10 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + ex:validPerson2 ex:id 1 . +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/shacl.ttl new file mode 100644 index 00000000000..aca4b22881b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/shacl.ttl @@ -0,0 +1,16 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:IdIsAFunctionalProperty + a sh:NodeShape ; + sh:targetObjectsOf ex:id ; + sh:property [ + sh:path [sh:inversePath ex:id] ; + sh:maxCount 1 ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case1/query1.rq new file mode 100644 index 00000000000..a0bfb060d2a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson2 ex:id 2 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case2/query1.rq new file mode 100644 index 00000000000..e74f507253e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case2/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:id 1 . +ex:validPerson2 ex:id [] . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case2/query2.rq new file mode 100644 index 00000000000..194b4dde4dd --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case2/query2.rq @@ -0,0 +1,10 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + ex:validPerson1 ex:id 2 . +} diff --git a/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case3/query1.rq new file mode 100644 index 00000000000..d9f85be93c7 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/functionalProperty/singleFunctional/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:id 1 . + ex:validPerson2 ex:id [] . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case1/query1.rq new file mode 100644 index 00000000000..a06e28fd4ee --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case1/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +ex:otherPerson1 ex:knows ex:validPerson1. +ex:otherPerson2 ex:knows ex:validPerson1. +ex:otherPerson3 ex:knows ex:validPerson1. +ex:otherPerson4 ex:knows ex:validPerson1. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case2/query1.rq new file mode 100644 index 00000000000..2936c1406ed --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case2/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:otherPerson1 ex:knows ex:validPerson1. +ex:otherPerson2 ex:knows ex:validPerson1. +ex:otherPerson3 ex:knows ex:validPerson1. +ex:otherPerson4 ex:knows ex:validPerson1. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case2/query2.rq new file mode 100644 index 00000000000..89b5915d5b9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query1.rq new file mode 100644 index 00000000000..21c33cf422e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:otherPerson1 ex:knows ex:validPerson1 . +ex:otherPerson2 ex:knows ex:validPerson1 . +ex:otherPerson3 ex:knows ex:validPerson1 . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query2.rq new file mode 100644 index 00000000000..89b5915d5b9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query3.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query3.rq new file mode 100644 index 00000000000..3bda7c10edb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/invalid/case3/query3.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:otherPerson4 ex:knows ex:validPerson1. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/shacl.ttl new file mode 100644 index 00000000000..90f6be4c0d6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/shacl.ttl @@ -0,0 +1,16 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property [ + sh:path [sh:inversePath ex:knows ] ; + sh:maxCount 3 + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case1/query1.rq new file mode 100644 index 00000000000..0a0c9f5a518 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case1/query1.rq @@ -0,0 +1,20 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + + +ex:otherPerson1 ex:knows ex:validPerson1. +ex:otherPerson2 ex:knows ex:validPerson1. +ex:otherPerson3 ex:knows ex:validPerson1. + +ex:otherPerson1 ex:knows ex:validPerson2. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case2/query1.rq new file mode 100644 index 00000000000..f2ace212d8f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case2/query1.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person. + + +ex:otherPerson1 ex:knows ex:validPerson1. +ex:otherPerson2 ex:knows ex:validPerson1. + + +ex:otherPerson1 ex:knows ex:validPerson2. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case2/query2.rq new file mode 100644 index 00000000000..692072fbf76 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case2/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson2 a ex:Person. + + +ex:otherPerson2 ex:knows ex:validPerson2. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query1.rq new file mode 100644 index 00000000000..8c072e40c61 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query1.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person . + + + +ex:otherPerson1 ex:knows ex:validPerson2 . + +ex:otherPerson1 ex:knows ex:validPerson1 . +ex:otherPerson2 ex:knows ex:validPerson1 . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query2.rq new file mode 100644 index 00000000000..957c07b014a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson2 a ex:Person . + + +ex:otherPerson2 ex:knows ex:validPerson2 . +ex:otherPerson3 ex:knows ex:validPerson2 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query3.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query3.rq new file mode 100644 index 00000000000..2669d551ca8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case3/query3.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE { +ex:validPerson2 a ex:Person. +} +INSERT{ + +ex:otherPerson4 ex:knows ex:validPerson2 . + +} +WHERE{?a ?b ?c} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case4/query1.rq new file mode 100644 index 00000000000..1d33817e970 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case4/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person . + +ex:otherPerson1 ex:knows ex:validPerson1 . +ex:otherPerson2 ex:knows ex:validPerson1 . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case4/query2.rq new file mode 100644 index 00000000000..21c33cf422e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/simpleInversePath/valid/case4/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:otherPerson1 ex:knows ex:validPerson1 . +ex:otherPerson2 ex:knows ex:validPerson1 . +ex:otherPerson3 ex:knows ex:validPerson1 . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/invalid/case1/query1.rq new file mode 100644 index 00000000000..16f0e6b6aa7 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/invalid/case1/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:Peter a ex:Person. + +[] ex:knows ex:Peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/shacl.ttl new file mode 100644 index 00000000000..5e8c267b2b8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/shacl.ttl @@ -0,0 +1,16 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property [ + sh:path [ sh:inversePath ex:knows ] ; + sh:nodeKind sh:IRI ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/valid/case1/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/nodeKind/simpleInversePath/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case1/query1.rq new file mode 100644 index 00000000000..b22965cdb55 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case1/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +ex:norway a ex:Country. +ex:norway ex:inverseKnows ex:validPerson1. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case2/query1.rq new file mode 100644 index 00000000000..a1409cae5fa --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case2/query1.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +ex:pete ex:inverseKnows ex:validPerson1. +ex:fluffy ex:inverseKnows ex:validPerson1. + +ex:pete a ex:Person. +ex:fluffy a ex:Animal. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case2/query2.rq new file mode 100644 index 00000000000..32aaee0d875 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case2/query2.rq @@ -0,0 +1,22 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE { + +ex:pete a ex:Person. +ex:fluffy a ex:Animal. + +} + + +INSERT { + + + +} + +where {?a ?B ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case3/query1.rq new file mode 100644 index 00000000000..10e93710f53 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case3/query1.rq @@ -0,0 +1,44 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + + +ex:validPerson5 a ex:Person . + + +ex:validPerson3 a ex:Person . + + +ex:validPerson4 a ex:Person . + +ex:validPerson2 a ex:Person . + + +ex:pete ex:inverseKnows ex:validPerson1 . +ex:fluffy ex:inverseKnows ex:validPerson1 . + +ex:a ex:inverseKnows ex:validPerson5 . +ex:b ex:inverseKnows ex:validPerson3 . + +ex:c ex:inverseKnows ex:validPerson4 . + +ex:d ex:inverseKnows ex:validPerson2 . + + + + +ex:pete a ex:Person. +ex:fluffy a ex:Animal. + +ex:a a ex:Person. +ex:b a ex:Animal. +ex:c a ex:Person. +ex:d a ex:Animal. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case3/query2.rq new file mode 100644 index 00000000000..502c32b3460 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/invalid/case3/query2.rq @@ -0,0 +1,34 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE { + +ex:pete a ex:Person. +ex:fluffy a ex:Animal. + +ex:a a ex:Person. +ex:b a ex:Animal. +ex:c a ex:Person. +ex:d a ex:Animal. + +} + + +INSERT { + + +ex:pete a ex:Animal. +ex:fluffy a ex:Person. + +#ex:a a ex:Animal. +ex:b a ex:Person. +ex:c a ex:Animal. +#ex:d a ex:Person. + +} + +where {?a ?B ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/shacl.ttl new file mode 100644 index 00000000000..a6763b1958e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/shacl.ttl @@ -0,0 +1,20 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property ex:personShapeOr. + + +ex:personShapeOr + sh:path [sh:inversePath ex:inverseKnows]; + sh:not [sh:and ( + [sh:not [sh:class ex:Person]] + [sh:not [sh:class ex:Animal]] + ) ]. # reduces to sh:or by demorgan diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case1/query1.rq new file mode 100644 index 00000000000..b92d4d9006f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case1/query1.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +ex:pete a ex:Person. +ex:fluffy a ex:Animal. + + +ex:pete ex:inverseKnows ex:validPerson1 . +ex:fluffy ex:inverseKnows ex:validPerson1 . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case2/query1.rq new file mode 100644 index 00000000000..cb5f65fbd92 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case2/query1.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +ex:pete a ex:Person. +ex:fluffy a ex:Animal. + +ex:pete ex:inverseKnows ex:validPerson1 . +ex:fluffy ex:inverseKnows ex:validPerson1 . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case2/query2.rq new file mode 100644 index 00000000000..693d766d33f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/class2InversePath/valid/case2/query2.rq @@ -0,0 +1,24 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE { + +ex:pete a ex:Person. +ex:fluffy a ex:Animal. + +} + + +INSERT { + + +ex:pete a ex:Animal. +ex:fluffy a ex:Person. + +} + +where {?a ?B ?c} \ No newline at end of file From 55b5b5448f5ce1c818a02d00b928cc0a5464b436 Mon Sep 17 00:00:00 2001 From: Sakshi saini Date: Thu, 28 May 2020 15:43:54 +0530 Subject: [PATCH 14/35] GH-688: Added getLabel OptionalMethod for Optional (#2279) * GH-688: Added getLabel OptionalMethod for Optional Signed-off-by: SakshiSaini17092 * GH-688: Fixed the getLabel for Optional Signed-off-by: SakshiSaini17092 --- .../eclipse/rdf4j/model/util/Literals.java | 6 +++ .../rdf4j/model/util/LiteralsTest.java | 37 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java b/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java index b832ffd27e2..d4663b4f69c 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/util/Literals.java @@ -13,6 +13,7 @@ import java.util.IllformedLocaleException; import java.util.Locale; import java.util.Objects; +import java.util.Optional; import javax.xml.datatype.Duration; import javax.xml.datatype.XMLGregorianCalendar; @@ -51,6 +52,11 @@ public static String getLabel(Value v, String fallback) { return v instanceof Literal ? getLabel((Literal) v, fallback) : fallback; } + public static String getLabel(Optional v, String fallback) { + + return v != null ? getLabel((Value) v.orElseGet(null), fallback) : fallback; + } + /** * Gets the byte value of the supplied literal. The fallback value is returned in case {@link Literal#byteValue()} * throws a {@link NumberFormatException}. diff --git a/core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java b/core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java index 9db4a352791..df016358192 100644 --- a/core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java +++ b/core/model/src/test/java/org/eclipse/rdf4j/model/util/LiteralsTest.java @@ -15,13 +15,17 @@ import java.util.Date; import java.util.GregorianCalendar; +import java.util.Optional; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.Duration; +import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Literal; +import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.LinkedHashModel; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.XSD; import org.junit.Ignore; @@ -35,6 +39,9 @@ public class LiteralsTest { private static final ValueFactory vf = SimpleValueFactory.getInstance(); + private static final Model model = new LinkedHashModel(); + private static final IRI foo = vf.createIRI("http://example.org/foo"); + private static final IRI bar = vf.createIRI("http://example.org/bar"); /** * Test method for @@ -819,4 +826,34 @@ public void testNormaliseBCP47Tag() throws Exception { assertEquals("fr-FR", Literals.normalizeLanguageTag("FR-FR")); assertEquals("fr-FR", Literals.normalizeLanguageTag("FR-fr")); } + + /** + * Test method for {@link org.eclipse.rdf4j.model.util.Literals#getLabel(Optional, String)}} . + */ + @Test + public void testGetLabelForOptional() throws Exception { + + Literal lit = vf.createLiteral(1.0); + model.add(foo, bar, lit); + + Optional result = Models.object(model); + String label = Literals.getLabel(result, "fallback"); + assertNotNull(label); + assertTrue(label.equals("1.0")); + } + + /** + * Test method for {@link org.eclipse.rdf4j.model.util.Literals#getLabel(Optional, String)}} . + */ + @Test + public void testGetLabelForOptionalInFallback() throws Exception { + + Literal lit = vf.createLiteral(1.0); + model.add(foo, bar, lit); + + Optional result = Models.object(model); + String label = Literals.getLabel((Optional) null, "fallback"); + assertNotNull(label); + assertTrue(label.equals("fallback")); + } } From 1d17aa66c5b2bd87f36d716664d20f9f557e5dba Mon Sep 17 00:00:00 2001 From: Bart Hanssens Date: Thu, 28 May 2020 12:56:29 +0200 Subject: [PATCH 15/35] GH-2199 exclude jackson dependencies from POM (#2200) Signed-off-by: Bart Hanssens --- core/query/pom.xml | 12 ++++++++++++ core/rio/api/pom.xml | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/core/query/pom.xml b/core/query/pom.xml index 98b09396e29..5e8000f3106 100644 --- a/core/query/pom.xml +++ b/core/query/pom.xml @@ -20,6 +20,18 @@ rdf4j-rio-api ${project.version} + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + diff --git a/core/rio/api/pom.xml b/core/rio/api/pom.xml index 5a4cd20d614..e6584416d39 100644 --- a/core/rio/api/pom.xml +++ b/core/rio/api/pom.xml @@ -28,6 +28,20 @@ com.github.jsonld-java jsonld-java + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + commons-io From 787f086b8d80c16882545462c4d912506a36c273 Mon Sep 17 00:00:00 2001 From: Navdha Date: Fri, 29 May 2020 13:07:17 +0530 Subject: [PATCH 16/35] GH-1135:replaced deprecated URI with IRI (#2292) Signed-off-by: navdhaagarwal --- .../eclipse/rdf4j/spin/function/EvalFunction.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/EvalFunction.java b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/EvalFunction.java index 92814d1d0b3..f3daadac1af 100644 --- a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/EvalFunction.java +++ b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/EvalFunction.java @@ -11,8 +11,8 @@ import org.eclipse.rdf4j.RDF4JException; import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.URI; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.BooleanLiteral; @@ -117,11 +117,11 @@ public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExpr } private boolean isQuery(Resource r, TripleSource store) throws RDF4JException { - try (CloseableIteration typeIter = TripleSources.getObjectURIs(r, + try (CloseableIteration typeIter = TripleSources.getObjectURIs(r, RDF.TYPE, store)) { while (typeIter.hasNext()) { - URI type = typeIter.next(); + IRI type = typeIter.next(); if (SP.SELECT_CLASS.equals(type) || SP.ASK_CLASS.equals(type) || SPIN.TEMPLATES_CLASS.equals(type)) { return true; } @@ -133,10 +133,10 @@ private boolean isQuery(Resource r, TripleSource store) throws RDF4JException { protected static void addArguments(Query query, Value... args) throws ValueExprEvaluationException { for (int i = 1; i < args.length; i += 2) { - if (!(args[i] instanceof URI)) { - throw new ValueExprEvaluationException("Argument " + i + " must be a URI"); + if (!(args[i] instanceof IRI)) { + throw new ValueExprEvaluationException("Argument " + i + " must be a IRI"); } - query.setBinding(((URI) args[i]).getLocalName(), args[i + 1]); + query.setBinding(((IRI) args[i]).getLocalName(), args[i + 1]); } } } From 816543334d4c03a212ca662f33d838931e49aefc Mon Sep 17 00:00:00 2001 From: Navdha Date: Fri, 29 May 2020 13:07:42 +0530 Subject: [PATCH 17/35] GH-1190: Added HYDRA class (#2291) Signed-off-by: navdhaagarwal GH-1190: Added a test Signed-off-by: navdhaagarwal --- .../eclipse/rdf4j/model/vocabulary/HYDRA.java | 202 ++++++++++++++++++ .../rdf4j/model/util/VocabulariesTest.java | 23 ++ 2 files changed, 225 insertions(+) create mode 100644 core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/HYDRA.java diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/HYDRA.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/HYDRA.java new file mode 100644 index 00000000000..b13fd149a34 --- /dev/null +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/HYDRA.java @@ -0,0 +1,202 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.model.vocabulary; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Namespace; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.SimpleNamespace; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; + +/** + * Constants for the Hydra Core Vocabulary. + * + * @see Hydra Core Vocabulary + * + */ +public class HYDRA { + + /** + * The HYDRA namespace: http://www.w3.org/ns/hydra/core# + */ + public static final String NAMESPACE = "http://www.w3.org/ns/hydra/core#"; + + /** + * The recommended prefix for the HYDRA namespace: "hydra" + */ + public static final String PREFIX = "hydra"; + + /** + * An immutable {@link Namespace} constant that represents the HYDRA namespace. + */ + public static final Namespace NS = new SimpleNamespace(PREFIX, NAMESPACE); + + // ----- Classes ------ + public final static IRI API_DOCUMENTATION; + + public final static IRI CLASS; + + public final static IRI COLLECTION; + + public final static IRI ERROR; + + public final static IRI IRI_TEMPLATE; + + public final static IRI IRI_TEMPLATE_MAPPING; + + public final static IRI LINK; + + public final static IRI OPERATION; + + public final static IRI PARTIAL_COLLECTION_VIEW; + + public final static IRI RESOURCE; + + public final static IRI STATUS; + + public final static IRI SUPPORTED_PROPERTY; + + public final static IRI TEMPLATED_LINK; + + public final static IRI VARIABLE_REPRESENTATION; + + // ----- Properties ------ + public final static IRI API_DOCUMENTATION_PROP; + + public final static IRI COLLECTION_PROP; + + public final static IRI DESCRIPTION; + + public final static IRI ENTRYPOINT; + + public final static IRI EXPECTS; + + public final static IRI EXPECTS_HEADER; + + public final static IRI FIRST; + + public final static IRI FREETEXT_QUERY; + + public final static IRI LAST; + + public final static IRI LIMIT; + + public final static IRI MAPPING; + + public final static IRI MEMBER; + + public final static IRI METHOD; + + public final static IRI NEXT; + + public final static IRI OFFSET; + + public final static IRI OPERATION_PROP; + + public final static IRI PAGE_INDEX; + + public final static IRI PAGE_REFERENCE; + + public final static IRI POSSIBLE_STATUS; + + public final static IRI PREVIOUS; + + public final static IRI PROPERTY; + + public final static IRI READABLE; + + public final static IRI REQUIRED; + + public final static IRI RETURNS; + + public final static IRI RETURNS_HEADER; + + public final static IRI SEARCH; + + public final static IRI STATUS_CODE; + + public final static IRI SUPPORTED_CLASS; + + public final static IRI SUPPORTED_OPERATION; + + public final static IRI SUPPORTED_PROPERTY_PROP; + + public final static IRI TEMPLATE; + + public final static IRI TITLE; + + public final static IRI TOTAL_ITEMS; + + public final static IRI VARIABLE; + + public final static IRI VARIABLE_REPRESENTATION_PROP; + + public final static IRI VIEW; + + public final static IRI WRITABLE; + + static { + ValueFactory factory = SimpleValueFactory.getInstance(); + + // ----- Classes ------ + API_DOCUMENTATION = factory.createIRI(HYDRA.NAMESPACE, "ApiDocumentation"); + CLASS = factory.createIRI(HYDRA.NAMESPACE, "Class"); + COLLECTION = factory.createIRI(HYDRA.NAMESPACE, "Collection"); + ERROR = factory.createIRI(HYDRA.NAMESPACE, "Error"); + IRI_TEMPLATE = factory.createIRI(HYDRA.NAMESPACE, "IriTemplate"); + IRI_TEMPLATE_MAPPING = factory.createIRI(HYDRA.NAMESPACE, "IriTemplateMapping"); + LINK = factory.createIRI(HYDRA.NAMESPACE, "Link"); + OPERATION = factory.createIRI(HYDRA.NAMESPACE, "Operation"); + PARTIAL_COLLECTION_VIEW = factory.createIRI(HYDRA.NAMESPACE, "PartialCollectionView"); + RESOURCE = factory.createIRI(HYDRA.NAMESPACE, "Resource"); + STATUS = factory.createIRI(HYDRA.NAMESPACE, "Status"); + SUPPORTED_PROPERTY = factory.createIRI(HYDRA.NAMESPACE, "SupportedProperty"); + TEMPLATED_LINK = factory.createIRI(HYDRA.NAMESPACE, "TemplatedLink"); + VARIABLE_REPRESENTATION = factory.createIRI(HYDRA.NAMESPACE, "VariableRepresentation"); + + // ----- Properties ------ + API_DOCUMENTATION_PROP = factory.createIRI(HYDRA.NAMESPACE, "apiDocumentation"); + COLLECTION_PROP = factory.createIRI(HYDRA.NAMESPACE, "collection"); + DESCRIPTION = factory.createIRI(HYDRA.NAMESPACE, "description"); + ENTRYPOINT = factory.createIRI(HYDRA.NAMESPACE, "entrypoint"); + EXPECTS = factory.createIRI(HYDRA.NAMESPACE, "expects"); + EXPECTS_HEADER = factory.createIRI(HYDRA.NAMESPACE, "expectsHeader"); + FIRST = factory.createIRI(HYDRA.NAMESPACE, "first"); + FREETEXT_QUERY = factory.createIRI(HYDRA.NAMESPACE, "freetextQuery"); + LAST = factory.createIRI(HYDRA.NAMESPACE, "last"); + LIMIT = factory.createIRI(HYDRA.NAMESPACE, "limit"); + MAPPING = factory.createIRI(HYDRA.NAMESPACE, "mapping"); + MEMBER = factory.createIRI(HYDRA.NAMESPACE, "member"); + METHOD = factory.createIRI(HYDRA.NAMESPACE, "method"); + NEXT = factory.createIRI(HYDRA.NAMESPACE, "next"); + OFFSET = factory.createIRI(HYDRA.NAMESPACE, "offset"); + OPERATION_PROP = factory.createIRI(HYDRA.NAMESPACE, "operation"); + PAGE_INDEX = factory.createIRI(HYDRA.NAMESPACE, "pageIndex"); + PAGE_REFERENCE = factory.createIRI(HYDRA.NAMESPACE, "pageReference"); + POSSIBLE_STATUS = factory.createIRI(HYDRA.NAMESPACE, "possibleStatus"); + PREVIOUS = factory.createIRI(HYDRA.NAMESPACE, "previous"); + PROPERTY = factory.createIRI(HYDRA.NAMESPACE, "property"); + READABLE = factory.createIRI(HYDRA.NAMESPACE, "readable"); + REQUIRED = factory.createIRI(HYDRA.NAMESPACE, "required"); + RETURNS = factory.createIRI(HYDRA.NAMESPACE, "returns"); + RETURNS_HEADER = factory.createIRI(HYDRA.NAMESPACE, "returnsHeader"); + SEARCH = factory.createIRI(HYDRA.NAMESPACE, "search"); + STATUS_CODE = factory.createIRI(HYDRA.NAMESPACE, "statusCode"); + SUPPORTED_CLASS = factory.createIRI(HYDRA.NAMESPACE, "supportedClass"); + SUPPORTED_OPERATION = factory.createIRI(HYDRA.NAMESPACE, "supportedOperation"); + SUPPORTED_PROPERTY_PROP = factory.createIRI(HYDRA.NAMESPACE, "supportedProperty"); + TEMPLATE = factory.createIRI(HYDRA.NAMESPACE, "template"); + TITLE = factory.createIRI(HYDRA.NAMESPACE, "title"); + TOTAL_ITEMS = factory.createIRI(HYDRA.NAMESPACE, "totalItems"); + VARIABLE = factory.createIRI(HYDRA.NAMESPACE, "variable"); + VARIABLE_REPRESENTATION_PROP = factory.createIRI(HYDRA.NAMESPACE, "variableRepresentation"); + VIEW = factory.createIRI(HYDRA.NAMESPACE, "view"); + WRITABLE = factory.createIRI(HYDRA.NAMESPACE, "writeable"); + + } +} diff --git a/core/model/src/test/java/org/eclipse/rdf4j/model/util/VocabulariesTest.java b/core/model/src/test/java/org/eclipse/rdf4j/model/util/VocabulariesTest.java index ef76707185e..11a03d8b399 100644 --- a/core/model/src/test/java/org/eclipse/rdf4j/model/util/VocabulariesTest.java +++ b/core/model/src/test/java/org/eclipse/rdf4j/model/util/VocabulariesTest.java @@ -15,6 +15,7 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.vocabulary.DC; +import org.eclipse.rdf4j.model.vocabulary.HYDRA; import org.junit.Test; /** @@ -32,4 +33,26 @@ public void testVocabAllIRI() throws Exception { assertEquals(dcIRIs, allIRIs); } + + @Test + public void testVocabAllIRIHYDRA() throws Exception { + Set hydraIRIs = new HashSet<>(Arrays.asList(HYDRA.API_DOCUMENTATION, HYDRA.CLASS, HYDRA.COLLECTION, + HYDRA.ERROR, + HYDRA.IRI_TEMPLATE, HYDRA.IRI_TEMPLATE_MAPPING, HYDRA.LINK, HYDRA.OPERATION, + HYDRA.PARTIAL_COLLECTION_VIEW, + HYDRA.RESOURCE, HYDRA.STATUS, HYDRA.SUPPORTED_PROPERTY, HYDRA.TEMPLATED_LINK, + HYDRA.VARIABLE_REPRESENTATION, + HYDRA.API_DOCUMENTATION_PROP, HYDRA.COLLECTION_PROP, HYDRA.DESCRIPTION, HYDRA.ENTRYPOINT, HYDRA.EXPECTS, + HYDRA.EXPECTS_HEADER, HYDRA.FIRST, HYDRA.FREETEXT_QUERY, HYDRA.LAST, HYDRA.LIMIT, HYDRA.MAPPING, + HYDRA.MEMBER, + HYDRA.METHOD, HYDRA.NEXT, HYDRA.OFFSET, HYDRA.OPERATION_PROP, HYDRA.PAGE_INDEX, HYDRA.PAGE_REFERENCE, + HYDRA.POSSIBLE_STATUS, HYDRA.PREVIOUS, HYDRA.PROPERTY, HYDRA.READABLE, HYDRA.REQUIRED, HYDRA.RETURNS, + HYDRA.RETURNS_HEADER, HYDRA.SEARCH, HYDRA.STATUS_CODE, HYDRA.SUPPORTED_CLASS, HYDRA.SUPPORTED_OPERATION, + HYDRA.SUPPORTED_PROPERTY_PROP, HYDRA.TEMPLATE, HYDRA.TITLE, HYDRA.TOTAL_ITEMS, HYDRA.VARIABLE, + HYDRA.VARIABLE_REPRESENTATION_PROP, HYDRA.VIEW, HYDRA.WRITABLE)); + + Set allIRIs = Vocabularies.getIRIs(HYDRA.class); + + assertEquals(hydraIRIs, allIRIs); + } } From d460c7e29a62eadc5f132b708a68ee48ff8f1bf8 Mon Sep 17 00:00:00 2001 From: Navdha Date: Fri, 29 May 2020 14:49:26 +0530 Subject: [PATCH 18/35] GH-2158: Added getAllValues function to QueryResults (#2288) Signed-off-by: shubhi0108 GH-2158: Formatted getAllValues function Signed-off-by: navdhaagarwal GH-2158: Added a test Signed-off-by: navdhaagarwal GH-2158: changed function name Signed-off-by: navdhaagarwal GH2158: Final check with one more test Signed-off-by: navdhaagarwal GH2158: changes made Signed-off-by: navdhaagarwal Co-authored-by: shubhi0108 --- .../org/eclipse/rdf4j/query/QueryResults.java | 18 ++++++++++ .../eclipse/rdf4j/query/QueryResultsTest.java | 34 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java index 64936ca77a5..143fbbf6afb 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResults.java @@ -9,6 +9,7 @@ import java.io.InputStream; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -17,6 +18,7 @@ import java.util.Set; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.LinkedBlockingQueue; +import java.util.stream.Collectors; import java.util.stream.Stream; import javax.xml.datatype.XMLGregorianCalendar; @@ -87,6 +89,22 @@ public static Model asModel(CloseableIteration getAllValues(TupleQueryResult result, String var) throws QueryEvaluationException { + try (Stream stream = result.stream()) { + return result.getBindingNames().contains(var) + ? stream.map(bs -> bs.getValue(var)).collect(Collectors.toList()) + : Collections.emptyList(); + } + } + /** * Returns a single element from the query result.The QueryResult is automatically closed by this method. * diff --git a/core/query/src/test/java/org/eclipse/rdf4j/query/QueryResultsTest.java b/core/query/src/test/java/org/eclipse/rdf4j/query/QueryResultsTest.java index bf3710533d9..08391667814 100644 --- a/core/query/src/test/java/org/eclipse/rdf4j/query/QueryResultsTest.java +++ b/core/query/src/test/java/org/eclipse/rdf4j/query/QueryResultsTest.java @@ -23,6 +23,7 @@ import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; @@ -352,4 +353,37 @@ public void testBNodeBindingSet7() throws QueryEvaluationException { assertFalse(QueryResults.equals(tqr1, tqr3)); } + + @Test + public void testStreamTupleAllValuesOfResult1() { + BindingSet a = new ListBindingSet(twoBindingNames, foo, lit1); + BindingSet b = new ListBindingSet(twoBindingNames, bar, lit2); + tqr1.append(a); + tqr1.append(b); + tqr1.append(a); + tqr1.append(b); + tqr1.append(b); + + List list = QueryResults.getAllValues(tqr1, "a"); + + assertNotNull(list); + assertFalse(list.isEmpty()); + assertTrue(list.equals(Arrays.asList(foo, bar, foo, bar, bar))); + } + + @Test + public void testStreamTupleAllValuesOfResult2() { + BindingSet a = new ListBindingSet(twoBindingNames, foo, lit1); + BindingSet b = new ListBindingSet(twoBindingNames, bar, lit2); + tqr1.append(a); + tqr1.append(b); + tqr1.append(a); + tqr1.append(b); + tqr1.append(b); + + List list = QueryResults.getAllValues(tqr1, "c"); + + assertNotNull(list); + assertTrue(list.isEmpty()); + } } From ca6e338ffc883ecd0fd1fae1d255dc5a804222dd Mon Sep 17 00:00:00 2001 From: Sakshi saini Date: Mon, 1 Jun 2020 03:57:29 +0530 Subject: [PATCH 19/35] GH-956-SilentModeSparqlEndpoint : added silentMode in sparql connection (#2277) * GH-956-SilentModeSparqlEndpoint : added silentMode in sparql connection Signed-off-by: SakshiSaini17092 * added test case to SPARQLConnectionTest Signed-off-by: SakshiSaini17092 * GH:956: Updated test case Signed-off-by: SakshiSaini17092 --- .../repository/sparql/SPARQLConnection.java | 21 ++++++++++++++++--- .../repository/sparql/SPARQLRepository.java | 1 - .../sparql/SPARQLConnectionTest.java | 18 +++++++++++++++- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnection.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnection.java index 99ecfe84647..bdb20fffdca 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnection.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnection.java @@ -103,6 +103,7 @@ public class SPARQLConnection extends AbstractRepositoryConnection implements Ht private int maxPendingSize = DEFAULT_MAX_PENDING_SIZE; private final boolean quadMode; + private boolean silentMode; public SPARQLConnection(SPARQLRepository repository, SPARQLProtocolSession client) { this(repository, client, false); // in triple mode by default @@ -112,6 +113,7 @@ public SPARQLConnection(SPARQLRepository repository, SPARQLProtocolSession clien super(repository); this.client = client; this.quadMode = quadMode; + this.silentMode = false; } @Override @@ -119,6 +121,10 @@ public String toString() { return client.getQueryURL(); } + public void enableSilentMode(boolean flag) { + this.silentMode = flag; + } + @Override public void setParserConfig(ParserConfig parserConfig) { client.setParserConfig(parserConfig); @@ -604,16 +610,21 @@ public void clear(Resource... contexts) throws RepositoryException { OpenRDFUtil.verifyContextNotNull(contexts); boolean localTransaction = startLocalTransaction(); + String clearMode = "CLEAR"; + if (this.isSilentMode()) { + clearMode = "CLEAR SILENT"; + } + if (contexts.length == 0) { - sparqlTransaction.append("CLEAR ALL "); + sparqlTransaction.append(clearMode + " ALL "); sparqlTransaction.append("; "); } else { for (Resource context : contexts) { if (context == null) { - sparqlTransaction.append("CLEAR DEFAULT "); + sparqlTransaction.append(clearMode + " DEFAULT "); sparqlTransaction.append("; "); } else if (context instanceof IRI) { - sparqlTransaction.append("CLEAR GRAPH <" + context.stringValue() + "> "); + sparqlTransaction.append(clearMode + " GRAPH <" + context.stringValue() + "> "); sparqlTransaction.append("; "); } else { throw new RepositoryException("SPARQL does not support named graphs identified by blank nodes."); @@ -986,6 +997,10 @@ protected boolean isQuadMode() { return quadMode; } + protected boolean isSilentMode() { + return silentMode; + } + /** * Converts a {@link TupleQueryResult} resulting from the {@link #EVERYTHING_WITH_GRAPH} to a statement by using the * respective values from the {@link BindingSet} or (if provided) the ones from the arguments. diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLRepository.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLRepository.java index 7361279bfe1..47cb957f98b 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLRepository.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLRepository.java @@ -37,7 +37,6 @@ public class SPARQLRepository extends AbstractRepository implements HttpClientDe * @see #enableQuadMode(boolean) */ private boolean quadMode = false; - /** * The HTTP client that takes care of the client-server communication. */ diff --git a/core/repository/sparql/src/test/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnectionTest.java b/core/repository/sparql/src/test/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnectionTest.java index 4bba624826f..8c8e51be36e 100644 --- a/core/repository/sparql/src/test/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnectionTest.java +++ b/core/repository/sparql/src/test/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnectionTest.java @@ -18,6 +18,7 @@ import org.eclipse.rdf4j.http.client.SPARQLProtocolSession; import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.FOAF; @@ -32,7 +33,6 @@ public class SPARQLConnectionTest { private SPARQLConnection subject; private SPARQLProtocolSession client; - private final ValueFactory vf = SimpleValueFactory.getInstance(); @Before @@ -150,4 +150,20 @@ public void testHandlingAddsRemoves() throws Exception { .contains(expectedRemovedTriple1); } + + @Test + public void testSilentModeSparqlConnection() throws Exception { + subject.enableSilentMode(true); + assertThat(subject.isSilentMode() == true); + + ArgumentCaptor sparqlUpdateCaptor = ArgumentCaptor.forClass(String.class); + subject.begin(); + subject.clear(); + subject.commit(); + + verify(client).sendUpdate(any(), sparqlUpdateCaptor.capture(), any(), any(), anyBoolean(), anyInt(), any()); + + String sparqlUpdate = sparqlUpdateCaptor.getValue(); + assertThat(sparqlUpdate).containsOnlyOnce("CLEAR SILENT"); + } } From 8eb404119631dbd86d5d26c5c86ad99cc9d0aeb7 Mon Sep 17 00:00:00 2001 From: Pavel Mihaylov Date: Sat, 6 Jun 2020 09:23:14 +0300 Subject: [PATCH 20/35] GH-2304: Disables stack trace collection for ValueExprEvaluationException (#2305) Signed-off-by: Pavel Mihaylov Co-authored-by: Pavel Mihaylov --- .../algebra/evaluation/ValueExprEvaluationException.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ValueExprEvaluationException.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ValueExprEvaluationException.java index a2a1e7458c1..cb1e98ce630 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ValueExprEvaluationException.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ValueExprEvaluationException.java @@ -35,4 +35,10 @@ public ValueExprEvaluationException(String message, Throwable t) { public ValueExprEvaluationException(Throwable t) { super(t); } + + @Override + public Throwable fillInStackTrace() { + // Exception used for excessive flow control. Collecting the stack trace is a slow operation, so skip it. + return this; + } } From 4f4f246efae17f7861f0622cc560715ff59d3290 Mon Sep 17 00:00:00 2001 From: iamaryananand <32545908+iamaryananand@users.noreply.github.com> Date: Wed, 10 Jun 2020 04:56:04 +0530 Subject: [PATCH 21/35] GH-1368 RDFXmlPrettyWriter now inlines blank nodes when it can (#2294) * GH-1368 Added a CompactXML setting to XMLWriterSettings [Reformatted + Test Cases] Signed-off-by: iamaryananand GH-1368 Added a RioSetting Compact_Xml. [Reformatted and signed] Signed-off-by: iamaryananand <32545908+iamaryananand@users.noreply.github.com> GH-1368 Added a RioSetting Compact_Xml. [Reformatted] Signed-off-by: iamaryananand GH-1368 Added a RioSetting Compact_Xml + Test Case Added. [Reformatted] Signed-off-by: iamaryananand GH-1368 Added a CompactXML setting to XMLWriterSettings Signed-off-by: iamaryananand * GH-1368 Removed ArrangedWriter(use and dependency) from the test case and removed CompactXML setting. Signed-off-by: iamaryananand * GH-1368 Removed ArrangedWriter(use and dependency) from the test case and removed CompactXML setting(reformatted). Signed-off-by: iamaryananand * GH-1368 Using INLINE_BLANK_NODE setting and test case changed. [Reformatted code] Signed-off-by: iamaryananand --- .../rio/rdfxml/util/RDFXMLPrettyWriter.java | 18 ++---- .../rio/rdfxml/RDFXMLPrettyWriterTest.java | 56 +++++++++++++++---- 2 files changed, 52 insertions(+), 22 deletions(-) diff --git a/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/util/RDFXMLPrettyWriter.java b/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/util/RDFXMLPrettyWriter.java index a0e1b394b83..4cee631a01d 100644 --- a/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/util/RDFXMLPrettyWriter.java +++ b/core/rio/rdfxml/src/main/java/org/eclipse/rdf4j/rio/rdfxml/util/RDFXMLPrettyWriter.java @@ -7,25 +7,17 @@ *******************************************************************************/ package org.eclipse.rdf4j.rio.rdfxml.util; -import java.io.Closeable; -import java.io.Flushable; -import java.io.IOException; -import java.io.OutputStream; -import java.io.Writer; +import java.io.*; import java.util.Stack; import org.eclipse.rdf4j.common.net.ParsedIRI; -import org.eclipse.rdf4j.model.BNode; -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Literal; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.model.*; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.util.Literals; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.RDFS; import org.eclipse.rdf4j.rio.RDFHandlerException; +import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings; import org.eclipse.rdf4j.rio.rdfxml.RDFXMLWriter; /** @@ -372,6 +364,7 @@ public void consumeStatement(Statement st) throws RDFHandlerException { * Used both in writeStartSubject and writeEmptySubject. */ private void writeNodeStartOfStartTag(Node node) throws IOException, RDFHandlerException { + Boolean inlineBlankNodes = getWriterConfig().get(BasicWriterSettings.INLINE_BLANK_NODES); Value value = node.getValue(); if (node.hasType()) { @@ -387,7 +380,8 @@ private void writeNodeStartOfStartTag(Node node) throws IOException, RDFHandlerE writeAttribute(RDF.NAMESPACE, "about", uri.toString()); } else { BNode bNode = (BNode) value; - writeAttribute(RDF.NAMESPACE, "nodeID", getValidNodeId(bNode)); + if (!inlineBlankNodes) + writeAttribute(RDF.NAMESPACE, "nodeID", getValidNodeId(bNode)); } } diff --git a/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLPrettyWriterTest.java b/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLPrettyWriterTest.java index 4950d4745f9..190dc5407d4 100644 --- a/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLPrettyWriterTest.java +++ b/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLPrettyWriterTest.java @@ -9,24 +9,21 @@ import static org.junit.Assert.assertEquals; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; +import java.io.*; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; import org.apache.commons.io.IOUtils; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.*; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.rio.RDFHandlerException; -import org.eclipse.rdf4j.rio.RDFWriter; -import org.eclipse.rdf4j.rio.RDFWriterTest; -import org.eclipse.rdf4j.rio.WriterConfig; +import org.eclipse.rdf4j.model.vocabulary.RDFS; +import org.eclipse.rdf4j.rio.*; import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings; +import org.eclipse.rdf4j.rio.rdfxml.util.RDFXMLPrettyWriter; import org.eclipse.rdf4j.rio.rdfxml.util.RDFXMLPrettyWriterFactory; import org.junit.Test; @@ -104,6 +101,46 @@ public void outOfSequenceItemsAreNotAbbreviated() throws RDFHandlerException, IO assertEquals(Arrays.asList(" statementArrayList = new ArrayList<>(); + + rdfXmlWriter.set(BasicWriterSettings.PRETTY_PRINT, false); + rdfXmlWriter.set(BasicWriterSettings.INLINE_BLANK_NODES, true); + + IRI subject = vf.createIRI("http://example.org/subject"); + IRI relation = vf.createIRI("http://example.org/relation"); + BNode bnode = vf.createBNode("bnode"); + + statementArrayList.add(vf.createStatement(subject, relation, bnode)); + statementArrayList.add(vf.createStatement(bnode, RDFS.LABEL, vf.createLiteral("the blank node"))); + Rio.write(statementArrayList, rdfXmlWriter); + + String expectedOutput = "\n" + + "\n" + + "\n" + + "\t\n" + + "\t\t\n" + + "\t\t\tthe blank node\n" + + + "\t\t\n" + + "\t\n" + + "\n" + + "\n" + + ""; + + assertEquals(expectedOutput, outputStream.toString()); + } + @Test public void inSequenceItemsMixedWithOtherElementsAreAbbreviated() throws RDFHandlerException, IOException { StringWriter writer = new StringWriter(); @@ -126,7 +163,6 @@ public void inSequenceItemsMixedWithOtherElementsAreAbbreviated() throws RDFHand rdfWriter.endRDF(); List rdfLines = rdfOpenTags(writer.toString()); - assertEquals(Arrays.asList(" Date: Wed, 10 Jun 2020 10:02:16 +1000 Subject: [PATCH 22/35] fix reference to XMLSchema/XSD vocabulary --- .../algebra/evaluation/util/ValueComparatorTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/ValueComparatorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/ValueComparatorTest.java index 74aa0198862..df4830df404 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/ValueComparatorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/util/ValueComparatorTest.java @@ -157,8 +157,8 @@ public void testOrder3() throws Exception { public void testNonStrictComparisons() throws Exception { cmp.setStrict(false); assertTrue(cmp.isStrict() == false); - Literal date1 = vf.createLiteral("2019-09-02", XMLSchema.DATE); - Literal date2 = vf.createLiteral("2018", XMLSchema.GYEAR); + Literal date1 = vf.createLiteral("2019-09-02", XSD.DATE); + Literal date2 = vf.createLiteral("2018", XSD.GYEAR); assertTrue(cmp.compare(date1, date2) > 0); } @@ -166,8 +166,8 @@ public void testNonStrictComparisons() throws Exception { public void testStrictComparisons() throws Exception { cmp.setStrict(true); assertTrue(cmp.isStrict() == true); - Literal date1 = vf.createLiteral("2019-09-02", XMLSchema.DATE); - Literal date2 = vf.createLiteral("2018", XMLSchema.GYEAR); + Literal date1 = vf.createLiteral("2019-09-02", XSD.DATE); + Literal date2 = vf.createLiteral("2018", XSD.GYEAR); assertTrue(cmp.compare(date1, date2) < 0); } } From 0581d4982fbd376ad334114816b0c34ed575b0e1 Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Thu, 11 Jun 2020 14:28:05 +1000 Subject: [PATCH 23/35] set correct version Signed-off-by: Jeen Broekstra --- assembly/pom.xml | 2 +- bom/pom.xml | 2 +- compliance/elasticsearch/pom.xml | 2 +- compliance/geosparql/pom.xml | 2 +- compliance/lucene/pom.xml | 2 +- compliance/model/pom.xml | 2 +- compliance/pom.xml | 2 +- compliance/repository/pom.xml | 2 +- compliance/rio/pom.xml | 2 +- compliance/serql/pom.xml | 2 +- compliance/shacl/pom.xml | 2 +- compliance/solr/pom.xml | 2 +- compliance/sparql/pom.xml | 2 +- core/client/pom.xml | 2 +- core/http/client/pom.xml | 2 +- core/http/pom.xml | 2 +- core/http/protocol/pom.xml | 2 +- core/model/pom.xml | 2 +- core/pom.xml | 2 +- core/query/pom.xml | 2 +- core/queryalgebra/evaluation/pom.xml | 2 +- core/queryalgebra/geosparql/pom.xml | 2 +- core/queryalgebra/model/pom.xml | 2 +- core/queryalgebra/pom.xml | 2 +- core/queryparser/api/pom.xml | 2 +- core/queryparser/pom.xml | 2 +- core/queryparser/serql/pom.xml | 2 +- core/queryparser/sparql/pom.xml | 2 +- core/queryrender/pom.xml | 2 +- core/queryresultio/api/pom.xml | 2 +- core/queryresultio/binary/pom.xml | 2 +- core/queryresultio/pom.xml | 2 +- core/queryresultio/sparqljson/pom.xml | 2 +- core/queryresultio/sparqlxml/pom.xml | 2 +- core/queryresultio/text/pom.xml | 2 +- core/repository/api/pom.xml | 2 +- core/repository/contextaware/pom.xml | 2 +- core/repository/dataset/pom.xml | 2 +- core/repository/event/pom.xml | 2 +- core/repository/http/pom.xml | 2 +- core/repository/manager/pom.xml | 2 +- core/repository/pom.xml | 2 +- core/repository/sail/pom.xml | 2 +- core/repository/sparql/pom.xml | 2 +- core/rio/api/pom.xml | 2 +- core/rio/binary/pom.xml | 2 +- core/rio/datatypes/pom.xml | 2 +- core/rio/hdt/pom.xml | 2 +- core/rio/jsonld/pom.xml | 2 +- core/rio/languages/pom.xml | 2 +- core/rio/n3/pom.xml | 2 +- core/rio/nquads/pom.xml | 2 +- core/rio/ntriples/pom.xml | 2 +- core/rio/pom.xml | 2 +- core/rio/rdfjson/pom.xml | 2 +- core/rio/rdfxml/pom.xml | 2 +- core/rio/trig/pom.xml | 2 +- core/rio/trix/pom.xml | 2 +- core/rio/turtle/pom.xml | 2 +- core/sail/api/pom.xml | 2 +- core/sail/base/pom.xml | 2 +- core/sail/elasticsearch-store/pom.xml | 2 +- core/sail/elasticsearch/pom.xml | 2 +- core/sail/extensible-store/pom.xml | 2 +- core/sail/federation/pom.xml | 2 +- core/sail/inferencer/pom.xml | 2 +- core/sail/lucene-api/pom.xml | 2 +- core/sail/lucene-spin/pom.xml | 2 +- core/sail/lucene/pom.xml | 2 +- core/sail/memory/pom.xml | 2 +- core/sail/model/pom.xml | 2 +- core/sail/nativerdf/pom.xml | 2 +- core/sail/pom.xml | 2 +- core/sail/sail-spin/pom.xml | 2 +- core/sail/shacl/pom.xml | 2 +- core/sail/solr/pom.xml | 2 +- core/sparqlbuilder/pom.xml | 2 +- core/spin/pom.xml | 2 +- core/storage/pom.xml | 2 +- core/util/pom.xml | 2 +- pom.xml | 2 +- testsuites/benchmark/pom.xml | 2 +- testsuites/geosparql/pom.xml | 2 +- testsuites/lucene/pom.xml | 2 +- testsuites/model/pom.xml | 2 +- testsuites/pom.xml | 2 +- testsuites/queryresultio/pom.xml | 2 +- testsuites/repository/pom.xml | 2 +- testsuites/rio/pom.xml | 2 +- testsuites/sail/pom.xml | 2 +- testsuites/serql/pom.xml | 2 +- testsuites/shacl/pom.xml | 2 +- testsuites/sparql/pom.xml | 2 +- tools/config/pom.xml | 2 +- tools/console/pom.xml | 2 +- tools/federation/pom.xml | 2 +- tools/pom.xml | 2 +- tools/runtime-osgi/pom.xml | 2 +- tools/runtime/pom.xml | 2 +- tools/server-spring/pom.xml | 2 +- tools/server/pom.xml | 2 +- tools/workbench/pom.xml | 2 +- 102 files changed, 102 insertions(+), 102 deletions(-) diff --git a/assembly/pom.xml b/assembly/pom.xml index bdbcccaf101..6e2cc5362f6 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-assembly pom diff --git a/bom/pom.xml b/bom/pom.xml index dd4d35b4e62..8ee73408dad 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-bom pom diff --git a/compliance/elasticsearch/pom.xml b/compliance/elasticsearch/pom.xml index 6a49876eee8..e0721443a23 100644 --- a/compliance/elasticsearch/pom.xml +++ b/compliance/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-elasticsearch-compliance RDF4J Elasticsearch Sail Tests diff --git a/compliance/geosparql/pom.xml b/compliance/geosparql/pom.xml index 404d2fc0a1d..60af5141244 100644 --- a/compliance/geosparql/pom.xml +++ b/compliance/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-compliance RDF4J GeoSPARQL compliance tests diff --git a/compliance/lucene/pom.xml b/compliance/lucene/pom.xml index d89a50c1575..e53b1ab6f69 100644 --- a/compliance/lucene/pom.xml +++ b/compliance/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-compliance RDF4J Lucene Sail Tests diff --git a/compliance/model/pom.xml b/compliance/model/pom.xml index 1b29ffd30a9..676cf158bfa 100644 --- a/compliance/model/pom.xml +++ b/compliance/model/pom.xml @@ -3,7 +3,7 @@ rdf4j-compliance org.eclipse.rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT 4.0.0 rdf4j-model-compliance diff --git a/compliance/pom.xml b/compliance/pom.xml index 68a868bb8a5..452df902de4 100644 --- a/compliance/pom.xml +++ b/compliance/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-compliance pom diff --git a/compliance/repository/pom.xml b/compliance/repository/pom.xml index d3c3cf5d8ac..945ccdec499 100644 --- a/compliance/repository/pom.xml +++ b/compliance/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-compliance war diff --git a/compliance/rio/pom.xml b/compliance/rio/pom.xml index 8b126120bfb..270aa343a42 100644 --- a/compliance/rio/pom.xml +++ b/compliance/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-compliance RDF4J Rio compliance tests diff --git a/compliance/serql/pom.xml b/compliance/serql/pom.xml index 0d7dd57cf3a..3582b88a288 100644 --- a/compliance/serql/pom.xml +++ b/compliance/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-compliance RDF4J SeRQL query parser compliance tests diff --git a/compliance/shacl/pom.xml b/compliance/shacl/pom.xml index e1bfc52df1c..2f70fdbf779 100644 --- a/compliance/shacl/pom.xml +++ b/compliance/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-compliance RDF4J SHACL compliance tests diff --git a/compliance/solr/pom.xml b/compliance/solr/pom.xml index 9f4c21992c4..917d864d771 100644 --- a/compliance/solr/pom.xml +++ b/compliance/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-solr-compliance RDF4J Solr Sail Tests diff --git a/compliance/sparql/pom.xml b/compliance/sparql/pom.xml index 498df81f52e..7054a1ff892 100644 --- a/compliance/sparql/pom.xml +++ b/compliance/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-compliance war diff --git a/core/client/pom.xml b/core/client/pom.xml index a391d555a06..2639cd8a1cd 100644 --- a/core/client/pom.xml +++ b/core/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-client RDF4J: Client Libraries diff --git a/core/http/client/pom.xml b/core/http/client/pom.xml index a06d99f6feb..c41aaab00cc 100644 --- a/core/http/client/pom.xml +++ b/core/http/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-client RDF4J: HTTP client diff --git a/core/http/pom.xml b/core/http/pom.xml index 25db1428a89..d35255a95eb 100644 --- a/core/http/pom.xml +++ b/core/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http pom diff --git a/core/http/protocol/pom.xml b/core/http/protocol/pom.xml index ae966f1d151..1a3d6dff039 100644 --- a/core/http/protocol/pom.xml +++ b/core/http/protocol/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-protocol RDF4J: HTTP protocol diff --git a/core/model/pom.xml b/core/model/pom.xml index 76b76be05f5..5020f0a7277 100644 --- a/core/model/pom.xml +++ b/core/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model RDF4J: Model diff --git a/core/pom.xml b/core/pom.xml index 409cc170b2d..1e27344892b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-core pom diff --git a/core/query/pom.xml b/core/query/pom.xml index a2c950b5128..98b09396e29 100644 --- a/core/query/pom.xml +++ b/core/query/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-query RDF4J: Query diff --git a/core/queryalgebra/evaluation/pom.xml b/core/queryalgebra/evaluation/pom.xml index 4b25a79b8bf..4aaed5165f3 100644 --- a/core/queryalgebra/evaluation/pom.xml +++ b/core/queryalgebra/evaluation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-evaluation RDF4J: Query algebra - evaluation diff --git a/core/queryalgebra/geosparql/pom.xml b/core/queryalgebra/geosparql/pom.xml index 51c81a6a189..01e1dfd69f9 100644 --- a/core/queryalgebra/geosparql/pom.xml +++ b/core/queryalgebra/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-geosparql RDF4J: Query algebra - GeoSPARQL diff --git a/core/queryalgebra/model/pom.xml b/core/queryalgebra/model/pom.xml index 38ad845dfce..9756bfa3fab 100644 --- a/core/queryalgebra/model/pom.xml +++ b/core/queryalgebra/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-model RDF4J: Query algebra - model diff --git a/core/queryalgebra/pom.xml b/core/queryalgebra/pom.xml index c9d2801efcf..e1b487d6952 100644 --- a/core/queryalgebra/pom.xml +++ b/core/queryalgebra/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra pom diff --git a/core/queryparser/api/pom.xml b/core/queryparser/api/pom.xml index e03e1d456bf..57e8066dd0c 100644 --- a/core/queryparser/api/pom.xml +++ b/core/queryparser/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-api RDF4J: Query parser - API diff --git a/core/queryparser/pom.xml b/core/queryparser/pom.xml index 9f480a35414..ed654e6514f 100644 --- a/core/queryparser/pom.xml +++ b/core/queryparser/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser pom diff --git a/core/queryparser/serql/pom.xml b/core/queryparser/serql/pom.xml index 7a0c7bab262..1ba3fbdf31d 100644 --- a/core/queryparser/serql/pom.xml +++ b/core/queryparser/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-serql RDF4J: Query parser - SeRQL diff --git a/core/queryparser/sparql/pom.xml b/core/queryparser/sparql/pom.xml index 9861227ec76..b2ffedbbf84 100644 --- a/core/queryparser/sparql/pom.xml +++ b/core/queryparser/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-sparql RDF4J: Query parser - SPARQL diff --git a/core/queryrender/pom.xml b/core/queryrender/pom.xml index f5f6503642a..a9f0a872074 100644 --- a/core/queryrender/pom.xml +++ b/core/queryrender/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryrender RDF4J: Query Rendering diff --git a/core/queryresultio/api/pom.xml b/core/queryresultio/api/pom.xml index a1e7fac1706..b33ca33d98b 100644 --- a/core/queryresultio/api/pom.xml +++ b/core/queryresultio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-api RDF4J: Query result IO - API diff --git a/core/queryresultio/binary/pom.xml b/core/queryresultio/binary/pom.xml index 7530aff9256..c2f157e6bf9 100644 --- a/core/queryresultio/binary/pom.xml +++ b/core/queryresultio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-binary RDF4J: Query result IO - binary diff --git a/core/queryresultio/pom.xml b/core/queryresultio/pom.xml index bdf8c93ce03..d9e5dd06fc9 100644 --- a/core/queryresultio/pom.xml +++ b/core/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio pom diff --git a/core/queryresultio/sparqljson/pom.xml b/core/queryresultio/sparqljson/pom.xml index 570e2ada4ff..0e47e241561 100644 --- a/core/queryresultio/sparqljson/pom.xml +++ b/core/queryresultio/sparqljson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqljson RDF4J: Query result IO - SPARQL/JSON diff --git a/core/queryresultio/sparqlxml/pom.xml b/core/queryresultio/sparqlxml/pom.xml index a8f76aaceca..fe97661f6a9 100644 --- a/core/queryresultio/sparqlxml/pom.xml +++ b/core/queryresultio/sparqlxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqlxml RDF4J: Query result IO - SPARQL/XML diff --git a/core/queryresultio/text/pom.xml b/core/queryresultio/text/pom.xml index 1b99cab592f..38dbfcbec03 100644 --- a/core/queryresultio/text/pom.xml +++ b/core/queryresultio/text/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-text RDF4J: Query result IO - plain text booleans diff --git a/core/repository/api/pom.xml b/core/repository/api/pom.xml index 43e2f04b5db..329699b9801 100644 --- a/core/repository/api/pom.xml +++ b/core/repository/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-api RDF4J: Repository - API diff --git a/core/repository/contextaware/pom.xml b/core/repository/contextaware/pom.xml index 90633517a51..485ec462156 100644 --- a/core/repository/contextaware/pom.xml +++ b/core/repository/contextaware/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-contextaware RDF4J: Repository - context aware (wrapper) diff --git a/core/repository/dataset/pom.xml b/core/repository/dataset/pom.xml index e8aa368e3a9..646760c1527 100644 --- a/core/repository/dataset/pom.xml +++ b/core/repository/dataset/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-dataset RDF4J: DatasetRepository (wrapper) diff --git a/core/repository/event/pom.xml b/core/repository/event/pom.xml index cd0fd69b38d..2358504439a 100644 --- a/core/repository/event/pom.xml +++ b/core/repository/event/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-event RDF4J: Repository - event (wrapper) diff --git a/core/repository/http/pom.xml b/core/repository/http/pom.xml index 3c73b6fa88c..727a025e228 100644 --- a/core/repository/http/pom.xml +++ b/core/repository/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-http RDF4J: HTTPRepository diff --git a/core/repository/manager/pom.xml b/core/repository/manager/pom.xml index f7f689fac31..3f291fe0bc4 100644 --- a/core/repository/manager/pom.xml +++ b/core/repository/manager/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-manager RDF4J: Repository manager diff --git a/core/repository/pom.xml b/core/repository/pom.xml index c24437a0a0d..9b9b97cde3d 100644 --- a/core/repository/pom.xml +++ b/core/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository pom diff --git a/core/repository/sail/pom.xml b/core/repository/sail/pom.xml index 9cb17116be7..04ccfc72fbd 100644 --- a/core/repository/sail/pom.xml +++ b/core/repository/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sail RDF4J: SailRepository diff --git a/core/repository/sparql/pom.xml b/core/repository/sparql/pom.xml index df74f01e046..61c7785d99e 100644 --- a/core/repository/sparql/pom.xml +++ b/core/repository/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sparql RDF4J: SPARQL Repository diff --git a/core/rio/api/pom.xml b/core/rio/api/pom.xml index 5675351fab8..5a4cd20d614 100644 --- a/core/rio/api/pom.xml +++ b/core/rio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-api RDF4J: Rio - API diff --git a/core/rio/binary/pom.xml b/core/rio/binary/pom.xml index b10d24d458b..ee0bd22954f 100644 --- a/core/rio/binary/pom.xml +++ b/core/rio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-binary RDF4J: Rio - Binary diff --git a/core/rio/datatypes/pom.xml b/core/rio/datatypes/pom.xml index ab8e6253cc9..1250511c4b8 100644 --- a/core/rio/datatypes/pom.xml +++ b/core/rio/datatypes/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-datatypes RDF4J: Rio - Datatypes diff --git a/core/rio/hdt/pom.xml b/core/rio/hdt/pom.xml index a1347a1826e..d6cb85f1ece 100644 --- a/core/rio/hdt/pom.xml +++ b/core/rio/hdt/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-hdt jar diff --git a/core/rio/jsonld/pom.xml b/core/rio/jsonld/pom.xml index 7ef82452ab1..6208961e90f 100644 --- a/core/rio/jsonld/pom.xml +++ b/core/rio/jsonld/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-jsonld RDF4J: Rio - JSON-LD diff --git a/core/rio/languages/pom.xml b/core/rio/languages/pom.xml index 07cb8c83b3d..2c6618646da 100644 --- a/core/rio/languages/pom.xml +++ b/core/rio/languages/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-languages RDF4J: Rio - Languages diff --git a/core/rio/n3/pom.xml b/core/rio/n3/pom.xml index 9071c9b5d72..12a90ac868b 100644 --- a/core/rio/n3/pom.xml +++ b/core/rio/n3/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-n3 RDF4J: Rio - N3 (writer-only) diff --git a/core/rio/nquads/pom.xml b/core/rio/nquads/pom.xml index 8151c56ad6a..27f08c03eb3 100644 --- a/core/rio/nquads/pom.xml +++ b/core/rio/nquads/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-nquads RDF4J: Rio - N-Quads diff --git a/core/rio/ntriples/pom.xml b/core/rio/ntriples/pom.xml index f6e978d94fb..dc7302637bc 100644 --- a/core/rio/ntriples/pom.xml +++ b/core/rio/ntriples/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-ntriples RDF4J: Rio - N-Triples diff --git a/core/rio/pom.xml b/core/rio/pom.xml index 56e65f8a91b..db0afa2698c 100644 --- a/core/rio/pom.xml +++ b/core/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio pom diff --git a/core/rio/rdfjson/pom.xml b/core/rio/rdfjson/pom.xml index 72de588cf68..26b57806918 100644 --- a/core/rio/rdfjson/pom.xml +++ b/core/rio/rdfjson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfjson RDF4J: Rio - RDF/JSON diff --git a/core/rio/rdfxml/pom.xml b/core/rio/rdfxml/pom.xml index f7351cbcd65..2e12c77035b 100644 --- a/core/rio/rdfxml/pom.xml +++ b/core/rio/rdfxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfxml RDF4J: Rio - RDF/XML diff --git a/core/rio/trig/pom.xml b/core/rio/trig/pom.xml index 3a408c5466c..d6a18113cba 100644 --- a/core/rio/trig/pom.xml +++ b/core/rio/trig/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trig RDF4J: Rio - TriG diff --git a/core/rio/trix/pom.xml b/core/rio/trix/pom.xml index 386eadeaaa7..b1a6fc818a4 100644 --- a/core/rio/trix/pom.xml +++ b/core/rio/trix/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trix RDF4J: Rio - TriX diff --git a/core/rio/turtle/pom.xml b/core/rio/turtle/pom.xml index c409cb9d424..14363862440 100644 --- a/core/rio/turtle/pom.xml +++ b/core/rio/turtle/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-turtle RDF4J: Rio - Turtle diff --git a/core/sail/api/pom.xml b/core/sail/api/pom.xml index 6bce6ce9bc0..b12bb1457a2 100644 --- a/core/sail/api/pom.xml +++ b/core/sail/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-api RDF4J: Sail API diff --git a/core/sail/base/pom.xml b/core/sail/base/pom.xml index 9d9e1e6d37a..3a29b447d92 100644 --- a/core/sail/base/pom.xml +++ b/core/sail/base/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-base RDF4J: Sail base implementations diff --git a/core/sail/elasticsearch-store/pom.xml b/core/sail/elasticsearch-store/pom.xml index 367d8328475..89c5ad1e22a 100644 --- a/core/sail/elasticsearch-store/pom.xml +++ b/core/sail/elasticsearch-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch-store RDF4J Elasticsearch Store diff --git a/core/sail/elasticsearch/pom.xml b/core/sail/elasticsearch/pom.xml index 015505e7ac4..787f0b89234 100644 --- a/core/sail/elasticsearch/pom.xml +++ b/core/sail/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch RDF4J Elastic Search Sail Index diff --git a/core/sail/extensible-store/pom.xml b/core/sail/extensible-store/pom.xml index 8f028cbef28..de8f72aff13 100644 --- a/core/sail/extensible-store/pom.xml +++ b/core/sail/extensible-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-extensible-store RDF4J Extensible Store diff --git a/core/sail/federation/pom.xml b/core/sail/federation/pom.xml index 9f66da2a3aa..563c203457e 100644 --- a/core/sail/federation/pom.xml +++ b/core/sail/federation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-federation RDF4J: Federation SAIL diff --git a/core/sail/inferencer/pom.xml b/core/sail/inferencer/pom.xml index 1c6d57cb547..9422f06037f 100644 --- a/core/sail/inferencer/pom.xml +++ b/core/sail/inferencer/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-inferencer RDF4J: Inferencer Sails diff --git a/core/sail/lucene-api/pom.xml b/core/sail/lucene-api/pom.xml index 53707f1009e..adbd392650e 100644 --- a/core/sail/lucene-api/pom.xml +++ b/core/sail/lucene-api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene-api RDF4J Lucene Sail API diff --git a/core/sail/lucene-spin/pom.xml b/core/sail/lucene-spin/pom.xml index a594ded7915..111dc308b42 100644 --- a/core/sail/lucene-spin/pom.xml +++ b/core/sail/lucene-spin/pom.xml @@ -4,7 +4,7 @@ rdf4j-sail org.eclipse.rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-spin RDF4J Lucene Sail Spin diff --git a/core/sail/lucene/pom.xml b/core/sail/lucene/pom.xml index dabb782a39a..b752e12b16c 100644 --- a/core/sail/lucene/pom.xml +++ b/core/sail/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene RDF4J Lucene Sail Index diff --git a/core/sail/memory/pom.xml b/core/sail/memory/pom.xml index a8eb4d04ace..31a265883d9 100644 --- a/core/sail/memory/pom.xml +++ b/core/sail/memory/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-memory RDF4J: MemoryStore diff --git a/core/sail/model/pom.xml b/core/sail/model/pom.xml index eee732a6b89..bc69ab76280 100644 --- a/core/sail/model/pom.xml +++ b/core/sail/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-model RDF4J: Sail Model diff --git a/core/sail/nativerdf/pom.xml b/core/sail/nativerdf/pom.xml index bea1f0f99ca..9f3d7ed7f9c 100644 --- a/core/sail/nativerdf/pom.xml +++ b/core/sail/nativerdf/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-nativerdf RDF4J: NativeStore diff --git a/core/sail/pom.xml b/core/sail/pom.xml index c848402ea32..32a7d02c191 100644 --- a/core/sail/pom.xml +++ b/core/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail pom diff --git a/core/sail/sail-spin/pom.xml b/core/sail/sail-spin/pom.xml index d705e3b2010..46bb8d1b75f 100644 --- a/core/sail/sail-spin/pom.xml +++ b/core/sail/sail-spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-spin RDF4J: SPIN SAIL diff --git a/core/sail/shacl/pom.xml b/core/sail/shacl/pom.xml index 226d311a831..67e94f3bd13 100644 --- a/core/sail/shacl/pom.xml +++ b/core/sail/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl RDF4J: SHACL diff --git a/core/sail/solr/pom.xml b/core/sail/solr/pom.xml index 3ee150effbd..547ab856231 100644 --- a/core/sail/solr/pom.xml +++ b/core/sail/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-solr RDF4J Solr Sail Index diff --git a/core/sparqlbuilder/pom.xml b/core/sparqlbuilder/pom.xml index 519447bbe14..85470528110 100644 --- a/core/sparqlbuilder/pom.xml +++ b/core/sparqlbuilder/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparqlbuilder RDF4J: SparqlBuilder diff --git a/core/spin/pom.xml b/core/spin/pom.xml index ac85fbf5302..6bf2f0ae88b 100644 --- a/core/spin/pom.xml +++ b/core/spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-spin RDF4J: SPIN diff --git a/core/storage/pom.xml b/core/storage/pom.xml index 226677fd1f5..511dca86c86 100644 --- a/core/storage/pom.xml +++ b/core/storage/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-storage RDF4J: Storage Libraries diff --git a/core/util/pom.xml b/core/util/pom.xml index bba71838624..ed76ac9f873 100644 --- a/core/util/pom.xml +++ b/core/util/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-util RDF4J: util diff --git a/pom.xml b/pom.xml index 37b81b00f96..ad9ab31f04f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.eclipse.rdf4j rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT pom Eclipse RDF4J An extensible Java framework for RDF and SPARQL diff --git a/testsuites/benchmark/pom.xml b/testsuites/benchmark/pom.xml index 0a7254424a7..7c3fa436804 100644 --- a/testsuites/benchmark/pom.xml +++ b/testsuites/benchmark/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-benchmark RDF4J: benchmarks diff --git a/testsuites/geosparql/pom.xml b/testsuites/geosparql/pom.xml index 890c82cc058..83e751e8e3d 100644 --- a/testsuites/geosparql/pom.xml +++ b/testsuites/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-testsuite RDF4J GeoSPARQL compliance test suite diff --git a/testsuites/lucene/pom.xml b/testsuites/lucene/pom.xml index a882bd09155..8d9405c43a4 100644 --- a/testsuites/lucene/pom.xml +++ b/testsuites/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-testsuite RDF4J Lucene Sail Tests diff --git a/testsuites/model/pom.xml b/testsuites/model/pom.xml index 0250ddefa37..a8ad142b919 100644 --- a/testsuites/model/pom.xml +++ b/testsuites/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model-testsuite RDF4J: Model API testsuite diff --git a/testsuites/pom.xml b/testsuites/pom.xml index 48cc3cfea7e..745926f4ef3 100644 --- a/testsuites/pom.xml +++ b/testsuites/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-testsuites pom diff --git a/testsuites/queryresultio/pom.xml b/testsuites/queryresultio/pom.xml index 57f4d3d3c04..d6d2205ccda 100644 --- a/testsuites/queryresultio/pom.xml +++ b/testsuites/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-testsuite RDF4J: QueryResultIO testsuite diff --git a/testsuites/repository/pom.xml b/testsuites/repository/pom.xml index 241aa4eb949..37db19075b0 100644 --- a/testsuites/repository/pom.xml +++ b/testsuites/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-testsuite RDF4J: Repository API testsuite diff --git a/testsuites/rio/pom.xml b/testsuites/rio/pom.xml index 990a88004eb..439ce4c21c8 100644 --- a/testsuites/rio/pom.xml +++ b/testsuites/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-testsuite RDF4J Rio compliance test suite diff --git a/testsuites/sail/pom.xml b/testsuites/sail/pom.xml index 2abec00d370..3de37b6f45e 100644 --- a/testsuites/sail/pom.xml +++ b/testsuites/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-testsuite RDF4J: Sail API testsuite diff --git a/testsuites/serql/pom.xml b/testsuites/serql/pom.xml index 2fcf0ad9802..08f8d46e616 100644 --- a/testsuites/serql/pom.xml +++ b/testsuites/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-testsuite RDF4J SeRQL test suite diff --git a/testsuites/shacl/pom.xml b/testsuites/shacl/pom.xml index 3906217914f..952bb546e4e 100644 --- a/testsuites/shacl/pom.xml +++ b/testsuites/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-testsuite RDF4J SHACL compliance test suite diff --git a/testsuites/sparql/pom.xml b/testsuites/sparql/pom.xml index 2b4f69b38c0..45663cc3c0b 100644 --- a/testsuites/sparql/pom.xml +++ b/testsuites/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-testsuite RDF4J SPARQL compliance test suite diff --git a/tools/config/pom.xml b/tools/config/pom.xml index 38995f67297..74aff1aea3b 100644 --- a/tools/config/pom.xml +++ b/tools/config/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-config RDF4J: application configuration diff --git a/tools/console/pom.xml b/tools/console/pom.xml index 745d46908f8..b9dddcdc4ba 100644 --- a/tools/console/pom.xml +++ b/tools/console/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-console RDF4J: Console diff --git a/tools/federation/pom.xml b/tools/federation/pom.xml index 83db4155340..736c0f77da1 100644 --- a/tools/federation/pom.xml +++ b/tools/federation/pom.xml @@ -8,7 +8,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT 9.4.19.v20190610 diff --git a/tools/pom.xml b/tools/pom.xml index 578c7101488..81979390a16 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT org.eclipse.rdf4j rdf4j-tools diff --git a/tools/runtime-osgi/pom.xml b/tools/runtime-osgi/pom.xml index 3151591a54b..bf3ba94fb55 100644 --- a/tools/runtime-osgi/pom.xml +++ b/tools/runtime-osgi/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime-osgi bundle diff --git a/tools/runtime/pom.xml b/tools/runtime/pom.xml index beb0d26ec5a..58dae30a158 100644 --- a/tools/runtime/pom.xml +++ b/tools/runtime/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime RDF4J: Runtime diff --git a/tools/server-spring/pom.xml b/tools/server-spring/pom.xml index 4a7e1d875f9..6a82ef5d935 100644 --- a/tools/server-spring/pom.xml +++ b/tools/server-spring/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server-spring RDF4J: HTTP server - core diff --git a/tools/server/pom.xml b/tools/server/pom.xml index 27941dc2c7c..8e9c552094d 100644 --- a/tools/server/pom.xml +++ b/tools/server/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server war diff --git a/tools/workbench/pom.xml b/tools/workbench/pom.xml index 79935a5ba3c..bb1dbdf328f 100644 --- a/tools/workbench/pom.xml +++ b/tools/workbench/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.3-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-workbench war From 045cd44e72e05b47d6564164c2fed4fd3c973c77 Mon Sep 17 00:00:00 2001 From: hmottestad Date: Tue, 16 Jun 2020 07:54:59 +0200 Subject: [PATCH 24/35] GH-2017 SHACL support for advanced targeting (#2229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * GH-2017 initial test case and implementation Signed-off-by: Håvard Ottestad * more test cases Signed-off-by: Håvard Ottestad * GH-1912 initial sparql target support Signed-off-by: Håvard Ottestad * better support for sparql targets Signed-off-by: Håvard Ottestad * GH-1912 better support for sparql targets Signed-off-by: Håvard Ottestad * test Signed-off-by: Håvard Ottestad * more sparql target tests Signed-off-by: Håvard Ottestad * fixed typo Signed-off-by: Håvard Ottestad * change targetClass to targetObject for new compound targetting Signed-off-by: Håvard Ottestad * benchmark Signed-off-by: Håvard Ottestad * fix supported features docs Signed-off-by: Håvard Ottestad * Trigger GitHub ci * improved benchmarks Signed-off-by: Håvard Ottestad * GH-2017 introduce support for dash:AllObjectsTarget and AllSubjectsTarget in order to support the filter structure Signed-off-by: Håvard Ottestad * GH-2017 initial support for filter shapes Signed-off-by: Håvard Ottestad * fix up tests Signed-off-by: Håvard Ottestad * cleanup Signed-off-by: Håvard Ottestad * fix dash vocab file Signed-off-by: Håvard Ottestad * fix after merge Signed-off-by: Håvard Ottestad * refactoring to better handle target filters Signed-off-by: Håvard Ottestad * merge fixes Signed-off-by: Håvard Ottestad * Support for dash constants for dash:AllSubjects and dash:AllObjects Signed-off-by: Håvard Ottestad * refactored code Signed-off-by: Håvard Ottestad * final code for toggle for experimental filter shapes Signed-off-by: Håvard Ottestad * added test cases for sh:hasValue Signed-off-by: Håvard Ottestad * more test cases for hasValue and also fix for empty sh:and, sh:or, sh:not Signed-off-by: Håvard Ottestad * moving shapes back where they came from, will do the bigger refactor in the new AST branch Signed-off-by: Håvard Ottestad * code cleanup Signed-off-by: Håvard Ottestad * support for sh:hasValue Signed-off-by: Håvard Ottestad * more javadocs Signed-off-by: Håvard Ottestad * remove unused tests Signed-off-by: Håvard Ottestad * some simplification and docs Signed-off-by: Håvard Ottestad * fixed headers and more tests Signed-off-by: Håvard Ottestad * fix tests and some code cleanup Signed-off-by: Håvard Ottestad * code cleanup Signed-off-by: Håvard Ottestad * initial support for dash:valuesIn Signed-off-by: Håvard Ottestad * bechmark Signed-off-by: Håvard Ottestad * migrate to sh:targetShape Signed-off-by: Håvard Ottestad * a couple of tests for negation Signed-off-by: Håvard Ottestad * test cases for value in Signed-off-by: Håvard Ottestad * more tests for targetNode Signed-off-by: Håvard Ottestad * added some benchmarks Signed-off-by: Håvard Ottestad * implemented handling of node validation Signed-off-by: Håvard Ottestad * functional implementation for valuesIn Signed-off-by: Håvard Ottestad * more fixes Signed-off-by: Håvard Ottestad * switched naming of new features Signed-off-by: Håvard Ottestad --- .../eclipse/rdf4j/model/vocabulary/DASH.java | 39 +++ .../eclipse/rdf4j/model/vocabulary/SHACL.java | 4 + .../AST/AbstractSimplePropertyShape.java | 10 +- .../sail/shacl/AST/AllObjectsTarget.java | 104 ++++++++ .../sail/shacl/AST/AllSubjectsTarget.java | 120 +++++++++ .../sail/shacl/AST/AndPropertyShape.java | 82 +++++- .../sail/shacl/AST/ClassPropertyShape.java | 61 +++-- .../rdf4j/sail/shacl/AST/CompoundTarget.java | 93 +++++++ .../sail/shacl/AST/HasValuePropertyShape.java | 245 ++++++++++++++++++ .../rdf4j/sail/shacl/AST/InversePath.java | 11 + .../sail/shacl/AST/MaxCountPropertyShape.java | 8 +- .../sail/shacl/AST/MinCountPropertyShape.java | 12 +- .../rdf4j/sail/shacl/AST/NodeShape.java | 166 +++++++++--- .../sail/shacl/AST/NotPropertyShape.java | 24 +- .../rdf4j/sail/shacl/AST/OrPropertyShape.java | 46 +++- .../eclipse/rdf4j/sail/shacl/AST/Path.java | 6 + .../sail/shacl/AST/PathPropertyShape.java | 2 +- .../rdf4j/sail/shacl/AST/PlanGenerator.java | 2 + .../rdf4j/sail/shacl/AST/PropertyShape.java | 150 +++++++---- .../rdf4j/sail/shacl/AST/ShaclProperties.java | 89 +++++-- .../rdf4j/sail/shacl/AST/SimplePath.java | 13 +- .../rdf4j/sail/shacl/AST/SparqlTarget.java | 75 ++++++ .../rdf4j/sail/shacl/AST/TargetClass.java | 13 +- .../rdf4j/sail/shacl/AST/TargetNode.java | 10 +- .../rdf4j/sail/shacl/AST/TargetObjectsOf.java | 12 +- .../rdf4j/sail/shacl/AST/TargetShape.java | 201 ++++++++++++++ .../sail/shacl/AST/TargetSubjectsOf.java | 12 +- .../shacl/AST/UniqueLangPropertyShape.java | 4 +- .../sail/shacl/AST/ValueInPropertyShape.java | 216 +++++++++++++++ .../eclipse/rdf4j/sail/shacl/ShaclSail.java | 119 ++++++++- .../rdf4j/sail/shacl/ShaclSailConnection.java | 4 +- .../sail/shacl/SourceConstraintComponent.java | 3 + ...SimpleRdfsBackwardsChainingConnection.java | 7 +- .../sail/shacl/config/ShaclSailConfig.java | 100 +++++-- .../sail/shacl/config/ShaclSailFactory.java | 2 + .../sail/shacl/config/ShaclSailSchema.java | 4 + .../planNodes/AbstractBulkJoinPlanNode.java | 31 ++- .../shacl/planNodes/BufferedSplitter.java | 4 +- .../planNodes/BulkedExternalInnerJoin.java | 18 +- .../BulkedExternalLeftOuterJoin.java | 4 +- .../sail/shacl/planNodes/DebugPlanNode.java | 98 +++++++ .../planNodes/ExternalFilterByPredicate.java | 2 +- .../planNodes/ExternalFilterByQuery.java | 88 +++++++ .../planNodes/ExternalFilterIsObject.java | 43 +++ .../planNodes/ExternalFilterIsSubject.java | 47 ++++ ...ava => ExternalPredicateObjectFilter.java} | 39 +-- .../sail/shacl/planNodes/FilterPlanNode.java | 17 +- .../rdf4j/sail/shacl/planNodes/InnerJoin.java | 5 +- .../rdf4j/sail/shacl/planNodes/Select.java | 11 +- .../shacl/planNodes/SparqlTargetSelect.java | 166 ++++++++++++ .../{ModifyTuple.java => TupleMapper.java} | 4 +- .../rdf4j/sail/shacl/planNodes/Unique.java | 6 +- .../shacl-sparql-inference/dashConstants.rq | 20 ++ .../rdf4j/sail/shacl/AbstractShaclTest.java | 117 +++++++-- .../sail/shacl/ExtendedFeaturesetTest.java | 107 ++++++++ .../benchmark/AddRemoveBenchmarkEmpty.java | 4 +- .../sail/shacl/benchmark/BulkedBenchmark.java | 3 +- .../shacl/benchmark/ClassBenchmarkEmpty.java | 7 +- .../shacl/benchmark/ComplexBenchmark.java | 7 +- .../benchmark/ComplexLargeBenchmark.java | 3 +- .../benchmark/ComplexTargetBenchmark.java | 147 +++++++++++ .../benchmark/DatatypeBenchmarkEmpty.java | 7 +- .../benchmark/DatatypeBenchmarkLinear.java | 7 +- .../benchmark/DatatypeBenchmarkPrefilled.java | 1 + .../DatatypeBenchmarkSerializableEmpty.java | 7 +- .../benchmark/HasValueBenchmarkEmpty.java | 170 ++++++++++++ .../rdf4j/sail/shacl/benchmark/Main.java | 2 +- .../benchmark/MaxCountBenchmarkEmpty.java | 7 +- .../benchmark/MinCountBenchmarkEmpty.java | 7 +- .../benchmark/MinCountBenchmarkPrefilled.java | 1 + .../MinCountPrefilledVsEmptyBenchmark.java | 2 +- .../shacl/benchmark/NativeStoreBenchmark.java | 3 +- .../benchmark/NotClassBenchmarkEmpty.java | 7 +- .../benchmark/NotMaxCountBenchmarkEmpty.java | 7 +- .../NotUniqueLangBenchmarkEmpty.java | 4 +- .../shacl/benchmark/ParallelBenchmark.java | 4 +- .../benchmark/ShaclLoadingBenchmark.java | 3 +- .../benchmark/TargetBenchmarkInitialData.java | 146 +++++++++++ .../benchmark/UniqueLangBenchmarkEmpty.java | 7 +- .../benchmark/ValueInBenchmarkEmpty.java | 183 +++++++++++++ .../shacl/config/ShaclSailConfigTest.java | 147 ++++++----- .../shacl/config/ShaclSailFactoryTest.java | 17 +- .../sail/shacl/testimp/TestNotifyingSail.java | 29 +++ .../testimp/TestNotifyingSailConnection.java | 60 +++++ .../resources/shaclDatatypeSparqlTarget.ttl | 34 +++ .../resources/shaclDatatypeTargetFilter.ttl | 26 ++ .../shaclDatatypeTargetFilterWithUnion.ttl | 26 ++ .../class/allObjects/invalid/case1/query1.rq | 14 + .../class/allObjects/invalid/case2/query1.rq | 17 ++ .../class/allObjects/invalid/case2/query2.rq | 12 + .../class/allObjects/invalid/case3/query1.rq | 15 ++ .../class/allObjects/invalid/case3/query2.rq | 12 + .../test-cases/class/allObjects/shacl.ttl | 17 ++ .../class/allObjects/valid/case1/query1.rq | 17 ++ .../class/allObjects/valid/case2/query1.rq | 16 ++ .../class/allObjects/valid/case2/query2.rq | 14 + .../class/allObjects/valid/case3/query1.rq | 13 + .../class/allObjects/valid/case3/query2.rq | 12 + .../class/allSubjects/invalid/case1/query1.rq | 12 + .../class/allSubjects/invalid/case2/query1.rq | 15 ++ .../class/allSubjects/invalid/case2/query2.rq | 12 + .../test-cases/class/allSubjects/shacl.ttl | 17 ++ .../class/allSubjects/valid/case1/query1.rq | 14 + .../class/allSubjects/valid/case2/query1.rq | 15 ++ .../class/allSubjects/valid/case2/query2.rq | 14 + .../class/allSubjects/valid/case3/query1.rq | 12 + .../class/allSubjects/valid/case3/query2.rq | 12 + .../invalid/case1/query1.rq | 13 + .../invalid/case2/query1.rq | 12 + .../invalid/case2/query2.rq | 12 + .../invalid/case3/query1.rq | 15 ++ .../invalid/case3/query2.rq | 12 + .../invalid/case4/query1.rq | 15 ++ .../invalid/case4/query2.rq | 15 ++ .../invalid/case5/query1.rq | 16 ++ .../invalid/case5/query2.rq | 19 ++ .../invalid/case6/query1.rq | 15 ++ .../invalid/case6/query2.rq | 13 + .../invalid/case7/query1.rq | 13 + .../invalid/case8/query1.rq | 13 + .../invalid/case9/query1.rq | 16 ++ .../invalid/case9/query2.rq | 19 ++ .../class/complexTargetShape/shacl.ttl | 24 ++ .../complexTargetShape/valid/case1/query1.rq | 15 ++ .../complexTargetShape/valid/case2/query1.rq | 12 + .../complexTargetShape/valid/case2/query2.rq | 13 + .../complexTargetShape/valid/case3/query1.rq | 14 + .../complexTargetShape/valid/case3/query2.rq | 12 + .../complexTargetShape/valid/case4/query1.rq | 15 ++ .../complexTargetShape/valid/case4/query2.rq | 15 ++ .../complexTargetShape/valid/case5/query1.rq | 15 ++ .../complexTargetShape/valid/case5/query2.rq | 14 + .../complexTargetShape/valid/case6/query1.rq | 15 ++ .../complexTargetShape/valid/case7/query1.rq | 11 + .../complexTargetShape/valid/case7/query2.rq | 18 ++ .../invalid/case1/query1.rq | 14 + .../invalid/case2/query1.rq | 16 ++ .../invalid/case3/query1.rq | 15 ++ .../invalid/case3/query2.rq | 12 + .../invalid/case4/query1.rq | 14 + .../invalid/case4/query2.rq | 13 + .../class/complexTargetShape2/shacl.ttl | 35 +++ .../complexTargetShape2/valid/case1/query1.rq | 16 ++ .../complexTargetShape2/valid/case2/query1.rq | 14 + .../complexTargetShape2/valid/case2/query2.rq | 12 + .../complexTargetShape2/valid/case2/query3.rq | 12 + .../complexTargetShape2/valid/case3/query1.rq | 13 + .../simpleTargetShape/invalid/case1/query1.rq | 13 + .../simpleTargetShape/invalid/case2/query1.rq | 12 + .../simpleTargetShape/invalid/case2/query2.rq | 12 + .../simpleTargetShape/invalid/case3/query1.rq | 15 ++ .../simpleTargetShape/invalid/case3/query2.rq | 12 + .../simpleTargetShape/invalid/case4/query1.rq | 15 ++ .../simpleTargetShape/invalid/case4/query2.rq | 15 ++ .../simpleTargetShape/invalid/case5/query1.rq | 16 ++ .../simpleTargetShape/invalid/case5/query2.rq | 19 ++ .../simpleTargetShape/invalid/case6/query1.rq | 15 ++ .../simpleTargetShape/invalid/case6/query2.rq | 13 + .../simpleTargetShape/invalid/case7/query1.rq | 13 + .../simpleTargetShape/invalid/case8/query1.rq | 13 + .../simpleTargetShape/invalid/case9/query1.rq | 16 ++ .../simpleTargetShape/invalid/case9/query2.rq | 19 ++ .../class/simpleTargetShape/shacl.ttl | 24 ++ .../simpleTargetShape/valid/case1/query1.rq | 15 ++ .../simpleTargetShape/valid/case2/query1.rq | 12 + .../simpleTargetShape/valid/case2/query2.rq | 13 + .../simpleTargetShape/valid/case3/query1.rq | 14 + .../simpleTargetShape/valid/case3/query2.rq | 12 + .../simpleTargetShape/valid/case4/query1.rq | 15 ++ .../simpleTargetShape/valid/case4/query2.rq | 15 ++ .../simpleTargetShape/valid/case5/query1.rq | 15 ++ .../simpleTargetShape/valid/case5/query2.rq | 14 + .../simpleTargetShape/valid/case6/query1.rq | 15 ++ .../simpleTargetShape/valid/case7/query1.rq | 11 + .../simpleTargetShape/valid/case7/query2.rq | 18 ++ .../sparqlTarget/invalid/case1/query1.rq | 15 ++ .../sparqlTarget/invalid/case2/query1.rq | 13 + .../sparqlTarget/invalid/case2/query2.rq | 12 + .../sparqlTarget/invalid/case3/query1.rq | 15 ++ .../sparqlTarget/invalid/case3/query2.rq | 12 + .../sparqlTarget/invalid/case4/query1.rq | 15 ++ .../sparqlTarget/invalid/case4/query2.rq | 15 ++ .../sparqlTarget/invalid/case5/query1.rq | 17 ++ .../sparqlTarget/invalid/case5/query2.rq | 19 ++ .../sparqlTarget/invalid/case6/query1.rq | 15 ++ .../sparqlTarget/invalid/case6/query2.rq | 13 + .../sparqlTarget/invalid/case7/query1.rq | 13 + .../sparqlTarget/invalid/case8/query1.rq | 15 ++ .../sparqlTarget/invalid/case9/query1.rq | 16 ++ .../sparqlTarget/invalid/case9/query2.rq | 19 ++ .../test-cases/class/sparqlTarget/shacl.ttl | 40 +++ .../class/sparqlTarget/valid/case1/query1.rq | 15 ++ .../class/sparqlTarget/valid/case2/query1.rq | 12 + .../class/sparqlTarget/valid/case2/query2.rq | 13 + .../class/sparqlTarget/valid/case3/query1.rq | 14 + .../class/sparqlTarget/valid/case3/query2.rq | 12 + .../class/sparqlTarget/valid/case4/query1.rq | 15 ++ .../class/sparqlTarget/valid/case4/query2.rq | 15 ++ .../class/sparqlTarget/valid/case5/query1.rq | 15 ++ .../class/sparqlTarget/valid/case5/query2.rq | 14 + .../class/sparqlTarget/valid/case6/query1.rq | 15 ++ .../class/sparqlTarget/valid/case7/query1.rq | 11 + .../class/sparqlTarget/valid/case7/query2.rq | 18 ++ .../sparqlTargetNot/invalid/case1/query1.rq | 15 ++ .../sparqlTargetNot/invalid/case2/query1.rq | 12 + .../sparqlTargetNot/invalid/case2/query2.rq | 13 + .../sparqlTargetNot/invalid/case3/query1.rq | 14 + .../sparqlTargetNot/invalid/case3/query2.rq | 12 + .../sparqlTargetNot/invalid/case6/query1.rq | 15 ++ .../sparqlTargetNot/invalid/case7/query1.rq | 11 + .../sparqlTargetNot/invalid/case7/query2.rq | 18 ++ .../sparqlTargetNot/invalid/case8/query1.rq | 13 + .../sparqlTargetNot/invalid/case8/query2.rq | 12 + .../class/sparqlTargetNot/shacl.ttl | 38 +++ .../sparqlTargetNot/valid/case1/query1.rq | 13 + .../sparqlTargetNot/valid/case2/query1.rq | 12 + .../sparqlTargetNot/valid/case2/query2.rq | 12 + .../sparqlTargetNot/valid/case4/query1.rq | 14 + .../sparqlTargetNot/valid/case4/query2.rq | 15 ++ .../sparqlTargetNot/valid/case5/query1.rq | 15 ++ .../sparqlTargetNot/valid/case5/query2.rq | 19 ++ .../sparqlTargetNot/valid/case6/query1.rq | 15 ++ .../sparqlTargetNot/valid/case6/query2.rq | 13 + .../sparqlTargetNot/valid/case7/query1.rq | 13 + .../sparqlTargetNot/valid/case8/query1.rq | 13 + .../sparqlTargetNot/valid/case9/query1.rq | 16 ++ .../sparqlTargetNot/valid/case9/query2.rq | 19 ++ .../sparqlTarget/invalid/case1/query1.rq | 107 ++++++++ .../sparqlTarget/invalid/case1/query2.rq | 19 ++ .../test-cases/complex/sparqlTarget/shacl.ttl | 51 ++++ .../sparqlTarget/valid/case1/query1.rq | 107 ++++++++ .../allObjects/invalid/case1/query1.rq | 12 + .../allObjects/invalid/case2/query1.rq | 12 + .../allObjects/invalid/case2/query2.rq | 12 + .../test-cases/datatype/allObjects/shacl.ttl | 14 + .../datatype/allObjects/valid/case1/query1.rq | 12 + .../datatype/allObjects/valid/case2/query1.rq | 12 + .../datatype/allObjects/valid/case2/query2.rq | 13 + .../datatype/notNodeShapeAnd/shacl.ttl | 24 ++ .../notNodeShapeAnd/valid/case1/query1.rq | 13 + .../notNodeShapeAnd/valid/case2/query1.rq | 13 + .../notNodeShapeAnd/valid/case2/query2.rq | 13 + .../notNodeShapeAnd/valid/case3/query1.rq | 12 + .../notNodeShapeAnd/valid/case3/query2.rq | 15 ++ .../notNodeShapeAnd/valid/case4/query1.rq | 14 + .../notNodeShapeAnd/valid/case4/query2.rq | 19 ++ .../notNodeShapeAnd/valid/case5/query1.rq | 13 + .../notNodeShapeAnd/valid/case5/query2.rq | 12 + .../notNodeShapeAnd/valid/case6/query1.rq | 12 + .../notNodeShapeAnd/valid/case6/query2.rq | 14 + .../notNodeShapeAnd/valid/case7/query1.rq | 12 + .../notNodeShapeAnd/valid/case7/query2.rq | 18 ++ .../notNodeShapeAnd/valid/case8/query1.rq | 17 ++ .../invalid/case1/query1.rq | 13 + .../invalid/case3/query1.rq | 12 + .../invalid/case3/query2.rq | 12 + .../notNodeShapeTargetShape/shacl.ttl | 16 ++ .../valid/case1/query1.rq | 13 + .../valid/case2/query1.rq | 13 + .../valid/case2/query2.rq | 13 + .../valid/case3/query1.rq | 12 + .../valid/case3/query2.rq | 15 ++ .../valid/case4/query1.rq | 14 + .../valid/case4/query2.rq | 19 ++ .../valid/case5/query1.rq | 13 + .../valid/case5/query2.rq | 12 + .../valid/case6/query1.rq | 12 + .../valid/case6/query2.rq | 14 + .../valid/case7/query1.rq | 12 + .../valid/case7/query2.rq | 18 ++ .../notTargetShape/invalid/case1/query1.rq | 13 + .../notTargetShape/invalid/case2/query1.rq | 13 + .../notTargetShape/invalid/case2/query2.rq | 12 + .../notTargetShape/invalid/case3/query1.rq | 12 + .../notTargetShape/invalid/case3/query2.rq | 12 + .../notTargetShape/invalid/case4/query1.rq | 12 + .../notTargetShape/invalid/case4/query2.rq | 14 + .../notTargetShape/invalid/case5/query1.rq | 12 + .../notTargetShape/invalid/case5/query2.rq | 18 ++ .../datatype/notTargetShape/shacl.ttl | 17 ++ .../notTargetShape/valid/case1/query1.rq | 13 + .../notTargetShape/valid/case2/query1.rq | 13 + .../notTargetShape/valid/case2/query2.rq | 13 + .../notTargetShape/valid/case3/query1.rq | 12 + .../notTargetShape/valid/case3/query2.rq | 15 ++ .../notTargetShape/valid/case4/query1.rq | 14 + .../notTargetShape/valid/case4/query2.rq | 19 ++ .../sparqlTarget/invalid/case1/query1.rq | 13 + .../sparqlTarget/invalid/case2/query1.rq | 13 + .../sparqlTarget/invalid/case2/query2.rq | 12 + .../sparqlTarget/invalid/case3/query1.rq | 12 + .../sparqlTarget/invalid/case3/query2.rq | 12 + .../sparqlTarget/invalid/case4/query1.rq | 12 + .../sparqlTarget/invalid/case4/query2.rq | 14 + .../sparqlTarget/invalid/case5/query1.rq | 12 + .../sparqlTarget/invalid/case5/query2.rq | 18 ++ .../datatype/sparqlTarget/shacl.ttl | 36 +++ .../sparqlTarget/valid/case1/query1.rq | 13 + .../sparqlTarget/valid/case2/query1.rq | 13 + .../sparqlTarget/valid/case2/query2.rq | 13 + .../sparqlTarget/valid/case3/query1.rq | 12 + .../sparqlTarget/valid/case3/query2.rq | 15 ++ .../sparqlTarget/valid/case4/query1.rq | 14 + .../sparqlTarget/valid/case4/query2.rq | 19 ++ .../hasValue/and/invalid/case1/query1.rq | 14 + .../hasValue/and/invalid/case2/query1.rq | 13 + .../hasValue/and/invalid/case2/query2.rq | 12 + .../test-cases/hasValue/and/shacl.ttl | 28 ++ .../hasValue/and/valid/case1/query1.rq | 14 + .../hasValue/and/valid/case3/query1.rq | 13 + .../hasValue/and/valid/case3/query2.rq | 15 ++ .../hasValue/not/invalid/case1/query1.rq | 14 + .../hasValue/not/invalid/case2/query1.rq | 13 + .../hasValue/not/invalid/case2/query2.rq | 12 + .../hasValue/not/invalid/case3/query1.rq | 13 + .../hasValue/not/invalid/case3/query2.rq | 12 + .../hasValue/not/invalid/case5/query1.rq | 12 + .../hasValue/not/invalid/case5/query2.rq | 18 ++ .../test-cases/hasValue/not/shacl.ttl | 16 ++ .../hasValue/not/valid/case1/query1.rq | 13 + .../hasValue/not/valid/case2/query1.rq | 13 + .../hasValue/not/valid/case2/query2.rq | 12 + .../hasValue/not/valid/case3/query1.rq | 13 + .../hasValue/not/valid/case3/query2.rq | 14 + .../hasValue/not2/invalid/case1/query1.rq | 14 + .../hasValue/not2/invalid/case2/query1.rq | 13 + .../hasValue/not2/invalid/case2/query2.rq | 12 + .../hasValue/not2/invalid/case4/query1.rq | 13 + .../hasValue/not2/invalid/case4/query2.rq | 13 + .../hasValue/not2/invalid/case4/query3.rq | 13 + .../hasValue/not2/invalid/case5/query1.rq | 13 + .../hasValue/not2/invalid/case5/query2.rq | 13 + .../test-cases/hasValue/not2/shacl.ttl | 30 +++ .../hasValue/not2/valid/case1/query1.rq | 14 + .../hasValue/not2/valid/case2/query1.rq | 13 + .../hasValue/not2/valid/case2/query2.rq | 12 + .../hasValue/not2/valid/case3/query1.rq | 13 + .../hasValue/not2/valid/case3/query2.rq | 14 + .../hasValue/not2/valid/case4/query1.rq | 14 + .../hasValue/not2/valid/case5/query1.rq | 17 ++ .../hasValue/not2/valid/case6/query1.rq | 14 + .../hasValue/not2/valid/case6/query2.rq | 15 ++ .../hasValue/simple/invalid/case1/query1.rq | 14 + .../hasValue/simple/invalid/case2/query1.rq | 13 + .../hasValue/simple/invalid/case2/query2.rq | 12 + .../hasValue/simple/invalid/case3/query1.rq | 13 + .../hasValue/simple/invalid/case3/query2.rq | 12 + .../hasValue/simple/invalid/case4/query1.rq | 12 + .../hasValue/simple/invalid/case4/query2.rq | 18 ++ .../test-cases/hasValue/simple/shacl.ttl | 16 ++ .../hasValue/simple/valid/case1/query1.rq | 13 + .../hasValue/simple/valid/case2/query1.rq | 13 + .../hasValue/simple/valid/case2/query2.rq | 12 + .../hasValue/simple/valid/case3/query1.rq | 13 + .../hasValue/simple/valid/case3/query2.rq | 15 ++ .../hasValue/simple/valid/case4/query1.rq | 13 + .../hasValue/simple/valid/case5/query1.rq | 13 + .../hasValue/simple/valid/case5/query2.rq | 11 + .../hasValue/simple/valid/case6/query1.rq | 13 + .../hasValue/simple/valid/case6/query2.rq | 10 + .../test-cases/hasValue/targetNode/shacl.ttl | 15 ++ .../hasValue/targetNode/valid/case1/query1.rq | 13 + .../hasValue/targetNode/valid/case2/query1.rq | 13 + .../hasValue/targetNode/valid/case2/query2.rq | 12 + .../targetNode2/invalid/case1/query1.rq | 13 + .../test-cases/hasValue/targetNode2/shacl.ttl | 15 ++ .../sparqlTarget/invalid/case1/query1.rq | 13 + .../sparqlTarget/invalid/case2/query1.rq | 12 + .../sparqlTarget/invalid/case2/query2.rq | 13 + .../sparqlTarget/invalid/case3/query1.rq | 12 + .../sparqlTarget/invalid/case3/query2.rq | 13 + .../sparqlTarget/invalid/case3/query3.rq | 13 + .../maxCount/sparqlTarget/shacl.ttl | 32 +++ .../sparqlTarget/valid/case1/query1.rq | 15 ++ .../sparqlTarget/valid/case2/query1.rq | 14 + .../sparqlTarget/valid/case2/query2.rq | 11 + .../sparqlTarget/valid/case3/query1.rq | 14 + .../sparqlTarget/valid/case3/query2.rq | 11 + .../sparqlTarget/valid/case3/query3.rq | 14 + .../sparqlTarget/valid/case4/query1.rq | 12 + .../sparqlTarget/valid/case4/query2.rq | 11 + .../invalid/case1/query1.rq | 13 + .../invalid/case2/query1.rq | 13 + .../or/implicitAndSparqlTarget/shacl.ttl | 42 +++ .../valid/case1/query1.rq | 13 + .../valid/case2/query1.rq | 13 + .../valueIn/and/invalid/case1/query1.rq | 14 + .../valueIn/and/invalid/case2/query1.rq | 13 + .../valueIn/and/invalid/case2/query2.rq | 12 + .../test-cases/valueIn/and/shacl.ttl | 29 +++ .../valueIn/and/valid/case1/query1.rq | 14 + .../valueIn/and/valid/case3/query1.rq | 13 + .../valueIn/and/valid/case3/query2.rq | 15 ++ .../valueIn/not/invalid/case1/query1.rq | 14 + .../valueIn/not/invalid/case2/query1.rq | 13 + .../valueIn/not/invalid/case2/query2.rq | 12 + .../valueIn/not/invalid/case3/query1.rq | 13 + .../valueIn/not/invalid/case3/query2.rq | 12 + .../valueIn/not/invalid/case5/query1.rq | 12 + .../valueIn/not/invalid/case5/query2.rq | 18 ++ .../test-cases/valueIn/not/shacl.ttl | 17 ++ .../valueIn/not/valid/case1/query1.rq | 13 + .../valueIn/not/valid/case2/query1.rq | 13 + .../valueIn/not/valid/case2/query2.rq | 12 + .../valueIn/not/valid/case3/query1.rq | 13 + .../valueIn/not/valid/case3/query2.rq | 14 + .../valueIn/not2/invalid/case1/query1.rq | 14 + .../valueIn/not2/invalid/case2/query1.rq | 13 + .../valueIn/not2/invalid/case2/query2.rq | 12 + .../valueIn/not2/invalid/case4/query1.rq | 13 + .../valueIn/not2/invalid/case4/query2.rq | 13 + .../valueIn/not2/invalid/case4/query3.rq | 13 + .../valueIn/not2/invalid/case5/query1.rq | 13 + .../valueIn/not2/invalid/case5/query2.rq | 13 + .../test-cases/valueIn/not2/shacl.ttl | 31 +++ .../valueIn/not2/valid/case1/query1.rq | 14 + .../valueIn/not2/valid/case2/query1.rq | 13 + .../valueIn/not2/valid/case2/query2.rq | 12 + .../valueIn/not2/valid/case3/query1.rq | 13 + .../valueIn/not2/valid/case3/query2.rq | 14 + .../valueIn/not2/valid/case4/query1.rq | 14 + .../valueIn/not2/valid/case5/query1.rq | 17 ++ .../valueIn/not2/valid/case6/query1.rq | 14 + .../valueIn/not2/valid/case6/query2.rq | 15 ++ .../valueIn/simple/invalid/case1/query1.rq | 14 + .../valueIn/simple/invalid/case2/query1.rq | 13 + .../valueIn/simple/invalid/case2/query2.rq | 12 + .../valueIn/simple/invalid/case3/query1.rq | 13 + .../valueIn/simple/invalid/case3/query2.rq | 12 + .../valueIn/simple/invalid/case4/query1.rq | 12 + .../valueIn/simple/invalid/case4/query2.rq | 18 ++ .../test-cases/valueIn/simple/shacl.ttl | 17 ++ .../valueIn/simple/valid/case1/query1.rq | 13 + .../valueIn/simple/valid/case2/query1.rq | 13 + .../valueIn/simple/valid/case2/query2.rq | 12 + .../valueIn/simple/valid/case3/query1.rq | 13 + .../valueIn/simple/valid/case3/query2.rq | 15 ++ .../valueIn/simple/valid/case4/query1.rq | 13 + .../valueIn/simple/valid/case5/query1.rq | 13 + .../valueIn/simple/valid/case5/query2.rq | 11 + .../valueIn/simple/valid/case6/query1.rq | 13 + .../valueIn/simple/valid/case6/query2.rq | 10 + .../valueIn/simple/valid/case7/query1.rq | 13 + .../test-cases/valueIn/targetNode/shacl.ttl | 15 ++ .../valueIn/targetNode/valid/case1/query1.rq | 13 + .../valueIn/targetNode/valid/case2/query1.rq | 13 + .../valueIn/targetNode/valid/case2/query2.rq | 12 + .../targetNode2/invalid/case1/query1.rq | 13 + .../test-cases/valueIn/targetNode2/shacl.ttl | 15 ++ 449 files changed, 9006 insertions(+), 415 deletions(-) create mode 100644 core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DASH.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AllObjectsTarget.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AllSubjectsTarget.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/CompoundTarget.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/HasValuePropertyShape.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SparqlTarget.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetShape.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ValueInPropertyShape.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/DebugPlanNode.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByQuery.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterIsObject.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterIsSubject.java rename core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/{ExternalTypeFilterNode.java => ExternalPredicateObjectFilter.java} (76%) create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/SparqlTargetSelect.java rename core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/{ModifyTuple.java => TupleMapper.java} (95%) create mode 100644 core/sail/shacl/src/main/resources/shacl-sparql-inference/dashConstants.rq create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ExtendedFeaturesetTest.java create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexTargetBenchmark.java create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/HasValueBenchmarkEmpty.java create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/TargetBenchmarkInitialData.java create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ValueInBenchmarkEmpty.java create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/testimp/TestNotifyingSail.java create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/testimp/TestNotifyingSailConnection.java create mode 100644 core/sail/shacl/src/test/resources/shaclDatatypeSparqlTarget.ttl create mode 100644 core/sail/shacl/src/test/resources/shaclDatatypeTargetFilter.ttl create mode 100644 core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case8/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case9/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case9/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case7/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query3.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case8/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case9/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case9/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case7/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case8/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case9/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case9/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case7/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case7/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case8/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case8/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case8/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case9/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case9/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/invalid/case1/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case7/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case8/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case7/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/and/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query3.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode2/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode2/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query3.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query3.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/and/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query3.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case4/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case7/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/shacl.ttl create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query2.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/invalid/case1/query1.rq create mode 100644 core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/shacl.ttl diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DASH.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DASH.java new file mode 100644 index 00000000000..f0619623163 --- /dev/null +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DASH.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.model.vocabulary; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Namespace; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.SimpleNamespace; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; + +public class DASH { + + public static final String NAMESPACE = "http://datashapes.org/dash#"; + + public static final String PREFIX = "dash"; + + /** + * An immutable {@link Namespace} constant that represents the namespace. + */ + public static final Namespace NS = new SimpleNamespace(PREFIX, NAMESPACE); + + static private final ValueFactory vf = SimpleValueFactory.getInstance(); + + public static final IRI AllObjectsTarget = createIRI("AllObjectsTarget"); + public static final IRI AllSubjectsTarget = createIRI("AllSubjectsTarget"); + public static final IRI valueIn = createIRI("valueIn"); + public static final IRI ValueInConstraintComponent = createIRI("HasValueConstraintComponent"); + + private static IRI createIRI(String allObjectsTarget) { + return vf.createIRI(NAMESPACE, allObjectsTarget); + } + +} diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/SHACL.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/SHACL.java index 6c2bc914525..ffb12deb823 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/SHACL.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/SHACL.java @@ -596,6 +596,9 @@ public class SHACL { /** sh:targetSubjectsOf */ public static final IRI TARGET_SUBJECTS_OF; + /** sh:targetShape */ + public static final IRI TARGET_SHAPE; + /** sh:uniqueLang */ public static final IRI UNIQUE_LANG; @@ -830,5 +833,6 @@ public class SHACL { XONE = factory.createIRI(NAMESPACE, "xone"); ZERO_OR_MORE_PATH = factory.createIRI(NAMESPACE, "zeroOrMorePath"); ZERO_OR_ONE_PATH = factory.createIRI(NAMESPACE, "zeroOrOnePath"); + TARGET_SHAPE = factory.createIRI(NAMESPACE, "targetShape"); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AbstractSimplePropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AbstractSimplePropertyShape.java index 0d5bcea14cd..a2eaddb96aa 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AbstractSimplePropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AbstractSimplePropertyShape.java @@ -14,10 +14,10 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.BulkedExternalInnerJoin; import org.eclipse.rdf4j.sail.shacl.planNodes.FilterPlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.InnerJoin; -import org.eclipse.rdf4j.sail.shacl.planNodes.ModifyTuple; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; +import org.eclipse.rdf4j.sail.shacl.planNodes.TupleMapper; import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.UnionNode; import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; @@ -44,7 +44,7 @@ static public PlanNode getGenericSingleObjectPlan(ConnectionsGroup connectionsGr PlanNode planNode; if (pathPropertyShape.getPath() == null) { - planNode = new ModifyTuple(overrideTargetNode.getPlanNode(), t -> { + planNode = new TupleMapper(overrideTargetNode.getPlanNode(), t -> { t.getLine().add(t.getLine().get(0)); return t; }); @@ -64,7 +64,7 @@ static public PlanNode getGenericSingleObjectPlan(ConnectionsGroup connectionsGr if (pathPropertyShape.getPath() == null) { - PlanNode targets = new ModifyTuple( + PlanNode targets = new TupleMapper( nodeShape.getPlanAddedStatements(connectionsGroup, null), t -> { t.getLine().add(t.getLine().get(0)); return t; @@ -101,7 +101,7 @@ static public PlanNode getGenericSingleObjectPlan(ConnectionsGroup connectionsGr PlanNode discardedRight = innerJoin.getDiscardedRight(BufferedPlanNode.class); - PlanNode typeFilterPlan = nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), discardedRight); + PlanNode typeFilterPlan = nodeShape.getTargetFilter(connectionsGroup, discardedRight); top = new UnionNode(top, typeFilterPlan); @@ -135,6 +135,6 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg plan = new Unique(new TrimTuple(plan, 0, 1)); - return nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), plan); + return nodeShape.getTargetFilter(connectionsGroup, plan); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AllObjectsTarget.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AllObjectsTarget.java new file mode 100644 index 00000000000..0e6ffc87bca --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AllObjectsTarget.java @@ -0,0 +1,104 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.AST; + +import java.util.UUID; + +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.SailConnection; +import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; +import org.eclipse.rdf4j.sail.shacl.Stats; +import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalFilterIsObject; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; +import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; +import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnorderedSelect; + +/** + * + * @author Håvard Mikkelsen Ottestad + */ +public class AllObjectsTarget extends NodeShape { + + AllObjectsTarget(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated) { + super(id, shaclSail, connection, deactivated); + } + + @Override + public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, + PlanNodeProvider overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + assert !negateSubPlans : "There are no subplans!"; + assert !negateThisPlan; + + return getPlanNode(connectionsGroup, connectionsGroup.getBaseConnection()); + } + + private PlanNode getPlanNode(ConnectionsGroup connectionsGroup, SailConnection baseConnection) { + PlanNode select = new Unique( + new Sort( + new TrimTuple( + new UnorderedSelect( + baseConnection, + null, + null, + null, + UnorderedSelect.OutputPattern.ObjectPredicateSubject), + 0, + 1))); + + return connectionsGroup.getCachedNodeFor(select); + } + + @Override + public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + + assert planeNodeWrapper == null; + return getPlanNode(connectionsGroup, connectionsGroup.getAddedStatements()); + } + + @Override + public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; + return getPlanNode(connectionsGroup, connectionsGroup.getRemovedStatements()); + } + + @Override + public boolean requiresEvaluation(SailConnection addedStatements, SailConnection removedStatements, Stats stats) { + return !stats.isEmpty(); + } + + @Override + public String getQuery(String subjectVariable, String objectVariable, + RdfsSubClassOfReasoner rdfsSubClassOfReasoner) { + return objectVariable + " ?allObjectsTarget" + UUID.randomUUID().toString().replace("-", "") + " " + + subjectVariable + " ."; + } + + @Override + public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { + return new ExternalFilterIsObject(connectionsGroup.getBaseConnection(), parent, 0) + .getTrueNode(UnBufferedPlanNode.class); + } + + @Override + public String toString() { + return "AllSubjectsTarget{" + + "id=" + id + + '}'; + } + +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AllSubjectsTarget.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AllSubjectsTarget.java new file mode 100644 index 00000000000..3880d068179 --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AllSubjectsTarget.java @@ -0,0 +1,120 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl.AST; + +import java.util.UUID; + +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.SailConnection; +import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; +import org.eclipse.rdf4j.sail.shacl.Stats; +import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalFilterIsSubject; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; +import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; +import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnorderedSelect; + +/** + * + * @author Håvard Mikkelsen Ottestad + */ +public class AllSubjectsTarget extends NodeShape { + + AllSubjectsTarget(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated) { + super(id, shaclSail, connection, deactivated); + } + + @Override + public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, + PlanNodeProvider overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + assert !negateSubPlans : "There are no subplans!"; + assert !negateThisPlan; + + PlanNode select = getAllSubjectsPlan(connectionsGroup.getBaseConnection()); + return connectionsGroup.getCachedNodeFor(select); + + } + + @Override + public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; + + PlanNode select = getAllSubjectsPlan(connectionsGroup.getAddedStatements()); + + return connectionsGroup.getCachedNodeFor(select); + + } + + @Override + public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; + + PlanNode select = getAllSubjectsPlan(connectionsGroup.getRemovedStatements()); + + return connectionsGroup.getCachedNodeFor(select); + + } + + @Override + public boolean requiresEvaluation(SailConnection addedStatements, SailConnection removedStatements, Stats stats) { + return !stats.isEmpty(); + } + + @Override + public String getQuery(String subjectVariable, String objectVariable, + RdfsSubClassOfReasoner rdfsSubClassOfReasoner) { + + return subjectVariable + " ?allSubjectsTarget" + UUID.randomUUID().toString().replace("-", "") + " " + + objectVariable + " ."; + + } + + @Override + public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { + + return new ExternalFilterIsSubject(connectionsGroup.getBaseConnection(), parent, 0) + .getTrueNode(UnBufferedPlanNode.class); + + } + + private PlanNode getAllSubjectsPlan(SailConnection sailConnection) { + // @formatter:off + return new Unique( + new Sort( + new TrimTuple( + new UnorderedSelect( + sailConnection, + null, + null, + null, + UnorderedSelect.OutputPattern.SubjectPredicateObject + ), + 0, + 1) + ) + ); + // @formatter:on + + } + + @Override + public String toString() { + return "AllSubjectsTarget{" + + ", id=" + id + + '}'; + } + +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AndPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AndPropertyShape.java index 101a9e20539..5fe9df53553 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AndPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/AndPropertyShape.java @@ -12,11 +12,14 @@ import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.query.algebra.StatementPattern; import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.SourceConstraintComponent; import org.eclipse.rdf4j.sail.shacl.Stats; import org.eclipse.rdf4j.sail.shacl.planNodes.AggregateIteratorTypeOverride; @@ -40,18 +43,37 @@ public class AndPropertyShape extends PathPropertyShape { private static final Logger logger = LoggerFactory.getLogger(AndPropertyShape.class); AndPropertyShape(Resource id, SailRepositoryConnection connection, NodeShape nodeShape, boolean deactivated, - PathPropertyShape parent, Resource path, Resource and) { + PathPropertyShape parent, Resource path, Resource and, ShaclSail shaclSail) { super(id, connection, nodeShape, deactivated, parent, path); - this.and = toList(connection, and).stream() - .map(v -> Factory.getPropertyShapesInner(connection, nodeShape, (Resource) v, this)) - .collect(Collectors.toList()); + this.and = getPropertyShapes(connection, nodeShape, shaclSail, and); + + if (!this.and.stream().flatMap(Collection::stream).findAny().isPresent()) { + logger.warn("sh:and contained no supported shapes: " + id); + this.deactivated = true; + } } + private List> getPropertyShapes(SailRepositoryConnection connection, NodeShape nodeShape, + ShaclSail shaclSail, + Resource and) { + return toList(connection, and).stream() + .map(v -> Factory.getPropertyShapesInner(connection, nodeShape, (Resource) v, this, shaclSail) + .stream() + .filter(s -> !s.deactivated) + .collect(Collectors.toList())) + .collect(Collectors.toList()); + } + public AndPropertyShape(Resource id, NodeShape nodeShape, boolean deactivated, PathPropertyShape parent, Path path, List> and) { super(id, nodeShape, deactivated, parent, path); this.and = and; + + if (!this.and.stream().flatMap(Collection::stream).findAny().isPresent()) { + logger.warn("sh:and contained no supported shapes: " + id); + this.deactivated = true; + } } @Override @@ -66,9 +88,15 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, OrPropertyShape orPropertyShape = new OrPropertyShape(getId(), nodeShape, deactivated, this, null, and); - EnrichWithShape plan = (EnrichWithShape) orPropertyShape.getPlan(connectionsGroup, printPlans, + EnrichWithShape plan = (EnrichWithShape) orPropertyShape.getPlan(connectionsGroup, false, overrideTargetNode, false, true); + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(plan, + connectionsGroup); + logger.info(planAsGraphvizDot); + } + return new EnrichWithShape(plan.getParent(), this); } @@ -77,13 +105,18 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode plan = and.get(0) .get(0) .getPlan(connectionsGroup, false, overrideTargetNode, negateSubPlans, false); + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(plan, + connectionsGroup); + logger.info(planAsGraphvizDot); + } return new EnrichWithShape(plan, this); } List plans = and .stream() .flatMap(List::stream) - .map(shape -> shape.getPlan(connectionsGroup, printPlans, overrideTargetNode, negateSubPlans, + .map(shape -> shape.getPlan(connectionsGroup, false, overrideTargetNode, negateSubPlans, false)) .collect(Collectors.toList()); @@ -112,6 +145,12 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, unionPlan = new AggregateIteratorTypeOverride(new Unique(new TrimTuple(unionPlan, 0, 1))); } + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(unionPlan, + connectionsGroup); + logger.info(planAsGraphvizDot); + } + return new EnrichWithShape(unionPlan, this); } @@ -167,16 +206,43 @@ public String toString() { } public boolean childrenHasOwnPath() { - return and.stream().flatMap(a -> a.stream().map(PathPropertyShape::hasOwnPath)).anyMatch(a -> a); + return and + .stream() + .flatMap(a -> a + .stream() + .map(PathPropertyShape::hasOwnPath)) + .anyMatch(a -> a); } @Override public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean negated) { - Optional reduce = and.stream() + Optional reduce = and + .stream() .flatMap(Collection::stream) .map(a -> a.getAllTargetsPlan(connectionsGroup, negated)) .reduce((a, b) -> new UnionNode(a, b)); return new Unique(reduce.get()); } + + @Override + public String buildSparqlValidNodes(String targetVar) { + return and.stream() + .map(propertyShapes -> propertyShapes + .stream() + .map(propertyShape -> propertyShape.buildSparqlValidNodes(targetVar)) + .reduce((a, b) -> a + "\n" + b)) + .filter(Optional::isPresent) + .map(Optional::get) + .reduce((a, b) -> a + "\n" + b) + .orElse(""); + } + + @Override + public Stream getStatementPatterns() { + return and + .stream() + .flatMap(Collection::stream) + .flatMap(PropertyShape::getStatementPatterns); + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ClassPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ClassPropertyShape.java index 91e82a93782..48a0b83330b 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ClassPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ClassPropertyShape.java @@ -25,15 +25,15 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.BulkedExternalLeftOuterJoin; import org.eclipse.rdf4j.sail.shacl.planNodes.EmptyNode; import org.eclipse.rdf4j.sail.shacl.planNodes.EnrichWithShape; -import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalTypeFilterNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalPredicateObjectFilter; import org.eclipse.rdf4j.sail.shacl.planNodes.InnerJoin; -import org.eclipse.rdf4j.sail.shacl.planNodes.ModifyTuple; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; import org.eclipse.rdf4j.sail.shacl.planNodes.Select; import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; import org.eclipse.rdf4j.sail.shacl.planNodes.TupleLengthFilter; +import org.eclipse.rdf4j.sail.shacl.planNodes.TupleMapper; import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.UnionNode; import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; @@ -82,7 +82,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode planNode; if (getPath() == null) { - planNode = new ModifyTuple(overrideTargetNode.getPlanNode(), t -> { + planNode = new TupleMapper(overrideTargetNode.getPlanNode(), t -> { t.getLine().add(t.getLine().get(0)); return t; }); @@ -95,12 +95,12 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, // filter by type against addedStatements, this is an optimization for when you add the type statement in // the same transaction - PlanNode addedStatementsTypeFilter = new ExternalTypeFilterNode(addedStatements, - Collections.singleton(classResource), planNode, 1, false); + PlanNode addedStatementsTypeFilter = new ExternalPredicateObjectFilter(addedStatements, + RDF.TYPE, Collections.singleton(classResource), planNode, 1, false); // filter by type against the base sail - PlanNode invalidTuplesDueToDataAddedThatMatchesTargetOrPath = new ExternalTypeFilterNode( - connectionsGroup.getBaseConnection(), Collections.singleton(classResource), + PlanNode invalidTuplesDueToDataAddedThatMatchesTargetOrPath = new ExternalPredicateObjectFilter( + connectionsGroup.getBaseConnection(), RDF.TYPE, Collections.singleton(classResource), addedStatementsTypeFilter, 1, false); if (printPlans) { String planAsGraphvizDot = getPlanAsGraphvizDot(invalidTuplesDueToDataAddedThatMatchesTargetOrPath, @@ -127,7 +127,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, } if (getPath() == null) { - PlanNode targets = new ModifyTuple( + PlanNode targets = new TupleMapper( nodeShape.getPlanAddedStatements(connectionsGroup, null), t -> { t.getLine().add(t.getLine().get(0)); @@ -137,19 +137,18 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, // filter by type against addedStatements, this is an optimization for when you add the type statement // in // the same transaction - PlanNode filteredAgainstAdded = new ExternalTypeFilterNode(addedStatements, - Collections.singleton(classResource), targets, 1, + PlanNode filteredAgainstAdded = new ExternalPredicateObjectFilter(addedStatements, + RDF.TYPE, Collections.singleton(classResource), targets, 1, false); // filter by type against the base sail - PlanNode filteredAgainsteBaseSail = new ExternalTypeFilterNode(connectionsGroup.getBaseConnection(), - Collections.singleton(classResource), + PlanNode filteredAgainsteBaseSail = new ExternalPredicateObjectFilter(connectionsGroup.getBaseConnection(), + RDF.TYPE, Collections.singleton(classResource), filteredAgainstAdded, 1, false); if (connectionsGroup.getStats().hasRemoved()) { - // Handle when a type statement has been removed, first get all removed type statements that match - // the + // Handle when a type statement has been removed, first get all removed type statements that match the // classResource for this shape PlanNode removedTypeStatements = new Select(connectionsGroup.getRemovedStatements(), "?a a <" + classResource + ">", "?a"); @@ -184,7 +183,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode innerJoin = innerJoinHolder.getJoined(BufferedPlanNode.class); PlanNode discardedRight = innerJoinHolder.getDiscardedRight(BufferedPlanNode.class); - PlanNode typeFilterPlan = nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), discardedRight); + PlanNode typeFilterPlan = nodeShape.getTargetFilter(connectionsGroup, discardedRight); innerJoin = new Unique(new UnionNode(innerJoin, typeFilterPlan)); @@ -203,13 +202,13 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, // filter by type against addedStatements, this is an optimization for when you add the type statement in // the same transaction - PlanNode addedStatementsTypeFilter = new ExternalTypeFilterNode(addedStatements, - Collections.singleton(classResource), joined, 1, false); + PlanNode addedStatementsTypeFilter = new ExternalPredicateObjectFilter(addedStatements, + RDF.TYPE, Collections.singleton(classResource), joined, 1, false); // filter by type against the base sail - PlanNode invalidTuplesDueToDataAddedThatMatchesTargetOrPath = new ExternalTypeFilterNode( + PlanNode invalidTuplesDueToDataAddedThatMatchesTargetOrPath = new ExternalPredicateObjectFilter( connectionsGroup.getBaseConnection(), - Collections.singleton(classResource), + RDF.TYPE, Collections.singleton(classResource), addedStatementsTypeFilter, 1, false); if (connectionsGroup.getStats().hasRemoved()) { @@ -227,7 +226,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, // do bulked external join for the removed class statements again the query above. // Essentially gets data that is now invalid because of the removed type statement - PlanNode invalidDataDueToRemovedTypeStatement = new Sort(new ModifyTuple( + PlanNode invalidDataDueToRemovedTypeStatement = new Sort(new TupleMapper( new BulkedExternalInnerJoin(removedTypeStatements, connectionsGroup.getBaseConnection(), query, false, null, "?a", "?c"), @@ -260,7 +259,7 @@ private PlanNode getNegatedPlan(ConnectionsGroup connectionsGroup, PlanNodeProvi PlanNode planNode; if (getPath() == null) { - planNode = new ModifyTuple(overrideTargetNode.getPlanNode(), t -> { + planNode = new TupleMapper(overrideTargetNode.getPlanNode(), t -> { t.getLine().add(t.getLine().get(0)); return t; }); @@ -272,8 +271,8 @@ private PlanNode getNegatedPlan(ConnectionsGroup connectionsGroup, PlanNodeProvi } // filter by type against the base sail - planNode = new ExternalTypeFilterNode(connectionsGroup.getBaseConnection(), - Collections.singleton(classResource), + planNode = new ExternalPredicateObjectFilter(connectionsGroup.getBaseConnection(), + RDF.TYPE, Collections.singleton(classResource), planNode, 1, true); return planNode; @@ -305,7 +304,7 @@ private PlanNode getNegatedPlan(ConnectionsGroup connectionsGroup, PlanNodeProvi PlanNode innerJoin = innerJoinHolder.getJoined(BufferedPlanNode.class); PlanNode discardedRight = innerJoinHolder.getDiscardedRight(BufferedPlanNode.class); - PlanNode typeFilterPlan = nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), discardedRight); + PlanNode typeFilterPlan = nodeShape.getTargetFilter(connectionsGroup, discardedRight); innerJoin = new Unique(new UnionNode(innerJoin, typeFilterPlan)); @@ -336,7 +335,7 @@ private PlanNode getNegatedPlan(ConnectionsGroup connectionsGroup, PlanNodeProvi // do bulked external join for the removed class statements again the query above. // Essentially gets data that is now invalid because of the removed type statement - PlanNode invalidDataDueToRemovedTypeStatement = new Sort(new ModifyTuple( + PlanNode invalidDataDueToRemovedTypeStatement = new Sort(new TupleMapper( new BulkedExternalInnerJoin(newAddedByClassResource, connectionsGroup.getBaseConnection(), query, false, null, "?a", @@ -355,8 +354,8 @@ private PlanNode getNegatedPlan(ConnectionsGroup connectionsGroup, PlanNodeProvi innerJoin = new Unique(innerJoin); - return new ExternalTypeFilterNode(connectionsGroup.getBaseConnection(), - Collections.singleton(classResource), + return new ExternalPredicateObjectFilter(connectionsGroup.getBaseConnection(), + RDF.TYPE, Collections.singleton(classResource), innerJoin, 1, true); @@ -438,7 +437,7 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg // do bulked external join for the removed class statements again the query above. // Essentially gets data that is now invalid because of the removed type statement - PlanNode invalidDataDueToRemovedTypeStatement = new Sort(new ModifyTuple( + PlanNode invalidDataDueToRemovedTypeStatement = new Sort(new TupleMapper( new BulkedExternalInnerJoin(removedTypeStatements, connectionsGroup.getBaseConnection(), query, false, null, "?a", "?c"), @@ -456,7 +455,7 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg } if (negated && connectionsGroup.getStats().hasAdded() && getPath() != null) { - // Handle when a type statement has been removed, first get all removed type statements that match the + // Handle when a type statement has been removed, first get all added type statements that match the // classResource for this shape PlanNode removedTypeStatements = new Select(connectionsGroup.getAddedStatements(), "?a a <" + classResource + ">", "?a"); @@ -468,7 +467,7 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg // do bulked external join for the removed class statements again the query above. // Essentially gets data that is now invalid because of the removed type statement - PlanNode invalidDataDueToRemovedTypeStatement = new Sort(new ModifyTuple( + PlanNode invalidDataDueToRemovedTypeStatement = new Sort(new TupleMapper( new BulkedExternalInnerJoin(removedTypeStatements, connectionsGroup.getBaseConnection(), query, false, null, "?a", "?c"), @@ -487,6 +486,6 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg plan = new Unique(new TrimTuple(plan, 0, 1)); - return nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), plan); + return nodeShape.getTargetFilter(connectionsGroup, plan); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/CompoundTarget.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/CompoundTarget.java new file mode 100644 index 00000000000..f3010d0d5fe --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/CompoundTarget.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Distribution License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl.AST; + +// Keeping this around because we may use it in the future to optimize simple use of filter shapes + +/* + * import java.util.Arrays; import java.util.HashSet; import java.util.Objects; + * + * import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import + * org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import + * org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.SailConnection; import + * org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; import + * org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.Stats; import + * org.eclipse.rdf4j.sail.shacl.planNodes.ExternalTypeFilterNode; import + * org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; + * import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; import + * org.eclipse.rdf4j.sail.shacl.planNodes.Unique; import org.eclipse.rdf4j.sail.shacl.planNodes.UnorderedSelect; + * + * public class CompoundTarget extends NodeShape { + * + * private IRI targetPredicate; private IRI targetObject; + * + * CompoundTarget(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated, Resource + * compoundTarget) { super(id, shaclSail, connection, deactivated); + * + * SimpleValueFactory vf = SimpleValueFactory.getInstance(); + * + * IRI targetPredicate = vf.createIRI("http://rdf4j.org/schema/rdf4j-shacl#", "targetPredicate"); IRI targetObject = + * vf.createIRI("http://rdf4j.org/schema/rdf4j-shacl#", "targetObject"); + * + * for (Statement statement : connection.getStatements(compoundTarget, null, null)) { if + * (statement.getPredicate().equals(targetObject)) { this.targetObject = (IRI) statement.getObject(); } if + * (statement.getPredicate().equals(targetPredicate)) { this.targetPredicate = (IRI) statement.getObject(); } } + * + * } + * + * @Override public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNodeProvider + * overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + * + * assert !negateSubPlans : "There are no subplans!"; assert !negateThisPlan; + * + * PlanNode planNode = connectionsGroup .getCachedNodeFor(new Sort(new + * UnorderedSelect(connectionsGroup.getBaseConnection(), null, targetPredicate, targetObject, + * UnorderedSelect.OutputPattern.SubjectPredicateObject))); + * + * return new Unique(new TrimTuple(planNode, 0, 1)); + * + * } + * + * @Override public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper + * planeNodeWrapper) { PlanNode planNode = connectionsGroup .getCachedNodeFor(new Sort(new + * UnorderedSelect(connectionsGroup.getAddedStatements(), null, targetPredicate, targetObject, + * UnorderedSelect.OutputPattern.SubjectPredicateObject))); + * + * return new Unique(new TrimTuple(planNode, 0, 1)); + * + * } + * + * @Override public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper + * planeNodeWrapper) { PlanNode planNode = connectionsGroup .getCachedNodeFor(new Sort(new + * UnorderedSelect(connectionsGroup.getRemovedStatements(), null, targetPredicate, targetObject, + * UnorderedSelect.OutputPattern.SubjectPredicateObject))); + * + * return new Unique(new TrimTuple(planNode, 0, 1)); } + * + * @Override public boolean requiresEvaluation(SailConnection addedStatements, SailConnection removedStatements, Stats + * stats) { return addedStatements.hasStatement(null, targetPredicate, targetObject, false); } + * + * @Override public String getQuery(String subjectVariable, String objectVariable, RdfsSubClassOfReasoner + * rdfsSubClassOfReasoner) { + * + * return " BIND(<" + targetPredicate + "> as ?b1) \n " + "BIND(<" + targetObject + "> as " + objectVariable + ") \n " + + * subjectVariable + " ?b1 " + objectVariable + ". \n"; + * + * } + * + * @Override public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { return new + * ExternalTypeFilterNode(connectionsGroup.getBaseConnection(), targetPredicate, new + * HashSet<>(Arrays.asList(targetObject)), parent, 0, true); } + * + * @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != + * o.getClass()) { return false; } if (!super.equals(o)) { return false; } CompoundTarget that = (CompoundTarget) o; + * return Objects.equals(targetPredicate, that.targetPredicate) && Objects.equals(targetObject, that.targetObject); } + * + * @Override public int hashCode() { return Objects.hash(super.hashCode(), targetPredicate, targetObject); } + * + * @Override public String toString() { return "CompoundTarget{" + "targetPredicate=" + targetPredicate + + * ", targetObject=" + targetObject + ", id=" + id + '}'; } } + */ diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/HasValuePropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/HasValuePropertyShape.java new file mode 100644 index 00000000000..febbcd28a33 --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/HasValuePropertyShape.java @@ -0,0 +1,245 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl.AST; + +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Objects; +import java.util.UUID; +import java.util.stream.Stream; + +import org.eclipse.rdf4j.model.BNode; +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Literal; +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.query.algebra.StatementPattern; +import org.eclipse.rdf4j.query.algebra.Var; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.SourceConstraintComponent; +import org.eclipse.rdf4j.sail.shacl.planNodes.EnrichWithShape; +import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalFilterByQuery; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; +import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; +import org.eclipse.rdf4j.sail.shacl.planNodes.TupleMapper; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnionNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; +import org.eclipse.rdf4j.sail.shacl.planNodes.ValueInFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Håvard Ottestad + */ +public class HasValuePropertyShape extends PathPropertyShape { + + private final Value hasValue; + private static final Logger logger = LoggerFactory.getLogger(HasValuePropertyShape.class); + + HasValuePropertyShape(Resource id, SailRepositoryConnection connection, NodeShape nodeShape, boolean deactivated, + PathPropertyShape parent, Resource path, + Value hasValue) { + super(id, connection, nodeShape, deactivated, parent, path); + + if (hasValue instanceof BNode) { + throw new UnsupportedOperationException("sh:hasValue does not currently support blank nodes"); + } + + this.hasValue = hasValue; + + } + + @Override + public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, + PlanNodeProvider overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + + if (deactivated) { + return null; + } + assert !negateSubPlans : "There are no subplans!"; + + // TODO - these plans are generally slow because they generate a lot of SPARQL queries and also they don't + // optimize for the case when everything already valid in the added statements. + + if (getPath() == null) { + PlanNode addedTargets = nodeShape.getPlanAddedStatements(connectionsGroup, null); + if (overrideTargetNode != null) { + addedTargets = overrideTargetNode.getPlanNode(); + } + + PlanNode invalidTargets = new TupleMapper(addedTargets, t -> { + List line = t.getLine(); + t.getLine().add(line.get(0)); + return t; + }); + + if (negateThisPlan) { + invalidTargets = new ValueInFilter(invalidTargets, new HashSet<>(Collections.singletonList(hasValue))) + .getTrueNode(UnBufferedPlanNode.class); + } else { + invalidTargets = new ValueInFilter(invalidTargets, new HashSet<>(Collections.singletonList(hasValue))) + .getFalseNode(UnBufferedPlanNode.class); + } + + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(invalidTargets, connectionsGroup); + logger.info(planAsGraphvizDot); + } + + return new EnrichWithShape(invalidTargets, this); + + } + + if (overrideTargetNode != null) { + PlanNode planNode = overrideTargetNode.getPlanNode(); + + ExternalFilterByQuery externalFilterByQuery = new ExternalFilterByQuery( + connectionsGroup.getBaseConnection(), planNode, 0, buildSparqlValidNodes("?this"), "?this"); + + if (negateThisPlan) { + planNode = externalFilterByQuery.getTrueNode(UnBufferedPlanNode.class); + } else { + planNode = externalFilterByQuery.getFalseNode(UnBufferedPlanNode.class); + } + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(planNode, connectionsGroup); + logger.info(planAsGraphvizDot); + } + + return new EnrichWithShape(planNode, this); + } + + PlanNode planAddedStatements = nodeShape.getPlanAddedStatements(connectionsGroup, null); + + ExternalFilterByQuery externalFilterByQuery = new ExternalFilterByQuery(connectionsGroup.getBaseConnection(), + planAddedStatements, 0, + buildSparqlValidNodes("?this"), "?this"); + + PlanNode invalidValues; + + if (negateThisPlan) { + invalidValues = externalFilterByQuery.getTrueNode(UnBufferedPlanNode.class); + } else { + invalidValues = externalFilterByQuery.getFalseNode(UnBufferedPlanNode.class); + } + + if (negateThisPlan && connectionsGroup.getStats().hasAdded()) { + + PlaneNodeWrapper planeNodeWrapper = planNode -> { + PlanNode targetFilter = nodeShape.getTargetFilter(connectionsGroup, planNode); + return new ExternalFilterByQuery(connectionsGroup.getBaseConnection(), targetFilter, 0, + buildSparqlValidNodes("?this"), "?this").getTrueNode(UnBufferedPlanNode.class); + }; + + invalidValues = new UnionNode(invalidValues, + getPlanAddedStatements(connectionsGroup, planeNodeWrapper)); + } + + if (!negateThisPlan && connectionsGroup.getStats().hasRemoved()) { + + PlaneNodeWrapper planeNodeWrapper = planNode -> { + PlanNode targetFilter = nodeShape.getTargetFilter(connectionsGroup, planNode); + return new ExternalFilterByQuery(connectionsGroup.getBaseConnection(), targetFilter, 0, + buildSparqlValidNodes("?this"), "?this").getFalseNode(UnBufferedPlanNode.class); + }; + + invalidValues = new UnionNode(invalidValues, + getPlanRemovedStatements(connectionsGroup, planeNodeWrapper)); + } + + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(invalidValues, connectionsGroup); + logger.info(planAsGraphvizDot); + } + + return new EnrichWithShape(invalidValues, this); + + } + + @Override + public SourceConstraintComponent getSourceConstraintComponent() { + return SourceConstraintComponent.HasValueConstraintComponent; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + HasValuePropertyShape that = (HasValuePropertyShape) o; + return hasValue.equals(that.hasValue); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), hasValue); + } + + @Override + public String toString() { + return "HasValuePropertyShape{" + + "hasValue=" + hasValue + + ", path=" + getPath() + + ", id=" + id + + + '}'; + } + + public Value getHasValue() { + return hasValue; + } + + @Override + public String buildSparqlValidNodes(String targetVar) { + String objectVar = "?hasValue_" + UUID.randomUUID().toString().replace("-", ""); + + if (hasValue instanceof IRI) { + return "BIND(<" + hasValue + "> as " + objectVar + ")\n" + getPath().getQuery(targetVar, objectVar, null); + } + if (hasValue instanceof Literal) { + return "BIND(" + hasValue.toString() + " as " + objectVar + ")\n" + + getPath().getQuery(targetVar, objectVar, null); + } + + throw new UnsupportedOperationException( + "hasValue was unsupported type: " + hasValue.getClass().getSimpleName()); + + } + + @Override + public Stream getStatementPatterns() { + return getPath().getStatementsPatterns(new Var("?this"), new Var(UUID.randomUUID().toString(), hasValue)); + + } + + @Override + public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean negated) { + PlanNode plan = nodeShape.getPlanAddedStatements(connectionsGroup, null); + plan = new UnionNode(plan, nodeShape.getPlanRemovedStatements(connectionsGroup, null)); + + Path path = getPath(); + if (path != null) { + plan = new UnionNode(plan, getPlanAddedStatements(connectionsGroup, null)); + plan = new UnionNode(plan, getPlanRemovedStatements(connectionsGroup, null)); + } + + plan = new Unique(new TrimTuple(plan, 0, 1)); + + return nodeShape.getTargetFilter(connectionsGroup, plan); + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/InversePath.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/InversePath.java index 18ec0d8d17d..8e76b339135 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/InversePath.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/InversePath.java @@ -10,9 +10,13 @@ import java.util.List; import java.util.Objects; +import java.util.UUID; +import java.util.stream.Stream; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.query.algebra.StatementPattern; +import org.eclipse.rdf4j.query.algebra.Var; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; @@ -123,4 +127,11 @@ public int hashCode() { public String toString() { return path.toString(); } + + @Override + public Stream getStatementsPatterns(Var start, Var end) { + return Stream + .of(new StatementPattern(end, new Var(UUID.randomUUID().toString(), path), start)); + + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MaxCountPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MaxCountPropertyShape.java index 96bc7b10225..7b98360282e 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MaxCountPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MaxCountPropertyShape.java @@ -21,11 +21,11 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.EnrichWithShape; import org.eclipse.rdf4j.sail.shacl.planNodes.GroupByCount; import org.eclipse.rdf4j.sail.shacl.planNodes.MaxCountFilter; -import org.eclipse.rdf4j.sail.shacl.planNodes.ModifyTuple; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; import org.eclipse.rdf4j.sail.shacl.planNodes.Select; import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; +import org.eclipse.rdf4j.sail.shacl.planNodes.TupleMapper; import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.UnionNode; import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; @@ -87,7 +87,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, String negationQuery = query + "\n" + query1 + "\n" + query2 + "\nFILTER(?d != ?e)"; PlanNode select = new Select(connectionsGroup.getAddedStatements(), negationQuery, "?a"); - select = new ModifyTuple(select, (a) -> { + select = new TupleMapper(select, (a) -> { a.getLine().add(SimpleValueFactory.getInstance().createLiteral(">= 2")); return a; @@ -107,7 +107,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode planAddedStatements1 = super.getPlanAddedStatements(connectionsGroup, null); - planAddedStatements1 = nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), planAddedStatements1); + planAddedStatements1 = nodeShape.getTargetFilter(connectionsGroup, planAddedStatements1); PlanNode mergeNode = new UnionNode(planAddedStatements, planAddedStatements1); @@ -198,6 +198,6 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg plan = new Unique(new TrimTuple(plan, 0, 1)); - return nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), plan); + return nodeShape.getTargetFilter(connectionsGroup, plan); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MinCountPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MinCountPropertyShape.java index d6e2368efd5..5f6719c9159 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MinCountPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/MinCountPropertyShape.java @@ -20,11 +20,11 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.EnrichWithShape; import org.eclipse.rdf4j.sail.shacl.planNodes.GroupByCount; import org.eclipse.rdf4j.sail.shacl.planNodes.MinCountFilter; -import org.eclipse.rdf4j.sail.shacl.planNodes.ModifyTuple; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; import org.eclipse.rdf4j.sail.shacl.planNodes.Select; import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; +import org.eclipse.rdf4j.sail.shacl.planNodes.TupleMapper; import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.UnionNode; import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; @@ -91,7 +91,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, String negationQuery = query + "\n FILTER(NOT EXISTS{" + query1 + "})"; PlanNode select = new Select(connectionsGroup.getAddedStatements(), negationQuery, "?a"); - select = new ModifyTuple(select, (a) -> { + select = new TupleMapper(select, (a) -> { a.getLine().add(SimpleValueFactory.getInstance().createLiteral(0)); return a; @@ -109,7 +109,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode planRemovedStatements = new Unique( new TrimTuple(getPlanRemovedStatements(connectionsGroup, null), 0, 1)); - PlanNode filteredPlanRemovedStatements = nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), + PlanNode filteredPlanRemovedStatements = nodeShape.getTargetFilter(connectionsGroup, planRemovedStatements); PlanNode planAddedStatements = nodeShape.getPlanAddedStatements(connectionsGroup, null); @@ -120,7 +120,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode planAddedStatements1 = getPlanAddedStatements(connectionsGroup, null); - planAddedStatements1 = (nodeShape).getTargetFilter(connectionsGroup.getBaseConnection(), + planAddedStatements1 = (nodeShape).getTargetFilter(connectionsGroup, planAddedStatements1); topNode = new UnionNode(unique, planAddedStatements1); @@ -138,7 +138,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode addedByPath = getPlanAddedStatements(connectionsGroup, null); - addedByPath = (nodeShape).getTargetFilter(connectionsGroup.getBaseConnection(), addedByPath); + addedByPath = (nodeShape).getTargetFilter(connectionsGroup, addedByPath); topNode = new UnionNode(planAddedForShape, addedByPath); @@ -217,6 +217,6 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg plan = new Unique(new TrimTuple(plan, 0, 1)); - return nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), plan); + return nodeShape.getTargetFilter(connectionsGroup, plan); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java index 8616c8aef18..0a4db7b3ca6 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java @@ -17,8 +17,10 @@ import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.vocabulary.DASH; import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.SHACL; +import org.eclipse.rdf4j.query.algebra.StatementPattern; import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; @@ -31,6 +33,8 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.Select; import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The AST (Abstract Syntax Tree) node that represents the NodeShape node. NodeShape nodes can have multiple property @@ -41,16 +45,18 @@ */ public class NodeShape implements PlanGenerator, RequiresEvalutation, QueryGenerator { + private static final Logger logger = LoggerFactory.getLogger(NodeShape.class); + final Resource id; private List propertyShapes = Collections.emptyList(); private List nodeShapes = Collections.emptyList(); - public NodeShape(Resource id, SailRepositoryConnection connection, boolean deactivated) { + public NodeShape(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated) { this.id = id; if (!deactivated) { - propertyShapes = PropertyShape.Factory.getPropertyShapes(id, connection, this); - nodeShapes = PropertyShape.Factory.getPropertyShapesInner(connection, this, id, null); + propertyShapes = PropertyShape.Factory.getPropertyShapes(id, connection, this, shaclSail); + nodeShapes = PropertyShape.Factory.getPropertyShapesInner(connection, this, id, null, shaclSail); } } @@ -66,6 +72,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, @Override public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; PlanNode node = connectionsGroup.getCachedNodeFor( new Select(connectionsGroup.getAddedStatements(), getQuery("?a", "?c", null), "?a", "?c")); @@ -76,6 +83,7 @@ public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, @Override public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; PlanNode node = connectionsGroup.getCachedNodeFor( new Select(connectionsGroup.getRemovedStatements(), getQuery("?a", "?c", null), "?a", "?c")); @@ -93,8 +101,8 @@ public List getPaths() { throw new IllegalStateException(); } - public Stream generatePlans(ConnectionsGroup connectionsGroup, NodeShape nodeShape, - boolean printPlans, boolean validateEntireBaseSail) { + public Stream generatePlans(ConnectionsGroup connectionsGroup, NodeShape nodeShape, boolean printPlans, + boolean validateEntireBaseSail) { PlanNodeProvider overrideTargetNodeBufferedSplitter; SailConnection addedStatements; @@ -125,11 +133,9 @@ public Stream generatePlans(ConnectionsGroup connectionsGroup, NodeSha return Stream.concat(propertyShapesPlans, nodeShapesPlans); } - private Stream convertToPlan(List propertyShapes, - ConnectionsGroup connectionsGroup, + private Stream convertToPlan(List propertyShapes, ConnectionsGroup connectionsGroup, NodeShape nodeShape, boolean printPlans, PlanNodeProvider overrideTargetNodeBufferedSplitter, - SailConnection addedStatements, - SailConnection removedStatements) { + SailConnection addedStatements, SailConnection removedStatements) { Stats stats = connectionsGroup.getStats(); return propertyShapes @@ -154,42 +160,136 @@ public Resource getId() { return id; } + /** + * Returns a query that can be run against the base sail to retrieve all targets that would be valid according to + * this shape. + * + * Eg. A datatype restriction on foaf:age datatype == integer would look like: + * + * ?a foaf:age ?age_UUID. FILTER(isLiteral(?age_UUID) && datatype(?age_UUID) = xsd:integer) + * + * Where targetVar == ?a + * + * @param targetVar the SPARQL variable name used to bind the target nodes + * @return sparql query + */ + protected String buildSparqlValidNodes(String targetVar) { + + if (!propertyShapes.isEmpty() && !nodeShapes.isEmpty()) { + throw new UnsupportedOperationException( + "sh:targetShape don't support both nodeshapes and property shapes!"); + } + + if (!propertyShapes.isEmpty()) { + return propertyShapes + .stream() + .map(propertyShapes -> propertyShapes.buildSparqlValidNodes(targetVar)) + .reduce((a, b) -> a + "\n" + b) + .orElse(""); + } + + if (!nodeShapes.isEmpty()) { + return nodeShapes + .stream() + .map(propertyShapes -> propertyShapes.buildSparqlValidNodes(targetVar)) + .reduce((a, b) -> a + "\n" + b) + .orElse(""); + } + + return ""; + + } + + /** + * Get all statement patterns that would affect the validity of this shape. + * + * Eg. If the shape validates that all foaf:Person should have one foaf:name, then the statement pattern that would + * affect the validity would be "?a foaf:name ?b". We don't consider the patterns that would affect the targets (eg. + * foaf:Person). + * + * @return + */ + protected Stream getStatementPatterns() { + + return Stream.concat( + propertyShapes + .stream() + .flatMap(PropertyShape::getStatementPatterns), + nodeShapes + .stream() + .flatMap(PropertyShape::getStatementPatterns)); + } + public static class Factory { - public static List getShapes(SailRepositoryConnection connection, ShaclSail sail) { + public static List getShapes(SailRepositoryConnection connection, ShaclSail shaclSail) { try (Stream stream = connection.getStatements(null, RDF.TYPE, SHACL.NODE_SHAPE).stream()) { return stream.map(Statement::getSubject).flatMap(shapeId -> { - List propertyShapes = new ArrayList<>(2); + List propertyShapes = new ArrayList<>(); ShaclProperties shaclProperties = new ShaclProperties(shapeId, connection); - if (!shaclProperties.targetClass.isEmpty()) { - propertyShapes.add(new TargetClass(shapeId, connection, shaclProperties.deactivated, - shaclProperties.targetClass)); + if (!shaclProperties.getTargetClass().isEmpty()) { + propertyShapes + .add(new TargetClass(shapeId, shaclSail, connection, shaclProperties.isDeactivated(), + shaclProperties.getTargetClass())); + } + if (!shaclProperties.getTargetNode().isEmpty()) { + propertyShapes + .add(new TargetNode(shapeId, shaclSail, connection, shaclProperties.isDeactivated(), + shaclProperties.getTargetNode())); } - if (!shaclProperties.targetNode.isEmpty()) { - propertyShapes.add(new TargetNode(shapeId, connection, shaclProperties.deactivated, - shaclProperties.targetNode)); + if (!shaclProperties.getTargetSubjectsOf().isEmpty()) { + propertyShapes.add( + new TargetSubjectsOf(shapeId, shaclSail, connection, shaclProperties.isDeactivated(), + shaclProperties.getTargetSubjectsOf())); } - if (!shaclProperties.targetSubjectsOf.isEmpty()) { - propertyShapes.add(new TargetSubjectsOf(shapeId, connection, shaclProperties.deactivated, - shaclProperties.targetSubjectsOf)); + if (!shaclProperties.getTargetObjectsOf().isEmpty()) { + propertyShapes.add( + new TargetObjectsOf(shapeId, shaclSail, connection, shaclProperties.isDeactivated(), + shaclProperties.getTargetObjectsOf())); } - if (!shaclProperties.targetObjectsOf.isEmpty()) { - propertyShapes.add(new TargetObjectsOf(shapeId, connection, shaclProperties.deactivated, - shaclProperties.targetObjectsOf)); + + if (shaclSail.isShaclAdvancedFeatures()) { + shaclProperties.getTargetShape() + .stream() + .map(targetShape -> new TargetShape(shapeId, shaclSail, connection, + shaclProperties.isDeactivated(), targetShape)) + .forEach(propertyShapes::add); + } - if (sail.isUndefinedTargetValidatesAllSubjects() && propertyShapes.isEmpty()) { - propertyShapes.add(new NodeShape(shapeId, connection, shaclProperties.deactivated)); // target - // class - // nodeShapes - // are - // the - // only - // supported - // nodeShapes + if (!shaclProperties.getTarget().isEmpty()) { + shaclProperties.getTarget() + .forEach(sparqlTarget -> { +// if (connection.hasStatement(sparqlTarget, RDF.TYPE, SHACL.SPARQL_TARGET, true)) { +// propertyShapes.add(new SparqlTarget(shapeId, shaclSail, connection, +// shaclProperties.isDeactivated(), sparqlTarget)); +// } + if (shaclSail.isDashDataShapes() && connection.hasStatement(sparqlTarget, + RDF.TYPE, DASH.AllObjectsTarget, true)) { + propertyShapes.add( + new AllObjectsTarget(shapeId, shaclSail, connection, + shaclProperties.isDeactivated())); + } + if (shaclSail.isDashDataShapes() && connection.hasStatement(sparqlTarget, + RDF.TYPE, DASH.AllSubjectsTarget, true)) { + propertyShapes.add(new AllSubjectsTarget(shapeId, shaclSail, connection, + shaclProperties.isDeactivated())); + } + + }); + + } + + if (shaclSail.isUndefinedTargetValidatesAllSubjects() && propertyShapes.isEmpty()) { + logger.info( + "isUndefinedTargetValidatesAllSubjects() is deprecated, please use .setExperimentalDashSupport(true) and use the custom targets from http://datashapes.org/dash#AllSubjectsTarget"); + + propertyShapes + .add(new NodeShape(shapeId, shaclSail, connection, shaclProperties.isDeactivated())); + // target class nodeShapes are the only supported nodeShapes } return propertyShapes.stream(); @@ -204,7 +304,7 @@ public String toString() { return id.toString(); } - public PlanNode getTargetFilter(SailConnection shaclSailConnection, PlanNode parent) { + public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { return parent; } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NotPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NotPropertyShape.java index c411ba5bec0..f0fb3eab6e7 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NotPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NotPropertyShape.java @@ -16,6 +16,7 @@ import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.SourceConstraintComponent; import org.eclipse.rdf4j.sail.shacl.Stats; import org.eclipse.rdf4j.sail.shacl.planNodes.BufferedPlanNode; @@ -39,15 +40,20 @@ public class NotPropertyShape extends PathPropertyShape { private static final Logger logger = LoggerFactory.getLogger(NotPropertyShape.class); NotPropertyShape(Resource id, SailRepositoryConnection connection, NodeShape nodeShape, boolean deactivated, - PathPropertyShape parent, Resource path, Resource not) { + PathPropertyShape parent, Resource path, Resource not, ShaclSail shaclSail) { super(id, connection, nodeShape, deactivated, parent, path); - List> collect = Factory.getPropertyShapesInner(connection, nodeShape, not, this) + List> collect = Factory + .getPropertyShapesInner(connection, nodeShape, not, this, shaclSail) .stream() + .filter(s -> !s.deactivated) .map(Collections::singletonList) .collect(Collectors.toList()); orPropertyShape = new OrPropertyShape(id, connection, nodeShape, deactivated, this, null, collect); + if (orPropertyShape.deactivated) { + this.deactivated = true; + } } @@ -60,16 +66,19 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, } if (this.getPath() != null) { - EnrichWithShape plan = (EnrichWithShape) orPropertyShape.getPlan(connectionsGroup, printPlans, + EnrichWithShape plan = (EnrichWithShape) orPropertyShape.getPlan(connectionsGroup, false, overrideTargetNode, false, !negateThisPlan); PlanNode parent = plan.getParent(); - + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(parent, connectionsGroup); + logger.info(planAsGraphvizDot); + } return new EnrichWithShape(parent, this); } else { - EnrichWithShape plan = (EnrichWithShape) orPropertyShape.getPlan(connectionsGroup, printPlans, + EnrichWithShape plan = (EnrichWithShape) orPropertyShape.getPlan(connectionsGroup, false, () -> getTargetsPlan(connectionsGroup, overrideTargetNode, !negateThisPlan), false, false); // parents are the targets that are checked @@ -86,7 +95,10 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, // here we get all targets from targetsPlan that are not in parent parent = new InnerJoin(targetsPlan, parent).getDiscardedLeft(BufferedPlanNode.class); - + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(parent, connectionsGroup); + logger.info(planAsGraphvizDot); + } return new EnrichWithShape(parent, this); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/OrPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/OrPropertyShape.java index 1170d01e260..49273a99475 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/OrPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/OrPropertyShape.java @@ -12,11 +12,14 @@ import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.query.algebra.StatementPattern; import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.SourceConstraintComponent; import org.eclipse.rdf4j.sail.shacl.Stats; import org.eclipse.rdf4j.sail.shacl.planNodes.AggregateIteratorTypeOverride; @@ -44,12 +47,20 @@ public class OrPropertyShape extends PathPropertyShape { private static final Logger logger = LoggerFactory.getLogger(OrPropertyShape.class); OrPropertyShape(Resource id, SailRepositoryConnection connection, NodeShape nodeShape, boolean deactivated, - PathPropertyShape parent, Resource path, Resource or) { + PathPropertyShape parent, Resource path, Resource or, ShaclSail shaclSail) { super(id, connection, nodeShape, deactivated, parent, path); this.or = toList(connection, or).stream() - .map(v -> PropertyShape.Factory.getPropertyShapesInner(connection, nodeShape, (Resource) v, this)) + .map(v -> PropertyShape.Factory + .getPropertyShapesInner(connection, nodeShape, (Resource) v, this, shaclSail) + .stream() + .filter(s -> !s.deactivated) + .collect(Collectors.toList())) .collect(Collectors.toList()); + if (!this.or.stream().flatMap(Collection::stream).findAny().isPresent()) { + logger.warn("sh:or contained no supported shapes: " + id); + this.deactivated = true; + } } OrPropertyShape(Resource id, SailRepositoryConnection connection, NodeShape nodeShape, boolean deactivated, @@ -58,12 +69,22 @@ public class OrPropertyShape extends PathPropertyShape { super(id, connection, nodeShape, deactivated, parent, path); this.or = or; + if (!this.or.stream().flatMap(Collection::stream).findAny().isPresent()) { + logger.warn("sh:or contained no supported shapes: " + id); + this.deactivated = true; + } + } public OrPropertyShape(Resource id, NodeShape nodeShape, boolean deactivated, PathPropertyShape parent, Path path, List> or) { super(id, nodeShape, deactivated, parent, path); this.or = or; + + if (!this.or.stream().flatMap(Collection::stream).findAny().isPresent()) { + logger.warn("sh:or contained no supported shapes: " + id); + this.deactivated = true; + } } @Override @@ -270,4 +291,25 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg return new Unique(reduce.get()); } + + public List> getOr() { + return or; + } + + @Override + public String buildSparqlValidNodes(String targetVar) { + + return or.stream() + .map(l -> l.stream().map(p -> p.buildSparqlValidNodes(targetVar)).reduce((a, b) -> a + "\n" + b)) + .filter(Optional::isPresent) + .map(Optional::get) + .collect(Collectors.joining("\n} UNION {\n#VALUES_INJECTION_POINT#\n", "{\n#VALUES_INJECTION_POINT#\n", + "\n}")); + + } + + @Override + public Stream getStatementPatterns() { + return or.stream().flatMap(Collection::stream).flatMap(PropertyShape::getStatementPatterns); + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/Path.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/Path.java index 0bbe74c6177..b93aa7a8324 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/Path.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/Path.java @@ -8,7 +8,11 @@ package org.eclipse.rdf4j.sail.shacl.AST; +import java.util.stream.Stream; + import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.query.algebra.StatementPattern; +import org.eclipse.rdf4j.query.algebra.Var; /** * The AST (Abstract Syntax Tree) node that represents a simple path for exactly one predicate. Currently there is no @@ -29,4 +33,6 @@ abstract public class Path implements RequiresEvalutation, QueryGenerator, PlanG public Resource getId() { return id; } + + public abstract Stream getStatementsPatterns(Var start, Var end); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PathPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PathPropertyShape.java index 336814b36f2..f6e717467c7 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PathPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PathPropertyShape.java @@ -204,6 +204,6 @@ public int hashCode() { public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean negated) { Select select = new Select(connectionsGroup.getBaseConnection(), "?a ?b ?c", "?a"); Unique unique = new Unique(select); - return nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), unique); + return nodeShape.getTargetFilter(connectionsGroup, unique); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java index dc811eddd65..390c123b7c3 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java @@ -9,7 +9,9 @@ package org.eclipse.rdf4j.sail.shacl.AST; import java.util.List; +import java.util.stream.Stream; +import org.eclipse.rdf4j.query.algebra.StatementPattern; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java index ab68d491c62..fbdbe5ad37d 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java @@ -11,8 +11,10 @@ import java.io.StringWriter; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.List; import java.util.Objects; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -23,6 +25,7 @@ import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.model.vocabulary.SHACL; import org.eclipse.rdf4j.query.GraphQuery; +import org.eclipse.rdf4j.query.algebra.StatementPattern; import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.rio.RDFFormat; import org.eclipse.rdf4j.rio.Rio; @@ -32,6 +35,7 @@ import org.eclipse.rdf4j.sail.memory.MemoryStore; import org.eclipse.rdf4j.sail.memory.MemoryStoreConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.SourceConstraintComponent; import org.eclipse.rdf4j.sail.shacl.Stats; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; @@ -46,7 +50,7 @@ */ public abstract class PropertyShape implements PlanGenerator, RequiresEvalutation { - final boolean deactivated; + boolean deactivated; final Resource id; NodeShape nodeShape; @@ -144,6 +148,24 @@ static List toList(SailRepositoryConnection connection, Resource orList) } + static Set toSet(SailRepositoryConnection connection, Resource orList) { + Set ret = new HashSet<>(); + while (!orList.equals(RDF.NIL)) { + try (Stream stream = connection.getStatements(orList, RDF.FIRST, null).stream()) { + Value value = stream.map(Statement::getObject).findAny().get(); + ret.add(value); + } + + try (Stream stream = connection.getStatements(orList, RDF.REST, null).stream()) { + orList = stream.map(Statement::getObject).map(v -> (Resource) v).findAny().get(); + } + + } + + return ret; + + } + public Resource getId() { return id; } @@ -156,109 +178,141 @@ public SourceConstraintComponent getSourceConstraintComponent() { throw new IllegalStateException("Missing implementetion in extending class!"); } - static class Factory { + public String buildSparqlValidNodes(String targetVar) { + return ""; + } - static List getPropertyShapes(Resource ShapeId, SailRepositoryConnection connection, - NodeShape nodeShape) { + public Stream getStatementPatterns() { + return Stream.empty(); + } + + public static class Factory { + + public static List getPropertyShapes(Resource ShapeId, SailRepositoryConnection connection, + NodeShape nodeShape, ShaclSail shaclSail) { try (Stream stream = connection.getStatements(ShapeId, SHACL.PROPERTY, null).stream()) { return stream.map(Statement::getObject).map(v -> (Resource) v).flatMap(propertyShapeId -> { List propertyShapes = getPropertyShapesInner(connection, nodeShape, propertyShapeId, - null); + null, shaclSail); return propertyShapes.stream(); }).collect(Collectors.toList()); } } - static List getPropertyShapesInner(SailRepositoryConnection connection, NodeShape nodeShape, - Resource propertyShapeId, PathPropertyShape parent) { + public static List getPropertyShapesInner(SailRepositoryConnection connection, + NodeShape nodeShape, + Resource propertyShapeId, PathPropertyShape parent, ShaclSail shaclSail) { List propertyShapes = new ArrayList<>(2); ShaclProperties shaclProperties = new ShaclProperties(propertyShapeId, connection); - if (shaclProperties.minCount != null && shaclProperties.minCount > 0) { + if (shaclProperties.getMinCount() != null && shaclProperties.getMinCount() > 0) { propertyShapes.add(new MinCountPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.minCount)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getMinCount())); } - if (shaclProperties.maxCount != null) { + if (shaclProperties.getMaxCount() != null) { propertyShapes.add(new MaxCountPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.maxCount)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getMaxCount())); } - if (shaclProperties.datatype != null) { + if (shaclProperties.getDatatype() != null) { propertyShapes.add(new DatatypePropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.datatype)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getDatatype())); } - if (!shaclProperties.or.isEmpty()) { - shaclProperties.or.forEach(or -> { + if (!shaclProperties.getOr().isEmpty()) { + shaclProperties.getOr().forEach(or -> { propertyShapes.add(new OrPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, or)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), or, shaclSail)); }); } - if (shaclProperties.minLength != null) { + if (shaclProperties.getMinLength() != null) { propertyShapes.add(new MinLengthPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.minLength)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getMinLength())); } - if (shaclProperties.maxLength != null) { + if (shaclProperties.getMaxLength() != null) { propertyShapes.add(new MaxLengthPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.maxLength)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getMaxLength())); } - if (!shaclProperties.pattern.isEmpty()) { - shaclProperties.pattern.forEach(pattern -> { + if (!shaclProperties.getPattern().isEmpty()) { + shaclProperties.getPattern().forEach(pattern -> { propertyShapes.add(new PatternPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, pattern, shaclProperties.flags)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), pattern, + shaclProperties.getFlags())); }); } - if (shaclProperties.languageIn != null) { + if (shaclProperties.getLanguageIn() != null) { propertyShapes.add(new LanguageInPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.languageIn)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getLanguageIn())); } - if (shaclProperties.nodeKind != null) { + if (shaclProperties.getNodeKind() != null) { propertyShapes.add(new NodeKindPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.nodeKind)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getNodeKind())); } - if (shaclProperties.minExclusive != null) { + if (shaclProperties.getMinExclusive() != null) { propertyShapes.add(new MinExclusivePropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.minExclusive)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getMinExclusive())); } - if (shaclProperties.maxExclusive != null) { + if (shaclProperties.getMaxExclusive() != null) { propertyShapes.add(new MaxExclusivePropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.maxExclusive)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getMaxExclusive())); } - if (shaclProperties.maxInclusive != null) { + if (shaclProperties.getMaxInclusive() != null) { propertyShapes.add(new MaxInclusivePropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.maxInclusive)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getMaxInclusive())); } - if (shaclProperties.minInclusive != null) { + if (shaclProperties.getMinInclusive() != null) { propertyShapes.add(new MinInclusivePropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.minInclusive)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getMinInclusive())); } - if (!shaclProperties.clazz.isEmpty()) { - shaclProperties.clazz.forEach(clazz -> { + if (!shaclProperties.getClazz().isEmpty()) { + shaclProperties.getClazz().forEach(clazz -> { propertyShapes.add(new ClassPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, clazz)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), clazz)); }); } - if (!shaclProperties.and.isEmpty()) { - shaclProperties.and.forEach(and -> { + if (!shaclProperties.getAnd().isEmpty()) { + shaclProperties.getAnd().forEach(and -> { propertyShapes.add(new AndPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, and)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), and, shaclSail)); }); } - if (!shaclProperties.not.isEmpty()) { - shaclProperties.not.forEach(not -> { + if (!shaclProperties.getNot().isEmpty()) { + shaclProperties.getNot().forEach(not -> { propertyShapes.add(new NotPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, not)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), not, shaclSail)); }); } - if (shaclProperties.in != null) { + if (shaclProperties.getIn() != null) { propertyShapes.add(new InPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.in)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), shaclProperties.getIn())); } - if (shaclProperties.uniqueLang) { + if (shaclProperties.isUniqueLang()) { propertyShapes.add(new UniqueLangPropertyShape(propertyShapeId, connection, nodeShape, - shaclProperties.deactivated, parent, shaclProperties.path, shaclProperties.uniqueLang)); + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.isUniqueLang())); + } + if (shaclProperties.getHasValue() != null) { + propertyShapes.add(new HasValuePropertyShape(propertyShapeId, connection, nodeShape, + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getHasValue())); + } + if (shaclProperties.getValueIn() != null && shaclSail.isDashDataShapes()) { + propertyShapes.add(new ValueInPropertyShape(propertyShapeId, connection, nodeShape, + shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), + shaclProperties.getValueIn())); } return propertyShapes; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java index 13e77286f91..187e251ad55 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java @@ -22,40 +22,45 @@ public class ShaclProperties { private static final Logger logger = LoggerFactory.getLogger(ShaclProperties.class); - List clazz = new ArrayList<>(0); - List or = new ArrayList<>(0); - List and = new ArrayList<>(0); - List not = new ArrayList<>(0); - Long minCount; - Long maxCount; + private final List clazz = new ArrayList<>(); + private final List or = new ArrayList<>(); + private final List and = new ArrayList<>(); + private final List not = new ArrayList<>(); + private Long minCount; + private Long maxCount; - Resource datatype; - Resource in; + private Resource datatype; + private Resource in; + private Value hasValue; + private Resource valueIn; - Long minLength; - Long maxLength; + private Long minLength; + private Long maxLength; - Resource languageIn; - Resource nodeKind; + private Resource languageIn; + private Resource nodeKind; - Resource path; + private Resource path; - Literal minExclusive; - Literal maxExclusive; - Literal minInclusive; - Literal maxInclusive; + private Literal minExclusive; + private Literal maxExclusive; + private Literal minInclusive; + private Literal maxInclusive; - List pattern = new ArrayList<>(0); - String flags = ""; + private final List pattern = new ArrayList<>(); + private String flags = ""; - Set targetClass = new HashSet<>(0); - TreeSet targetNode = new TreeSet<>(new ValueComparator()); - Set targetSubjectsOf = new HashSet<>(0); - Set targetObjectsOf = new HashSet<>(0); + private final Set targetClass = new HashSet<>(); + private final TreeSet targetNode = new TreeSet<>(new ValueComparator()); + private final Set targetSubjectsOf = new HashSet<>(); + private final Set targetObjectsOf = new HashSet<>(); + private final List targetShape = new ArrayList<>(); - boolean deactivated = false; + private final List target = new ArrayList<>(); - boolean uniqueLang = false; + private boolean deactivated = false; + + private boolean uniqueLang = false; public ShaclProperties() { } @@ -183,6 +188,24 @@ public ShaclProperties(Resource propertyShapeId, SailRepositoryConnection connec break; case "http://www.w3.org/ns/shacl#property": break; + case "http://www.w3.org/ns/shacl#target": + target.add((Resource) object); + break; + case "http://www.w3.org/ns/shacl#hasValue": + if (hasValue != null) { + throw new IllegalStateException(predicate + " already populated"); + } + hasValue = object; + break; + case "http://datashapes.org/dash#valueIn": + if (valueIn != null) { + throw new IllegalStateException(predicate + " already populated"); + } + valueIn = (Resource) object; + break; + case "http://www.w3.org/ns/shacl#targetShape": + targetShape.add((Resource) object); + break; default: if (predicate.startsWith(SHACL.NAMESPACE)) { logger.warn("Unsupported SHACL feature detected {} in statement {}", @@ -295,4 +318,20 @@ public boolean isDeactivated() { public boolean isUniqueLang() { return uniqueLang; } + + public Value getHasValue() { + return hasValue; + } + + public List getTarget() { + return target; + } + + public List getTargetShape() { + return targetShape; + } + + public Resource getValueIn() { + return valueIn; + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SimplePath.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SimplePath.java index ce892345a71..3787b724dbe 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SimplePath.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SimplePath.java @@ -10,8 +10,12 @@ import java.util.List; import java.util.Objects; +import java.util.UUID; +import java.util.stream.Stream; import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.query.algebra.StatementPattern; +import org.eclipse.rdf4j.query.algebra.Var; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; @@ -32,7 +36,7 @@ public class SimplePath extends Path { private final IRI path; - SimplePath(IRI id) { + public SimplePath(IRI id) { super(id); this.path = id; @@ -123,4 +127,11 @@ public int hashCode() { public String toString() { return path.toString(); } + + @Override + public Stream getStatementsPatterns(Var start, Var end) { + return Stream + .of(new StatementPattern(start, new Var(UUID.randomUUID().toString(), path), end)); + + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SparqlTarget.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SparqlTarget.java new file mode 100644 index 00000000000..ed448bab367 --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/SparqlTarget.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Distribution License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl.AST; +/* + * import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; import + * org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.vocabulary.SHACL; import + * org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.SailConnection; import + * org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; import + * org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.Stats; import + * org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; + * import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; import org.eclipse.rdf4j.sail.shacl.planNodes.SparqlFilter; + * import org.eclipse.rdf4j.sail.shacl.planNodes.SparqlTargetSelect; import + * org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; + * import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; + * + * public class SparqlTarget extends NodeShape { + * + * private final String sparqlQuery; + * + * SparqlTarget(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated, Resource + * sparqlTarget) { super(id, shaclSail, connection, deactivated); + * + * sparqlQuery = connection .getStatements(sparqlTarget, SHACL.SELECT, null) .stream() .map(Statement::getObject) + * .map(Value::stringValue) .findFirst() .get(); + * + * } + * + * @Override public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNodeProvider + * overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + * + * assert !negateSubPlans : "There are no subplans!"; assert !negateThisPlan; + * + * PlanNode planNode = connectionsGroup .getCachedNodeFor(new Sort(new + * SparqlTargetSelect(connectionsGroup.getBaseConnection(), sparqlQuery))); + * + * return new Unique(new TrimTuple(planNode, 0, 1)); } + * + * @Override public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper + * planeNodeWrapper) { + * + * PlanNode planNode = connectionsGroup .getCachedNodeFor(new Sort(new + * SparqlTargetSelect(connectionsGroup.getBaseConnection(), sparqlQuery))); + * + * return new Unique(new TrimTuple(planNode, 0, 1)); + * + * } + * + * @Override public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper + * planeNodeWrapper) { PlanNode planNode = connectionsGroup .getCachedNodeFor(new Sort(new + * SparqlTargetSelect(connectionsGroup.getBaseConnection(), sparqlQuery))); + * + * return new Unique(new TrimTuple(planNode, 0, 1)); } + * + * @Override public boolean requiresEvaluation(SailConnection addedStatements, SailConnection removedStatements, Stats + * stats) { return true; } + * + * @Override public String getQuery(String subjectVariable, String objectVariable, RdfsSubClassOfReasoner + * rdfsSubClassOfReasoner) { + * + * // THIS IS A HACK. It's ok for the prototype, but needs to be fixed before we merge/release. return "\n{\n" + + * sparqlQuery.replace("?this", subjectVariable) + "\n}\n"; + * + * // return " BIND(<" + targetPredicate + "> as ?b1) \n " + // "BIND(<" + targetClass + "> as " + objectVariable + + * ") \n " + subjectVariable // + " ?b1 " + objectVariable + ". \n"; + * + * } + * + * @Override public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { return new + * SparqlFilter(connectionsGroup.getBaseConnection(), parent, sparqlQuery) .getTrueNode(UnBufferedPlanNode.class); } + * + * } + */ diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetClass.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetClass.java index d6d3bd229c8..76e724ceaca 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetClass.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetClass.java @@ -20,8 +20,9 @@ import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.Stats; -import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalTypeFilterNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalPredicateObjectFilter; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; import org.eclipse.rdf4j.sail.shacl.planNodes.Select; @@ -40,8 +41,9 @@ public class TargetClass extends NodeShape { private final Set targetClass; - TargetClass(Resource id, SailRepositoryConnection connection, boolean deactivated, Set targetClass) { - super(id, connection, deactivated); + TargetClass(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated, + Set targetClass) { + super(id, shaclSail, connection, deactivated); this.targetClass = targetClass; assert !this.targetClass.isEmpty(); @@ -126,8 +128,9 @@ public String getQuery(String subjectVariable, String objectVariable, } @Override - public PlanNode getTargetFilter(SailConnection shaclSailConnection, PlanNode parent) { - return new ExternalTypeFilterNode(shaclSailConnection, targetClass, parent, 0, true); + public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { + return new ExternalPredicateObjectFilter(connectionsGroup.getBaseConnection(), RDF.TYPE, targetClass, parent, 0, + true); } @Override diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetNode.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetNode.java index 0927fe18a43..691236065a8 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetNode.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetNode.java @@ -20,6 +20,7 @@ import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.Stats; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; @@ -38,8 +39,9 @@ public class TargetNode extends NodeShape { private final TreeSet targetNodeSet; - TargetNode(Resource id, SailRepositoryConnection connection, boolean deactivated, TreeSet targetNode) { - super(id, connection, deactivated); + TargetNode(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated, + TreeSet targetNode) { + super(id, shaclSail, connection, deactivated); this.targetNodeSet = targetNode; assert !this.targetNodeSet.isEmpty(); } @@ -58,6 +60,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, @Override public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; return new ValuesBackedNode(targetNodeSet); @@ -66,6 +69,7 @@ public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, @Override public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; PlanNode parent = connectionsGroup.getCachedNodeFor( new Select(connectionsGroup.getRemovedStatements(), getQuery("?a", "?c", null), "?a", "?c")); return new Unique(new TrimTuple(parent, 0, 1)); @@ -111,7 +115,7 @@ public String getQuery(String subjectVariable, String objectVariable, } @Override - public PlanNode getTargetFilter(SailConnection shaclSailConnection, PlanNode parent) { + public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { return new SetFilterNode(targetNodeSet, parent, 0, true); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetObjectsOf.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetObjectsOf.java index 7e06abbad1c..6de44d4d853 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetObjectsOf.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetObjectsOf.java @@ -18,6 +18,7 @@ import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.Stats; import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalFilterByPredicate; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; @@ -37,8 +38,9 @@ public class TargetObjectsOf extends NodeShape { private final Set targetObjectsOf; - TargetObjectsOf(Resource id, SailRepositoryConnection connection, boolean deactivated, Set targetObjectsOf) { - super(id, connection, deactivated); + TargetObjectsOf(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated, + Set targetObjectsOf) { + super(id, shaclSail, connection, deactivated); this.targetObjectsOf = targetObjectsOf; assert !this.targetObjectsOf.isEmpty(); @@ -60,6 +62,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, @Override public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; PlanNode select; if (targetObjectsOf.size() == 1) { @@ -80,6 +83,7 @@ public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, @Override public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; PlanNode select; if (targetObjectsOf.size() == 1) { IRI iri = targetObjectsOf.stream().findAny().get(); @@ -117,8 +121,8 @@ public String getQuery(String subjectVariable, String objectVariable, } @Override - public PlanNode getTargetFilter(SailConnection shaclSailConnection, PlanNode parent) { - return new ExternalFilterByPredicate(shaclSailConnection, targetObjectsOf, parent, 0, + public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { + return new ExternalFilterByPredicate(connectionsGroup.getBaseConnection(), targetObjectsOf, parent, 0, ExternalFilterByPredicate.On.Object); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetShape.java new file mode 100644 index 00000000000..2a5d34b038d --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetShape.java @@ -0,0 +1,201 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl.AST; + +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.vocabulary.SHACL; +import org.eclipse.rdf4j.query.algebra.StatementPattern; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.SailConnection; +import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; +import org.eclipse.rdf4j.sail.shacl.Stats; +import org.eclipse.rdf4j.sail.shacl.planNodes.BulkedExternalInnerJoin; +import org.eclipse.rdf4j.sail.shacl.planNodes.EmptyNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalFilterByQuery; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; +import org.eclipse.rdf4j.sail.shacl.planNodes.Select; +import org.eclipse.rdf4j.sail.shacl.planNodes.Sort; +import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnionNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnorderedSelect; + +/** + * sh:targetObjectsOf + * + * @author Håvard Mikkelsen Ottestad + */ +public class TargetShape extends NodeShape { + + NodeShape targetShape; + List statementPatternList; + String query; + + TargetShape(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated, + Resource targetShape) { + super(id, shaclSail, connection, deactivated); + + if (connection.hasStatement(targetShape, SHACL.PATH, null, false)) { + throw new UnsupportedOperationException( + "Experimental sh:targetShape support only supports sh:NodeShape and not sh:PropertyShape"); + } + + this.targetShape = new NodeShape(targetShape, shaclSail, connection, false); + statementPatternList = this.targetShape.getStatementPatterns().collect(Collectors.toList()); + query = this.targetShape.buildSparqlValidNodes("?a"); + + assert !statementPatternList.isEmpty(); + } + + @Override + public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, + PlanNodeProvider overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + assert !negateSubPlans : "There are no subplans!"; + assert !negateThisPlan; + + PlanNode select = new Select(connectionsGroup.getBaseConnection(), getQuery("?a", null, null), "?a"); + + return connectionsGroup.getCachedNodeFor(select); + + } + + @Override + public PlanNode getPlanAddedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; + + return getInnerPlanRemovedOrAdded(connectionsGroup, connectionsGroup.getAddedStatements()); + + } + + @Override + public PlanNode getPlanRemovedStatements(ConnectionsGroup connectionsGroup, + PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; + + return getInnerPlanRemovedOrAdded(connectionsGroup, connectionsGroup.getRemovedStatements()); + + } + + private PlanNode getInnerPlanRemovedOrAdded(ConnectionsGroup connectionsGroup, SailConnection removedStatements) { + + // @formatter:off + /* + * General approach here is to: + * + * 1. Get all subjects that match any of the statement patterns of the filter shape + * 2. Feed this in as a bind into the SPARQL query generated from the filter shape + */ + // @formatter:on + + PlanNode allPotentialTargetsFromTransaction = new EmptyNode(); + for (StatementPattern statementPattern : statementPatternList) { + + PlanNode statementsThatMatchPattern = new TrimTuple( + new UnorderedSelect( + removedStatements, + null, + ((IRI) statementPattern.getPredicateVar().getValue()), + (statementPattern.getObjectVar().getValue()), + UnorderedSelect.OutputPattern.SubjectPredicateObject), + 0, + 1); + + allPotentialTargetsFromTransaction = new UnionNode(allPotentialTargetsFromTransaction, + statementsThatMatchPattern); + + } + + allPotentialTargetsFromTransaction = new Unique(new Sort(allPotentialTargetsFromTransaction)); + + // TODO: The bulked external inner join could actually just be a bulked external sparql filter + PlanNode allTargetsThatReallyAreTargets = new BulkedExternalInnerJoin(allPotentialTargetsFromTransaction, + connectionsGroup.getBaseConnection(), query, false, null, + "?a"); + + allTargetsThatReallyAreTargets = new Unique(new TrimTuple(allTargetsThatReallyAreTargets, 0, 1)); + + return allTargetsThatReallyAreTargets; + } + + @Override + public boolean requiresEvaluation(SailConnection addedStatements, SailConnection removedStatements, Stats stats) { + return !stats.isEmpty(); + } + + @Override + public String getQuery(String subjectVariable, String objectVariable, + RdfsSubClassOfReasoner rdfsSubClassOfReasoner) { + return targetShape.buildSparqlValidNodes(subjectVariable); + + } + + @Override + public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { + return new ExternalFilterByQuery(connectionsGroup.getBaseConnection(), parent, 0, + getQuery("?a", null, null), "?a") + .getTrueNode(UnBufferedPlanNode.class); + } + + private PlanNode getAllSubjectsPlan(SailConnection sailConnection) { + // @formatter:off + return new Unique( + new Sort( + new TrimTuple( + new UnorderedSelect( + sailConnection, + null, + null, + null, + UnorderedSelect.OutputPattern.SubjectPredicateObject + ), + 0, + 1) + ) + ); + // @formatter:on + + } + + @Override + public String toString() { + return "TargetShape{" + + "targetShape=" + targetShape + + ", id=" + id + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + TargetShape that = (TargetShape) o; + return Objects.equals(targetShape, that.targetShape); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), targetShape); + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetSubjectsOf.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetSubjectsOf.java index 2d1974a9374..5d04fd1d6a6 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetSubjectsOf.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetSubjectsOf.java @@ -18,6 +18,7 @@ import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.RdfsSubClassOfReasoner; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.Stats; import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalFilterByPredicate; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; @@ -37,8 +38,9 @@ public class TargetSubjectsOf extends NodeShape { private final Set targetSubjectsOf; - TargetSubjectsOf(Resource id, SailRepositoryConnection connection, boolean deactivated, Set targetSubjectsOf) { - super(id, connection, deactivated); + TargetSubjectsOf(Resource id, ShaclSail shaclSail, SailRepositoryConnection connection, boolean deactivated, + Set targetSubjectsOf) { + super(id, shaclSail, connection, deactivated); this.targetSubjectsOf = targetSubjectsOf; assert !this.targetSubjectsOf.isEmpty(); } @@ -58,6 +60,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, @Override public PlanNode getPlanAddedStatements(ConnectionsGroup connection, PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; PlanNode select; if (targetSubjectsOf.size() == 1) { @@ -76,6 +79,7 @@ public PlanNode getPlanAddedStatements(ConnectionsGroup connection, @Override public PlanNode getPlanRemovedStatements(ConnectionsGroup connection, PlaneNodeWrapper planeNodeWrapper) { + assert planeNodeWrapper == null; PlanNode select; if (targetSubjectsOf.size() == 1) { @@ -114,8 +118,8 @@ public String getQuery(String subjectVariable, String objectVariable, } @Override - public PlanNode getTargetFilter(SailConnection connection, PlanNode parent) { - return new ExternalFilterByPredicate(connection, targetSubjectsOf, parent, 0, + public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode parent) { + return new ExternalFilterByPredicate(connectionsGroup.getBaseConnection(), targetSubjectsOf, parent, 0, ExternalFilterByPredicate.On.Subject); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/UniqueLangPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/UniqueLangPropertyShape.java index 9b466197fe1..49f669c9f50 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/UniqueLangPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/UniqueLangPropertyShape.java @@ -93,7 +93,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, PlanNode addedByPath = super.getPlanAddedStatements(connectionsGroup, null); - addedByPath = nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), addedByPath); + addedByPath = nodeShape.getTargetFilter(connectionsGroup, addedByPath); PlanNode mergeNode = new UnionNode(addedTargets, addedByPath); @@ -163,6 +163,6 @@ public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean neg plan = new Unique(new TrimTuple(plan, 0, 1)); - return nodeShape.getTargetFilter(connectionsGroup.getBaseConnection(), plan); + return nodeShape.getTargetFilter(connectionsGroup, plan); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ValueInPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ValueInPropertyShape.java new file mode 100644 index 00000000000..856c7242a65 --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ValueInPropertyShape.java @@ -0,0 +1,216 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl.AST; + +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Literal; +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.query.algebra.StatementPattern; +import org.eclipse.rdf4j.query.algebra.Var; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; +import org.eclipse.rdf4j.sail.shacl.SourceConstraintComponent; +import org.eclipse.rdf4j.sail.shacl.planNodes.EnrichWithShape; +import org.eclipse.rdf4j.sail.shacl.planNodes.ExternalFilterByQuery; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; +import org.eclipse.rdf4j.sail.shacl.planNodes.TrimTuple; +import org.eclipse.rdf4j.sail.shacl.planNodes.TupleMapper; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnBufferedPlanNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.UnionNode; +import org.eclipse.rdf4j.sail.shacl.planNodes.Unique; +import org.eclipse.rdf4j.sail.shacl.planNodes.ValueInFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Håvard Ottestad + */ +public class ValueInPropertyShape extends PathPropertyShape { + + private final Set valueIn; + private static final Logger logger = LoggerFactory.getLogger(ValueInPropertyShape.class); + + ValueInPropertyShape(Resource id, SailRepositoryConnection connection, NodeShape nodeShape, boolean deactivated, + PathPropertyShape parent, Resource path, + Resource valueIn) { + super(id, connection, nodeShape, deactivated, parent, path); + + this.valueIn = toSet(connection, valueIn); + + assert (!this.valueIn.isEmpty()); + + } + + @Override + public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, + PlanNodeProvider overrideTargetNode, boolean negateThisPlan, boolean negateSubPlans) { + + if (deactivated) { + return null; + } + assert !negateSubPlans : "There are no subplans!"; + + if (getPath() == null) { + PlanNode addedTargets = nodeShape.getPlanAddedStatements(connectionsGroup, null); + if (overrideTargetNode != null) { + addedTargets = overrideTargetNode.getPlanNode(); + } + + PlanNode invalidTargets = new TupleMapper(addedTargets, t -> { + List line = t.getLine(); + t.getLine().add(line.get(0)); + return t; + }); + + if (negateThisPlan) { + invalidTargets = new ValueInFilter(invalidTargets, valueIn).getTrueNode(UnBufferedPlanNode.class); + } else { + invalidTargets = new ValueInFilter(invalidTargets, valueIn).getFalseNode(UnBufferedPlanNode.class); + + } + + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(invalidTargets, connectionsGroup); + logger.info(planAsGraphvizDot); + } + + return new EnrichWithShape(invalidTargets, this); + + } + + // TODO - these plans are generally slow because they generate a lot of SPARQL queries and also they don't + // optimize for the case when everything already valid in the added statements. + + if (overrideTargetNode != null) { + PlanNode planNode = overrideTargetNode.getPlanNode(); + + ExternalFilterByQuery externalFilterByQuery = new ExternalFilterByQuery( + connectionsGroup.getBaseConnection(), planNode, 0, buildSparqlValidNodes("?this"), "?this"); + + if (negateThisPlan) { + planNode = externalFilterByQuery.getTrueNode(UnBufferedPlanNode.class); + } else { + planNode = externalFilterByQuery.getFalseNode(UnBufferedPlanNode.class); + } + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(planNode, connectionsGroup); + logger.info(planAsGraphvizDot); + } + + return new EnrichWithShape(planNode, this); + } + + PlanNode planAddedStatements = nodeShape.getPlanAddedStatements(connectionsGroup, null); + + ExternalFilterByQuery externalFilterByQuery = new ExternalFilterByQuery(connectionsGroup.getBaseConnection(), + planAddedStatements, 0, + buildSparqlValidNodes("?this"), "?this"); + + PlanNode invalidValues; + + if (negateThisPlan) { + invalidValues = externalFilterByQuery.getTrueNode(UnBufferedPlanNode.class); + } else { + invalidValues = externalFilterByQuery.getFalseNode(UnBufferedPlanNode.class); + } + + if (negateThisPlan && connectionsGroup.getStats().hasAdded()) { + + PlaneNodeWrapper planeNodeWrapper = planNode -> { + PlanNode targetFilter = nodeShape.getTargetFilter(connectionsGroup, planNode); + return new ExternalFilterByQuery(connectionsGroup.getBaseConnection(), targetFilter, 0, + buildSparqlValidNodes("?this"), "?this").getTrueNode(UnBufferedPlanNode.class); + }; + + invalidValues = new UnionNode(invalidValues, + getPlanAddedStatements(connectionsGroup, planeNodeWrapper)); + } + + if (!negateThisPlan && connectionsGroup.getStats().hasRemoved()) { + + PlaneNodeWrapper planeNodeWrapper = planNode -> { + PlanNode targetFilter = nodeShape.getTargetFilter(connectionsGroup, planNode); + return new ExternalFilterByQuery(connectionsGroup.getBaseConnection(), targetFilter, 0, + buildSparqlValidNodes("?this"), "?this").getFalseNode(UnBufferedPlanNode.class); + }; + + invalidValues = new UnionNode(invalidValues, + getPlanRemovedStatements(connectionsGroup, planeNodeWrapper)); + } + + if (printPlans) { + String planAsGraphvizDot = getPlanAsGraphvizDot(invalidValues, connectionsGroup); + logger.info(planAsGraphvizDot); + } + + return new EnrichWithShape(invalidValues, this); + + } + + @Override + public SourceConstraintComponent getSourceConstraintComponent() { + return SourceConstraintComponent.ValueInConstraintComponent; + } + + @Override + public String buildSparqlValidNodes(String targetVar) { + + return valueIn + .stream() + .map(value -> { + String objectVar = "?valueIn_" + UUID.randomUUID().toString().replace("-", ""); + + if (value instanceof IRI) { + return "BIND(<" + value + "> as " + objectVar + ")\n" + + getPath().getQuery(targetVar, objectVar, null); + } + if (value instanceof Literal) { + return "BIND(" + value.toString() + " as " + objectVar + ")\n" + + getPath().getQuery(targetVar, objectVar, null); + } + + throw new UnsupportedOperationException( + "value was unsupported type: " + value.getClass().getSimpleName()); + }) + .collect(Collectors.joining("} UNION {\n#VALUES_INJECTION_POINT#\n", "{\n#VALUES_INJECTION_POINT#\n", + "}")); + + } + + @Override + public Stream getStatementPatterns() { + return valueIn + .stream() + .flatMap(value -> getPath().getStatementsPatterns(new Var("?this"), + new Var(UUID.randomUUID().toString(), value))); + } + + @Override + public PlanNode getAllTargetsPlan(ConnectionsGroup connectionsGroup, boolean negated) { + PlanNode plan = nodeShape.getPlanAddedStatements(connectionsGroup, null); + plan = new UnionNode(plan, nodeShape.getPlanRemovedStatements(connectionsGroup, null)); + + Path path = getPath(); + if (path != null) { + plan = new UnionNode(plan, getPlanAddedStatements(connectionsGroup, null)); + plan = new UnionNode(plan, getPlanRemovedStatements(connectionsGroup, null)); + } + + plan = new Unique(new TrimTuple(plan, 0, 1)); + + return nodeShape.getTargetFilter(connectionsGroup, plan); + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java index ea56c80130f..797ead510e7 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java @@ -27,6 +27,7 @@ import org.apache.commons.io.IOUtils; import org.eclipse.rdf4j.IsolationLevels; +import org.eclipse.rdf4j.common.annotation.Experimental; import org.eclipse.rdf4j.common.concurrent.locks.Lock; import org.eclipse.rdf4j.common.concurrent.locks.ReadPrefReadWriteLockManager; import org.eclipse.rdf4j.model.IRI; @@ -159,9 +160,10 @@ public class ShaclSail extends NotifyingSailWrapper { private List nodeShapes = Collections.emptyList(); - private static String IMPLICIT_TARGET_CLASS_NODE_SHAPE; - private static String IMPLICIT_TARGET_CLASS_PROPERTY_SHAPE; - private static String PROPERTY_SHAPE_WITH_TARGET; + private static final String IMPLICIT_TARGET_CLASS_NODE_SHAPE; + private static final String IMPLICIT_TARGET_CLASS_PROPERTY_SHAPE; + private static final String PROPERTY_SHAPE_WITH_TARGET; + private static final String DASH_CONSTANTS; /** * an initialized {@link Repository} for storing/retrieving Shapes data @@ -185,6 +187,8 @@ public class ShaclSail extends NotifyingSailWrapper { private boolean rdfsSubClassReasoning = ShaclSailConfig.RDFS_SUB_CLASS_REASONING_DEFAULT; private boolean serializableValidation = ShaclSailConfig.SERIALIZABLE_VALIDATION_DEFAULT; private boolean performanceLogging = ShaclSailConfig.PERFORMANCE_LOGGING_DEFAULT; + private boolean shaclAdvancedFeatures = ShaclSailConfig.SHACL_ADVANCED_FEATURES_DEFAULT; + private boolean dashDataShapes = ShaclSailConfig.DASH_DATA_SHAPES_DEFAULT; static { try { @@ -194,6 +198,8 @@ public class ShaclSail extends NotifyingSailWrapper { "shacl-sparql-inference/implicitTargetClassPropertyShape.rq"); PROPERTY_SHAPE_WITH_TARGET = resourceAsString( "shacl-sparql-inference/propertyShapeWithTarget.rq"); + DASH_CONSTANTS = resourceAsString( + "shacl-sparql-inference/dashConstants.rq"); } catch (IOException e) { throw new IllegalStateException(e); } @@ -234,7 +240,8 @@ synchronized boolean usesSingleConnection() { /** * Lists the predicates that have been implemented in the ShaclSail. All of these, and all combinations, - * should work, please report any bugs. For sh:path, only single predicate paths are supported. + * should work, please report any bugs. For sh:path, only single predicate paths, or single predicate inverse + * paths are supported. sh:targetShape requires that experimental support is enabled for that feature. * * @return List of IRIs (SHACL predicates) */ @@ -266,7 +273,10 @@ public static List getSupportedShaclPredicates() { SHACL.UNIQUE_LANG, SHACL.NOT, SHACL.TARGET_OBJECTS_OF, - SHACL.INVERSE_PATH); + SHACL.HAS_VALUE, + SHACL.TARGET_PROP, + SHACL.INVERSE_PATH, + SHACL.TARGET_SHAPE); } private final AtomicBoolean initialized = new AtomicBoolean(false); @@ -323,7 +333,7 @@ List refreshShapes(SailRepositoryConnection shapesRepoConnection) thr shapesRepoCacheConnection.add(statements); } - runInferencingSparqlQueries(shapesRepoCacheConnection); + runInferencingSparqlQueriesToFixPoint(shapesRepoCacheConnection); shapesRepoCacheConnection.commit(); shapes = NodeShape.Factory.getShapes(shapesRepoCacheConnection, this); @@ -333,6 +343,24 @@ List refreshShapes(SailRepositoryConnection shapesRepoConnection) thr return shapes; } + private void forceRefreshShapes() { + Lock writeLock = null; + try { + writeLock = acquireExclusiveWriteLock(null); + if (shapesRepo != null) { + try (SailRepositoryConnection shapesRepoConnection = shapesRepo.getConnection()) { + shapesRepoConnection.begin(IsolationLevels.NONE); + nodeShapes = refreshShapes(shapesRepoConnection); + shapesRepoConnection.commit(); + } + } + } finally { + if (writeLock != null) { + releaseExclusiveWriteLock(writeLock); + } + } + } + @Override public synchronized void shutDown() throws SailException { if (shapesRepo != null) { @@ -400,7 +428,7 @@ List getNodeShapes() { return nodeShapes; } - private void runInferencingSparqlQueries(SailRepositoryConnection shaclSailConnection) { + private void runInferencingSparqlQueriesToFixPoint(SailRepositoryConnection shaclSailConnection) { // performance optimisation, running the queries below is time-consuming, even if the repo is empty if (shaclSailConnection.isEmpty()) { @@ -414,6 +442,7 @@ private void runInferencingSparqlQueries(SailRepositoryConnection shaclSailConne shaclSailConnection.prepareUpdate(IMPLICIT_TARGET_CLASS_PROPERTY_SHAPE).execute(); shaclSailConnection.prepareUpdate(IMPLICIT_TARGET_CLASS_NODE_SHAPE).execute(); shaclSailConnection.prepareUpdate(PROPERTY_SHAPE_WITH_TARGET).execute(); + shaclSailConnection.prepareUpdate(DASH_CONSTANTS).execute(); currentSize = shaclSailConnection.size(); } while (prevSize != currentSize); @@ -461,7 +490,7 @@ Lock releaseExclusiveWriteLock(Lock lock) { return null; } - Lock acquireReadlock() { + Lock acquireReadLock() { if (threadHoldingWriteLock == Thread.currentThread()) { throw new SailConflictException( "Deadlock detected when a single thread uses multiple connections " + @@ -476,7 +505,7 @@ Lock acquireReadlock() { } - Lock releaseReadlock(Lock lock) { + Lock releaseReadLock(Lock lock) { assert lock != null; lock.release(); @@ -498,7 +527,6 @@ Lock releaseReadlock(Lock lock) { // } // } // -// System.out.println("convertToReadLock"); // return readLock; // // @@ -553,8 +581,11 @@ public void setLogValidationViolations(boolean logValidationViolations) { * make such NodeShapes wildcard shapes and validate all subjects. Equivalent to setting sh:targetClass to owl:Thing * or rdfs:Resource in an environment with a reasoner. * + * Deprecated in favour of: dash:AllSubjectsTarget + * * @param undefinedTargetValidatesAllSubjects default false */ + @Deprecated public void setUndefinedTargetValidatesAllSubjects(boolean undefinedTargetValidatesAllSubjects) { this.undefinedTargetValidatesAllSubjects = undefinedTargetValidatesAllSubjects; } @@ -562,9 +593,12 @@ public void setUndefinedTargetValidatesAllSubjects(boolean undefinedTargetValida /** * Check if {@link NodeShape}s without a defined target are considered wildcards. * + * Deprecated in favour of: dash:AllSubjectsTarget + * * @return true if enabled, false otherwise * @see #setUndefinedTargetValidatesAllSubjects(boolean) */ + @Deprecated public boolean isUndefinedTargetValidatesAllSubjects() { return this.undefinedTargetValidatesAllSubjects; } @@ -629,6 +663,7 @@ public void disableValidation() { * Enabled the SHACL validation on commit() */ public void enableValidation() { + forceRefreshShapes(); this.validationEnabled = true; } @@ -650,15 +685,25 @@ public boolean isLogValidationPlans() { return this.logValidationPlans; } + /** + * Deprecated since 3.3.0 and planned removed! + * + * @return + */ + @Deprecated public boolean isIgnoreNoShapesLoadedException() { return this.ignoreNoShapesLoadedException; } /** + * + * Deprecated since 3.3.0 and planned removed! + * * Check if shapes have been loaded into the shapes graph before other data is added * * @param ignoreNoShapesLoadedException */ + @Deprecated public void setIgnoreNoShapesLoadedException(boolean ignoreNoShapesLoadedException) { this.ignoreNoShapesLoadedException = ignoreNoShapesLoadedException; } @@ -764,4 +809,58 @@ private void startMonitoring(ReferenceQueue referenceQueue, Reference // this is a soft operation, the thread pool will actually wait until the task above has completed ex.shutdown(); } + + /** + * Support for SHACL Advanced Features W3C Working Group Note (https://www.w3.org/TR/shacl-af/). Enabling this + * currently enables support for sh:targetShape. + * + * EXPERIMENTAL! + * + * @param shaclAdvancedFeatures true to enable (default: false) + */ + @Experimental + public void setShaclAdvancedFeatures(boolean shaclAdvancedFeatures) { + this.shaclAdvancedFeatures = shaclAdvancedFeatures; + forceRefreshShapes(); + } + + /** + * Support for SHACL Advanced Features W3C Working Group Note (https://www.w3.org/TR/shacl-af/). Enabling this + * currently enables support for sh:targetShape. + * + * EXPERIMENTAL! + * + * @return true if enabled + */ + @Experimental + public boolean isShaclAdvancedFeatures() { + return shaclAdvancedFeatures; + } + + /** + * Support for DASH Data Shapes Vocabulary Unofficial Draft (http://datashapes.org/dash). Currently this enables + * support for dash:valueIn, dash:AllObjectsTarget and and dash:AllSubjectsTarget. + * + * EXPERIMENTAL! + * + * @param dashDataShapes true to enable (default: false) + */ + @Experimental + public void setDashDataShapes(boolean dashDataShapes) { + this.dashDataShapes = dashDataShapes; + forceRefreshShapes(); + } + + /** + * Support for DASH Data Shapes Vocabulary Unofficial Draft (http://datashapes.org/dash). Currently this enables + * support for dash:valueIn, dash:AllObjectsTarget and dash:AllSubjectsTarget. + * + * EXPERIMENTAL! + * + * @return true if enabled + */ + @Experimental + public boolean isDashDataShapes() { + return dashDataShapes; + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java index 20affa544d4..db066d3c9f5 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java @@ -569,7 +569,7 @@ public void prepare() throws SailException { } } else { if (!(writeLock != null && writeLock.isActive())) { - readLock = sail.acquireReadlock(); + readLock = sail.acquireReadLock(); } } @@ -638,7 +638,7 @@ public void prepare() throws SailException { } finally { if (readLock != null) { - readLock = sail.releaseReadlock(readLock); + readLock = sail.releaseReadLock(readLock); } assert readLock == null; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java index f3135006bf1..3170057af46 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java @@ -9,6 +9,7 @@ package org.eclipse.rdf4j.sail.shacl; import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.vocabulary.DASH; import org.eclipse.rdf4j.model.vocabulary.SHACL; public enum SourceConstraintComponent { @@ -27,6 +28,8 @@ public enum SourceConstraintComponent { MinInclusiveConstraintComponent(SHACL.MIN_INCLUSIVE_CONSTRAINT_COMPONENT), ClassConstraintComponent(SHACL.CLASS_CONSTRAINT_COMPONENT), InConstraintComponent(SHACL.IN_CONSTRAINT_COMPONENT), + HasValueConstraintComponent(SHACL.HAS_VALUE_CONSTRAINT_COMPONENT), + ValueInConstraintComponent(DASH.ValueInConstraintComponent), UniqueLangConstraintComponent(SHACL.UNIQUE_LANG_CONSTRAINT_COMPONENT), AndConstraintComponent(SHACL.AND_CONSTRAINT_COMPONENT), NotConstraintComponent(SHACL.NOT_CONSTRAINT_COMPONENT); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/VerySimpleRdfsBackwardsChainingConnection.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/VerySimpleRdfsBackwardsChainingConnection.java index 2c2173276b3..7bb072caec1 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/VerySimpleRdfsBackwardsChainingConnection.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/VerySimpleRdfsBackwardsChainingConnection.java @@ -11,6 +11,8 @@ import java.util.HashSet; import java.util.Set; +import org.eclipse.rdf4j.common.annotation.Experimental; +import org.eclipse.rdf4j.common.annotation.InternalUseOnly; import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.common.iteration.LookAheadIteration; import org.eclipse.rdf4j.common.iteration.UnionIteration; @@ -28,7 +30,10 @@ * Very simple RDFS backwardschaining connection that supports type inference on hasStatement and getStatement. It does * not support inference for SPARQL queries. */ -class VerySimpleRdfsBackwardsChainingConnection extends SailConnectionWrapper { +@Experimental +@Deprecated +@InternalUseOnly +public class VerySimpleRdfsBackwardsChainingConnection extends SailConnectionWrapper { private final RdfsSubClassOfReasoner rdfsSubClassOfReasoner; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java index da37a5aa441..415fd617300 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java @@ -20,6 +20,7 @@ import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.VALIDATION_ENABLED; +import org.eclipse.rdf4j.common.annotation.Experimental; import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.impl.BooleanLiteral; @@ -47,6 +48,8 @@ public class ShaclSailConfig extends AbstractDelegatingSailImplConfig { public static final boolean RDFS_SUB_CLASS_REASONING_DEFAULT = true; public static final boolean PERFORMANCE_LOGGING_DEFAULT = false; public static final boolean SERIALIZABLE_VALIDATION_DEFAULT = true; + public static final boolean SHACL_ADVANCED_FEATURES_DEFAULT = false; + public static final boolean DASH_DATA_SHAPES_DEFAULT = false; private boolean parallelValidation = PARALLEL_VALIDATION_DEFAULT; private boolean undefinedTargetValidatesAllSubjects = UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS_DEFAULT; @@ -59,6 +62,8 @@ public class ShaclSailConfig extends AbstractDelegatingSailImplConfig { private boolean rdfsSubClassReasoning = RDFS_SUB_CLASS_REASONING_DEFAULT; private boolean performanceLogging = PERFORMANCE_LOGGING_DEFAULT; private boolean serializableValidation = SERIALIZABLE_VALIDATION_DEFAULT; + private boolean shaclAdvancedFeatures = SHACL_ADVANCED_FEATURES_DEFAULT; + private boolean dashDataShapes = DASH_DATA_SHAPES_DEFAULT; public ShaclSailConfig() { super(ShaclSailFactory.SAIL_TYPE); @@ -68,70 +73,74 @@ public ShaclSailConfig(SailImplConfig delegate) { super(ShaclSailFactory.SAIL_TYPE, delegate); } + @Deprecated public boolean isUndefinedTargetValidatesAllSubjects() { return undefinedTargetValidatesAllSubjects; } + @Deprecated + public void setUndefinedTargetValidatesAllSubjects(boolean undefinedTargetValidatesAllSubjects) { + this.undefinedTargetValidatesAllSubjects = undefinedTargetValidatesAllSubjects; + } + public boolean isLogValidationPlans() { return logValidationPlans; } + public void setLogValidationPlans(boolean logValidationPlans) { + this.logValidationPlans = logValidationPlans; + } + public boolean isLogValidationViolations() { return logValidationViolations; } + public void setLogValidationViolations(boolean logValidationViolations) { + this.logValidationViolations = logValidationViolations; + } + public boolean isGlobalLogValidationExecution() { return globalLogValidationExecution; } + public void setGlobalLogValidationExecution(boolean globalLogValidationExecution) { + this.globalLogValidationExecution = globalLogValidationExecution; + } + + @Deprecated public boolean isIgnoreNoShapesLoadedException() { return ignoreNoShapesLoadedException; } + @Deprecated + public void setIgnoreNoShapesLoadedException(boolean ignoreNoShapesLoadedException) { + this.ignoreNoShapesLoadedException = ignoreNoShapesLoadedException; + } + public boolean isValidationEnabled() { return validationEnabled; } - public boolean isParallelValidation() { - return parallelValidation; + public void setValidationEnabled(boolean validationEnabled) { + this.validationEnabled = validationEnabled; } - public boolean isCacheSelectNodes() { - return cacheSelectNodes; + public boolean isParallelValidation() { + return parallelValidation; } public void setParallelValidation(boolean parallelValidation) { this.parallelValidation = parallelValidation; } - public void setUndefinedTargetValidatesAllSubjects(boolean undefinedTargetValidatesAllSubjects) { - this.undefinedTargetValidatesAllSubjects = undefinedTargetValidatesAllSubjects; - } - - public void setLogValidationPlans(boolean logValidationPlans) { - this.logValidationPlans = logValidationPlans; - } - - public void setLogValidationViolations(boolean logValidationViolations) { - this.logValidationViolations = logValidationViolations; - } - - public void setIgnoreNoShapesLoadedException(boolean ignoreNoShapesLoadedException) { - this.ignoreNoShapesLoadedException = ignoreNoShapesLoadedException; - } - - public void setValidationEnabled(boolean validationEnabled) { - this.validationEnabled = validationEnabled; + public boolean isCacheSelectNodes() { + return cacheSelectNodes; } public void setCacheSelectNodes(boolean cacheSelectNodes) { this.cacheSelectNodes = cacheSelectNodes; } - public void setGlobalLogValidationExecution(boolean globalLogValidationExecution) { - this.globalLogValidationExecution = globalLogValidationExecution; - } - public boolean isRdfsSubClassReasoning() { return rdfsSubClassReasoning; } @@ -156,6 +165,26 @@ public void setSerializableValidation(boolean serializableValidation) { this.serializableValidation = serializableValidation; } + @Experimental + public boolean isShaclAdvancedFeatures() { + return shaclAdvancedFeatures; + } + + @Experimental + public void setShaclAdvancedFeatures(boolean shaclAdvancedFeatures) { + this.shaclAdvancedFeatures = shaclAdvancedFeatures; + } + + @Experimental + public boolean isDashDataShapes() { + return dashDataShapes; + } + + @Experimental + public void setDashDataShapes(boolean dashDataShapes) { + this.dashDataShapes = dashDataShapes; + } + @Override public Resource export(Model m) { Resource implNode = super.export(m); @@ -173,6 +202,8 @@ public Resource export(Model m) { m.add(implNode, RDFS_SUB_CLASS_REASONING, BooleanLiteral.valueOf(isRdfsSubClassReasoning())); m.add(implNode, PERFORMANCE_LOGGING, BooleanLiteral.valueOf(isPerformanceLogging())); m.add(implNode, SERIALIZABLE_VALIDATION, BooleanLiteral.valueOf(isSerializableValidation())); + m.add(implNode, ShaclSailSchema.SHACL_ADVANCED_FEATURES, BooleanLiteral.valueOf(isShaclAdvancedFeatures())); + m.add(implNode, ShaclSailSchema.DASH_DATA_SHAPES, BooleanLiteral.valueOf(isDashDataShapes())); return implNode; } @@ -183,26 +214,43 @@ public void parse(Model m, Resource implNode) throws SailConfigException { try { Models.objectLiteral(m.getStatements(implNode, PARALLEL_VALIDATION, null)) .ifPresent(l -> setParallelValidation(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS, null)) .ifPresent(l -> setUndefinedTargetValidatesAllSubjects(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, LOG_VALIDATION_PLANS, null)) .ifPresent(l -> setLogValidationPlans(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, LOG_VALIDATION_VIOLATIONS, null)) .ifPresent(l -> setLogValidationViolations(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, IGNORE_NO_SHAPES_LOADED_EXCEPTION, null)) .ifPresent(l -> setIgnoreNoShapesLoadedException(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, VALIDATION_ENABLED, null)) .ifPresent(l -> setValidationEnabled(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, CACHE_SELECT_NODES, null)) .ifPresent(l -> setCacheSelectNodes(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, GLOBAL_LOG_VALIDATION_EXECUTION, null)) .ifPresent(l -> setGlobalLogValidationExecution(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, RDFS_SUB_CLASS_REASONING, null)) .ifPresent(l -> setRdfsSubClassReasoning(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, PERFORMANCE_LOGGING, null)) .ifPresent(l -> setPerformanceLogging(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, SERIALIZABLE_VALIDATION, null)) .ifPresent(l -> setSerializableValidation(l.booleanValue())); + + Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.SHACL_ADVANCED_FEATURES, null)) + .ifPresent(l -> setShaclAdvancedFeatures(l.booleanValue())); + + Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.DASH_DATA_SHAPES, null)) + .ifPresent(l -> setDashDataShapes(l.booleanValue())); + } catch (IllegalArgumentException e) { throw new SailConfigException("error parsing Sail configuration", e); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java index 748b3243815..636f1204941 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java @@ -64,6 +64,8 @@ public Sail getSail(SailImplConfig config) throws SailConfigException { sail.setPerformanceLogging(shaclSailConfig.isPerformanceLogging()); sail.setSerializableValidation(shaclSailConfig.isSerializableValidation()); sail.setRdfsSubClassReasoning(shaclSailConfig.isRdfsSubClassReasoning()); + sail.setShaclAdvancedFeatures(shaclSailConfig.isShaclAdvancedFeatures()); + sail.setDashDataShapes(shaclSailConfig.isDashDataShapes()); } return sail; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java index f2047fae6aa..514b8d748d7 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java @@ -55,6 +55,10 @@ public class ShaclSailSchema { /** http://rdf4j.org/config/sail/shacl#serializableValidation */ public final static IRI SERIALIZABLE_VALIDATION = create("serializableValidation"); + public final static IRI SHACL_ADVANCED_FEATURES = create("shaclAdvancedFeatures"); + + public final static IRI DASH_DATA_SHAPES = create("dashDataShapes"); + private static IRI create(String localName) { return SimpleValueFactory.getInstance().createIRI(NAMESPACE, localName); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java index dd7299dd06b..de54f9bce61 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java @@ -10,16 +10,21 @@ import java.util.ArrayDeque; import java.util.Collections; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.query.BindingSet; +import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.algebra.BindingSetAssignment; import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor; +import org.eclipse.rdf4j.query.explanation.Explanation; import org.eclipse.rdf4j.query.impl.ListBindingSet; import org.eclipse.rdf4j.query.impl.MapBindingSet; import org.eclipse.rdf4j.query.parser.ParsedQuery; +import org.eclipse.rdf4j.query.parser.QueryParserFactory; +import org.eclipse.rdf4j.query.parser.QueryParserRegistry; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; @@ -28,6 +33,16 @@ abstract class AbstractBulkJoinPlanNode implements PlanNode { protected String[] variables; ValidationExecutionLogger validationExecutionLogger; + ParsedQuery parseQuery(String query) { + QueryParserFactory queryParserFactory = QueryParserRegistry.getInstance().get(QueryLanguage.SPARQL).get(); + + // #VALUES_INJECTION_POINT# is an annotation in the query where there is a "new scope" due to the bottom up + // semantics of SPARQL but where we don't actually want a new scope. + query = query.replace("#VALUES_INJECTION_POINT#", "\nVALUES (?a) {}\n"); + String completeQuery = "select * where { \nVALUES (?a) {}\n" + query + "\n}\nORDER BY ?a"; + return queryParserFactory.getParser().parseQuery(completeQuery, null); + } + void runQuery(ArrayDeque left, ArrayDeque right, SailConnection connection, ParsedQuery parsedQuery, boolean skipBasedOnPreviousConnection, SailConnection previousStateConnection, String[] variables) { @@ -43,6 +58,9 @@ void runQuery(ArrayDeque left, ArrayDeque right, SailConnection co private static void executeQuery(ArrayDeque right, SailConnection connection, ParsedQuery parsedQuery, String[] variables) { +// Explanation explain = connection.explain(Explanation.Level.Timed, parsedQuery.getTupleExpr(), parsedQuery.getDataset(), new MapBindingSet(), true, 10000); +// System.out.println(explain); + try (Stream stream = connection .evaluate(parsedQuery.getTupleExpr(), parsedQuery.getDataset(), new MapBindingSet(), true) .stream()) { @@ -55,12 +73,19 @@ private static void executeQuery(ArrayDeque right, SailConnection connect private void updateQuery(ParsedQuery parsedQuery, List newBindindingset) { try { + parsedQuery.getTupleExpr() - .visitChildren(new AbstractQueryModelVisitor() { + .visit(new AbstractQueryModelVisitor() { @Override - public void meet(BindingSetAssignment node) { - node.setBindingSets(newBindindingset); + public void meet(BindingSetAssignment node) throws Exception { + Set bindingNames = node.getBindingNames(); + if (bindingNames.size() == 1 && bindingNames.contains("a")) { + node.setBindingSets(newBindindingset); + } + + super.meet(node); } + }); } catch (Exception e) { throw new RuntimeException(e); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BufferedSplitter.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BufferedSplitter.java index 77e793963d1..2075b577843 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BufferedSplitter.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BufferedSplitter.java @@ -32,7 +32,6 @@ public class BufferedSplitter implements PlanNodeProvider { PlanNode parent; private List tuplesBuffer; - private BufferedSplitter that = this; public BufferedSplitter(PlanNode planNode) { parent = planNode; @@ -59,7 +58,6 @@ public PlanNode getPlanNode() { private boolean printed = false; private ValidationExecutionLogger validationExecutionLogger; - PlanNode that = this; @Override public CloseableIteration iterator() { @@ -116,7 +114,7 @@ public void getPlanAsGraphvizDot(StringBuilder stringBuilder) { @Override public String getId() { - return System.identityHashCode(that) + ""; + return System.identityHashCode(BufferedSplitter.this) + ""; } @Override diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java index 9c8020ed599..2e2b93ddbd3 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java @@ -15,6 +15,7 @@ import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.algebra.evaluation.util.ValueComparator; import org.eclipse.rdf4j.query.parser.ParsedQuery; +import org.eclipse.rdf4j.query.parser.ParsedTupleQuery; import org.eclipse.rdf4j.query.parser.QueryParserUtil; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.SailException; @@ -43,8 +44,7 @@ public BulkedExternalInnerJoin(PlanNode leftNode, SailConnection connection, Str boolean skipBasedOnPreviousConnection, SailConnection previousStateConnection, String... variables) { this.leftNode = leftNode; - String completeQuery = "select * where { VALUES (?a) {}" + query + "} order by ?a"; - parsedQuery = QueryParserUtil.parseTupleQuery(QueryLanguage.SPARQL, completeQuery, null); + parsedQuery = parseQuery(query); this.connection = connection; this.skipBasedOnPreviousConnection = skipBasedOnPreviousConnection; @@ -57,13 +57,13 @@ public BulkedExternalInnerJoin(PlanNode leftNode, SailConnection connection, Str public CloseableIteration iterator() { return new LoggingCloseableIteration(this, validationExecutionLogger) { - ArrayDeque left = new ArrayDeque<>(); + final ArrayDeque left = new ArrayDeque<>(); - ArrayDeque right = new ArrayDeque<>(); + final ArrayDeque right = new ArrayDeque<>(); - ArrayDeque joined = new ArrayDeque<>(); + final ArrayDeque joined = new ArrayDeque<>(); - CloseableIteration leftNodeIterator = leftNode.iterator(); + final CloseableIteration leftNodeIterator = leftNode.iterator(); private void calculateNext() { @@ -86,6 +86,12 @@ private void calculateNext() { Tuple rightPeek = right.peekLast(); + assert leftPeek != null; + assert rightPeek != null; + + assert leftPeek.getLine() != null; + assert rightPeek.getLine() != null; + if (rightPeek.getLine().get(0) == leftPeek.getLine().get(0) || rightPeek.getLine().get(0).equals(leftPeek.getLine().get(0))) { // we have a join ! diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java index 333cfb187c3..89e618bc142 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java @@ -38,9 +38,7 @@ public class BulkedExternalLeftOuterJoin extends AbstractBulkJoinPlanNode { public BulkedExternalLeftOuterJoin(PlanNode leftNode, SailConnection connection, String query, boolean skipBasedOnPreviousConnection, SailConnection previousStateConnection, String... variables) { this.leftNode = leftNode; - QueryParserFactory queryParserFactory = QueryParserRegistry.getInstance().get(QueryLanguage.SPARQL).get(); - parsedQuery = queryParserFactory.getParser() - .parseQuery("select * where { VALUES (?a) {}" + query + "} order by ?a", null); + parsedQuery = parseQuery(query); this.connection = connection; this.skipBasedOnPreviousConnection = skipBasedOnPreviousConnection; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/DebugPlanNode.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/DebugPlanNode.java new file mode 100644 index 00000000000..6d40b38cf5e --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/DebugPlanNode.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl.planNodes; + +import org.apache.commons.text.StringEscapeUtils; +import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.sail.SailException; + +/** + * Used for adding a custom log statement to tuples as they pass through. Should only be used for debugging. + */ +public class DebugPlanNode implements PlanNode { + + private final String message; + PlanNode parent; + private boolean printed; + private ValidationExecutionLogger validationExecutionLogger; + + public DebugPlanNode(PlanNode parent, String message) { + this.parent = parent; + this.message = message; + } + + @Override + public CloseableIteration iterator() { + + return new CloseableIteration() { + + final CloseableIteration iterator = parent.iterator(); + + @Override + public boolean hasNext() throws SailException { + return iterator.hasNext(); + } + + @Override + public Tuple next() throws SailException { + Tuple next = iterator.next(); + validationExecutionLogger.log(depth(), message, next, DebugPlanNode.this, getId()); + return next; + } + + @Override + public void remove() throws SailException { + iterator.remove(); + } + + @Override + public void close() throws SailException { + iterator.close(); + } + }; + + } + + @Override + public int depth() { + return parent.depth() + 1; + } + + @Override + public void getPlanAsGraphvizDot(StringBuilder stringBuilder) { + if (printed) { + return; + } + printed = true; + stringBuilder.append(getId() + " [label=\"" + StringEscapeUtils.escapeJava(this.toString()) + "\"];") + .append("\n"); + stringBuilder.append(parent.getId() + " -> " + getId()).append("\n"); + parent.getPlanAsGraphvizDot(stringBuilder); + } + + @Override + public String getId() { + return System.identityHashCode(this) + ""; + } + + @Override + public String toString() { + return "DebugPlanNode"; + } + + @Override + public IteratorData getIteratorDataType() { + return parent.getIteratorDataType(); + } + + @Override + public void receiveLogger(ValidationExecutionLogger validationExecutionLogger) { + this.validationExecutionLogger = validationExecutionLogger; + parent.receiveLogger(validationExecutionLogger); + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByPredicate.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByPredicate.java index 07545974c52..95e7067b3a9 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByPredicate.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByPredicate.java @@ -53,7 +53,7 @@ public CloseableIteration iterator() { Tuple next = null; - CloseableIteration parentIterator = parent.iterator(); + final CloseableIteration parentIterator = parent.iterator(); void calculateNext() { while (next == null && parentIterator.hasNext()) { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByQuery.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByQuery.java new file mode 100644 index 00000000000..a367970af3d --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterByQuery.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.planNodes; + +import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.query.BindingSet; +import org.eclipse.rdf4j.query.MalformedQueryException; +import org.eclipse.rdf4j.query.QueryEvaluationException; +import org.eclipse.rdf4j.query.QueryLanguage; +import org.eclipse.rdf4j.query.impl.MapBindingSet; +import org.eclipse.rdf4j.query.parser.ParsedQuery; +import org.eclipse.rdf4j.query.parser.QueryParserFactory; +import org.eclipse.rdf4j.query.parser.QueryParserRegistry; +import org.eclipse.rdf4j.sail.SailConnection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Håvard Ottestad + */ +public class ExternalFilterByQuery extends FilterPlanNode { + + static private final Logger logger = LoggerFactory.getLogger(ExternalFilterByQuery.class); + + private final SailConnection connection; + private final int index; + private final ParsedQuery query; + private final String queryVariable; + private final String bindingVariable; + + public ExternalFilterByQuery(SailConnection connection, PlanNode parent, int index, String queryFragment, + String queryVariable) { + super(parent); + this.connection = connection; + this.index = index; + this.queryVariable = queryVariable; + this.bindingVariable = queryVariable.substring(1); + + assert queryVariable.startsWith("?"); + assert !bindingVariable.startsWith("?"); + + QueryParserFactory queryParserFactory = QueryParserRegistry.getInstance() + .get(QueryLanguage.SPARQL) + .get(); + + queryFragment = "SELECT " + queryVariable + " WHERE {\n" + queryFragment + "\n}"; + try { + this.query = queryParserFactory.getParser().parseQuery(queryFragment, null); + } catch (MalformedQueryException e) { + logger.error("Malformed query: \n{}", queryFragment); + throw e; + } + + } + + @Override + boolean checkTuple(Tuple t) { + + Value value = t.getLine().get(index); + + MapBindingSet bindings = new MapBindingSet(); + + bindings.addBinding(bindingVariable, value); + + try (CloseableIteration bindingSet = connection.evaluate( + query.getTupleExpr(), query.getDataset(), + bindings, false)) { + return bindingSet.hasNext(); + } + + } + + @Override + public String toString() { + return "ExternalFilterByQuery{" + + "index=" + index + + ", query=" + query + + ", queryVariable='" + queryVariable + '\'' + + '}'; + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterIsObject.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterIsObject.java new file mode 100644 index 00000000000..11f0b1cfb2a --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterIsObject.java @@ -0,0 +1,43 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.planNodes; + +import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.sail.SailConnection; + +/** + * @author Håvard Ottestad + */ +public class ExternalFilterIsObject extends FilterPlanNode { + + private final SailConnection connection; + private final int index; + + public ExternalFilterIsObject(SailConnection connection, PlanNode parent, int index) { + super(parent); + this.connection = connection; + this.index = index; + } + + @Override + boolean checkTuple(Tuple t) { + + Value value = t.getLine().get(index); + + return connection.hasStatement(null, null, value, true); + + } + + @Override + public String toString() { + return "ExternalFilterIsObject{" + + "index=" + index + + '}'; + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterIsSubject.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterIsSubject.java new file mode 100644 index 00000000000..e78cf444263 --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalFilterIsSubject.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.planNodes; + +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.sail.SailConnection; + +/** + * @author Håvard Ottestad + */ +public class ExternalFilterIsSubject extends FilterPlanNode { + + private final SailConnection connection; + private final int index; + + public ExternalFilterIsSubject(SailConnection connection, PlanNode parent, int index) { + super(parent); + this.connection = connection; + this.index = index; + } + + @Override + boolean checkTuple(Tuple t) { + + Value value = t.getLine().get(index); + + if (value instanceof Resource) { + return connection.hasStatement((Resource) value, null, null, true); + } else + return false; + + } + + @Override + public String toString() { + return "ExternalFilterIsSubject{" + + "index=" + index + + '}'; + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalTypeFilterNode.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalPredicateObjectFilter.java similarity index 76% rename from core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalTypeFilterNode.java rename to core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalPredicateObjectFilter.java index 0507c60d08a..20e3d651e5a 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalTypeFilterNode.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ExternalPredicateObjectFilter.java @@ -13,9 +13,9 @@ import org.apache.commons.text.StringEscapeUtils; import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.vocabulary.RDF; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.memory.MemoryStoreConnection; @@ -24,20 +24,23 @@ /** * @author Håvard Ottestad */ -public class ExternalTypeFilterNode implements PlanNode { +public class ExternalPredicateObjectFilter implements PlanNode { - private SailConnection connection; - private Set filterOnType; + private final SailConnection connection; + private final Set filterOnObject; + private final IRI filterOnPredicate; PlanNode parent; int index = 0; private final boolean returnMatching; private boolean printed = false; private ValidationExecutionLogger validationExecutionLogger; - public ExternalTypeFilterNode(SailConnection connection, Set filterOnType, PlanNode parent, int index, + public ExternalPredicateObjectFilter(SailConnection connection, IRI filterOnPredicate, Set filterOnObject, + PlanNode parent, int index, boolean returnMatching) { this.connection = connection; - this.filterOnType = filterOnType; + this.filterOnPredicate = filterOnPredicate; + this.filterOnObject = filterOnObject; this.parent = parent; this.index = index; this.returnMatching = returnMatching; @@ -45,13 +48,12 @@ public ExternalTypeFilterNode(SailConnection connection, Set filterOnT @Override public CloseableIteration iterator() { - PlanNode that = this; return new LoggingCloseableIteration(this, validationExecutionLogger) { Tuple next = null; - CloseableIteration parentIterator = parent.iterator(); + final CloseableIteration parentIterator = parent.iterator(); void calculateNext() { while (next == null && parentIterator.hasNext()) { @@ -64,11 +66,13 @@ void calculateNext() { if (returnMatching) { if (matchedType != null) { next = temp; - next.addHistory(new Tuple(Arrays.asList(subject, RDF.TYPE, matchedType))); + next.addHistory(new Tuple(Arrays.asList(subject, filterOnPredicate, matchedType))); } else { if (GlobalValidationExecutionLogging.loggingEnabled) { validationExecutionLogger.log(depth(), - that.getClass().getSimpleName() + ":IgnoredAsTypeMismatch", temp, that, + ExternalPredicateObjectFilter.this.getClass().getSimpleName() + + ":IgnoredAsTypeMismatch", + temp, ExternalPredicateObjectFilter.this, getId()); } } @@ -79,7 +83,9 @@ void calculateNext() { } else { if (GlobalValidationExecutionLogging.loggingEnabled) { validationExecutionLogger.log(depth(), - that.getClass().getSimpleName() + ":IgnoredAsTypeMismatch", temp, that, + ExternalPredicateObjectFilter.this.getClass().getSimpleName() + + ":IgnoredAsTypeMismatch", + temp, ExternalPredicateObjectFilter.this, getId()); } } @@ -90,8 +96,8 @@ void calculateNext() { private Resource isType(Value subject) { if (subject instanceof Resource) { - return filterOnType.stream() - .filter(type -> connection.hasStatement((Resource) subject, RDF.TYPE, type, true)) + return filterOnObject.stream() + .filter(type -> connection.hasStatement((Resource) subject, filterOnPredicate, type, true)) .findFirst() .orElse(null); } @@ -154,8 +160,11 @@ public void getPlanAsGraphvizDot(StringBuilder stringBuilder) { @Override public String toString() { - return "ExternalTypeFilterNode{" + "filterOnType=" - + Arrays.toString(filterOnType.stream().map(Formatter::prefix).toArray()) + '}'; + return "ExternalPredicateObjectFilter{" + + ", filterOnPredicate=" + filterOnPredicate + + "filterOnObject=" + Arrays.toString(filterOnObject.stream().map(Formatter::prefix).toArray()) + + ", index=" + index + + '}'; } @Override diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/FilterPlanNode.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/FilterPlanNode.java index 5645dbb9bd6..38c761c3828 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/FilterPlanNode.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/FilterPlanNode.java @@ -67,7 +67,10 @@ public PlanNode getFalseNode(Class type) { @Override public CloseableIteration iterator() { - FilterPlanNode that = this; + throw new IllegalStateException("Must specify if filter should return false or true nodes!"); + } + + private CloseableIteration iteratorInternal() { return new CloseableIteration() { @@ -92,8 +95,9 @@ private void calculateNext() { trueNode.push(temp); } else { if (GlobalValidationExecutionLogging.loggingEnabled) { - validationExecutionLogger.log(that.depth(), - that.getClass().getSimpleName() + ":IgnoredAsTrue.next()", temp, that, getId()); + validationExecutionLogger.log(FilterPlanNode.this.depth(), + FilterPlanNode.this.getClass().getSimpleName() + ":IgnoredAsTrue.next()", temp, + FilterPlanNode.this, getId()); } } } else { @@ -101,8 +105,9 @@ private void calculateNext() { falseNode.push(temp); } else { if (GlobalValidationExecutionLogging.loggingEnabled) { - validationExecutionLogger.log(that.depth(), - that.getClass().getSimpleName() + ":IgnoredAsFalse.next()", temp, that, + validationExecutionLogger.log(FilterPlanNode.this.depth(), + FilterPlanNode.this.getClass().getSimpleName() + ":IgnoredAsFalse.next()", temp, + FilterPlanNode.this, getId()); } } @@ -185,7 +190,7 @@ public String getId() { @Override public void init() { if (iterator == null) { - iterator = iterator(); + iterator = iteratorInternal(); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/InnerJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/InnerJoin.java index b12dc5e5a23..5bc71ea67f7 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/InnerJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/InnerJoin.java @@ -92,11 +92,10 @@ public CloseableIteration iterator() { public CloseableIteration internalIterator() { - InnerJoin that = this; return new CloseableIteration() { - CloseableIteration leftIterator = left.iterator(); - CloseableIteration rightIterator = right.iterator(); + final CloseableIteration leftIterator = left.iterator(); + final CloseableIteration rightIterator = right.iterator(); Tuple next; Tuple nextLeft; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Select.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Select.java index d3a1ddad23c..dd67044c63e 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Select.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Select.java @@ -43,6 +43,15 @@ public class Select implements PlanNode { public Select(SailConnection connection, String query, String... variables) { assert variables.length > 0; this.connection = connection; + if (query.trim().equals("")) { + logger.error("Query is empty", new Throwable("This throwable is just to log the stack trace")); + + // empty set + query = "" + + "?a ?c. \n" + + "FILTER (NOT EXISTS {?a ?c}) \n"; + } + this.query = "select " + String.join(" ", variables) + " where { " + query + "} order by ?a"; this.variables = variables; } @@ -51,7 +60,7 @@ public Select(SailConnection connection, String query, String... variables) { public CloseableIteration iterator() { return new LoggingCloseableIteration(this, validationExecutionLogger) { - CloseableIteration bindingSet; + final CloseableIteration bindingSet; { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/SparqlTargetSelect.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/SparqlTargetSelect.java new file mode 100644 index 00000000000..6972b5c0aef --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/SparqlTargetSelect.java @@ -0,0 +1,166 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.planNodes; + +import java.util.Objects; + +import org.apache.commons.text.StringEscapeUtils; +import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.query.BindingSet; +import org.eclipse.rdf4j.query.MalformedQueryException; +import org.eclipse.rdf4j.query.QueryEvaluationException; +import org.eclipse.rdf4j.query.QueryLanguage; +import org.eclipse.rdf4j.query.impl.MapBindingSet; +import org.eclipse.rdf4j.query.parser.ParsedQuery; +import org.eclipse.rdf4j.query.parser.QueryParserFactory; +import org.eclipse.rdf4j.query.parser.QueryParserRegistry; +import org.eclipse.rdf4j.sail.SailConnection; +import org.eclipse.rdf4j.sail.SailException; +import org.eclipse.rdf4j.sail.memory.MemoryStoreConnection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Håvard Ottestad + */ +public class SparqlTargetSelect implements PlanNode { + + private static final Logger logger = LoggerFactory.getLogger(SparqlTargetSelect.class); + + private final SailConnection connection; + + private final String query; + private final String[] variables; + private boolean printed = false; + private ValidationExecutionLogger validationExecutionLogger; + + public SparqlTargetSelect(SailConnection connection, String query) { + this.connection = connection; + this.query = query; + assert query.contains("?this") : "Query should contain ?this: " + query; + this.variables = new String[] { "?this" }; + } + + @Override + public CloseableIteration iterator() { + return new LoggingCloseableIteration(this, validationExecutionLogger) { + + final CloseableIteration bindingSet; + + { + + QueryParserFactory queryParserFactory = QueryParserRegistry.getInstance() + .get(QueryLanguage.SPARQL) + .get(); + + try { + ParsedQuery parsedQuery = queryParserFactory.getParser().parseQuery(query, null); + bindingSet = connection.evaluate(parsedQuery.getTupleExpr(), parsedQuery.getDataset(), + new MapBindingSet(), true); + } catch (MalformedQueryException e) { + logger.error("Malformed query: \n{}", query); + throw e; + } + } + + @Override + public void close() throws SailException { + bindingSet.close(); + } + + @Override + boolean localHasNext() throws SailException { + return bindingSet.hasNext(); + } + + @Override + Tuple loggingNext() throws SailException { + return new Tuple(bindingSet.next(), variables); + } + + @Override + public void remove() throws SailException { + + } + }; + } + + @Override + public int depth() { + return 0; + } + + @Override + public void getPlanAsGraphvizDot(StringBuilder stringBuilder) { + if (printed) { + return; + } + printed = true; + stringBuilder.append(getId() + " [label=\"" + StringEscapeUtils.escapeJava(this.toString()) + "\"];") + .append("\n"); + + if (connection instanceof MemoryStoreConnection) { + stringBuilder + .append(System.identityHashCode(((MemoryStoreConnection) connection).getSail()) + " -> " + getId()) + .append("\n"); + } else { + stringBuilder.append(System.identityHashCode(connection) + " -> " + getId()).append("\n"); + } + + } + + @Override + public String getId() { + return System.identityHashCode(this) + ""; + } + + @Override + public IteratorData getIteratorDataType() { + return IteratorData.tripleBased; + } + + @Override + public String toString() { + return "SparqlTargetSelect{" + "query='" + query.replace("\n", " ") + '\'' + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SparqlTargetSelect select = (SparqlTargetSelect) o; + + return Objects.equals( + connection instanceof MemoryStoreConnection ? ((MemoryStoreConnection) connection).getSail() + : connection, + select.connection instanceof MemoryStoreConnection + ? ((MemoryStoreConnection) select.connection).getSail() + : select.connection) + && query.equals(select.query); + } + + @Override + public int hashCode() { + + if (connection instanceof MemoryStoreConnection) { + return Objects.hash(System.identityHashCode(((MemoryStoreConnection) connection).getSail()), query); + } + return Objects.hash(System.identityHashCode(connection), query); + + } + + @Override + public void receiveLogger(ValidationExecutionLogger validationExecutionLogger) { + this.validationExecutionLogger = validationExecutionLogger; + } +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ModifyTuple.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleMapper.java similarity index 95% rename from core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ModifyTuple.java rename to core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleMapper.java index bab7c5c11a8..3433ca54479 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/ModifyTuple.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/TupleMapper.java @@ -13,13 +13,13 @@ import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.sail.SailException; -public class ModifyTuple implements PlanNode { +public class TupleMapper implements PlanNode { PlanNode parent; ModifyTupleInterface function; private boolean printed = false; private ValidationExecutionLogger validationExecutionLogger; - public ModifyTuple(PlanNode parent, ModifyTupleInterface function) { + public TupleMapper(PlanNode parent, ModifyTupleInterface function) { this.parent = parent; this.function = function; } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Unique.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Unique.java index 29605cac460..84c5526deaa 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Unique.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/Unique.java @@ -34,11 +34,10 @@ public Unique(PlanNode parent) { @Override public CloseableIteration iterator() { - Unique that = this; return new LoggingCloseableIteration(this, validationExecutionLogger) { - CloseableIteration parentIterator = parent.iterator(); + final CloseableIteration parentIterator = parent.iterator(); Set multiCardinalityDedupeSet; @@ -89,7 +88,8 @@ private void calculateNext() { } else { if (GlobalValidationExecutionLogging.loggingEnabled) { validationExecutionLogger.log(depth(), - that.getClass().getSimpleName() + ":IgnoredNotUnique", temp, that, getId()); + Unique.this.getClass().getSimpleName() + ":IgnoredNotUnique", temp, Unique.this, + getId()); } } diff --git a/core/sail/shacl/src/main/resources/shacl-sparql-inference/dashConstants.rq b/core/sail/shacl/src/main/resources/shacl-sparql-inference/dashConstants.rq new file mode 100644 index 00000000000..0236da3b34f --- /dev/null +++ b/core/sail/shacl/src/main/resources/shacl-sparql-inference/dashConstants.rq @@ -0,0 +1,20 @@ +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: +PREFIX dash: + +INSERT DATA { + + dash:AllSubjects + a dash:AllSubjectsTarget ; + rdfs:comment "A reusable instance of dash:AllSubjectsTarget." ; + rdfs:label "All subjects" . + + dash:AllObjects + a dash:AllObjectsTarget ; + rdfs:comment "A reusable instance of dash:AllObjectsTarget." ; + rdfs:label "All objects" . + +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java index aaec3c7face..e456da1ca58 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java @@ -67,28 +67,40 @@ abstract public class AbstractShaclTest { // @formatter:off // formatter doesn't understand that the trailing ) needs to be on a new line. - private static final List testCasePaths = Stream.of( "test-cases/and-or/datatypeNodeShape", + "test-cases/class/allObjects", + "test-cases/class/allSubjects", "test-cases/class/and", "test-cases/class/and2", + "test-cases/class/complexTargetShape", + "test-cases/class/complexTargetShape2", "test-cases/class/multipleClass", "test-cases/class/not", "test-cases/class/not2", "test-cases/class/notAnd", "test-cases/class/notNotSimple", "test-cases/class/simple", + "test-cases/class/simpleTargetShape", +// "test-cases/class/sparqlTarget", // NOT CURRENTLY SUPPORTED +// "test-cases/class/sparqlTargetNot", // NOT CURRENTLY SUPPORTED "test-cases/class/subclass", "test-cases/class/targetNode", "test-cases/class/validateTarget", "test-cases/class/validateTargetNot", "test-cases/complex/dcat", "test-cases/complex/foaf", +// "test-cases/complex/sparqlTarget", // NOT CURRENTLY SUPPORTED + "test-cases/datatype/allObjects", "test-cases/datatype/not", "test-cases/datatype/notNodeShape", + "test-cases/datatype/notNodeShapeTargetShape", + "test-cases/datatype/notTargetShape", + "test-cases/datatype/notNodeShapeAnd", "test-cases/datatype/notNot", "test-cases/datatype/notTargetNode", "test-cases/datatype/simple", +// "test-cases/datatype/sparqlTarget", // NOT CURRENTLY SUPPORTED "test-cases/datatype/targetNode", "test-cases/datatype/targetNode2", "test-cases/datatype/targetNodeLang", @@ -98,6 +110,9 @@ abstract public class AbstractShaclTest { "test-cases/deactivated/nodeshape", "test-cases/deactivated/or", "test-cases/deactivated/propertyshape", + "test-cases/functionalProperty/multipleFunctional", + "test-cases/functionalProperty/multipleFunctionalOr", + "test-cases/functionalProperty/singleFunctional", "test-cases/implicitTargetClass/simple", "test-cases/in/notAnd", "test-cases/in/notOr", @@ -108,6 +123,7 @@ abstract public class AbstractShaclTest { "test-cases/maxCount/notNot", "test-cases/maxCount/simple", "test-cases/maxCount/simpleInversePath", +// "test-cases/maxCount/sparqlTarget", // NOT CURRENTLY SUPPORTED "test-cases/maxCount/targetNode", "test-cases/maxExclusive/simple", "test-cases/maxExclusiveMinLength/not", @@ -131,11 +147,11 @@ abstract public class AbstractShaclTest { "test-cases/or/classValidateTarget", "test-cases/or/datatype", "test-cases/or/datatype2", - "test-cases/or/datatype2", "test-cases/or/datatypeDifferentPaths", "test-cases/or/datatypeNodeShape", "test-cases/or/datatypeTargetNode", "test-cases/or/implicitAnd", +// "test-cases/or/implicitAndSparqlTarget", "test-cases/or/inheritance", "test-cases/or/inheritance-deep", "test-cases/or/inheritanceNodeShape", @@ -151,9 +167,19 @@ abstract public class AbstractShaclTest { "test-cases/propertyShapeWithTarget/simple", "test-cases/uniqueLang/not", "test-cases/uniqueLang/simple", - "test-cases/functionalProperty/singleFunctional", - "test-cases/functionalProperty/multipleFunctional", - "test-cases/functionalProperty/multipleFunctionalOr" + "test-cases/hasValue/simple", + "test-cases/hasValue/and", + "test-cases/hasValue/not", + "test-cases/hasValue/not2", + "test-cases/hasValue/not2", + "test-cases/hasValue/targetNode", + "test-cases/hasValue/targetNode2", + "test-cases/valueIn/simple", + "test-cases/valueIn/and", + "test-cases/valueIn/not", + "test-cases/valueIn/not2", + "test-cases/valueIn/targetNode", + "test-cases/valueIn/targetNode2" ) .distinct() .sorted() @@ -232,16 +258,21 @@ private static Collection getTestsToRun() { List ret = new ArrayList<>(); for (String testCasePath : testCasePaths) { - for (ExpectedResult baseCase : ExpectedResult.values()) { - findTestCases(testCasePath, baseCase.name()).forEach(path -> { - for (IsolationLevel isolationLevel : Arrays.asList(IsolationLevels.NONE, IsolationLevels.SNAPSHOT, - IsolationLevels.SERIALIZABLE)) { - Object[] temp = { testCasePath, path, baseCase, isolationLevel }; - ret.add(temp); - } + List temp = new ArrayList<>(); - }); + for (ExpectedResult baseCase : ExpectedResult.values()) { + List collect = findTestCases(testCasePath, baseCase.name()) + .stream() + .flatMap(path -> Stream + .of(IsolationLevels.NONE, IsolationLevels.SNAPSHOT, IsolationLevels.SERIALIZABLE) + .map(isolationLevel -> new Object[] { testCasePath, path, baseCase, isolationLevel })) + .collect(Collectors.toList()); + + temp.addAll(collect); } + assert !temp.isEmpty() : "There were no test cases for: " + testCasePath; + ret.addAll(temp); + } return ret; @@ -280,7 +311,7 @@ static void runTestCase(String shaclPath, String dataPath, ExpectedResult expect connection.begin(isolationLevel); ValueFactory vf = connection.getValueFactory(); connection.add(vf.createBNode(), vf.createIRI("http://example.com/jkhsdfiu3r2y9fjr3u0"), - vf.createLiteral("auto-generated!"), vf.createBNode()); + vf.createLiteral("123", XSD.INTEGER), vf.createBNode()); try { connection.commit(); } catch (RepositoryException sailException) { @@ -384,14 +415,10 @@ private static void printFile(String filename) { try { System.out.println("### " + filename + " ###"); String s = IOUtils.toString(AbstractShaclTest.class.getClassLoader().getResourceAsStream(filename), - "utf-8"); - s = Arrays - .stream(s.split("\n")) - .filter(a -> !a.trim().toLowerCase().startsWith("@prefix")) - .filter(a -> !a.trim().toLowerCase().startsWith("@base")) - .filter(a -> !a.trim().toUpperCase().startsWith("PREFIX ")) - .reduce((a, b) -> a + "\n" + b) - .orElse(""); + StandardCharsets.UTF_8); + + s = removeLeadingPrefixStatements(s); + System.out.println(s); System.out.println("################################################\n"); } catch (IOException e) { @@ -399,6 +426,29 @@ private static void printFile(String filename) { } } + private static String removeLeadingPrefixStatements(String s) { + String[] split = s.split("\n"); + s = ""; + boolean skippingPrefixes = true; + + for (String s1 : split) { + if (skippingPrefixes) { + if (!(s1.trim().equals("") || + s1.trim().toLowerCase().startsWith("@prefix") || + s1.trim().toLowerCase().startsWith("@base") || + s1.trim().toLowerCase().startsWith("prefix"))) { + skippingPrefixes = false; + } + } + + if (!skippingPrefixes) { + s += s1 + "\n"; + } + + } + return s; + } + static void runTestCaseSingleTransaction(String shaclPath, String dataPath, ExpectedResult expectedResult, IsolationLevel isolationLevel) { @@ -582,10 +632,33 @@ private static SailRepository getShaclSail() { shaclSail.setParallelValidation(true); shaclSail.setLogValidationViolations(fullLogging); shaclSail.setGlobalLogValidationExecution(fullLogging); + shaclSail.setShaclAdvancedFeatures(true); + shaclSail.setDashDataShapes(true); repository.init(); return repository; } + /** + * Sort and output testCasePaths + * + * @param args + */ + public static void main(String[] args) { + + System.out.println("\n\tprivate static final List testCasePaths = Stream.of("); + String testCasesString = testCasePaths + .stream() + .map(a -> "\t\t\"" + a + "\"") + .reduce((a, b) -> a + ",\n" + b) + .orElse(""); + + System.out.println(testCasesString); + System.out.println("\t)\n" + + "\t\t.distinct()\n" + + "\t\t.sorted()\n" + + "\t\t.collect(Collectors.toList());"); + } + } diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ExtendedFeaturesetTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ExtendedFeaturesetTest.java new file mode 100644 index 00000000000..cf0970b14bd --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ExtendedFeaturesetTest.java @@ -0,0 +1,107 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl; + +import org.eclipse.rdf4j.model.BNode; +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.repository.RepositoryException; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.junit.AfterClass; +import org.junit.Test; + +/** + * @author Håvard Ottestad + */ +public class ExtendedFeaturesetTest { + + SimpleValueFactory vf = SimpleValueFactory.getInstance(); + IRI ex_knows = vf.createIRI("http://example.com/ns#knows"); + IRI ex_Person = vf.createIRI("http://example.com/ns#Person"); + + @AfterClass + public static void afterClass() { + GlobalValidationExecutionLogging.loggingEnabled = false; + } + + @Test + public void testDashIsDisabledByDefault() throws Exception { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("test-cases/class/allSubjects/shacl.ttl", + false); + + try (SailRepositoryConnection connection = shaclRepository.getConnection()) { + connection.begin(); + connection.add(vf.createBNode(), ex_knows, vf.createBNode()); + connection.commit(); + } + + } + + @Test(expected = ShaclSailValidationException.class) + public void testThatDashCanBeEnabled() throws Throwable { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("test-cases/class/allSubjects/shacl.ttl", + false); + ((ShaclSail) shaclRepository.getSail()).setDashDataShapes(true); + + try (SailRepositoryConnection connection = shaclRepository.getConnection()) { + connection.begin(); + connection.add(vf.createBNode(), ex_knows, vf.createBNode()); + try { + connection.commit(); + } catch (RepositoryException e) { + throw e.getCause(); + } + } + + } + + @Test + public void testTargetShapeIsDisabledByDefault() throws Exception { + + SailRepository shaclRepository = Utils + .getInitializedShaclRepository("test-cases/class/simpleTargetShape/shacl.ttl", false); + + try (SailRepositoryConnection connection = shaclRepository.getConnection()) { + connection.begin(); + BNode bNode = vf.createBNode(); + connection.add(bNode, RDF.TYPE, ex_Person); + connection.add(bNode, ex_knows, vf.createBNode()); + connection.commit(); + } + + } + + @Test(expected = ShaclSailValidationException.class) + public void testThatTargetShapesCanBeEnabled() throws Throwable { + + SailRepository shaclRepository = Utils + .getInitializedShaclRepository("test-cases/class/simpleTargetShape/shacl.ttl", false); + + ((ShaclSail) shaclRepository.getSail()).setDashDataShapes(true); + ((ShaclSail) shaclRepository.getSail()).setShaclAdvancedFeatures(true); + + try (SailRepositoryConnection connection = shaclRepository.getConnection()) { + connection.begin(); + BNode bNode = vf.createBNode(); + connection.add(bNode, RDF.TYPE, ex_Person); + connection.add(bNode, ex_knows, vf.createBNode()); + try { + connection.commit(); + } catch (RepositoryException e) { + throw e.getCause(); + } + } + + } + +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/AddRemoveBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/AddRemoveBenchmarkEmpty.java index a489196b1c5..31231af6b8f 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/AddRemoveBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/AddRemoveBenchmarkEmpty.java @@ -58,7 +58,7 @@ public class AddRemoveBenchmarkEmpty { } @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -77,7 +77,7 @@ public void setUp() { } } System.gc(); - + Thread.sleep(100); } @Benchmark diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/BulkedBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/BulkedBenchmark.java index 828f784a97b..5e2e3ab2ae2 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/BulkedBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/BulkedBenchmark.java @@ -94,10 +94,11 @@ public BulkedBenchmark() { } @Setup(Level.Invocation) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); System.gc(); + Thread.sleep(100); } @Benchmark diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ClassBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ClassBenchmarkEmpty.java index 71736351c15..0c0ea90b963 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ClassBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ClassBenchmarkEmpty.java @@ -24,6 +24,7 @@ import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -56,7 +57,7 @@ public class ClassBenchmarkEmpty { private List> allStatements; @Setup(Level.Invocation) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -72,7 +73,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark @@ -99,7 +100,7 @@ public void shacl() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexBenchmark.java index a789d803869..795c1cca521 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexBenchmark.java @@ -58,8 +58,8 @@ public class ComplexBenchmark { GlobalValidationExecutionLogging.loggingEnabled = false; } - private static String transaction1; - private static String transaction2; + private static final String transaction1; + private static final String transaction2; static { try { @@ -76,8 +76,9 @@ public class ComplexBenchmark { } @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { System.gc(); + Thread.sleep(100); ((Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName())) .setLevel(ch.qos.logback.classic.Level.ERROR); ((Logger) LoggerFactory.getLogger(ShaclSail.class.getName())).setLevel(ch.qos.logback.classic.Level.ERROR); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexLargeBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexLargeBenchmark.java index c8241798ed5..1c5a5416489 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexLargeBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexLargeBenchmark.java @@ -91,7 +91,7 @@ public class ComplexLargeBenchmark { private SailRepository repository; @Setup(Level.Invocation) - public void setUp() { + public void setUp() throws InterruptedException { ((Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName())) .setLevel(ch.qos.logback.classic.Level.ERROR); @@ -116,6 +116,7 @@ public void setUp() { } System.gc(); + Thread.sleep(100); } @TearDown(Level.Invocation) diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexTargetBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexTargetBenchmark.java new file mode 100644 index 00000000000..20825e3c90f --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexTargetBenchmark.java @@ -0,0 +1,147 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.benchmark; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.eclipse.rdf4j.IsolationLevels; +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.FOAF; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDFS; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; +import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; +import org.eclipse.rdf4j.sail.shacl.Utils; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.slf4j.LoggerFactory; + +import ch.qos.logback.classic.Logger; + +/** + * @author Håvard Ottestad + */ +@State(Scope.Benchmark) +@Warmup(iterations = 3) +@BenchmarkMode({ Mode.AverageTime }) +//@Fork(value = 1, jvmArgs = {"-Xms8G", "-Xmx8G", "-XX:+UseG1GC", "-XX:+UnlockCommercialFeatures", "-XX:StartFlightRecording=delay=5s,duration=60s,filename=recording.jfr,settings=profile", "-XX:FlightRecorderOptions=samplethreads=true,stackdepth=1024", "-XX:+UnlockDiagnosticVMOptions", "-XX:+DebugNonSafepoints"}) +@Fork(value = 1, jvmArgs = { "-Xms8G", "-Xmx8G", "-XX:+UseG1GC" }) +@Measurement(iterations = 3) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +public class ComplexTargetBenchmark { + { + GlobalValidationExecutionLogging.loggingEnabled = false; + } + + @Param({ "1", "1000", "100000" }) + public int existingTargets = 10; + + public String shape = "shaclDatatypeTargetFilterWithUnion.ttl"; + + public int NUMBER_OF_TRANSACTIONS = 10; + + List initialStatements = new ArrayList<>(); + + private List> transactions; + + SailRepository repository; + + @Setup(Level.Trial) + public void trialSetup() throws InterruptedException { + Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); + root.setLevel(ch.qos.logback.classic.Level.INFO); + + transactions = new ArrayList<>(NUMBER_OF_TRANSACTIONS); + + SimpleValueFactory vf = SimpleValueFactory.getInstance(); + + for (int j = 0; j < NUMBER_OF_TRANSACTIONS; j++) { + List statements = new ArrayList<>(BenchmarkConfigs.STATEMENTS_PER_TRANSACTION); + transactions.add(statements); + for (int i = 0; i < BenchmarkConfigs.STATEMENTS_PER_TRANSACTION; i++) { + IRI iri = vf.createIRI("http://example.com/transaction_" + i + "_" + j); + statements.add(vf.createStatement(iri, RDF.TYPE, RDFS.RESOURCE)); + statements.add(vf.createStatement(iri, FOAF.AGE, vf.createLiteral(i))); + + IRI iri2 = vf.createIRI("http://example.com/transaction_2" + i + "_" + j); + statements.add(vf.createStatement(iri2, RDF.TYPE, RDFS.CLASS)); + statements.add(vf.createStatement(iri2, FOAF.AGE, vf.createLiteral(i))); + + } + } + + for (int j = 0; j < existingTargets; j++) { + IRI iri = vf.createIRI("http://example.com/base_" + j); + initialStatements.add(vf.createStatement(iri, RDF.TYPE, RDFS.RESOURCE)); + initialStatements.add(vf.createStatement(iri, FOAF.AGE, vf.createLiteral(j))); + + IRI iri2 = vf.createIRI("http://example.com/base_2" + j); + initialStatements.add(vf.createStatement(iri2, RDF.TYPE, RDFS.CLASS)); + initialStatements.add(vf.createStatement(iri2, FOAF.AGE, vf.createLiteral(j))); + } + + System.gc(); + Thread.sleep(100); + } + + @Setup(Level.Invocation) + public void invocationSetup() throws IOException, InterruptedException { + + repository = new SailRepository(Utils.getInitializedShaclSail(shape)); + + ((ShaclSail) repository.getSail()).setDashDataShapes(true); + ((ShaclSail) repository.getSail()).setShaclAdvancedFeatures(true); + + ((ShaclSail) repository.getSail()).disableValidation(); + + try (SailRepositoryConnection connection = repository.getConnection()) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.add(initialStatements); + connection.commit(); + } + + ((ShaclSail) repository.getSail()).enableValidation(); + + System.gc(); + Thread.sleep(100); + } + + @Benchmark + public void benchmark() throws Exception { + + try (SailRepositoryConnection connection = repository.getConnection()) { + for (List statements : transactions) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.add(statements); + connection.commit(); + } + } + + repository.shutDown(); + } + +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkEmpty.java index c4f8cd07ff6..f191338e80a 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkEmpty.java @@ -26,6 +26,7 @@ import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -59,7 +60,7 @@ public class DatatypeBenchmarkEmpty { private List> allStatements; @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -72,7 +73,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark @@ -103,7 +104,7 @@ public void shacl() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkLinear.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkLinear.java index a708113cfdd..1d64ec1db24 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkLinear.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkLinear.java @@ -25,6 +25,7 @@ import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -62,7 +63,7 @@ public class DatatypeBenchmarkLinear { private List> allStatements; @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -81,7 +82,7 @@ public void setUp() { } } System.gc(); - + Thread.sleep(100); } @Benchmark @@ -109,7 +110,7 @@ public void shacl() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkPrefilled.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkPrefilled.java index 507c3718e40..d8fe0e32e6b 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkPrefilled.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkPrefilled.java @@ -118,6 +118,7 @@ public void setUp() throws Exception { connection.add(allStatements2); } System.gc(); + Thread.sleep(100); } @TearDown(Level.Invocation) diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkSerializableEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkSerializableEmpty.java index a93a62abb9c..b1e30e640de 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkSerializableEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/DatatypeBenchmarkSerializableEmpty.java @@ -26,6 +26,7 @@ import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -59,7 +60,7 @@ public class DatatypeBenchmarkSerializableEmpty { private List> allStatements; @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -72,7 +73,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark @@ -103,7 +104,7 @@ public void shacl() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/HasValueBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/HasValueBenchmarkEmpty.java new file mode 100644 index 00000000000..fb195ae617a --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/HasValueBenchmarkEmpty.java @@ -0,0 +1,170 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.benchmark; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.eclipse.rdf4j.IsolationLevels; +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.memory.MemoryStore; +import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; +import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; +import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.slf4j.LoggerFactory; + +import ch.qos.logback.classic.Logger; + +/** + * @author Håvard Ottestad + */ +@State(Scope.Benchmark) +@Warmup(iterations = 20) +@BenchmarkMode({ Mode.AverageTime }) +@Fork(value = 1, jvmArgs = { "-Xms8G", "-Xmx8G", "-XX:+UseG1GC" }) +//@Fork(value = 1, jvmArgs = {"-Xms8G", "-Xmx8G", "-XX:+UseG1GC", "-XX:+UnlockCommercialFeatures", "-XX:StartFlightRecording=delay=5s,duration=120s,filename=recording.jfr,settings=profile", "-XX:FlightRecorderOptions=samplethreads=true,stackdepth=1024", "-XX:+UnlockDiagnosticVMOptions", "-XX:+DebugNonSafepoints"}) +@Measurement(iterations = 10) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +public class HasValueBenchmarkEmpty { + + { + GlobalValidationExecutionLogging.loggingEnabled = false; + } + + ValueFactory vf = SimpleValueFactory.getInstance(); + + static String ex = "http://example.com/ns#"; + + IRI Person = vf.createIRI(ex, "Person"); + IRI knows = vf.createIRI(ex, "knows"); + IRI steve = vf.createIRI(ex, "steve"); + IRI peter = vf.createIRI(ex, "peter"); + + private List> allStatements; + + @Setup(Level.Iteration) + public void setUp() throws InterruptedException { + Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); + root.setLevel(ch.qos.logback.classic.Level.INFO); + + SimpleValueFactory vf = SimpleValueFactory.getInstance(); + + allStatements = BenchmarkConfigs.generateStatements(((statements, i, j) -> { + IRI iri = vf.createIRI("http://example.com/" + i + "_" + j); + statements.add(vf.createStatement(iri, RDF.TYPE, Person)); + statements.add(vf.createStatement(iri, knows, vf.createLiteral(i))); + statements.add(vf.createStatement(iri, knows, vf.createBNode())); + statements.add(vf.createStatement(iri, knows, steve)); + statements.add(vf.createStatement(iri, knows, peter)); + })); + + System.gc(); + Thread.sleep(100); + } + + @Benchmark + public void shacl() throws Exception { + + SailRepository repository = new SailRepository( + Utils.getInitializedShaclSail("test-cases/hasValue/simple/shacl.ttl")); + +// ((ShaclSail) repository.getSail()).setIgnoreNoShapesLoadedException(true); +// ((ShaclSail) repository.getSail()).disableValidation(); + + try (SailRepositoryConnection connection = repository.getConnection()) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.commit(); + } + + try (SailRepositoryConnection connection = repository.getConnection()) { + for (List statements : allStatements) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.add(statements); + connection.commit(); + } + } + + repository.shutDown(); + + } + + @Benchmark + public void noShacl() { + + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); + + repository.init(); + + try (SailRepositoryConnection connection = repository.getConnection()) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.commit(); + } + try (SailRepositoryConnection connection = repository.getConnection()) { + for (List statements : allStatements) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.add(statements); + connection.commit(); + } + } + +// repository.shutDown(); + + } + +// @Benchmark +// public void sparqlInsteadOfShacl() { +// +// SailRepository repository = new SailRepository(new MemoryStore()); +// +// repository.init(); +// +// try (SailRepositoryConnection connection = repository.getConnection()) { +// connection.begin(IsolationLevels.SNAPSHOT); +// connection.commit(); +// } +// try (SailRepositoryConnection connection = repository.getConnection()) { +// for (List statements : allStatements) { +// connection.begin(IsolationLevels.SNAPSHOT); +// connection.add(statements); +// try (Stream stream = connection +// .prepareTupleQuery( +// "select * where {?a a <" +ex+"Person" + ">; " + +// "<" +ex+"knows"+"> ?knows. " + +// "FILTER(?knows != )}") +// .evaluate() +// .stream()) { +// stream.forEach(System.out::println); +// } +// connection.commit(); +// } +// } +// +//// repository.shutDown(); +// +// } + +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/Main.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/Main.java index 57d2bd1ce8d..c11f8a62487 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/Main.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/Main.java @@ -24,7 +24,7 @@ public class Main { } public static void main(String[] args) throws RunnerException { - Options opt = new OptionsBuilder().include("") + Options opt = new OptionsBuilder().include("TargetBenchmarkInitialData.*") // .addProfiler("stack", "lines=20;period=1;top=20") .build(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MaxCountBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MaxCountBenchmarkEmpty.java index e0e9f47a5e6..25d9daf5b58 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MaxCountBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MaxCountBenchmarkEmpty.java @@ -24,6 +24,7 @@ import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -56,7 +57,7 @@ public class MaxCountBenchmarkEmpty { private List> allStatements; @Setup(Level.Invocation) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -69,7 +70,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark @@ -96,7 +97,7 @@ public void shacl() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkEmpty.java index 989744adbb1..b3c633b6e4d 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkEmpty.java @@ -25,6 +25,7 @@ import org.eclipse.rdf4j.sail.shacl.ShaclSail; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -57,7 +58,7 @@ public class MinCountBenchmarkEmpty { private List> allStatements; @Setup(Level.Invocation) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -70,7 +71,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark @@ -124,7 +125,7 @@ public void shaclClear() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkPrefilled.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkPrefilled.java index 18d85f4e72e..886a146c1e5 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkPrefilled.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountBenchmarkPrefilled.java @@ -116,6 +116,7 @@ public void setUp() throws Exception { connection.add(allStatements2); } System.gc(); + Thread.sleep(100); } @TearDown(Level.Invocation) diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountPrefilledVsEmptyBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountPrefilledVsEmptyBenchmark.java index d83f0c24d23..d85113d76d8 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountPrefilledVsEmptyBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/MinCountPrefilledVsEmptyBenchmark.java @@ -90,7 +90,7 @@ public void setUp() throws Exception { } shaclRepo.enableValidation(); System.gc(); - + Thread.sleep(100); } @TearDown(Level.Invocation) diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NativeStoreBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NativeStoreBenchmark.java index 284b34ea8e4..ce8184c6058 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NativeStoreBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NativeStoreBenchmark.java @@ -60,8 +60,9 @@ public class NativeStoreBenchmark { } @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { System.gc(); + Thread.sleep(100); ((Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName())) .setLevel(ch.qos.logback.classic.Level.ERROR); ((Logger) LoggerFactory.getLogger(ShaclSail.class.getName())).setLevel(ch.qos.logback.classic.Level.ERROR); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotClassBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotClassBenchmarkEmpty.java index 816fdaf76b9..3fe0bae2a68 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotClassBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotClassBenchmarkEmpty.java @@ -24,6 +24,7 @@ import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -62,7 +63,7 @@ public class NotClassBenchmarkEmpty { private final IRI ANIMAL = vf.createIRI("http://example.com/ns#Animal"); @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -91,7 +92,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark @@ -140,7 +141,7 @@ public void shaclWithoutAnimals() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotMaxCountBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotMaxCountBenchmarkEmpty.java index 02ca4d834f9..4b90e6b7f55 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotMaxCountBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotMaxCountBenchmarkEmpty.java @@ -22,6 +22,7 @@ import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -54,7 +55,7 @@ public class NotMaxCountBenchmarkEmpty { private List> allStatements; @Setup(Level.Invocation) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -67,7 +68,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark @@ -94,7 +95,7 @@ public void shacl() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotUniqueLangBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotUniqueLangBenchmarkEmpty.java index a8f05c229a5..62cc1e99209 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotUniqueLangBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/NotUniqueLangBenchmarkEmpty.java @@ -55,7 +55,7 @@ public class NotUniqueLangBenchmarkEmpty { private List> allStatements; @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -73,7 +73,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ParallelBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ParallelBenchmark.java index 30ced7250f7..2d5c10fb243 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ParallelBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ParallelBenchmark.java @@ -63,7 +63,7 @@ public class ParallelBenchmark { private List> allStatements; @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -76,7 +76,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ShaclLoadingBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ShaclLoadingBenchmark.java index bd9e8531992..487265e03bf 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ShaclLoadingBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ShaclLoadingBenchmark.java @@ -51,8 +51,9 @@ public class ShaclLoadingBenchmark { } @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { System.gc(); + Thread.sleep(100); ((Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName())) .setLevel(ch.qos.logback.classic.Level.ERROR); ((Logger) LoggerFactory.getLogger(ShaclSail.class.getName())).setLevel(ch.qos.logback.classic.Level.ERROR); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/TargetBenchmarkInitialData.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/TargetBenchmarkInitialData.java new file mode 100644 index 00000000000..51aea3614c5 --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/TargetBenchmarkInitialData.java @@ -0,0 +1,146 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.benchmark; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.eclipse.rdf4j.IsolationLevels; +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.FOAF; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDFS; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; +import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; +import org.eclipse.rdf4j.sail.shacl.Utils; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.slf4j.LoggerFactory; + +import ch.qos.logback.classic.Logger; + +/** + * @author Håvard Ottestad + */ +@State(Scope.Benchmark) +@Warmup(iterations = 20) +@BenchmarkMode({ Mode.AverageTime }) +//@Fork(value = 1, jvmArgs = {"-Xms8G", "-Xmx8G", "-XX:+UseG1GC", "-XX:+UnlockCommercialFeatures", "-XX:StartFlightRecording=delay=5s,duration=60s,filename=recording.jfr,settings=profile", "-XX:FlightRecorderOptions=samplethreads=true,stackdepth=1024", "-XX:+UnlockDiagnosticVMOptions", "-XX:+DebugNonSafepoints"}) +@Fork(value = 1, jvmArgs = { "-Xms8G", "-Xmx8G", "-XX:+UseG1GC" }) +@Measurement(iterations = 10) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +public class TargetBenchmarkInitialData { + { + GlobalValidationExecutionLogging.loggingEnabled = false; + } + + @Param({ "1", "1000", "100000" }) + public int existingTargets = 10; + + @Param({ "shaclDatatypePredicateObjectTarget.ttl", "shaclDatatypeSparqlTarget.ttl", + "shaclDatatypeTargetFilter.ttl" }) + public String shape; + + public int NUMBER_OF_TRANSACTIONS = 10; + + List initialStatements = new ArrayList<>(); + + private List> transactions; + + SailRepository repository; + + @Setup(Level.Trial) + public void trialSetup() throws InterruptedException { + Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); + root.setLevel(ch.qos.logback.classic.Level.INFO); + + transactions = new ArrayList<>(NUMBER_OF_TRANSACTIONS); + + SimpleValueFactory vf = SimpleValueFactory.getInstance(); + + for (int j = 0; j < NUMBER_OF_TRANSACTIONS; j++) { + List statements = new ArrayList<>(BenchmarkConfigs.STATEMENTS_PER_TRANSACTION); + transactions.add(statements); + for (int i = 0; i < BenchmarkConfigs.STATEMENTS_PER_TRANSACTION; i++) { + IRI iri = vf.createIRI("http://example.com/transaction_" + i + "_" + j); + statements.add(vf.createStatement(iri, RDF.TYPE, RDFS.RESOURCE)); + statements.add(vf.createStatement(iri, FOAF.AGE, + vf.createLiteral(i))); + } + } + + for (int j = 0; j < existingTargets; j++) { + IRI iri = vf.createIRI("http://example.com/base_" + j); + initialStatements.add(vf.createStatement(iri, RDF.TYPE, RDFS.RESOURCE)); + initialStatements.add(vf.createStatement(iri, FOAF.AGE, vf.createLiteral(j))); + + } + + System.gc(); + Thread.sleep(100); + } + + @Setup(Level.Invocation) + public void invocationSetup() throws IOException, InterruptedException { + + repository = new SailRepository(Utils.getInitializedShaclSail(shape)); + + ((ShaclSail) repository.getSail()).setDashDataShapes(true); + ((ShaclSail) repository.getSail()).setShaclAdvancedFeatures(true); + + ((ShaclSail) repository.getSail()).disableValidation(); + + try (SailRepositoryConnection connection = repository.getConnection()) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.add(initialStatements); + connection.commit(); + } + + ((ShaclSail) repository.getSail()).enableValidation(); + + System.gc(); + Thread.sleep(100); + } + + @Benchmark + public void benchmark() throws Exception { + runBenchmark(repository); + } + + private void runBenchmark(SailRepository repository) { + + try (SailRepositoryConnection connection = repository.getConnection()) { + for (List statements : transactions) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.add(statements); + connection.commit(); + } + } + + repository.shutDown(); + } + +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/UniqueLangBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/UniqueLangBenchmarkEmpty.java index fbde38314c5..50115890044 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/UniqueLangBenchmarkEmpty.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/UniqueLangBenchmarkEmpty.java @@ -23,6 +23,7 @@ import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -56,7 +57,7 @@ public class UniqueLangBenchmarkEmpty { private List> allStatements; @Setup(Level.Iteration) - public void setUp() { + public void setUp() throws InterruptedException { Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); root.setLevel(ch.qos.logback.classic.Level.INFO); @@ -72,7 +73,7 @@ public void setUp() { })); System.gc(); - + Thread.sleep(100); } @Benchmark @@ -95,7 +96,7 @@ public void shacl() throws Exception { @Benchmark public void noShacl() { - SailRepository repository = new SailRepository(new MemoryStore()); + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ValueInBenchmarkEmpty.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ValueInBenchmarkEmpty.java new file mode 100644 index 00000000000..dca03633171 --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ValueInBenchmarkEmpty.java @@ -0,0 +1,183 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.benchmark; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.eclipse.rdf4j.IsolationLevels; +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.memory.MemoryStore; +import org.eclipse.rdf4j.sail.shacl.GlobalValidationExecutionLogging; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; +import org.eclipse.rdf4j.sail.shacl.ShaclSailConnection; +import org.eclipse.rdf4j.sail.shacl.Utils; +import org.eclipse.rdf4j.sail.shacl.testimp.TestNotifyingSail; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.slf4j.LoggerFactory; + +import ch.qos.logback.classic.Logger; + +/** + * @author Håvard Ottestad + */ +@State(Scope.Benchmark) +@Warmup(iterations = 20) +@BenchmarkMode({ Mode.AverageTime }) +@Fork(value = 1, jvmArgs = { "-Xms8G", "-Xmx8G", "-XX:+UseG1GC" }) +//@Fork(value = 1, jvmArgs = {"-Xms8G", "-Xmx8G", "-XX:+UseG1GC", "-XX:+UnlockCommercialFeatures", "-XX:StartFlightRecording=delay=5s,duration=120s,filename=recording.jfr,settings=profile", "-XX:FlightRecorderOptions=samplethreads=true,stackdepth=1024", "-XX:+UnlockDiagnosticVMOptions", "-XX:+DebugNonSafepoints"}) +@Measurement(iterations = 10) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +public class ValueInBenchmarkEmpty { + + { + GlobalValidationExecutionLogging.loggingEnabled = false; + } + + ValueFactory vf = SimpleValueFactory.getInstance(); + + static String ex = "http://example.com/ns#"; + + IRI Person = vf.createIRI(ex, "Person"); + IRI knows = vf.createIRI(ex, "knows"); + IRI steve = vf.createIRI(ex, "steve"); + IRI peter = vf.createIRI(ex, "peter"); + IRI mary = vf.createIRI(ex, "mary"); + IRI kate = vf.createIRI(ex, "kate"); + + private List> allStatements; + + @Setup(Level.Iteration) + public void setUp() throws InterruptedException { + Logger root = (Logger) LoggerFactory.getLogger(ShaclSailConnection.class.getName()); + root.setLevel(ch.qos.logback.classic.Level.INFO); + + SimpleValueFactory vf = SimpleValueFactory.getInstance(); + + allStatements = BenchmarkConfigs.generateStatements(((statements, i, j) -> { + IRI iri = vf.createIRI("http://example.com/" + i + "_" + j); + statements.add(vf.createStatement(iri, RDF.TYPE, Person)); + statements.add(vf.createStatement(iri, knows, vf.createLiteral(i))); + statements.add(vf.createStatement(iri, knows, vf.createBNode())); + statements.add(vf.createStatement(iri, knows, steve)); + + if (j % 3 == 0) { + statements.add(vf.createStatement(iri, knows, peter)); + } else if (j % 3 == 1) { + statements.add(vf.createStatement(iri, knows, mary)); + } else if (j % 3 == 2) { + statements.add(vf.createStatement(iri, knows, kate)); + } + + })); + + System.gc(); + Thread.sleep(100); + + } + + @Benchmark + public void shacl() throws Exception { + + SailRepository repository = new SailRepository( + Utils.getInitializedShaclSail("test-cases/valueIn/simple/shacl.ttl")); + + ((ShaclSail) repository.getSail()).setDashDataShapes(true); +// ((ShaclSail) repository.getSail()).disableValidation(); + + try (SailRepositoryConnection connection = repository.getConnection()) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.commit(); + } + + try (SailRepositoryConnection connection = repository.getConnection()) { + for (List statements : allStatements) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.add(statements); + connection.commit(); + } + } + + repository.shutDown(); + + } + + @Benchmark + public void noShacl() { + + SailRepository repository = new SailRepository(new TestNotifyingSail(new MemoryStore())); +// SailRepository repository = new SailRepository((new MemoryStore())); + + repository.init(); + + try (SailRepositoryConnection connection = repository.getConnection()) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.commit(); + } + try (SailRepositoryConnection connection = repository.getConnection()) { + for (List statements : allStatements) { + connection.begin(IsolationLevels.SNAPSHOT); + connection.add(statements); + connection.commit(); + } + } + +// repository.shutDown(); + + } + +// @Benchmark +// public void sparqlInsteadOfShacl() { +// +// SailRepository repository = new SailRepository(new MemoryStore()); +// +// repository.init(); +// +// try (SailRepositoryConnection connection = repository.getConnection()) { +// connection.begin(IsolationLevels.SNAPSHOT); +// connection.commit(); +// } +// try (SailRepositoryConnection connection = repository.getConnection()) { +// for (List statements : allStatements) { +// connection.begin(IsolationLevels.SNAPSHOT); +// connection.add(statements); +// try (Stream stream = connection +// .prepareTupleQuery( +// "select * where {?a a <" +ex+"Person" + ">; " + +// "<" +ex+"knows"+"> ?knows. " + +// "FILTER(?knows != )}") +// .evaluate() +// .stream()) { +// stream.forEach(System.out::println); +// } +// connection.commit(); +// } +// } +// +//// repository.shutDown(); +// +// } + +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java index 2a604926737..71f29c4bf37 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java @@ -9,6 +9,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.CACHE_SELECT_NODES; +import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.DASH_DATA_SHAPES; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.GLOBAL_LOG_VALIDATION_EXECUTION; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.IGNORE_NO_SHAPES_LOADED_EXCEPTION; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.LOG_VALIDATION_PLANS; @@ -17,8 +18,10 @@ import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.PERFORMANCE_LOGGING; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.RDFS_SUB_CLASS_REASONING; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.SERIALIZABLE_VALIDATION; +import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.SHACL_ADVANCED_FEATURES; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.VALIDATION_ENABLED; +import static org.junit.Assert.assertTrue; import org.eclipse.rdf4j.model.BNode; import org.eclipse.rdf4j.model.Model; @@ -27,110 +30,114 @@ import org.eclipse.rdf4j.model.impl.TreeModel; import org.eclipse.rdf4j.model.util.ModelBuilder; import org.eclipse.rdf4j.sail.config.SailConfigException; -import org.junit.Before; import org.junit.Test; public class ShaclSailConfigTest { - private ShaclSailConfig subject; - - private BNode implNode; - - private ModelBuilder mb; - - @Before - public void setUp() throws Exception { - subject = new ShaclSailConfig(); - implNode = SimpleValueFactory.getInstance().createBNode(); - mb = new ModelBuilder().subject(implNode); - } - @Test public void defaultsCorrectlySet() { - assertThat(subject.isParallelValidation()).isTrue(); - assertThat(subject.isUndefinedTargetValidatesAllSubjects()).isFalse(); - assertThat(subject.isLogValidationPlans()).isFalse(); - assertThat(subject.isLogValidationViolations()).isFalse(); - assertThat(subject.isIgnoreNoShapesLoadedException()).isFalse(); - assertThat(subject.isValidationEnabled()).isTrue(); - assertThat(subject.isCacheSelectNodes()).isTrue(); - assertThat(subject.isGlobalLogValidationExecution()).isFalse(); - assertThat(subject.isRdfsSubClassReasoning()).isTrue(); - assertThat(subject.isPerformanceLogging()).isFalse(); - assertThat(subject.isSerializableValidation()).isTrue(); + ShaclSailConfig shaclSailConfig = new ShaclSailConfig(); + assertThat(shaclSailConfig.isParallelValidation()).isTrue(); + assertThat(shaclSailConfig.isUndefinedTargetValidatesAllSubjects()).isFalse(); + assertThat(shaclSailConfig.isLogValidationPlans()).isFalse(); + assertThat(shaclSailConfig.isLogValidationViolations()).isFalse(); + assertThat(shaclSailConfig.isIgnoreNoShapesLoadedException()).isFalse(); + assertThat(shaclSailConfig.isValidationEnabled()).isTrue(); + assertThat(shaclSailConfig.isCacheSelectNodes()).isTrue(); + assertThat(shaclSailConfig.isGlobalLogValidationExecution()).isFalse(); + assertThat(shaclSailConfig.isRdfsSubClassReasoning()).isTrue(); + assertThat(shaclSailConfig.isPerformanceLogging()).isFalse(); + assertThat(shaclSailConfig.isSerializableValidation()).isTrue(); + assertThat(shaclSailConfig.isShaclAdvancedFeatures()).isFalse(); + assertThat(shaclSailConfig.isDashDataShapes()).isFalse(); } @Test public void parseFromModelSetValuesCorrectly() { + ShaclSailConfig shaclSailConfig = new ShaclSailConfig(); + + BNode implNode = SimpleValueFactory.getInstance().createBNode(); + ModelBuilder mb = new ModelBuilder().subject(implNode); - // FIXME we need to set formatting guidelines for this kind of thing - // @formatter:off mb - .add(PARALLEL_VALIDATION, true) - .add(UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS, true) - .add(LOG_VALIDATION_PLANS, true) - .add(LOG_VALIDATION_VIOLATIONS, true) - .add(IGNORE_NO_SHAPES_LOADED_EXCEPTION, true) - .add(VALIDATION_ENABLED, true) - .add(CACHE_SELECT_NODES, true) - .add(GLOBAL_LOG_VALIDATION_EXECUTION, true) - .add(RDFS_SUB_CLASS_REASONING, false) - .add(PERFORMANCE_LOGGING, true) - .add(SERIALIZABLE_VALIDATION, false); - - // @formatter:on - - subject.parse(mb.build(), implNode); - - assertThat(subject.isParallelValidation()).isTrue(); - assertThat(subject.isUndefinedTargetValidatesAllSubjects()).isTrue(); - assertThat(subject.isLogValidationPlans()).isTrue(); - assertThat(subject.isLogValidationViolations()).isTrue(); - assertThat(subject.isIgnoreNoShapesLoadedException()).isTrue(); - assertThat(subject.isValidationEnabled()).isTrue(); - assertThat(subject.isCacheSelectNodes()).isTrue(); - assertThat(subject.isGlobalLogValidationExecution()).isTrue(); - assertThat(subject.isRdfsSubClassReasoning()).isFalse(); - assertThat(subject.isPerformanceLogging()).isTrue(); - assertThat(subject.isSerializableValidation()).isFalse(); + .add(PARALLEL_VALIDATION, true) + .add(UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS, true) + .add(LOG_VALIDATION_PLANS, true) + .add(LOG_VALIDATION_VIOLATIONS, true) + .add(IGNORE_NO_SHAPES_LOADED_EXCEPTION, true) + .add(VALIDATION_ENABLED, true) + .add(CACHE_SELECT_NODES, true) + .add(GLOBAL_LOG_VALIDATION_EXECUTION, true) + .add(RDFS_SUB_CLASS_REASONING, false) + .add(PERFORMANCE_LOGGING, true) + .add(SHACL_ADVANCED_FEATURES, true) + .add(DASH_DATA_SHAPES, true) + .add(SERIALIZABLE_VALIDATION, false); + + shaclSailConfig.parse(mb.build(), implNode); + + assertThat(shaclSailConfig.isParallelValidation()).isTrue(); + assertThat(shaclSailConfig.isUndefinedTargetValidatesAllSubjects()).isTrue(); + assertThat(shaclSailConfig.isLogValidationPlans()).isTrue(); + assertThat(shaclSailConfig.isLogValidationViolations()).isTrue(); + assertThat(shaclSailConfig.isIgnoreNoShapesLoadedException()).isTrue(); + assertThat(shaclSailConfig.isValidationEnabled()).isTrue(); + assertThat(shaclSailConfig.isCacheSelectNodes()).isTrue(); + assertThat(shaclSailConfig.isGlobalLogValidationExecution()).isTrue(); + assertThat(shaclSailConfig.isRdfsSubClassReasoning()).isFalse(); + assertThat(shaclSailConfig.isPerformanceLogging()).isTrue(); + assertThat(shaclSailConfig.isSerializableValidation()).isFalse(); + assertThat(shaclSailConfig.isShaclAdvancedFeatures()).isTrue(); + assertThat(shaclSailConfig.isDashDataShapes()).isTrue(); } @Test public void parseFromPartialModelSetValuesCorrectly() { + ShaclSailConfig shaclSailConfig = new ShaclSailConfig(); + BNode implNode = SimpleValueFactory.getInstance().createBNode(); + ModelBuilder mb = new ModelBuilder().subject(implNode); + mb.add(PARALLEL_VALIDATION, false); - subject.parse(mb.build(), implNode); + shaclSailConfig.parse(mb.build(), implNode); - assertThat(subject.isParallelValidation()).isFalse(); - assertThat(subject.isCacheSelectNodes()).isTrue(); + assertThat(shaclSailConfig.isParallelValidation()).isFalse(); + assertThat(shaclSailConfig.isCacheSelectNodes()).isTrue(); } @Test(expected = SailConfigException.class) public void parseInvalidModelGivesCorrectException() { + ShaclSailConfig shaclSailConfig = new ShaclSailConfig(); + BNode implNode = SimpleValueFactory.getInstance().createBNode(); + ModelBuilder mb = new ModelBuilder().subject(implNode); mb.add(PARALLEL_VALIDATION, "I'm not a boolean"); - subject.parse(mb.build(), implNode); + shaclSailConfig.parse(mb.build(), implNode); } @Test public void exportAddsAllConfigData() { + ShaclSailConfig shaclSailConfig = new ShaclSailConfig(); + Model m = new TreeModel(); - Resource node = subject.export(m); - assertThat(m.contains(node, PARALLEL_VALIDATION, null)).isTrue(); - assertThat(m.contains(node, UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS, null)).isTrue(); - assertThat(m.contains(node, LOG_VALIDATION_PLANS, null)).isTrue(); - assertThat(m.contains(node, LOG_VALIDATION_VIOLATIONS, null)).isTrue(); - assertThat(m.contains(node, IGNORE_NO_SHAPES_LOADED_EXCEPTION, null)).isTrue(); - assertThat(m.contains(node, VALIDATION_ENABLED, null)).isTrue(); - assertThat(m.contains(node, CACHE_SELECT_NODES, null)).isTrue(); - assertThat(m.contains(node, GLOBAL_LOG_VALIDATION_EXECUTION, null)).isTrue(); - assertThat(m.contains(node, RDFS_SUB_CLASS_REASONING, null)).isTrue(); - assertThat(m.contains(node, PERFORMANCE_LOGGING, null)).isTrue(); - assertThat(m.contains(node, SERIALIZABLE_VALIDATION, null)).isTrue(); + Resource node = shaclSailConfig.export(m); + assertTrue(m.contains(node, PARALLEL_VALIDATION, null)); + assertTrue(m.contains(node, UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS, null)); + assertTrue(m.contains(node, LOG_VALIDATION_PLANS, null)); + assertTrue(m.contains(node, LOG_VALIDATION_VIOLATIONS, null)); + assertTrue(m.contains(node, IGNORE_NO_SHAPES_LOADED_EXCEPTION, null)); + assertTrue(m.contains(node, VALIDATION_ENABLED, null)); + assertTrue(m.contains(node, CACHE_SELECT_NODES, null)); + assertTrue(m.contains(node, GLOBAL_LOG_VALIDATION_EXECUTION, null)); + assertTrue(m.contains(node, RDFS_SUB_CLASS_REASONING, null)); + assertTrue(m.contains(node, PERFORMANCE_LOGGING, null)); + assertTrue(m.contains(node, SERIALIZABLE_VALIDATION, null)); + assertTrue(m.contains(node, SHACL_ADVANCED_FEATURES, null)); + assertTrue(m.contains(node, DASH_DATA_SHAPES, null)); } diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java index b8252a88a8d..04df6ec0faa 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java @@ -10,7 +10,6 @@ import static org.assertj.core.api.Assertions.assertThat; import org.eclipse.rdf4j.sail.shacl.ShaclSail; -import org.junit.Before; import org.junit.Test; /** @@ -20,15 +19,9 @@ */ public class ShaclSailFactoryTest { - private ShaclSailFactory subject; - - @Before - public void setUp() throws Exception { - subject = new ShaclSailFactory(); - } - @Test public void getSailTypeReturnsCorrectValue() { + ShaclSailFactory subject = new ShaclSailFactory(); assertThat(subject.getSailType()).isEqualTo(ShaclSailFactory.SAIL_TYPE); } @@ -37,6 +30,8 @@ public void getSailTypeReturnsCorrectValue() { */ @Test public void getSailWithDefaultConfigSetsConfigurationCorrectly() { + ShaclSailFactory subject = new ShaclSailFactory(); + ShaclSailConfig config = new ShaclSailConfig(); ShaclSail sail = (ShaclSail) subject.getSail(config); assertMatchesConfig(sail, config); @@ -47,6 +42,8 @@ public void getSailWithDefaultConfigSetsConfigurationCorrectly() { */ @Test public void getSailWithCustomConfigSetsConfigurationCorrectly() { + ShaclSailFactory subject = new ShaclSailFactory(); + ShaclSailConfig config = new ShaclSailConfig(); // set everything to the opposite of its default @@ -61,6 +58,8 @@ public void getSailWithCustomConfigSetsConfigurationCorrectly() { config.setPerformanceLogging(!config.isPerformanceLogging()); config.setSerializableValidation(!config.isSerializableValidation()); config.setRdfsSubClassReasoning(!config.isRdfsSubClassReasoning()); + config.setShaclAdvancedFeatures(!config.isShaclAdvancedFeatures()); + config.setDashDataShapes(!config.isDashDataShapes()); ShaclSail sail = (ShaclSail) subject.getSail(config); assertMatchesConfig(sail, config); @@ -79,6 +78,8 @@ private void assertMatchesConfig(ShaclSail sail, ShaclSailConfig config) { assertThat(sail.isPerformanceLogging()).isEqualTo(config.isPerformanceLogging()); assertThat(sail.isSerializableValidation()).isEqualTo(config.isSerializableValidation()); assertThat(sail.isRdfsSubClassReasoning()).isEqualTo(config.isRdfsSubClassReasoning()); + assertThat(sail.isShaclAdvancedFeatures()).isEqualTo(config.isShaclAdvancedFeatures()); + assertThat(sail.isDashDataShapes()).isEqualTo(config.isDashDataShapes()); } } diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/testimp/TestNotifyingSail.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/testimp/TestNotifyingSail.java new file mode 100644 index 00000000000..2b6f2fe5f09 --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/testimp/TestNotifyingSail.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.testimp; + +import org.eclipse.rdf4j.sail.NotifyingSail; +import org.eclipse.rdf4j.sail.NotifyingSailConnection; +import org.eclipse.rdf4j.sail.SailException; +import org.eclipse.rdf4j.sail.helpers.NotifyingSailWrapper; + +/** + * Used for testing performance. Gives a good indication of the overhead of the notifying sail code. + */ +public class TestNotifyingSail extends NotifyingSailWrapper { + + public TestNotifyingSail(NotifyingSail baseSail) { + super(baseSail); + } + + @Override + public NotifyingSailConnection getConnection() throws SailException { + return new TestNotifyingSailConnection(super.getConnection()); + } +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/testimp/TestNotifyingSailConnection.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/testimp/TestNotifyingSailConnection.java new file mode 100644 index 00000000000..902b25dce5f --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/testimp/TestNotifyingSailConnection.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.testimp; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.rdf4j.IsolationLevel; +import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.sail.NotifyingSailConnection; +import org.eclipse.rdf4j.sail.SailConnectionListener; +import org.eclipse.rdf4j.sail.SailException; +import org.eclipse.rdf4j.sail.helpers.NotifyingSailConnectionWrapper; + +public class TestNotifyingSailConnection extends NotifyingSailConnectionWrapper implements SailConnectionListener { + + Set added; + Set removed; + + public TestNotifyingSailConnection(NotifyingSailConnection wrappedCon) { + super(wrappedCon); + addConnectionListener(this); + } + + @Override + public void statementAdded(Statement statement) { + boolean add = added.add(statement); + if (!add) { + removed.remove(statement); + } + } + + @Override + public void statementRemoved(Statement statement) { + boolean add = removed.add(statement); + if (!add) { + added.remove(statement); + } + } + + @Override + public void begin() throws SailException { + super.begin(); + added = new HashSet<>(); + removed = new HashSet<>(); + } + + @Override + public void begin(IsolationLevel level) throws SailException { + super.begin(level); + added = new HashSet<>(); + removed = new HashSet<>(); + } +} diff --git a/core/sail/shacl/src/test/resources/shaclDatatypeSparqlTarget.ttl b/core/sail/shacl/src/test/resources/shaclDatatypeSparqlTarget.ttl new file mode 100644 index 00000000000..b3b1957e80f --- /dev/null +++ b/core/sail/shacl/src/test/resources/shaclDatatypeSparqlTarget.ttl @@ -0,0 +1,34 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix foaf: . + +ex:PersonShape + a sh:NodeShape ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX ex: + PREFIX owl: + PREFIX rdf: + PREFIX rdfs: + PREFIX sh: + PREFIX xsd: + + SELECT ?this + WHERE { + ?this a rdfs:Resource . + } + """ ; + ] ; + + sh:property [ + sh:path foaf:age ; + sh:datatype xsd:int ; + + ] . + diff --git a/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilter.ttl b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilter.ttl new file mode 100644 index 00000000000..2acb2eae217 --- /dev/null +++ b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilter.ttl @@ -0,0 +1,26 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix foaf: . +@prefix rdf4j-sh: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetShape [ + a sh:Shape ; + sh:property [ + sh:path rdf:type ; + sh:hasValue rdfs:Resource; + ] + ] ; + + sh:property [ + sh:path foaf:age ; + sh:datatype xsd:int ; + ] . + diff --git a/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl new file mode 100644 index 00000000000..c1cf94132de --- /dev/null +++ b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl @@ -0,0 +1,26 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix foaf: . +@prefix rdf4j-sh: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetShape [ + a sh:Shape ; + sh:property [ + sh:path rdf:type ; + dash:valueIn (rdfs:Resource rdfs:class); + ] + ] ; + + sh:property [ + sh:path foaf:age ; + sh:datatype xsd:int ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case1/query1.rq new file mode 100644 index 00000000000..161913ac8f4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + [] ex:temp ex:validPerson1. + + ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case2/query1.rq new file mode 100644 index 00000000000..32d8146832c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case2/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + [] ex:temp ex:validPerson1. + + ex:validPerson1 ex:knows ex:peter. + + ex:peter a ex:Person . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case2/query2.rq new file mode 100644 index 00000000000..ab0fb999ccb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + + ex:peter a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case3/query1.rq new file mode 100644 index 00000000000..b99e44181d4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case3/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + + ex:validPerson1 ex:knows ex:peter. + + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case3/query2.rq new file mode 100644 index 00000000000..e6cdcb516f4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + [] ex:temp ex:validPerson1. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/shacl.ttl new file mode 100644 index 00000000000..ac945b3eed6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/shacl.ttl @@ -0,0 +1,17 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:target [a dash:AllObjectsTarget] ; + sh:property [ + sh:path ex:knows ; + sh:class ex:Person ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case1/query1.rq new file mode 100644 index 00000000000..ab625544080 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case1/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +[] ex:temp ex:validPerson1. + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case2/query1.rq new file mode 100644 index 00000000000..942337c1222 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case2/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case2/query2.rq new file mode 100644 index 00000000000..a14a4670bec --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case2/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] ex:temp ex:validPerson1. + + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case3/query1.rq new file mode 100644 index 00000000000..adac80eb517 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] ex:temp ex:validPerson1. +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case3/query2.rq new file mode 100644 index 00000000000..2433dceb50d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allObjects/valid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case1/query1.rq new file mode 100644 index 00000000000..2433dceb50d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case1/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case2/query1.rq new file mode 100644 index 00000000000..4405288bc25 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case2/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case2/query2.rq new file mode 100644 index 00000000000..9ca47ae3c0f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/shacl.ttl new file mode 100644 index 00000000000..a527a00b609 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/shacl.ttl @@ -0,0 +1,17 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:target [a dash:AllSubjectsTarget] ; + sh:property [ + sh:path ex:knows ; + sh:class ex:Person ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case1/query1.rq new file mode 100644 index 00000000000..891ac22cdd0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case2/query1.rq new file mode 100644 index 00000000000..46e554ecc84 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case2/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:peter a ex:Person. + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case2/query2.rq new file mode 100644 index 00000000000..231ecc275a9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case2/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + + + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case3/query1.rq new file mode 100644 index 00000000000..b7d5f6fee0a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case3/query2.rq new file mode 100644 index 00000000000..2433dceb50d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/allSubjects/valid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case1/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case2/query1.rq new file mode 100644 index 00000000000..2433dceb50d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case3/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case3/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case3/query2.rq new file mode 100644 index 00000000000..d6260a23cc6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case4/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case4/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case4/query2.rq new file mode 100644 index 00000000000..91340e62887 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case4/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:apple. + +ex:apple a ex:Company. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case5/query1.rq new file mode 100644 index 00000000000..326bbd793e5 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case5/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. +ex:steve a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case5/query2.rq new file mode 100644 index 00000000000..f41dc5eb40b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case5/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { +ex:steve a ex:Person. + +} + +INSERT { + +ex:validPerson1 ex:knows ex:steve. + + +} + where {?a ?b ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case6/query1.rq new file mode 100644 index 00000000000..4fac7590f39 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case6/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] a ex:Person ; + ex:knows _:b1. + +_:b1 a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case6/query2.rq new file mode 100644 index 00000000000..b541c22f109 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case6/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ?b ?c ?d. +} where { + ?a ex:knows ?b. + ?b ?c ?d. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case7/query1.rq new file mode 100644 index 00000000000..90321287df1 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case7/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows "peter". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case8/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case8/query1.rq new file mode 100644 index 00000000000..d70433f6490 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case8/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:SecondTarget ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case9/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case9/query1.rq new file mode 100644 index 00000000000..3b0260d322e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case9/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:SecondTarget ; + ex:knows ex:peter. + +ex:peter a ex:SecondTarget. +ex:steve a ex:SecondTarget. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case9/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case9/query2.rq new file mode 100644 index 00000000000..ff11e51979b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/invalid/case9/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { +ex:steve a ex:SecondTarget. + +} + +INSERT { + +ex:validPerson1 ex:knows ex:steve. + + +} + where {?a ?b ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/shacl.ttl new file mode 100644 index 00000000000..cf7284aebe9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/shacl.ttl @@ -0,0 +1,24 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetShape [ + a sh:NodeShape ; + sh:or ( + [ sh:and ([sh:path rdf:type; sh:hasValue ex:Person] [sh:path rdf:type; sh:hasValue ex:Person]) ] + [ sh:and ([sh:path rdf:type; sh:hasValue ex:SecondTarget] [sh:path rdf:type; sh:hasValue ex:SecondTarget]) ] + ); + ] ; + + sh:property [ + sh:path ex:knows ; + sh:class ex:Person ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case1/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case1/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case2/query1.rq new file mode 100644 index 00000000000..b7d5f6fee0a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case2/query2.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case3/query1.rq new file mode 100644 index 00000000000..891ac22cdd0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case3/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case3/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case4/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case4/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case4/query2.rq new file mode 100644 index 00000000000..2f9b7356d6d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case4/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +ex:validPerson1 ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case5/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case5/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case5/query2.rq new file mode 100644 index 00000000000..e2679f98f74 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case5/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case6/query1.rq new file mode 100644 index 00000000000..4fac7590f39 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case6/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] a ex:Person ; + ex:knows _:b1. + +_:b1 a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case7/query1.rq new file mode 100644 index 00000000000..404ff929ba9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case7/query1.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "steve". +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case7/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case7/query2.rq new file mode 100644 index 00000000000..1045001b94c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/valid/case7/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ex:validPerson1 ex:knows "steve". +} insert { + ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + ex:peter a ex:Person. + +} where { + ?a ?b ?c +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case1/query1.rq new file mode 100644 index 00000000000..b56bd604af7 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + rdfs:label "Jennifer"; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case2/query1.rq new file mode 100644 index 00000000000..7da8f1bd364 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case2/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + rdfs:label "Jennifer"; + rdfs:label "Peter"; + ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case3/query1.rq new file mode 100644 index 00000000000..c146ae02cee --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case3/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case3/query2.rq new file mode 100644 index 00000000000..7b0561a771c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 rdfs:label "Jennifer". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case4/query1.rq new file mode 100644 index 00000000000..66b00a028e8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case4/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + rdfs:label "Jennifer". + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case4/query2.rq new file mode 100644 index 00000000000..8a4f91968a9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/invalid/case4/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/shacl.ttl new file mode 100644 index 00000000000..5848700e73a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/shacl.ttl @@ -0,0 +1,35 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetShape [ + a sh:NodeShape ; + sh:and ( + [ + sh:path rdf:type; + sh:hasValue ex:Person + ] + + [ + sh:path rdfs:label; + sh:or ( + [ sh:hasValue "Peter" ] + [ sh:hasValue "Jennifer" ] + [ sh:hasValue "Sue" ] + ) + ] + ); + ] ; + + sh:property [ + sh:path ex:knows ; + sh:class ex:Person ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case1/query1.rq new file mode 100644 index 00000000000..6002e158f3b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case1/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + rdfs:label "Jennifer"; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query1.rq new file mode 100644 index 00000000000..891ac22cdd0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query3.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query3.rq new file mode 100644 index 00000000000..4506c1cded7 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case2/query3.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 rdfs:label "Jennifer" +. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case3/query1.rq new file mode 100644 index 00000000000..643b9f45dae --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + rdfs:label "Not Jennifer"; + ex:knows ex:peter. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case1/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case2/query1.rq new file mode 100644 index 00000000000..2433dceb50d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case3/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case3/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case3/query2.rq new file mode 100644 index 00000000000..d6260a23cc6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case4/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case4/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case4/query2.rq new file mode 100644 index 00000000000..91340e62887 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case4/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:apple. + +ex:apple a ex:Company. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case5/query1.rq new file mode 100644 index 00000000000..326bbd793e5 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case5/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. +ex:steve a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case5/query2.rq new file mode 100644 index 00000000000..f41dc5eb40b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case5/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { +ex:steve a ex:Person. + +} + +INSERT { + +ex:validPerson1 ex:knows ex:steve. + + +} + where {?a ?b ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case6/query1.rq new file mode 100644 index 00000000000..4fac7590f39 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case6/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] a ex:Person ; + ex:knows _:b1. + +_:b1 a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case6/query2.rq new file mode 100644 index 00000000000..b541c22f109 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case6/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ?b ?c ?d. +} where { + ?a ex:knows ?b. + ?b ?c ?d. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case7/query1.rq new file mode 100644 index 00000000000..90321287df1 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case7/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows "peter". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case8/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case8/query1.rq new file mode 100644 index 00000000000..d70433f6490 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case8/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:SecondTarget ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case9/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case9/query1.rq new file mode 100644 index 00000000000..3b0260d322e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case9/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:SecondTarget ; + ex:knows ex:peter. + +ex:peter a ex:SecondTarget. +ex:steve a ex:SecondTarget. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case9/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case9/query2.rq new file mode 100644 index 00000000000..ff11e51979b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/invalid/case9/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { +ex:steve a ex:SecondTarget. + +} + +INSERT { + +ex:validPerson1 ex:knows ex:steve. + + +} + where {?a ?b ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl new file mode 100644 index 00000000000..b4d1bc61c44 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl @@ -0,0 +1,24 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetShape [ + a sh:NodeShape ; + sh:property [ + sh:path rdf:type ; + dash:valueIn (ex:Person ex:SecondTarget) ; + ] + ] ; + + sh:property [ + sh:path ex:knows ; + sh:class ex:Person ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case1/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case1/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case2/query1.rq new file mode 100644 index 00000000000..b7d5f6fee0a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case2/query2.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case3/query1.rq new file mode 100644 index 00000000000..891ac22cdd0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case3/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case3/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case4/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case4/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case4/query2.rq new file mode 100644 index 00000000000..2f9b7356d6d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case4/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +ex:validPerson1 ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case5/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case5/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case5/query2.rq new file mode 100644 index 00000000000..e2679f98f74 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case5/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case6/query1.rq new file mode 100644 index 00000000000..4fac7590f39 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case6/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] a ex:Person ; + ex:knows _:b1. + +_:b1 a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case7/query1.rq new file mode 100644 index 00000000000..404ff929ba9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case7/query1.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "steve". +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case7/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case7/query2.rq new file mode 100644 index 00000000000..1045001b94c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/valid/case7/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ex:validPerson1 ex:knows "steve". +} insert { + ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + ex:peter a ex:Person. + +} where { + ?a ?b ?c +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case1/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case1/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case2/query1.rq new file mode 100644 index 00000000000..2fbe59d56e9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. +ex:peter a ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case3/query1.rq new file mode 100644 index 00000000000..05bd93a8e18 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case3/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case3/query2.rq new file mode 100644 index 00000000000..d6260a23cc6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case4/query1.rq new file mode 100644 index 00000000000..05bd93a8e18 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case4/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case4/query2.rq new file mode 100644 index 00000000000..61aa5d94619 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case4/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + ex:validPerson1 ex:knows ex:apple. + + ex:apple a ex:Company. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case5/query1.rq new file mode 100644 index 00000000000..dd6b66be12f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case5/query1.rq @@ -0,0 +1,17 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person, ex:Human. +ex:steve a ex:Person, ex:Human. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case5/query2.rq new file mode 100644 index 00000000000..813f2e23eaa --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case5/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { +ex:steve a ex:Person. + +} + +INSERT { + +ex:validPerson1 ex:knows ex:steve. + + +} + where {?a ?b ?c} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case6/query1.rq new file mode 100644 index 00000000000..08750d28a3f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case6/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] a ex:Person ; + ex:knows _:b1. + +_:b1 a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case6/query2.rq new file mode 100644 index 00000000000..b541c22f109 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case6/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ?b ?c ?d. +} where { + ?a ex:knows ?b. + ?b ?c ?d. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case7/query1.rq new file mode 100644 index 00000000000..90321287df1 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case7/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows "peter". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case8/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case8/query1.rq new file mode 100644 index 00000000000..692e8d29f22 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case8/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:SecondTarget ; + ex:knows ex:peter. + +ex:peter a "text". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case9/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case9/query1.rq new file mode 100644 index 00000000000..3b0260d322e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case9/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:SecondTarget ; + ex:knows ex:peter. + +ex:peter a ex:SecondTarget. +ex:steve a ex:SecondTarget. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case9/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case9/query2.rq new file mode 100644 index 00000000000..327a0dbea22 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/invalid/case9/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { +ex:steve a ex:SecondTarget. + +} + +INSERT { + +ex:validPerson1 ex:knows ex:steve. + + +} + where {?a ?b ?c} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/shacl.ttl new file mode 100644 index 00000000000..8e44cf9cbb0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/shacl.ttl @@ -0,0 +1,40 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix rdf4j-sh: . + +ex:PersonShape + a sh:NodeShape ; + + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + + PREFIX ex: + PREFIX owl: + PREFIX rdf: + PREFIX rdfs: + PREFIX sh: + PREFIX xsd: + + SELECT ?this + WHERE { + { + ?this a ex:Person . + } union { + ?this a ex:SecondTarget . + } + } + """ ; + ] ; + + sh:property [ + sh:path ex:knows ; + sh:and ( [sh:class ex:Person] [sh:class ex:Human]) + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case1/query1.rq new file mode 100644 index 00000000000..05bd93a8e18 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case1/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case2/query1.rq new file mode 100644 index 00000000000..fcba699380e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:peter a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case2/query2.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case3/query1.rq new file mode 100644 index 00000000000..b4df2d11b93 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case3/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case3/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case4/query1.rq new file mode 100644 index 00000000000..05bd93a8e18 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case4/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case4/query2.rq new file mode 100644 index 00000000000..2f9b7356d6d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case4/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +ex:validPerson1 ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case5/query1.rq new file mode 100644 index 00000000000..05bd93a8e18 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case5/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case5/query2.rq new file mode 100644 index 00000000000..e2679f98f74 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case5/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + +ex:peter a ex:Person. + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case6/query1.rq new file mode 100644 index 00000000000..08750d28a3f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case6/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] a ex:Person ; + ex:knows _:b1. + +_:b1 a ex:Person, ex:Human. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case7/query1.rq new file mode 100644 index 00000000000..404ff929ba9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case7/query1.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "steve". +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case7/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case7/query2.rq new file mode 100644 index 00000000000..d7ddc0182b6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTarget/valid/case7/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ex:validPerson1 ex:knows "steve". +} insert { + ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + ex:peter a ex:Person, ex:Human. + +} where { + ?a ?b ?c +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case1/query1.rq new file mode 100644 index 00000000000..4fe46ddbeb4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case1/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case2/query1.rq new file mode 100644 index 00000000000..b7d5f6fee0a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case2/query2.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case3/query1.rq new file mode 100644 index 00000000000..891ac22cdd0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case3/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case3/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case6/query1.rq new file mode 100644 index 00000000000..4fac7590f39 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case6/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] a ex:Person ; + ex:knows _:b1. + +_:b1 a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case7/query1.rq new file mode 100644 index 00000000000..404ff929ba9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case7/query1.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "steve". +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case7/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case7/query2.rq new file mode 100644 index 00000000000..1045001b94c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case7/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ex:validPerson1 ex:knows "steve". +} insert { + ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + ex:peter a ex:Person. + +} where { + ?a ?b ?c +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case8/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case8/query1.rq new file mode 100644 index 00000000000..e90ffe7314f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case8/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case8/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case8/query2.rq new file mode 100644 index 00000000000..b7d5f6fee0a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/invalid/case8/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:peter a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/shacl.ttl new file mode 100644 index 00000000000..83e032e86bd --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/shacl.ttl @@ -0,0 +1,38 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + + PREFIX ex: + PREFIX owl: + PREFIX rdf: + PREFIX rdfs: + PREFIX sh: + PREFIX xsd: + + SELECT ?this + WHERE { + { + ?this a ex:Person . + } union { + ?this a ex:SecondTarget . + } + } + """ ; + ] ; + + sh:property [ + sh:path ex:knows ; + sh:not [ sh:class ex:Person ]; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case1/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case2/query1.rq new file mode 100644 index 00000000000..2433dceb50d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case4/query1.rq new file mode 100644 index 00000000000..babc0cb48fc --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case4/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case4/query2.rq new file mode 100644 index 00000000000..91340e62887 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case4/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:apple. + +ex:apple a ex:Company. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case5/query1.rq new file mode 100644 index 00000000000..2c04c26912d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case5/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +ex:steve a ex:Person. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case5/query2.rq new file mode 100644 index 00000000000..f41dc5eb40b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case5/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { +ex:steve a ex:Person. + +} + +INSERT { + +ex:validPerson1 ex:knows ex:steve. + + +} + where {?a ?b ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case6/query1.rq new file mode 100644 index 00000000000..1045b96ab5e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case6/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +[] a ex:Person ; + ex:knows _:b1. + +_:b1 a ex:Animal. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case6/query2.rq new file mode 100644 index 00000000000..b541c22f109 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case6/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ?b ?c ?d. +} where { + ?a ex:knows ?b. + ?b ?c ?d. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case7/query1.rq new file mode 100644 index 00000000000..90321287df1 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case7/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows "peter". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case8/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case8/query1.rq new file mode 100644 index 00000000000..d70433f6490 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case8/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:SecondTarget ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case9/query1.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case9/query1.rq new file mode 100644 index 00000000000..3b0260d322e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case9/query1.rq @@ -0,0 +1,16 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:SecondTarget ; + ex:knows ex:peter. + +ex:peter a ex:SecondTarget. +ex:steve a ex:SecondTarget. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case9/query2.rq b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case9/query2.rq new file mode 100644 index 00000000000..ff11e51979b --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/class/sparqlTargetNot/valid/case9/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { +ex:steve a ex:SecondTarget. + +} + +INSERT { + +ex:validPerson1 ex:knows ex:steve. + + +} + where {?a ?b ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/invalid/case1/query1.rq new file mode 100644 index 00000000000..deed631a6c4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/invalid/case1/query1.rq @@ -0,0 +1,107 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: +PREFIX dcat: +PREFIX dc: +PREFIX skos: +PREFIX foaf: + +INSERT DATA { + + + + a dcat:Catalog ; + dc:identifier "https://data.some.org/catalog" ; + dc:title "An example catalog" ; + dc:description "A longer description of what the catalog is, who maintains it, etc. Special characters should be properly handed (if the file is utf8 encoded), for instance for catalogs from Sant Adrià." ; + dc:issued "2013-04-26T00:00:00Z"^^xsd:dateTime ; + dc:modified "2013-05-22T09:38:45Z"^^xsd:dateTime ; + dc:language "en" ; + foaf:homepage ; + dc:license ; + dcat:dataset , . + + + a dcat:Dataset ; + dc:identifier "https://data.some.org/catalog/datasets/1" ; + dc:title "Example dataset 1" ; + dc:description "A longer description of dataset 1: includes three distributions, a CSV file, a PDF file and an API. Some special characters: Θεσσαλονίκη." ; + dcat:keyword "stats", "pollution" ; + dc:issued "2013-04-26T00:00:00Z"^^xsd:dateTime ; + dc:modified "2013-04-26T00:00:00Z"^^xsd:dateTime ; + dc:language "en" ; + dc:license ; + dc:subject ; + dc:publisher [ + a foaf:Organization ; + foaf:name "Publishing Organization for dataset 1" ; + foaf:mbox "contact@some.org" + ] ; + dcat:distribution [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/1/distribution/1" ; + dc:title "A distribution for this dataset in CSV format" ; + dc:description "A longer description for the distribution" ; + dcat:downloadURL ; + dcat:mediaType "text/csv" ; + dc:license + ], [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/1/distribution/2" ; + dc:title "A distribution for this dataset in PDF format" ; + dc:description "A longer description for the distribution" ; + dcat:downloadURL ; + dc:format [ + a dc:IMT ; + rdf:value "application/pdf" + ] ; + dc:license + ], [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/1/distribution/3" ; + dc:title "A distribution for this dataset as an API" ; + dc:description "A longer description for the distribution" ; + dcat:accessURL + ] . + + + a dcat:Dataset ; + dc:identifier "https://data.some.org/catalog/datasets/2" ; + dc:description "A longer description of dataset 2: with two distributions, a website and a PDF file. Some special characters: Łódź" ; + dcat:keyword "stats", "education", "sloths" ; + dc:issued "2012-06-21"^^xsd:date ; + dc:modified "2013-04-01"^^xsd:date ; + dc:subject ; + dc:license ; + dc:language "en" ; + dc:publisher [ + a foaf:Organization ; + foaf:name "Publishing Organization for dataset 2" ; + foaf:mbox "contact@another.org" + ] ; + dcat:distribution [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/2/distribution/1" ; + dc:title "A distribution for this dataset as an external website" ; + dc:description "A longer description for the distribution" ; + dcat:downloadURL ; + + dc:format "html" + ], [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/2/distribution/2" ; + dc:title "A distribution for this dataset in PDF format" ; + dc:description "A longer description for the distribution" ; + dcat:downloadURL ; + + dc:format [ + a dc:IMT ; + rdf:value "application/pdf" + ] + ] . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/invalid/case1/query2.rq b/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/invalid/case1/query2.rq new file mode 100644 index 00000000000..de02bd3aa8f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/invalid/case1/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: +PREFIX dcat: +PREFIX dc: +PREFIX skos: +PREFIX foaf: + +INSERT DATA { + + + + dcat:distribution []. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/shacl.ttl new file mode 100644 index 00000000000..a0205059b5d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/shacl.ttl @@ -0,0 +1,51 @@ +@prefix sh: . +@prefix schema: . +@prefix spdx: . +@prefix dct: . +@prefix adms: . +@prefix owl: . +@prefix xsd: . +@prefix skos: . +@prefix rdfs: . +@prefix vcard: . +@prefix dcat: . +@prefix foaf: . +@prefix rdf4j-sh: . +@prefix ex: . + + +ex:PersonShape + a sh:NodeShape ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX ex: + PREFIX owl: + PREFIX rdf: + PREFIX rdfs: + PREFIX sh: + PREFIX xsd: + PREFIX dcat: + PREFIX dc: + PREFIX skos: + PREFIX foaf: + + + SELECT ?this + WHERE { + # we want to validate that all Datasets with >=3 Distributions has a dc:title + ?this a dcat:Dataset . + ?this dcat:distribution ?distribution. + FILTER(! EXISTS {?this dc:language "no"}) + } + GROUP BY ?this + HAVING(COUNT(?distribution) >= 3) + """ ; + ] ; + + sh:property [ + sh:path dc:title ; + sh:minCount 1 ; + ] . + + diff --git a/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/valid/case1/query1.rq new file mode 100644 index 00000000000..deed631a6c4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/complex/sparqlTarget/valid/case1/query1.rq @@ -0,0 +1,107 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: +PREFIX dcat: +PREFIX dc: +PREFIX skos: +PREFIX foaf: + +INSERT DATA { + + + + a dcat:Catalog ; + dc:identifier "https://data.some.org/catalog" ; + dc:title "An example catalog" ; + dc:description "A longer description of what the catalog is, who maintains it, etc. Special characters should be properly handed (if the file is utf8 encoded), for instance for catalogs from Sant Adrià." ; + dc:issued "2013-04-26T00:00:00Z"^^xsd:dateTime ; + dc:modified "2013-05-22T09:38:45Z"^^xsd:dateTime ; + dc:language "en" ; + foaf:homepage ; + dc:license ; + dcat:dataset , . + + + a dcat:Dataset ; + dc:identifier "https://data.some.org/catalog/datasets/1" ; + dc:title "Example dataset 1" ; + dc:description "A longer description of dataset 1: includes three distributions, a CSV file, a PDF file and an API. Some special characters: Θεσσαλονίκη." ; + dcat:keyword "stats", "pollution" ; + dc:issued "2013-04-26T00:00:00Z"^^xsd:dateTime ; + dc:modified "2013-04-26T00:00:00Z"^^xsd:dateTime ; + dc:language "en" ; + dc:license ; + dc:subject ; + dc:publisher [ + a foaf:Organization ; + foaf:name "Publishing Organization for dataset 1" ; + foaf:mbox "contact@some.org" + ] ; + dcat:distribution [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/1/distribution/1" ; + dc:title "A distribution for this dataset in CSV format" ; + dc:description "A longer description for the distribution" ; + dcat:downloadURL ; + dcat:mediaType "text/csv" ; + dc:license + ], [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/1/distribution/2" ; + dc:title "A distribution for this dataset in PDF format" ; + dc:description "A longer description for the distribution" ; + dcat:downloadURL ; + dc:format [ + a dc:IMT ; + rdf:value "application/pdf" + ] ; + dc:license + ], [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/1/distribution/3" ; + dc:title "A distribution for this dataset as an API" ; + dc:description "A longer description for the distribution" ; + dcat:accessURL + ] . + + + a dcat:Dataset ; + dc:identifier "https://data.some.org/catalog/datasets/2" ; + dc:description "A longer description of dataset 2: with two distributions, a website and a PDF file. Some special characters: Łódź" ; + dcat:keyword "stats", "education", "sloths" ; + dc:issued "2012-06-21"^^xsd:date ; + dc:modified "2013-04-01"^^xsd:date ; + dc:subject ; + dc:license ; + dc:language "en" ; + dc:publisher [ + a foaf:Organization ; + foaf:name "Publishing Organization for dataset 2" ; + foaf:mbox "contact@another.org" + ] ; + dcat:distribution [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/2/distribution/1" ; + dc:title "A distribution for this dataset as an external website" ; + dc:description "A longer description for the distribution" ; + dcat:downloadURL ; + + dc:format "html" + ], [ + a dcat:Distribution ; + dc:identifier "https://data.some.org/catalog/datasets/2/distribution/2" ; + dc:title "A distribution for this dataset in PDF format" ; + dc:description "A longer description for the distribution" ; + dcat:downloadURL ; + + dc:format [ + a dc:IMT ; + rdf:value "application/pdf" + ] + ] . + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case1/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case1/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case2/query1.rq new file mode 100644 index 00000000000..1b1bd9ebca2 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case2/query2.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/shacl.ttl new file mode 100644 index 00000000000..8a07f014c49 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/shacl.ttl @@ -0,0 +1,14 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:target [a dash:AllObjectsTarget] ; + sh:datatype xsd:integer . + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case1/query1.rq new file mode 100644 index 00000000000..1b1bd9ebca2 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case1/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case2/query1.rq new file mode 100644 index 00000000000..1b1bd9ebca2 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case2/query2.rq new file mode 100644 index 00000000000..2f2679c5f1e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/allObjects/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age 234. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/shacl.ttl new file mode 100644 index 00000000000..058ccc92c45 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/shacl.ttl @@ -0,0 +1,24 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:not [ + sh:and ( + [ + sh:path ex:age ; + sh:datatype xsd:boolean + ] + [ + sh:path ex:age ; + sh:datatype xsd:string + ] + ); + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case1/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case2/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case2/query2.rq new file mode 100644 index 00000000000..2f2679c5f1e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age 234. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case3/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case3/query2.rq new file mode 100644 index 00000000000..d511402c811 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + ex:age 234 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case4/query1.rq new file mode 100644 index 00000000000..06eed13cecf --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case4/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson1 + ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case4/query2.rq new file mode 100644 index 00000000000..0271cd39620 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case4/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ex:validPerson1 + ex:age "123". +} insert { + + ex:validPerson1 + ex:age 234 ; + a ex:Person . + +} where { + ?a ?b ?c. +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case5/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case5/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case5/query2.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case5/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case6/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case6/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case6/query2.rq new file mode 100644 index 00000000000..f957a102c63 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case6/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:age 234 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case7/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case7/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case7/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case7/query2.rq new file mode 100644 index 00000000000..b150d122df4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case7/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:age 234 ; + a ex:Person . + +ex:validPerson2 + ex:age 235 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case8/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case8/query1.rq new file mode 100644 index 00000000000..c71cc4d23fb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeAnd/valid/case8/query1.rq @@ -0,0 +1,17 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age true. + +ex:validPerson2 a ex:Person ; + ex:age "abc". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case1/query1.rq new file mode 100644 index 00000000000..b02e02cf69a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case3/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case3/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/shacl.ttl new file mode 100644 index 00000000000..a6e19ceac43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/shacl.ttl @@ -0,0 +1,16 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetShape [ sh:property [sh:path rdf:type; sh:hasValue ex:Person ]]; + sh:not [ + sh:path ex:age ; + sh:or ([sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ); + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case1/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case2/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case2/query2.rq new file mode 100644 index 00000000000..2f2679c5f1e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age 234. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case3/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case3/query2.rq new file mode 100644 index 00000000000..d511402c811 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + ex:age 234 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case4/query1.rq new file mode 100644 index 00000000000..06eed13cecf --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case4/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson1 + ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case4/query2.rq new file mode 100644 index 00000000000..0271cd39620 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case4/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ex:validPerson1 + ex:age "123". +} insert { + + ex:validPerson1 + ex:age 234 ; + a ex:Person . + +} where { + ?a ?b ?c. +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case5/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case5/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case5/query2.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case5/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case6/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case6/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case6/query2.rq new file mode 100644 index 00000000000..f957a102c63 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case6/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:age 234 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case7/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case7/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case7/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case7/query2.rq new file mode 100644 index 00000000000..e3d819e193a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/valid/case7/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:age 234 ; + a ex:Person . + +ex:validPerson2 + ex:age 234 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case1/query1.rq new file mode 100644 index 00000000000..b02e02cf69a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case2/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case2/query2.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case3/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case3/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case4/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case4/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case4/query2.rq new file mode 100644 index 00000000000..f957a102c63 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case4/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:age 234 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case5/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case5/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case5/query2.rq new file mode 100644 index 00000000000..e3d819e193a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/invalid/case5/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:age 234 ; + a ex:Person . + +ex:validPerson2 + ex:age 234 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/shacl.ttl new file mode 100644 index 00000000000..d0a93782b45 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/shacl.ttl @@ -0,0 +1,17 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetShape [ sh:property [sh:path rdf:type; sh:hasValue ex:Person ]]; + sh:property [ + sh:path ex:age ; + sh:not [ sh:datatype xsd:boolean ]; + sh:not [ sh:datatype xsd:string ]; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case1/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case2/query1.rq new file mode 100644 index 00000000000..2db11fdda43 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case2/query2.rq new file mode 100644 index 00000000000..2f2679c5f1e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age 234. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case3/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case3/query2.rq new file mode 100644 index 00000000000..d511402c811 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + ex:age 234 ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case4/query1.rq new file mode 100644 index 00000000000..06eed13cecf --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case4/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson1 + ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case4/query2.rq new file mode 100644 index 00000000000..0271cd39620 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/valid/case4/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ex:validPerson1 + ex:age "123". +} insert { + + ex:validPerson1 + ex:age 234 ; + a ex:Person . + +} where { + ?a ?b ?c. +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case1/query1.rq new file mode 100644 index 00000000000..73c59360fc7 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:type ex:Person ; + ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case2/query1.rq new file mode 100644 index 00000000000..42608623661 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:type ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case2/query2.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case3/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case3/query2.rq new file mode 100644 index 00000000000..87d1c5bb580 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:type ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case4/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case4/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case4/query2.rq new file mode 100644 index 00000000000..2ab64b3d8f9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case4/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:age 234 ; + ex:type ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case5/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case5/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case5/query2.rq new file mode 100644 index 00000000000..f38d96f8fcc --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/invalid/case5/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:age 234 ; + ex:type ex:Person . + +ex:validPerson2 + ex:age 234 ; + ex:type ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/shacl.ttl new file mode 100644 index 00000000000..43cbe515be5 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/shacl.ttl @@ -0,0 +1,36 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix rdf4j-sh: . + + + + +ex:PersonShape + a sh:NodeShape ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + PREFIX ex: + PREFIX owl: + PREFIX rdf: + PREFIX rdfs: + PREFIX sh: + PREFIX xsd: + + SELECT ?this + WHERE { + ?this ex:type ex:Person . + } + """ ; + ] ; + + sh:property [ + sh:path ex:age ; + sh:datatype xsd:integer ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case1/query1.rq new file mode 100644 index 00000000000..42608623661 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:type ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case2/query1.rq new file mode 100644 index 00000000000..42608623661 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:type ex:Person ; + ex:age 123. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case2/query2.rq new file mode 100644 index 00000000000..2f2679c5f1e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age 234. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case3/query1.rq new file mode 100644 index 00000000000..3fdba605ade --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case3/query2.rq new file mode 100644 index 00000000000..3b93ab33fd0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + ex:age 234 ; + ex:type ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case4/query1.rq new file mode 100644 index 00000000000..06eed13cecf --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case4/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson1 + ex:age "123". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case4/query2.rq new file mode 100644 index 00000000000..1faa3b77f98 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/sparqlTarget/valid/case4/query2.rq @@ -0,0 +1,19 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +delete { + ex:validPerson1 + ex:age "123". +} insert { + + ex:validPerson1 + ex:age 234 ; + ex:type ex:Person . + +} where { + ?a ?b ?c. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case1/query1.rq new file mode 100644 index 00000000000..756e1677167 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case2/query1.rq new file mode 100644 index 00000000000..b4a42cfa63a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/and/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/shacl.ttl new file mode 100644 index 00000000000..f73e40f3978 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/shacl.ttl @@ -0,0 +1,28 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:and ( + [ + + sh:path ex:knows ; + sh:hasValue ex:peter ; + + ] + + [ + + sh:path ex:knows ; + sh:hasValue ex:steve ; + + ] + + ) . + diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case1/query1.rq new file mode 100644 index 00000000000..8f59e0b77c2 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case1/query1.rq @@ -0,0 +1,14 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:steve, ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case3/query1.rq new file mode 100644 index 00000000000..b4a42cfa63a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case3/query2.rq new file mode 100644 index 00000000000..241633b7f86 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/and/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:validPerson1 + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case1/query1.rq new file mode 100644 index 00000000000..6c78b96a5eb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case2/query1.rq new file mode 100644 index 00000000000..2d190bb40c9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person . + + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case2/query2.rq new file mode 100644 index 00000000000..2d7a2519ff9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case3/query1.rq new file mode 100644 index 00000000000..6687f5d9426 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case3/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case5/query1.rq new file mode 100644 index 00000000000..2976785b4d4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case5/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "1234567". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case5/query2.rq new file mode 100644 index 00000000000..f576f939408 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/invalid/case5/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:knows [], ex:peter ; + a ex:Person . + +ex:validPerson2 + ex:knows [] ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/shacl.ttl new file mode 100644 index 00000000000..00ad1b8e12a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/shacl.ttl @@ -0,0 +1,16 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property [ + sh:path ex:knows ; + sh:not [sh:hasValue ex:peter ]; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case1/query1.rq new file mode 100644 index 00000000000..1756cb0a83c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case2/query1.rq new file mode 100644 index 00000000000..1756cb0a83c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case2/query2.rq new file mode 100644 index 00000000000..c2bcddb088d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case3/query1.rq new file mode 100644 index 00000000000..0af6f705213 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. +. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case3/query2.rq new file mode 100644 index 00000000000..bd094e00557 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not/valid/case3/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case1/query1.rq new file mode 100644 index 00000000000..b88a296dc36 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter, ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case2/query1.rq new file mode 100644 index 00000000000..e7acbcbfd14 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter, ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query1.rq new file mode 100644 index 00000000000..fbacf40606d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query2.rq new file mode 100644 index 00000000000..86776390b06 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query3.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query3.rq new file mode 100644 index 00000000000..8a4f91968a9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case4/query3.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case5/query1.rq new file mode 100644 index 00000000000..fbacf40606d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case5/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case5/query2.rq new file mode 100644 index 00000000000..ff52f4339a3 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/invalid/case5/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter, ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/shacl.ttl new file mode 100644 index 00000000000..c7d9c14de83 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/shacl.ttl @@ -0,0 +1,30 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:not [ + sh:and ( + [ + + sh:path ex:knows ; + sh:hasValue ex:peter ; + + ] + + [ + + sh:path ex:knows ; + sh:hasValue ex:steve ; + + ] + + ) + ]. + diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case1/query1.rq new file mode 100644 index 00000000000..52610fd09d0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case1/query1.rq @@ -0,0 +1,14 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case2/query1.rq new file mode 100644 index 00000000000..1756cb0a83c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case2/query2.rq new file mode 100644 index 00000000000..151db0cd375 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case3/query1.rq new file mode 100644 index 00000000000..85cf366ffa8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. +. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case3/query2.rq new file mode 100644 index 00000000000..bd094e00557 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case3/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case4/query1.rq new file mode 100644 index 00000000000..230ab378dd0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case4/query1.rq @@ -0,0 +1,14 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:steve. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case5/query1.rq new file mode 100644 index 00000000000..8c311b26aea --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case5/query1.rq @@ -0,0 +1,17 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:steve. + +ex:validPerson2 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case6/query1.rq new file mode 100644 index 00000000000..52610fd09d0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case6/query1.rq @@ -0,0 +1,14 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case6/query2.rq new file mode 100644 index 00000000000..717cdfe424f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/not2/valid/case6/query2.rq @@ -0,0 +1,15 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE { + ex:validPerson1 a ex:Person . +} +INSERT{ + ex:validPerson1 ex:knows ex:steve. +} +WHERE{ ?a ?b ?c} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case1/query1.rq new file mode 100644 index 00000000000..ebd071d8077 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows "1234567". + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case2/query1.rq new file mode 100644 index 00000000000..5ea65f2709d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "1234567". + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case3/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case3/query2.rq new file mode 100644 index 00000000000..e5401cf6e9a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + + ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case4/query1.rq new file mode 100644 index 00000000000..2976785b4d4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case4/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "1234567". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case4/query2.rq new file mode 100644 index 00000000000..44a8b9a2258 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/invalid/case4/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:knows [], ex:pete ; + a ex:Person . + +ex:validPerson2 + ex:knows [] ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/shacl.ttl new file mode 100644 index 00000000000..9b261e75e45 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/shacl.ttl @@ -0,0 +1,16 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property [ + sh:path ex:knows ; + sh:hasValue ex:peter ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case1/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case2/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case2/query2.rq new file mode 100644 index 00000000000..c2bcddb088d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case3/query1.rq new file mode 100644 index 00000000000..0af6f705213 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. +. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case3/query2.rq new file mode 100644 index 00000000000..b526001d7ba --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + ex:knows ex:peter ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case4/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case4/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case5/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case5/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case5/query2.rq new file mode 100644 index 00000000000..f727aa67379 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case5/query2.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + ex:validPerson1 a ex:Person . + ex:validPerson1 ex:knows ex:peter. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case6/query1.rq new file mode 100644 index 00000000000..63c03fe0fe1 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case6/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:steve, ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case6/query2.rq new file mode 100644 index 00000000000..5dbb5447d25 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/simple/valid/case6/query2.rq @@ -0,0 +1,10 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + ex:validPerson1 ex:knows ex:steve. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/shacl.ttl new file mode 100644 index 00000000000..f17b0b321ee --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/shacl.ttl @@ -0,0 +1,15 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetNode ex:peter ; + sh:hasValue ex:peter ; + . + diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case1/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case2/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case2/query2.rq new file mode 100644 index 00000000000..c2bcddb088d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode2/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode2/invalid/case1/query1.rq new file mode 100644 index 00000000000..5b8b19fb3fb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode2/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:steve. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode2/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode2/shacl.ttl new file mode 100644 index 00000000000..2b7198e3ccf --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/hasValue/targetNode2/shacl.ttl @@ -0,0 +1,15 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetNode ex:steve ; + sh:hasValue ex:peter ; + . + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case1/query1.rq new file mode 100644 index 00000000000..dff1e90e462 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:ssn "123", "234", "567", "890". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case2/query1.rq new file mode 100644 index 00000000000..abfcb0fd422 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case2/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:ssn "123", "234", "567", "890". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case2/query2.rq new file mode 100644 index 00000000000..416b3ec7838 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case2/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query1.rq new file mode 100644 index 00000000000..b7c9c097bae --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:ssn "123", "234", "567". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query2.rq new file mode 100644 index 00000000000..416b3ec7838 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person. + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query3.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query3.rq new file mode 100644 index 00000000000..f268e310c69 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/invalid/case3/query3.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:ssn "123456789". + +} + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/shacl.ttl new file mode 100644 index 00000000000..8246952dec6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/shacl.ttl @@ -0,0 +1,32 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + + PREFIX ex: + PREFIX owl: + PREFIX rdf: + PREFIX rdfs: + PREFIX sh: + PREFIX xsd: + + SELECT ?this + WHERE { + ?this a ex:Person . + } + """ ; + ] ; sh:property [ + sh:path ex:ssn ; + sh:maxCount 3 + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case1/query1.rq new file mode 100644 index 00000000000..6e694b45915 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case1/query1.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:ssn "123", "456", "789". + +ex:validPerson2 ex:ssn "123". + +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case2/query1.rq new file mode 100644 index 00000000000..7354a2d0833 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case2/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person ; + ex:ssn "123", "456". + +ex:validPerson2 ex:ssn "123". + +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case2/query2.rq new file mode 100644 index 00000000000..d83a28ac680 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case2/query2.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson2 a ex:Person; + ex:ssn "456". +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query1.rq new file mode 100644 index 00000000000..7354a2d0833 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person ; + ex:ssn "123", "456". + +ex:validPerson2 ex:ssn "123". + +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query2.rq new file mode 100644 index 00000000000..5063168f846 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query2.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson2 a ex:Person; + ex:ssn "456", "789". +} diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query3.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query3.rq new file mode 100644 index 00000000000..ca547863a38 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case3/query3.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE { +ex:validPerson2 a ex:Person. +} +INSERT{ +ex:validPerson2 ex:ssn "123456789". +} +WHERE{?a ?b ?c} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case4/query1.rq new file mode 100644 index 00000000000..4f6ec8cb08a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case4/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person ; + ex:ssn "123", "456". + +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case4/query2.rq new file mode 100644 index 00000000000..85bca204cda --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/maxCount/sparqlTarget/valid/case4/query2.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 ex:ssn "123", "456", "789". + +} \ No newline at end of file diff --git a/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/invalid/case1/query1.rq new file mode 100644 index 00000000000..5311a970d3f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:iriOr10LengthEnglishNorwegianLiteral 12345678901. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/invalid/case2/query1.rq new file mode 100644 index 00000000000..5311a970d3f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:iriOr10LengthEnglishNorwegianLiteral 12345678901. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/shacl.ttl new file mode 100644 index 00000000000..71d32d5a8cc --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/shacl.ttl @@ -0,0 +1,42 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . + +ex:PersonShape + a sh:NodeShape ; + sh:target [ + a sh:SPARQLTarget ; + sh:select """ + + PREFIX ex: + PREFIX owl: + PREFIX rdf: + PREFIX rdfs: + PREFIX sh: + PREFIX xsd: + + SELECT ?this + WHERE { + ?this a ex:Person . + } + """ ; + ]; + sh:property [ + sh:path ex:iriOr10LengthEnglishNorwegianLiteral ; + + sh:or ( + [ + sh:nodeKind sh:IRI ; + ] + [ + sh:minLength 10 ; + sh:nodeKind sh:Literal ; + sh:languageIn ("no" "en") ; + ] + ) ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/valid/case1/query1.rq new file mode 100644 index 00000000000..811cedf037c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:iriOr10LengthEnglishNorwegianLiteral "12345678901"@no . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/valid/case2/query1.rq new file mode 100644 index 00000000000..37273442806 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/or/implicitAndSparqlTarget/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:iriOr10LengthEnglishNorwegianLiteral ex:pete. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case1/query1.rq new file mode 100644 index 00000000000..756e1677167 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query1.rq new file mode 100644 index 00000000000..b4a42cfa63a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/shacl.ttl new file mode 100644 index 00000000000..b559625ab94 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/shacl.ttl @@ -0,0 +1,29 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:and ( + [ + + sh:path ex:knows ; + dash:valueIn (ex:peter ex:mary ex:kate) ; + + ] + + [ + + sh:path ex:knows ; + dash:valueIn (ex:steve) ; + + ] + + ) . + diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case1/query1.rq new file mode 100644 index 00000000000..8f59e0b77c2 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case1/query1.rq @@ -0,0 +1,14 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:steve, ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query1.rq new file mode 100644 index 00000000000..b4a42cfa63a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query2.rq new file mode 100644 index 00000000000..241633b7f86 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +ex:validPerson1 + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case1/query1.rq new file mode 100644 index 00000000000..6c78b96a5eb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query1.rq new file mode 100644 index 00000000000..2d190bb40c9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { +ex:validPerson1 a ex:Person . + + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query2.rq new file mode 100644 index 00000000000..2d7a2519ff9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query1.rq new file mode 100644 index 00000000000..6687f5d9426 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query1.rq new file mode 100644 index 00000000000..2976785b4d4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "1234567". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query2.rq new file mode 100644 index 00000000000..f576f939408 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:knows [], ex:peter ; + a ex:Person . + +ex:validPerson2 + ex:knows [] ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/shacl.ttl new file mode 100644 index 00000000000..f5f3b95f1c9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/shacl.ttl @@ -0,0 +1,17 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property [ + sh:path ex:knows ; + sh:not [dash:valueIn (ex:peter ex:mary ex:kate) ]; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case1/query1.rq new file mode 100644 index 00000000000..1756cb0a83c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query1.rq new file mode 100644 index 00000000000..1756cb0a83c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query2.rq new file mode 100644 index 00000000000..c2bcddb088d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query1.rq new file mode 100644 index 00000000000..0af6f705213 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. +. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query2.rq new file mode 100644 index 00000000000..bd094e00557 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case1/query1.rq new file mode 100644 index 00000000000..b88a296dc36 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter, ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query1.rq new file mode 100644 index 00000000000..e7acbcbfd14 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter, ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query1.rq new file mode 100644 index 00000000000..fbacf40606d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query2.rq new file mode 100644 index 00000000000..86776390b06 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query3.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query3.rq new file mode 100644 index 00000000000..8a4f91968a9 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query3.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query1.rq new file mode 100644 index 00000000000..fbacf40606d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query2.rq new file mode 100644 index 00000000000..ff52f4339a3 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query2.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:peter, ex:steve. + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/shacl.ttl new file mode 100644 index 00000000000..a5dcc4578c7 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/shacl.ttl @@ -0,0 +1,31 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:not [ + sh:and ( + [ + + sh:path ex:knows ; + dash:valueIn (ex:peter ex:mary ex:kate) ; + + ] + + [ + + sh:path ex:knows ; + dash:valueIn (ex:steve ex:mary ex:kate) ; + + ] + + ) + ]. + diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case1/query1.rq new file mode 100644 index 00000000000..52610fd09d0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case1/query1.rq @@ -0,0 +1,14 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query1.rq new file mode 100644 index 00000000000..1756cb0a83c --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query2.rq new file mode 100644 index 00000000000..151db0cd375 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query1.rq new file mode 100644 index 00000000000..85cf366ffa8 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows ex:steve. +. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query2.rq new file mode 100644 index 00000000000..bd094e00557 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query2.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case4/query1.rq new file mode 100644 index 00000000000..230ab378dd0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case4/query1.rq @@ -0,0 +1,14 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:steve. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case5/query1.rq new file mode 100644 index 00000000000..8c311b26aea --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case5/query1.rq @@ -0,0 +1,17 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:steve. + +ex:validPerson2 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query1.rq new file mode 100644 index 00000000000..52610fd09d0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query1.rq @@ -0,0 +1,14 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query2.rq new file mode 100644 index 00000000000..717cdfe424f --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query2.rq @@ -0,0 +1,15 @@ + +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE { + ex:validPerson1 a ex:Person . +} +INSERT{ + ex:validPerson1 ex:knows ex:steve. +} +WHERE{ ?a ?b ?c} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case1/query1.rq new file mode 100644 index 00000000000..ebd071d8077 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case1/query1.rq @@ -0,0 +1,14 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows "1234567". + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query1.rq new file mode 100644 index 00000000000..5ea65f2709d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "1234567". + + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query2.rq new file mode 100644 index 00000000000..93fb72304f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query2.rq new file mode 100644 index 00000000000..e5401cf6e9a --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + + ex:validPerson1 ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query1.rq new file mode 100644 index 00000000000..2976785b4d4 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query1.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows "1234567". + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query2.rq new file mode 100644 index 00000000000..44a8b9a2258 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query2.rq @@ -0,0 +1,18 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 + ex:knows [], ex:pete ; + a ex:Person . + +ex:validPerson2 + ex:knows [] ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/shacl.ttl new file mode 100644 index 00000000000..75cac87ea9d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/shacl.ttl @@ -0,0 +1,17 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass ex:Person ; + sh:property [ + sh:path ex:knows ; + dash:valueIn (ex:peter ex:mary ex:kate) ; + ] . + diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case1/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query2.rq new file mode 100644 index 00000000000..c2bcddb088d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query1.rq new file mode 100644 index 00000000000..0af6f705213 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. +. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query2.rq new file mode 100644 index 00000000000..b526001d7ba --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query2.rq @@ -0,0 +1,15 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + + +ex:validPerson2 + ex:knows ex:peter ; + a ex:Person . + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case4/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case4/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query2.rq new file mode 100644 index 00000000000..f727aa67379 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query2.rq @@ -0,0 +1,11 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + ex:validPerson1 a ex:Person . + ex:validPerson1 ex:knows ex:peter. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query1.rq new file mode 100644 index 00000000000..63c03fe0fe1 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:steve, ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query2.rq new file mode 100644 index 00000000000..5dbb5447d25 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query2.rq @@ -0,0 +1,10 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +DELETE DATA { + ex:validPerson1 ex:knows ex:steve. +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case7/query1.rq new file mode 100644 index 00000000000..1f71f3c3959 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case7/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:mary, ex:steve, ex:kate. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/shacl.ttl new file mode 100644 index 00000000000..eeca2ab7e0e --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/shacl.ttl @@ -0,0 +1,15 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetNode ex:peter ; + dash:valueIn (ex:peter ex:mary ex:kate) ; + . + diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case1/query1.rq new file mode 100644 index 00000000000..7b2e68408e6 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query1.rq new file mode 100644 index 00000000000..1e1db0745cb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows ex:peter. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query2.rq new file mode 100644 index 00000000000..c2bcddb088d --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query2.rq @@ -0,0 +1,12 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 ex:knows []. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/invalid/case1/query1.rq new file mode 100644 index 00000000000..5b8b19fb3fb --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/invalid/case1/query1.rq @@ -0,0 +1,13 @@ +PREFIX ex: +PREFIX owl: +PREFIX rdf: +PREFIX rdfs: +PREFIX sh: +PREFIX xsd: + +INSERT DATA { + +ex:validPerson1 a ex:Person ; + ex:knows [], ex:steve. + +} diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/shacl.ttl new file mode 100644 index 00000000000..fcba49c9d00 --- /dev/null +++ b/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/shacl.ttl @@ -0,0 +1,15 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix dash: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetNode ex:steve ; + dash:valueIn (ex:peter ex:mary ex:kate) ; + . + From 4811aaea22945604f1a6b1ec5d886f5d69f0ccc5 Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Tue, 30 Jun 2020 19:29:14 +1000 Subject: [PATCH 25/35] GH-1913 N3 owl:sameAs shorthand support (#2345) * GH-1913 Added N3Parser to handle '=' sign Signed-off-by: Tanisha Adding changes for N3Parser Signed-off-by: Tanisha Added header comment on N3Parser.java file Signed-off-by: Tanisha Re added author information in N3ParserFactory Signed-off-by: Tanisha Adjusted a comment Signed-off-by: Tanisha * GH-1913 Added a unit test and changed header comment Signed-off-by: Tanisha * GH-1913 Revert compliance changes Signed-off-by: Tanisha * GH-1913 cleaned up test a bit Co-authored-by: Tanisha --- .../org/eclipse/rdf4j/rio/n3/N3Parser.java | 84 +++++++++++++++++++ .../eclipse/rdf4j/rio/n3/N3ParserFactory.java | 6 +- .../eclipse/rdf4j/rio/n3/N3ParserTest.java | 69 +++++++++++++++ 3 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 core/rio/n3/src/main/java/org/eclipse/rdf4j/rio/n3/N3Parser.java create mode 100644 core/rio/n3/src/test/java/org/eclipse/rdf4j/rio/n3/N3ParserTest.java diff --git a/core/rio/n3/src/main/java/org/eclipse/rdf4j/rio/n3/N3Parser.java b/core/rio/n3/src/main/java/org/eclipse/rdf4j/rio/n3/N3Parser.java new file mode 100644 index 00000000000..494e2ee4a1f --- /dev/null +++ b/core/rio/n3/src/main/java/org/eclipse/rdf4j/rio/n3/N3Parser.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.rio.n3; + +import java.io.IOException; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.OWL; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.rio.RDFHandlerException; +import org.eclipse.rdf4j.rio.RDFParseException; +import org.eclipse.rdf4j.rio.turtle.TurtleParser; +import org.eclipse.rdf4j.rio.turtle.TurtleUtil; + +public class N3Parser extends TurtleParser { + + /*--------------* + * Constructors * + *--------------*/ + + /** + * Creates a new N3Parser that will use a {@link SimpleValueFactory} to create RDF model objects. + */ + public N3Parser() { + super(); + } + + /** + * Creates a new N3Parser that will use the supplied ValueFactory to create RDF model objects. + * + * @param valueFactory A ValueFactory. + */ + public N3Parser(ValueFactory valueFactory) { + super(valueFactory); + } + + @Override + protected IRI parsePredicate() throws IOException, RDFParseException, RDFHandlerException { + // Check if the short-cut 'a' or '=' is used + int c1 = readCodePoint(); + + if (c1 == 'a') { + int c2 = readCodePoint(); + + if (TurtleUtil.isWhitespace(c2)) { + // Short-cut is used, return the rdf:type URI + return RDF.TYPE; + } + + // Short-cut is not used, unread all characters + unread(c2); + } + if (c1 == '=') { + int c2 = readCodePoint(); + + if (TurtleUtil.isWhitespace(c2)) { + // Short-cut is used, return the owl:sameAs URI + return OWL.SAMEAS; + } + + // Short-cut is not used, unread all characters + unread(c2); + } + unread(c1); + + // Predicate is a normal resource + Value predicate = parseValue(); + if (predicate instanceof IRI) { + return (IRI) predicate; + } else { + reportFatalError("Illegal predicate value: " + predicate); + return null; + } + } + +} diff --git a/core/rio/n3/src/main/java/org/eclipse/rdf4j/rio/n3/N3ParserFactory.java b/core/rio/n3/src/main/java/org/eclipse/rdf4j/rio/n3/N3ParserFactory.java index feda1c80c45..766d78833ad 100644 --- a/core/rio/n3/src/main/java/org/eclipse/rdf4j/rio/n3/N3ParserFactory.java +++ b/core/rio/n3/src/main/java/org/eclipse/rdf4j/rio/n3/N3ParserFactory.java @@ -10,7 +10,7 @@ import org.eclipse.rdf4j.rio.RDFFormat; import org.eclipse.rdf4j.rio.RDFParser; import org.eclipse.rdf4j.rio.RDFParserFactory; -import org.eclipse.rdf4j.rio.turtle.TurtleParser; +import org.eclipse.rdf4j.rio.n3.N3Parser; /** * An {@link RDFParserFactory} for N3 parsers. @@ -28,10 +28,10 @@ public RDFFormat getRDFFormat() { } /** - * Returns a new instance of {@link TurtleParser}. + * Returns a new instance of {@link N3Parser}. */ @Override public RDFParser getParser() { - return new TurtleParser(); + return new N3Parser(); } } diff --git a/core/rio/n3/src/test/java/org/eclipse/rdf4j/rio/n3/N3ParserTest.java b/core/rio/n3/src/test/java/org/eclipse/rdf4j/rio/n3/N3ParserTest.java new file mode 100644 index 00000000000..d6b9547ddaa --- /dev/null +++ b/core/rio/n3/src/test/java/org/eclipse/rdf4j/rio/n3/N3ParserTest.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.rio.n3; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.io.StringReader; + +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.OWL; +import org.eclipse.rdf4j.rio.helpers.ParseErrorCollector; +import org.eclipse.rdf4j.rio.helpers.SimpleParseLocationListener; +import org.eclipse.rdf4j.rio.helpers.StatementCollector; +import org.junit.Before; +import org.junit.Test; + +/** + * @author tanisha + */ +public class N3ParserTest { + + private N3Parser parser; + + private ValueFactory vf = SimpleValueFactory.getInstance(); + + private final ParseErrorCollector errorCollector = new ParseErrorCollector(); + + private final StatementCollector statementCollector = new StatementCollector(); + + private final String prefixes = "@prefix ex: . \n@prefix : . \n"; + + private final String baseURI = "http://example.org/"; + + private SimpleParseLocationListener locationListener = new SimpleParseLocationListener(); + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() { + parser = new N3Parser(); + parser.setParseErrorListener(errorCollector); + parser.setRDFHandler(statementCollector); + parser.setParseLocationListener(locationListener); + } + + @Test + public void testParseEquals() throws IOException { + String data = prefixes + " ex:foo = ex:bar. "; + + parser.parse(new StringReader(data), baseURI); + + assertTrue(errorCollector.getWarnings().isEmpty()); + assertTrue(errorCollector.getErrors().isEmpty()); + assertTrue(errorCollector.getFatalErrors().isEmpty()); + + assertThat(statementCollector.getStatements()).containsExactly(vf.createStatement( + vf.createIRI("http://example.org/ex/foo"), OWL.SAMEAS, vf.createIRI("http://example.org/ex/bar"))); + } + +} From 31a5ac161336cf2cdb9d20bce838138895807faa Mon Sep 17 00:00:00 2001 From: hmottestad Date: Wed, 1 Jul 2020 21:55:37 +0200 Subject: [PATCH 26/35] Gh-2018 support for sh:value (#2341) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håvard Ottestad --- .../shacl/ShaclSailValidationException.java | 3 +- .../sail/shacl/SourceConstraintComponent.java | 66 +++++++++++++------ .../sail/shacl/results/ValidationResult.java | 33 ++++++++-- .../sail/shacl/ValidationReportTest.java | 24 ++++--- 4 files changed, 89 insertions(+), 37 deletions(-) diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java index 762a7914495..5aafd191909 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java @@ -59,8 +59,9 @@ public ValidationReport getValidationReport() { ArrayDeque propertyShapes = new ArrayDeque<>(invalidTuple.getCausedByPropertyShapes()); while (!propertyShapes.isEmpty()) { + ValidationResult validationResult = new ValidationResult(propertyShapes.pop(), - invalidTuple.getLine().get(0)); + invalidTuple.getLine().get(0), invalidTuple.getLine().get(invalidTuple.getLine().size() - 1)); if (parent == null) { validationReport.addValidationResult(validationResult); } else { diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java index 3170057af46..eb98a49771d 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java @@ -13,35 +13,59 @@ import org.eclipse.rdf4j.model.vocabulary.SHACL; public enum SourceConstraintComponent { - MaxCountConstraintComponent(SHACL.MAX_COUNT_CONSTRAINT_COMPONENT), - DatatypeConstraintComponent(SHACL.DATATYPE_CONSTRAINT_COMPONENT), - OrConstraintComponent(SHACL.OR_CONSTRAINT_COMPONENT), - MinCountConstraintComponent(SHACL.MIN_COUNT_CONSTRAINT_COMPONENT), - LanguageInConstraintComponent(SHACL.LANGUAGE_IN_CONSTRAINT_COMPONENT), - MaxLengthConstraintComponent(SHACL.MAX_LENGTH_CONSTRAINT_COMPONENT), - MinLengthConstraintComponent(SHACL.MIN_LENGTH_CONSTRAINT_COMPONENT), - NodeKindConstraintComponent(SHACL.NODE_KIND_CONSTRAINT_COMPONENT), - PatternConstraintComponent(SHACL.PATTERN_CONSTRAINT_COMPONENT), - MinExclusiveConstraintComponent(SHACL.MIN_EXCLUSIVE_CONSTRAINT_COMPONENT), - MaxExclusiveConstraintComponent(SHACL.MAX_EXCLUSIVE_CONSTRAINT_COMPONENT), - MaxInclusiveConstraintComponent(SHACL.MAX_INCLUSIVE_CONSTRAINT_COMPONENT), - MinInclusiveConstraintComponent(SHACL.MIN_INCLUSIVE_CONSTRAINT_COMPONENT), - ClassConstraintComponent(SHACL.CLASS_CONSTRAINT_COMPONENT), - InConstraintComponent(SHACL.IN_CONSTRAINT_COMPONENT), - HasValueConstraintComponent(SHACL.HAS_VALUE_CONSTRAINT_COMPONENT), - ValueInConstraintComponent(DASH.ValueInConstraintComponent), - UniqueLangConstraintComponent(SHACL.UNIQUE_LANG_CONSTRAINT_COMPONENT), - AndConstraintComponent(SHACL.AND_CONSTRAINT_COMPONENT), - NotConstraintComponent(SHACL.NOT_CONSTRAINT_COMPONENT); + MaxCountConstraintComponent(SHACL.MAX_COUNT_CONSTRAINT_COMPONENT, ConstraintType.Cardinality), + MinCountConstraintComponent(SHACL.MIN_COUNT_CONSTRAINT_COMPONENT, ConstraintType.Cardinality), + + DatatypeConstraintComponent(SHACL.DATATYPE_CONSTRAINT_COMPONENT, ConstraintType.ValueType), + LanguageInConstraintComponent(SHACL.LANGUAGE_IN_CONSTRAINT_COMPONENT, ConstraintType.StringBased), + + NodeKindConstraintComponent(SHACL.NODE_KIND_CONSTRAINT_COMPONENT, ConstraintType.ValueType), + PatternConstraintComponent(SHACL.PATTERN_CONSTRAINT_COMPONENT, ConstraintType.StringBased), + + ClassConstraintComponent(SHACL.CLASS_CONSTRAINT_COMPONENT, ConstraintType.ValueType), + + InConstraintComponent(SHACL.IN_CONSTRAINT_COMPONENT, ConstraintType.Other), + HasValueConstraintComponent(SHACL.HAS_VALUE_CONSTRAINT_COMPONENT, ConstraintType.Other), + ValueInConstraintComponent(DASH.ValueInConstraintComponent, ConstraintType.Other), + UniqueLangConstraintComponent(SHACL.UNIQUE_LANG_CONSTRAINT_COMPONENT, ConstraintType.StringBased), + + MinExclusiveConstraintComponent(SHACL.MIN_EXCLUSIVE_CONSTRAINT_COMPONENT, ConstraintType.ValueRange), + MaxExclusiveConstraintComponent(SHACL.MAX_EXCLUSIVE_CONSTRAINT_COMPONENT, ConstraintType.ValueRange), + MaxInclusiveConstraintComponent(SHACL.MAX_INCLUSIVE_CONSTRAINT_COMPONENT, ConstraintType.ValueRange), + MinInclusiveConstraintComponent(SHACL.MIN_INCLUSIVE_CONSTRAINT_COMPONENT, ConstraintType.ValueRange), + + MaxLengthConstraintComponent(SHACL.MAX_LENGTH_CONSTRAINT_COMPONENT, ConstraintType.StringBased), + MinLengthConstraintComponent(SHACL.MIN_LENGTH_CONSTRAINT_COMPONENT, ConstraintType.StringBased), + + AndConstraintComponent(SHACL.AND_CONSTRAINT_COMPONENT, ConstraintType.Logical), + OrConstraintComponent(SHACL.OR_CONSTRAINT_COMPONENT, ConstraintType.Logical), + NotConstraintComponent(SHACL.NOT_CONSTRAINT_COMPONENT, ConstraintType.Logical); private final IRI iri; + private final ConstraintType constraintType; - SourceConstraintComponent(IRI iri) { + SourceConstraintComponent(IRI iri, ConstraintType constraintType) { this.iri = iri; + this.constraintType = constraintType; } public IRI getIri() { return iri; } + public ConstraintType getConstraintType() { + return constraintType; + } + + public enum ConstraintType { + ValueType, + Cardinality, + ValueRange, + StringBased, + PropertyPair, + Logical, + ShapeBased, + Other + + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationResult.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationResult.java index c6cfc66c03b..a2dec7a9347 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationResult.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationResult.java @@ -9,7 +9,11 @@ package org.eclipse.rdf4j.sail.shacl.results; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.Resource; @@ -33,15 +37,22 @@ @Deprecated public class ValidationResult { - private Resource id = SimpleValueFactory.getInstance().createBNode(); + private final Resource id = SimpleValueFactory.getInstance().createBNode(); - private SourceConstraintComponent sourceConstraintComponent; - private PropertyShape sourceShape; + private final SourceConstraintComponent sourceConstraintComponent; + private final PropertyShape sourceShape; private Path path; private ValidationResult detail; - private Value focusNode; + private final Value focusNode; + private final Optional value; - public ValidationResult(PropertyShape sourceShape, Value focusNode) { + static Set constraintTypesThatSupportValue = Arrays + .stream(SourceConstraintComponent.ConstraintType.values()) + .filter(t -> t != SourceConstraintComponent.ConstraintType.Cardinality) + .filter(t -> t != SourceConstraintComponent.ConstraintType.Logical) + .collect(Collectors.toSet()); + + public ValidationResult(PropertyShape sourceShape, Value focusNode, Value value) { this.sourceShape = sourceShape; this.focusNode = focusNode; this.sourceConstraintComponent = sourceShape.getSourceConstraintComponent(); @@ -49,6 +60,12 @@ public ValidationResult(PropertyShape sourceShape, Value focusNode) { this.path = ((PathPropertyShape) sourceShape).getPath(); } + if (constraintTypesThatSupportValue.contains(sourceConstraintComponent.getConstraintType())) { + this.value = Optional.of(value); + } else { + this.value = Optional.empty(); + } + } public void setDetail(ValidationResult detail) { @@ -97,6 +114,8 @@ public Model asModel(Model model) { } } + value.ifPresent(v -> model.add(getId(), SHACL.VALUE, v)); + if (detail != null) { model.add(getId(), SHACL.DETAIL, detail.getId()); detail.asModel(model); @@ -147,4 +166,8 @@ public String toString() { ", focusNode=" + focusNode + '}'; } + + public Optional getValue() { + return value; + } } diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationReportTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationReportTest.java index cec6adeebce..99d8c840908 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationReportTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationReportTest.java @@ -107,14 +107,15 @@ public void withoutPathTest() throws IOException { "@prefix rdf: .\n" + "@prefix sh: .\n" + "\n" + - "_:node1e4dsta0ax19 a sh:ValidationReport;\n" + + "_:node1ebu5r1fdx77 a sh:ValidationReport;\n" + " sh:conforms false;\n" + - " sh:result _:node1e4dsta0ax20 .\n" + + " sh:result _:node1ebu5r1fdx78 .\n" + "\n" + - "_:node1e4dsta0ax20 a sh:ValidationResult;\n" + + "_:node1ebu5r1fdx78 a sh:ValidationResult;\n" + " sh:focusNode ex:node1;\n" + " sh:sourceConstraintComponent sh:ClassConstraintComponent;\n" + - " sh:sourceShape ex:PersonShape ." + " sh:sourceShape ex:PersonShape;\n" + + " sh:value ex:node1 .\n" + ""), "", RDFFormat.TURTLE); assertTrue(Models.isomorphic(expected, actual)); @@ -151,10 +152,11 @@ public void nestedLogicalOrSupport() throws IOException { Rio.write(actual, System.out, RDFFormat.TURTLE, writerConfig); Model expected = Rio.parse(new StringReader("" - + "@prefix ex: .\n" - + "@prefix rdf: .\n" - + "@prefix sh: .\n" + "\n" - + "[] a sh:ValidationReport;\n" + + + "@prefix ex: .\n" + + "@prefix rdf: .\n" + + "@prefix sh: .\n" + + "\n" + + "[] a sh:ValidationReport;\n" + " sh:conforms false;\n" + " sh:result [ a sh:ValidationResult;\n" + " sh:detail [ a sh:ValidationResult;\n" + @@ -162,12 +164,14 @@ public void nestedLogicalOrSupport() throws IOException { " sh:focusNode ex:validPerson1;\n" + " sh:resultPath ex:age;\n" + " sh:sourceConstraintComponent sh:DatatypeConstraintComponent;\n" + - " sh:sourceShape ex:personShapeAgeLong\n" + + " sh:sourceShape ex:personShapeAgeLong;\n" + + " sh:value \"abc\"\n" + " ];\n" + " sh:focusNode ex:validPerson1;\n" + " sh:resultPath ex:age;\n" + " sh:sourceConstraintComponent sh:DatatypeConstraintComponent;\n" + - " sh:sourceShape ex:personShapeAgeInteger\n" + + " sh:sourceShape ex:personShapeAgeInteger;\n" + + " sh:value \"abc\"\n" + " ];\n" + " sh:focusNode ex:validPerson1;\n" + " sh:resultPath ex:age;\n" + From ba5c4d1a8940dce0962e83e1646a0148227f00c3 Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Thu, 2 Jul 2020 13:15:43 +1000 Subject: [PATCH 27/35] set correct version Signed-off-by: Jeen Broekstra --- assembly/pom.xml | 2 +- bom/pom.xml | 2 +- compliance/elasticsearch/pom.xml | 2 +- compliance/geosparql/pom.xml | 2 +- compliance/lucene/pom.xml | 2 +- compliance/model/pom.xml | 2 +- compliance/pom.xml | 2 +- compliance/repository/pom.xml | 2 +- compliance/rio/pom.xml | 2 +- compliance/serql/pom.xml | 2 +- compliance/shacl/pom.xml | 2 +- compliance/solr/pom.xml | 2 +- compliance/sparql/pom.xml | 2 +- core/client/pom.xml | 2 +- core/http/client/pom.xml | 2 +- core/http/pom.xml | 2 +- core/http/protocol/pom.xml | 2 +- core/model/pom.xml | 2 +- core/pom.xml | 2 +- core/query/pom.xml | 2 +- core/queryalgebra/evaluation/pom.xml | 2 +- core/queryalgebra/geosparql/pom.xml | 2 +- core/queryalgebra/model/pom.xml | 2 +- core/queryalgebra/pom.xml | 2 +- core/queryparser/api/pom.xml | 2 +- core/queryparser/pom.xml | 2 +- core/queryparser/serql/pom.xml | 2 +- core/queryparser/sparql/pom.xml | 2 +- core/queryrender/pom.xml | 2 +- core/queryresultio/api/pom.xml | 2 +- core/queryresultio/binary/pom.xml | 2 +- core/queryresultio/pom.xml | 2 +- core/queryresultio/sparqljson/pom.xml | 2 +- core/queryresultio/sparqlxml/pom.xml | 2 +- core/queryresultio/text/pom.xml | 2 +- core/repository/api/pom.xml | 2 +- core/repository/contextaware/pom.xml | 2 +- core/repository/dataset/pom.xml | 2 +- core/repository/event/pom.xml | 2 +- core/repository/http/pom.xml | 2 +- core/repository/manager/pom.xml | 2 +- core/repository/pom.xml | 2 +- core/repository/sail/pom.xml | 2 +- core/repository/sparql/pom.xml | 2 +- core/rio/api/pom.xml | 2 +- core/rio/binary/pom.xml | 2 +- core/rio/datatypes/pom.xml | 2 +- core/rio/hdt/pom.xml | 2 +- core/rio/jsonld/pom.xml | 2 +- core/rio/languages/pom.xml | 2 +- core/rio/n3/pom.xml | 2 +- core/rio/nquads/pom.xml | 2 +- core/rio/ntriples/pom.xml | 2 +- core/rio/pom.xml | 2 +- core/rio/rdfjson/pom.xml | 2 +- core/rio/rdfxml/pom.xml | 2 +- core/rio/trig/pom.xml | 2 +- core/rio/trix/pom.xml | 2 +- core/rio/turtle/pom.xml | 2 +- core/sail/api/pom.xml | 2 +- core/sail/base/pom.xml | 2 +- core/sail/elasticsearch-store/pom.xml | 2 +- core/sail/elasticsearch/pom.xml | 2 +- core/sail/extensible-store/pom.xml | 2 +- core/sail/federation/pom.xml | 2 +- core/sail/inferencer/pom.xml | 2 +- core/sail/lucene-api/pom.xml | 2 +- core/sail/lucene-spin/pom.xml | 2 +- core/sail/lucene/pom.xml | 2 +- core/sail/memory/pom.xml | 2 +- core/sail/model/pom.xml | 2 +- core/sail/nativerdf/pom.xml | 2 +- core/sail/pom.xml | 2 +- core/sail/sail-spin/pom.xml | 2 +- core/sail/shacl/pom.xml | 2 +- core/sail/solr/pom.xml | 2 +- core/sparqlbuilder/pom.xml | 2 +- core/spin/pom.xml | 2 +- core/storage/pom.xml | 2 +- core/util/pom.xml | 2 +- pom.xml | 2 +- testsuites/benchmark/pom.xml | 2 +- testsuites/geosparql/pom.xml | 2 +- testsuites/lucene/pom.xml | 2 +- testsuites/model/pom.xml | 2 +- testsuites/pom.xml | 2 +- testsuites/queryresultio/pom.xml | 2 +- testsuites/repository/pom.xml | 2 +- testsuites/rio/pom.xml | 2 +- testsuites/sail/pom.xml | 2 +- testsuites/serql/pom.xml | 2 +- testsuites/shacl/pom.xml | 2 +- testsuites/sparql/pom.xml | 2 +- tools/config/pom.xml | 2 +- tools/console/pom.xml | 2 +- tools/federation/pom.xml | 2 +- tools/pom.xml | 2 +- tools/runtime-osgi/pom.xml | 2 +- tools/runtime/pom.xml | 2 +- tools/server-spring/pom.xml | 2 +- tools/server/pom.xml | 2 +- tools/workbench/pom.xml | 2 +- 102 files changed, 102 insertions(+), 102 deletions(-) diff --git a/assembly/pom.xml b/assembly/pom.xml index 6b5d277c49e..6e2cc5362f6 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-assembly pom diff --git a/bom/pom.xml b/bom/pom.xml index a88d4fe2dea..8ee73408dad 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-bom pom diff --git a/compliance/elasticsearch/pom.xml b/compliance/elasticsearch/pom.xml index 0dcc287bf51..e0721443a23 100644 --- a/compliance/elasticsearch/pom.xml +++ b/compliance/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-elasticsearch-compliance RDF4J Elasticsearch Sail Tests diff --git a/compliance/geosparql/pom.xml b/compliance/geosparql/pom.xml index 55f4d690cea..60af5141244 100644 --- a/compliance/geosparql/pom.xml +++ b/compliance/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-compliance RDF4J GeoSPARQL compliance tests diff --git a/compliance/lucene/pom.xml b/compliance/lucene/pom.xml index 032d2518c0f..e53b1ab6f69 100644 --- a/compliance/lucene/pom.xml +++ b/compliance/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-compliance RDF4J Lucene Sail Tests diff --git a/compliance/model/pom.xml b/compliance/model/pom.xml index 4f672228afe..676cf158bfa 100644 --- a/compliance/model/pom.xml +++ b/compliance/model/pom.xml @@ -3,7 +3,7 @@ rdf4j-compliance org.eclipse.rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT 4.0.0 rdf4j-model-compliance diff --git a/compliance/pom.xml b/compliance/pom.xml index 9d11abc1928..452df902de4 100644 --- a/compliance/pom.xml +++ b/compliance/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-compliance pom diff --git a/compliance/repository/pom.xml b/compliance/repository/pom.xml index af56f86b2ec..945ccdec499 100644 --- a/compliance/repository/pom.xml +++ b/compliance/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-compliance war diff --git a/compliance/rio/pom.xml b/compliance/rio/pom.xml index 8056fdacc63..270aa343a42 100644 --- a/compliance/rio/pom.xml +++ b/compliance/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-compliance RDF4J Rio compliance tests diff --git a/compliance/serql/pom.xml b/compliance/serql/pom.xml index 9a8bbffc6f3..3582b88a288 100644 --- a/compliance/serql/pom.xml +++ b/compliance/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-compliance RDF4J SeRQL query parser compliance tests diff --git a/compliance/shacl/pom.xml b/compliance/shacl/pom.xml index e35aa729296..2f70fdbf779 100644 --- a/compliance/shacl/pom.xml +++ b/compliance/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-compliance RDF4J SHACL compliance tests diff --git a/compliance/solr/pom.xml b/compliance/solr/pom.xml index 510c27c92b8..917d864d771 100644 --- a/compliance/solr/pom.xml +++ b/compliance/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-solr-compliance RDF4J Solr Sail Tests diff --git a/compliance/sparql/pom.xml b/compliance/sparql/pom.xml index 9c9139b10b4..7054a1ff892 100644 --- a/compliance/sparql/pom.xml +++ b/compliance/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-compliance - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-compliance war diff --git a/core/client/pom.xml b/core/client/pom.xml index fbd6863e5fd..2639cd8a1cd 100644 --- a/core/client/pom.xml +++ b/core/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-client RDF4J: Client Libraries diff --git a/core/http/client/pom.xml b/core/http/client/pom.xml index 48b542e9d0e..c41aaab00cc 100644 --- a/core/http/client/pom.xml +++ b/core/http/client/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-client RDF4J: HTTP client diff --git a/core/http/pom.xml b/core/http/pom.xml index 157fee6f062..d35255a95eb 100644 --- a/core/http/pom.xml +++ b/core/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http pom diff --git a/core/http/protocol/pom.xml b/core/http/protocol/pom.xml index 78a91ea024c..1a3d6dff039 100644 --- a/core/http/protocol/pom.xml +++ b/core/http/protocol/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-http - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-protocol RDF4J: HTTP protocol diff --git a/core/model/pom.xml b/core/model/pom.xml index 91506f3f5b8..5020f0a7277 100644 --- a/core/model/pom.xml +++ b/core/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model RDF4J: Model diff --git a/core/pom.xml b/core/pom.xml index 95b2be443d8..1e27344892b 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-core pom diff --git a/core/query/pom.xml b/core/query/pom.xml index 0bebd89ec45..98b09396e29 100644 --- a/core/query/pom.xml +++ b/core/query/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-query RDF4J: Query diff --git a/core/queryalgebra/evaluation/pom.xml b/core/queryalgebra/evaluation/pom.xml index 0081d83e38d..4aaed5165f3 100644 --- a/core/queryalgebra/evaluation/pom.xml +++ b/core/queryalgebra/evaluation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-evaluation RDF4J: Query algebra - evaluation diff --git a/core/queryalgebra/geosparql/pom.xml b/core/queryalgebra/geosparql/pom.xml index d633824b24a..01e1dfd69f9 100644 --- a/core/queryalgebra/geosparql/pom.xml +++ b/core/queryalgebra/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-geosparql RDF4J: Query algebra - GeoSPARQL diff --git a/core/queryalgebra/model/pom.xml b/core/queryalgebra/model/pom.xml index 7924257666a..9756bfa3fab 100644 --- a/core/queryalgebra/model/pom.xml +++ b/core/queryalgebra/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryalgebra - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra-model RDF4J: Query algebra - model diff --git a/core/queryalgebra/pom.xml b/core/queryalgebra/pom.xml index 4d0807aa6e2..e1b487d6952 100644 --- a/core/queryalgebra/pom.xml +++ b/core/queryalgebra/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryalgebra pom diff --git a/core/queryparser/api/pom.xml b/core/queryparser/api/pom.xml index 92c9fa7d978..57e8066dd0c 100644 --- a/core/queryparser/api/pom.xml +++ b/core/queryparser/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-api RDF4J: Query parser - API diff --git a/core/queryparser/pom.xml b/core/queryparser/pom.xml index af9f2146792..ed654e6514f 100644 --- a/core/queryparser/pom.xml +++ b/core/queryparser/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser pom diff --git a/core/queryparser/serql/pom.xml b/core/queryparser/serql/pom.xml index cd2d460f519..1ba3fbdf31d 100644 --- a/core/queryparser/serql/pom.xml +++ b/core/queryparser/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-serql RDF4J: Query parser - SeRQL diff --git a/core/queryparser/sparql/pom.xml b/core/queryparser/sparql/pom.xml index f0be68573ea..b2ffedbbf84 100644 --- a/core/queryparser/sparql/pom.xml +++ b/core/queryparser/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryparser - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryparser-sparql RDF4J: Query parser - SPARQL diff --git a/core/queryrender/pom.xml b/core/queryrender/pom.xml index 853260ffa28..a9f0a872074 100644 --- a/core/queryrender/pom.xml +++ b/core/queryrender/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryrender RDF4J: Query Rendering diff --git a/core/queryresultio/api/pom.xml b/core/queryresultio/api/pom.xml index e30e7cd6b8e..b33ca33d98b 100644 --- a/core/queryresultio/api/pom.xml +++ b/core/queryresultio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-api RDF4J: Query result IO - API diff --git a/core/queryresultio/binary/pom.xml b/core/queryresultio/binary/pom.xml index ac94f89aca8..c2f157e6bf9 100644 --- a/core/queryresultio/binary/pom.xml +++ b/core/queryresultio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-binary RDF4J: Query result IO - binary diff --git a/core/queryresultio/pom.xml b/core/queryresultio/pom.xml index 47505244d51..d9e5dd06fc9 100644 --- a/core/queryresultio/pom.xml +++ b/core/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio pom diff --git a/core/queryresultio/sparqljson/pom.xml b/core/queryresultio/sparqljson/pom.xml index 1219c7e9742..0e47e241561 100644 --- a/core/queryresultio/sparqljson/pom.xml +++ b/core/queryresultio/sparqljson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqljson RDF4J: Query result IO - SPARQL/JSON diff --git a/core/queryresultio/sparqlxml/pom.xml b/core/queryresultio/sparqlxml/pom.xml index df3da9ea0bd..fe97661f6a9 100644 --- a/core/queryresultio/sparqlxml/pom.xml +++ b/core/queryresultio/sparqlxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-sparqlxml RDF4J: Query result IO - SPARQL/XML diff --git a/core/queryresultio/text/pom.xml b/core/queryresultio/text/pom.xml index 207210708c2..38dbfcbec03 100644 --- a/core/queryresultio/text/pom.xml +++ b/core/queryresultio/text/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-queryresultio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-text RDF4J: Query result IO - plain text booleans diff --git a/core/repository/api/pom.xml b/core/repository/api/pom.xml index 02863d19c2d..329699b9801 100644 --- a/core/repository/api/pom.xml +++ b/core/repository/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-api RDF4J: Repository - API diff --git a/core/repository/contextaware/pom.xml b/core/repository/contextaware/pom.xml index ca07c109c86..485ec462156 100644 --- a/core/repository/contextaware/pom.xml +++ b/core/repository/contextaware/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-contextaware RDF4J: Repository - context aware (wrapper) diff --git a/core/repository/dataset/pom.xml b/core/repository/dataset/pom.xml index 3c39bdd0d39..646760c1527 100644 --- a/core/repository/dataset/pom.xml +++ b/core/repository/dataset/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-dataset RDF4J: DatasetRepository (wrapper) diff --git a/core/repository/event/pom.xml b/core/repository/event/pom.xml index ab5914789d5..2358504439a 100644 --- a/core/repository/event/pom.xml +++ b/core/repository/event/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-event RDF4J: Repository - event (wrapper) diff --git a/core/repository/http/pom.xml b/core/repository/http/pom.xml index de77b312fe0..727a025e228 100644 --- a/core/repository/http/pom.xml +++ b/core/repository/http/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-http RDF4J: HTTPRepository diff --git a/core/repository/manager/pom.xml b/core/repository/manager/pom.xml index 57bae6c02be..3f291fe0bc4 100644 --- a/core/repository/manager/pom.xml +++ b/core/repository/manager/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-manager RDF4J: Repository manager diff --git a/core/repository/pom.xml b/core/repository/pom.xml index 80e67d90dc6..9b9b97cde3d 100644 --- a/core/repository/pom.xml +++ b/core/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository pom diff --git a/core/repository/sail/pom.xml b/core/repository/sail/pom.xml index 479c2c58e16..04ccfc72fbd 100644 --- a/core/repository/sail/pom.xml +++ b/core/repository/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sail RDF4J: SailRepository diff --git a/core/repository/sparql/pom.xml b/core/repository/sparql/pom.xml index 0bdfd9e858e..61c7785d99e 100644 --- a/core/repository/sparql/pom.xml +++ b/core/repository/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-repository - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-sparql RDF4J: SPARQL Repository diff --git a/core/rio/api/pom.xml b/core/rio/api/pom.xml index a2ad61d1ec9..5a4cd20d614 100644 --- a/core/rio/api/pom.xml +++ b/core/rio/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-api RDF4J: Rio - API diff --git a/core/rio/binary/pom.xml b/core/rio/binary/pom.xml index 9b029f4e351..ee0bd22954f 100644 --- a/core/rio/binary/pom.xml +++ b/core/rio/binary/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-binary RDF4J: Rio - Binary diff --git a/core/rio/datatypes/pom.xml b/core/rio/datatypes/pom.xml index d204de0fc58..1250511c4b8 100644 --- a/core/rio/datatypes/pom.xml +++ b/core/rio/datatypes/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-datatypes RDF4J: Rio - Datatypes diff --git a/core/rio/hdt/pom.xml b/core/rio/hdt/pom.xml index 6b87c97a11f..d6cb85f1ece 100644 --- a/core/rio/hdt/pom.xml +++ b/core/rio/hdt/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-hdt jar diff --git a/core/rio/jsonld/pom.xml b/core/rio/jsonld/pom.xml index 9519633be5d..6208961e90f 100644 --- a/core/rio/jsonld/pom.xml +++ b/core/rio/jsonld/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-jsonld RDF4J: Rio - JSON-LD diff --git a/core/rio/languages/pom.xml b/core/rio/languages/pom.xml index b3fa1d09c10..2c6618646da 100644 --- a/core/rio/languages/pom.xml +++ b/core/rio/languages/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-languages RDF4J: Rio - Languages diff --git a/core/rio/n3/pom.xml b/core/rio/n3/pom.xml index f670882df6e..12a90ac868b 100644 --- a/core/rio/n3/pom.xml +++ b/core/rio/n3/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-n3 RDF4J: Rio - N3 (writer-only) diff --git a/core/rio/nquads/pom.xml b/core/rio/nquads/pom.xml index 89b9ad55770..27f08c03eb3 100644 --- a/core/rio/nquads/pom.xml +++ b/core/rio/nquads/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-nquads RDF4J: Rio - N-Quads diff --git a/core/rio/ntriples/pom.xml b/core/rio/ntriples/pom.xml index ec7de3a11e0..dc7302637bc 100644 --- a/core/rio/ntriples/pom.xml +++ b/core/rio/ntriples/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-ntriples RDF4J: Rio - N-Triples diff --git a/core/rio/pom.xml b/core/rio/pom.xml index 28e9889bb5d..db0afa2698c 100644 --- a/core/rio/pom.xml +++ b/core/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio pom diff --git a/core/rio/rdfjson/pom.xml b/core/rio/rdfjson/pom.xml index 952a5ee0f46..26b57806918 100644 --- a/core/rio/rdfjson/pom.xml +++ b/core/rio/rdfjson/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfjson RDF4J: Rio - RDF/JSON diff --git a/core/rio/rdfxml/pom.xml b/core/rio/rdfxml/pom.xml index 5a68d4ab47e..2e12c77035b 100644 --- a/core/rio/rdfxml/pom.xml +++ b/core/rio/rdfxml/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-rdfxml RDF4J: Rio - RDF/XML diff --git a/core/rio/trig/pom.xml b/core/rio/trig/pom.xml index ae8dffc7a16..d6a18113cba 100644 --- a/core/rio/trig/pom.xml +++ b/core/rio/trig/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trig RDF4J: Rio - TriG diff --git a/core/rio/trix/pom.xml b/core/rio/trix/pom.xml index 2a105ecad43..b1a6fc818a4 100644 --- a/core/rio/trix/pom.xml +++ b/core/rio/trix/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-trix RDF4J: Rio - TriX diff --git a/core/rio/turtle/pom.xml b/core/rio/turtle/pom.xml index b5854ad753d..14363862440 100644 --- a/core/rio/turtle/pom.xml +++ b/core/rio/turtle/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-rio - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-turtle RDF4J: Rio - Turtle diff --git a/core/sail/api/pom.xml b/core/sail/api/pom.xml index 986543debc4..b12bb1457a2 100644 --- a/core/sail/api/pom.xml +++ b/core/sail/api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-api RDF4J: Sail API diff --git a/core/sail/base/pom.xml b/core/sail/base/pom.xml index bbf4e28eab7..3a29b447d92 100644 --- a/core/sail/base/pom.xml +++ b/core/sail/base/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-base RDF4J: Sail base implementations diff --git a/core/sail/elasticsearch-store/pom.xml b/core/sail/elasticsearch-store/pom.xml index 59db85e8616..89c5ad1e22a 100644 --- a/core/sail/elasticsearch-store/pom.xml +++ b/core/sail/elasticsearch-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch-store RDF4J Elasticsearch Store diff --git a/core/sail/elasticsearch/pom.xml b/core/sail/elasticsearch/pom.xml index 3fba6bb3621..787f0b89234 100644 --- a/core/sail/elasticsearch/pom.xml +++ b/core/sail/elasticsearch/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-elasticsearch RDF4J Elastic Search Sail Index diff --git a/core/sail/extensible-store/pom.xml b/core/sail/extensible-store/pom.xml index 1bc999dd368..de8f72aff13 100644 --- a/core/sail/extensible-store/pom.xml +++ b/core/sail/extensible-store/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-extensible-store RDF4J Extensible Store diff --git a/core/sail/federation/pom.xml b/core/sail/federation/pom.xml index 7aa76d359f2..563c203457e 100644 --- a/core/sail/federation/pom.xml +++ b/core/sail/federation/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-federation RDF4J: Federation SAIL diff --git a/core/sail/inferencer/pom.xml b/core/sail/inferencer/pom.xml index 8681a2d5156..9422f06037f 100644 --- a/core/sail/inferencer/pom.xml +++ b/core/sail/inferencer/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-inferencer RDF4J: Inferencer Sails diff --git a/core/sail/lucene-api/pom.xml b/core/sail/lucene-api/pom.xml index 2e8982851d2..adbd392650e 100644 --- a/core/sail/lucene-api/pom.xml +++ b/core/sail/lucene-api/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene-api RDF4J Lucene Sail API diff --git a/core/sail/lucene-spin/pom.xml b/core/sail/lucene-spin/pom.xml index 4be20752f8f..111dc308b42 100644 --- a/core/sail/lucene-spin/pom.xml +++ b/core/sail/lucene-spin/pom.xml @@ -4,7 +4,7 @@ rdf4j-sail org.eclipse.rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-spin RDF4J Lucene Sail Spin diff --git a/core/sail/lucene/pom.xml b/core/sail/lucene/pom.xml index 5e5cac54d7b..b752e12b16c 100644 --- a/core/sail/lucene/pom.xml +++ b/core/sail/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-lucene RDF4J Lucene Sail Index diff --git a/core/sail/memory/pom.xml b/core/sail/memory/pom.xml index e5bb29161c5..31a265883d9 100644 --- a/core/sail/memory/pom.xml +++ b/core/sail/memory/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-memory RDF4J: MemoryStore diff --git a/core/sail/model/pom.xml b/core/sail/model/pom.xml index ed6b2af4e1b..bc69ab76280 100644 --- a/core/sail/model/pom.xml +++ b/core/sail/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-model RDF4J: Sail Model diff --git a/core/sail/nativerdf/pom.xml b/core/sail/nativerdf/pom.xml index ad167be8597..9f3d7ed7f9c 100644 --- a/core/sail/nativerdf/pom.xml +++ b/core/sail/nativerdf/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-nativerdf RDF4J: NativeStore diff --git a/core/sail/pom.xml b/core/sail/pom.xml index 0fbd59677d6..32a7d02c191 100644 --- a/core/sail/pom.xml +++ b/core/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail pom diff --git a/core/sail/sail-spin/pom.xml b/core/sail/sail-spin/pom.xml index b5b3013fc1f..46bb8d1b75f 100644 --- a/core/sail/sail-spin/pom.xml +++ b/core/sail/sail-spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-spin RDF4J: SPIN SAIL diff --git a/core/sail/shacl/pom.xml b/core/sail/shacl/pom.xml index 3fbc0e983f8..67e94f3bd13 100644 --- a/core/sail/shacl/pom.xml +++ b/core/sail/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl RDF4J: SHACL diff --git a/core/sail/solr/pom.xml b/core/sail/solr/pom.xml index 42f831f8959..547ab856231 100644 --- a/core/sail/solr/pom.xml +++ b/core/sail/solr/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-sail - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-solr RDF4J Solr Sail Index diff --git a/core/sparqlbuilder/pom.xml b/core/sparqlbuilder/pom.xml index 5b35f3cca5a..85470528110 100644 --- a/core/sparqlbuilder/pom.xml +++ b/core/sparqlbuilder/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparqlbuilder RDF4J: SparqlBuilder diff --git a/core/spin/pom.xml b/core/spin/pom.xml index 43241b2dc6e..6bf2f0ae88b 100644 --- a/core/spin/pom.xml +++ b/core/spin/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-spin RDF4J: SPIN diff --git a/core/storage/pom.xml b/core/storage/pom.xml index bcde592952f..511dca86c86 100644 --- a/core/storage/pom.xml +++ b/core/storage/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-storage RDF4J: Storage Libraries diff --git a/core/util/pom.xml b/core/util/pom.xml index 1481aef41bc..ed76ac9f873 100644 --- a/core/util/pom.xml +++ b/core/util/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-core - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-util RDF4J: util diff --git a/pom.xml b/pom.xml index df263bd3627..ad9ab31f04f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.eclipse.rdf4j rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT pom Eclipse RDF4J An extensible Java framework for RDF and SPARQL diff --git a/testsuites/benchmark/pom.xml b/testsuites/benchmark/pom.xml index bb01e21519c..7c3fa436804 100644 --- a/testsuites/benchmark/pom.xml +++ b/testsuites/benchmark/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-benchmark RDF4J: benchmarks diff --git a/testsuites/geosparql/pom.xml b/testsuites/geosparql/pom.xml index 7ceb176fed8..83e751e8e3d 100644 --- a/testsuites/geosparql/pom.xml +++ b/testsuites/geosparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-geosparql-testsuite RDF4J GeoSPARQL compliance test suite diff --git a/testsuites/lucene/pom.xml b/testsuites/lucene/pom.xml index a0773e2ffb8..8d9405c43a4 100644 --- a/testsuites/lucene/pom.xml +++ b/testsuites/lucene/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-lucene-testsuite RDF4J Lucene Sail Tests diff --git a/testsuites/model/pom.xml b/testsuites/model/pom.xml index 5d2efe9465a..a8ad142b919 100644 --- a/testsuites/model/pom.xml +++ b/testsuites/model/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-model-testsuite RDF4J: Model API testsuite diff --git a/testsuites/pom.xml b/testsuites/pom.xml index a1d9febcf1e..745926f4ef3 100644 --- a/testsuites/pom.xml +++ b/testsuites/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-testsuites pom diff --git a/testsuites/queryresultio/pom.xml b/testsuites/queryresultio/pom.xml index b0b1024fda4..d6d2205ccda 100644 --- a/testsuites/queryresultio/pom.xml +++ b/testsuites/queryresultio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-queryresultio-testsuite RDF4J: QueryResultIO testsuite diff --git a/testsuites/repository/pom.xml b/testsuites/repository/pom.xml index 54dd6ec549a..37db19075b0 100644 --- a/testsuites/repository/pom.xml +++ b/testsuites/repository/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-repository-testsuite RDF4J: Repository API testsuite diff --git a/testsuites/rio/pom.xml b/testsuites/rio/pom.xml index 52ada113480..439ce4c21c8 100644 --- a/testsuites/rio/pom.xml +++ b/testsuites/rio/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-rio-testsuite RDF4J Rio compliance test suite diff --git a/testsuites/sail/pom.xml b/testsuites/sail/pom.xml index 74843dc5e7b..3de37b6f45e 100644 --- a/testsuites/sail/pom.xml +++ b/testsuites/sail/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sail-testsuite RDF4J: Sail API testsuite diff --git a/testsuites/serql/pom.xml b/testsuites/serql/pom.xml index ee2ebb53403..08f8d46e616 100644 --- a/testsuites/serql/pom.xml +++ b/testsuites/serql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-serql-testsuite RDF4J SeRQL test suite diff --git a/testsuites/shacl/pom.xml b/testsuites/shacl/pom.xml index 5a48dc26e35..952bb546e4e 100644 --- a/testsuites/shacl/pom.xml +++ b/testsuites/shacl/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-shacl-testsuite RDF4J SHACL compliance test suite diff --git a/testsuites/sparql/pom.xml b/testsuites/sparql/pom.xml index ed0403a7ddd..45663cc3c0b 100644 --- a/testsuites/sparql/pom.xml +++ b/testsuites/sparql/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-testsuites - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-sparql-testsuite RDF4J SPARQL compliance test suite diff --git a/tools/config/pom.xml b/tools/config/pom.xml index 71ff0e37f38..74aff1aea3b 100644 --- a/tools/config/pom.xml +++ b/tools/config/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-config RDF4J: application configuration diff --git a/tools/console/pom.xml b/tools/console/pom.xml index 3fab1381456..b9dddcdc4ba 100644 --- a/tools/console/pom.xml +++ b/tools/console/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-console RDF4J: Console diff --git a/tools/federation/pom.xml b/tools/federation/pom.xml index ddf416e1fcc..736c0f77da1 100644 --- a/tools/federation/pom.xml +++ b/tools/federation/pom.xml @@ -8,7 +8,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT 9.4.19.v20190610 diff --git a/tools/pom.xml b/tools/pom.xml index df398404c17..81979390a16 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT org.eclipse.rdf4j rdf4j-tools diff --git a/tools/runtime-osgi/pom.xml b/tools/runtime-osgi/pom.xml index 20a4a76bce2..bf3ba94fb55 100644 --- a/tools/runtime-osgi/pom.xml +++ b/tools/runtime-osgi/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime-osgi bundle diff --git a/tools/runtime/pom.xml b/tools/runtime/pom.xml index 6df9b7ffb41..58dae30a158 100644 --- a/tools/runtime/pom.xml +++ b/tools/runtime/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-runtime RDF4J: Runtime diff --git a/tools/server-spring/pom.xml b/tools/server-spring/pom.xml index 38ee34193b2..6a82ef5d935 100644 --- a/tools/server-spring/pom.xml +++ b/tools/server-spring/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server-spring RDF4J: HTTP server - core diff --git a/tools/server/pom.xml b/tools/server/pom.xml index 85a843fc670..8e9c552094d 100644 --- a/tools/server/pom.xml +++ b/tools/server/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-server war diff --git a/tools/workbench/pom.xml b/tools/workbench/pom.xml index bde3706a35b..bb1dbdf328f 100644 --- a/tools/workbench/pom.xml +++ b/tools/workbench/pom.xml @@ -4,7 +4,7 @@ org.eclipse.rdf4j rdf4j-tools - 3.2.4-SNAPSHOT + 3.3.0-SNAPSHOT rdf4j-http-workbench war From 54ed00d2a317e2d5659457a63d25cabb7b443a63 Mon Sep 17 00:00:00 2001 From: Bart Hanssens Date: Sun, 5 Jul 2020 14:23:56 +0200 Subject: [PATCH 28/35] GH-2192 upgrade jsonld-java and jackson + fix for test (#2233) * GH-2192 upgrade jsonld-java and jackson + fix for test Signed-off-by:Bart Hanssens --- compliance/elasticsearch/pom.xml | 6 ++++++ .../eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java | 6 +++--- pom.xml | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/compliance/elasticsearch/pom.xml b/compliance/elasticsearch/pom.xml index 2552cf4419b..3e3835417e9 100644 --- a/compliance/elasticsearch/pom.xml +++ b/compliance/elasticsearch/pom.xml @@ -103,6 +103,12 @@ + + org.yaml + snakeyaml + 1.25 + test + org.apache.logging.log4j log4j-core diff --git a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java index 6b5e0143286..e70554ca564 100644 --- a/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java +++ b/core/rio/jsonld/src/test/java/org/eclipse/rdf4j/rio/jsonld/JSONLDParserCustomTest.java @@ -359,7 +359,7 @@ public void testIncludeSourceLocationDefault() throws Exception { assertTrue(e.getCause() instanceof JsonProcessingException); JsonProcessingException cause = (JsonProcessingException) e.getCause(); assertEquals(2, cause.getLocation().getLineNr()); - assertEquals(1, cause.getLocation().getColumnNr()); + assertEquals(3, cause.getLocation().getColumnNr()); assertNotNull(cause.getLocation().getSourceRef()); assertEquals(source, cause.getLocation().getSourceRef()); } @@ -377,7 +377,7 @@ public void testIncludeSourceLocationEnabled() throws Exception { assertTrue(e.getCause() instanceof JsonProcessingException); JsonProcessingException cause = (JsonProcessingException) e.getCause(); assertEquals(2, cause.getLocation().getLineNr()); - assertEquals(1, cause.getLocation().getColumnNr()); + assertEquals(3, cause.getLocation().getColumnNr()); assertNotNull(cause.getLocation().getSourceRef()); assertEquals(source, cause.getLocation().getSourceRef()); } @@ -394,7 +394,7 @@ public void testIncludeSourceLocationDisabled() throws Exception { assertTrue(e.getCause() instanceof JsonProcessingException); JsonProcessingException cause = (JsonProcessingException) e.getCause(); assertEquals(2, cause.getLocation().getLineNr()); - assertEquals(1, cause.getLocation().getColumnNr()); + assertEquals(3, cause.getLocation().getColumnNr()); assertNull(cause.getLocation().getSourceRef()); } } diff --git a/pom.xml b/pom.xml index 332e44bc48e..5c91e16d227 100644 --- a/pom.xml +++ b/pom.xml @@ -295,8 +295,8 @@ 1.1.11 4.5.10 4.4.12 - 2.9.9 - 0.12.5 + 2.10.4 + 0.13.0 3.1.4 2.3.1 7.7.2 From aaacc48e46a05f6ff244d77ab47facf295d51feb Mon Sep 17 00:00:00 2001 From: hmottestad Date: Fri, 10 Jul 2020 15:35:23 +0200 Subject: [PATCH 29/35] GH-2017 migrate from dash:valueIn to dash:hasValueIn as agreed on the shacl mailing list (#2355) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håvard Ottestad --- .../eclipse/rdf4j/model/vocabulary/DASH.java | 4 +-- ...hape.java => HasValueInPropertyShape.java} | 27 +++++++++---------- .../rdf4j/sail/shacl/AST/PropertyShape.java | 6 ++--- .../rdf4j/sail/shacl/AST/ShaclProperties.java | 12 ++++----- .../eclipse/rdf4j/sail/shacl/ShaclSail.java | 4 +-- .../sail/shacl/SourceConstraintComponent.java | 2 +- .../rdf4j/sail/shacl/AbstractShaclTest.java | 12 ++++----- .../shaclDatatypeTargetFilterWithUnion.ttl | 2 +- .../class/simpleTargetShape/shacl.ttl | 2 +- .../and/invalid/case1/query1.rq | 0 .../and/invalid/case2/query1.rq | 0 .../and/invalid/case2/query2.rq | 0 .../{valueIn => hasValueIn}/and/shacl.ttl | 4 +-- .../and/valid/case1/query1.rq | 0 .../and/valid/case3/query1.rq | 0 .../and/valid/case3/query2.rq | 0 .../not/invalid/case1/query1.rq | 0 .../not/invalid/case2/query1.rq | 0 .../not/invalid/case2/query2.rq | 0 .../not/invalid/case3/query1.rq | 0 .../not/invalid/case3/query2.rq | 0 .../not/invalid/case5/query1.rq | 0 .../not/invalid/case5/query2.rq | 0 .../{valueIn => hasValueIn}/not/shacl.ttl | 2 +- .../not/valid/case1/query1.rq | 0 .../not/valid/case2/query1.rq | 0 .../not/valid/case2/query2.rq | 0 .../not/valid/case3/query1.rq | 0 .../not/valid/case3/query2.rq | 0 .../not2/invalid/case1/query1.rq | 0 .../not2/invalid/case2/query1.rq | 0 .../not2/invalid/case2/query2.rq | 0 .../not2/invalid/case4/query1.rq | 0 .../not2/invalid/case4/query2.rq | 0 .../not2/invalid/case4/query3.rq | 0 .../not2/invalid/case5/query1.rq | 0 .../not2/invalid/case5/query2.rq | 0 .../{valueIn => hasValueIn}/not2/shacl.ttl | 4 +-- .../not2/valid/case1/query1.rq | 0 .../not2/valid/case2/query1.rq | 0 .../not2/valid/case2/query2.rq | 0 .../not2/valid/case3/query1.rq | 0 .../not2/valid/case3/query2.rq | 0 .../not2/valid/case4/query1.rq | 0 .../not2/valid/case5/query1.rq | 0 .../not2/valid/case6/query1.rq | 0 .../not2/valid/case6/query2.rq | 0 .../simple/invalid/case1/query1.rq | 0 .../simple/invalid/case2/query1.rq | 0 .../simple/invalid/case2/query2.rq | 0 .../simple/invalid/case3/query1.rq | 0 .../simple/invalid/case3/query2.rq | 0 .../simple/invalid/case4/query1.rq | 0 .../simple/invalid/case4/query2.rq | 0 .../{valueIn => hasValueIn}/simple/shacl.ttl | 2 +- .../simple/valid/case1/query1.rq | 0 .../simple/valid/case2/query1.rq | 0 .../simple/valid/case2/query2.rq | 0 .../simple/valid/case3/query1.rq | 0 .../simple/valid/case3/query2.rq | 0 .../simple/valid/case4/query1.rq | 0 .../simple/valid/case5/query1.rq | 0 .../simple/valid/case5/query2.rq | 0 .../simple/valid/case6/query1.rq | 0 .../simple/valid/case6/query2.rq | 0 .../simple/valid/case7/query1.rq | 0 .../targetNode/shacl.ttl | 2 +- .../targetNode/valid/case1/query1.rq | 0 .../targetNode/valid/case2/query1.rq | 0 .../targetNode/valid/case2/query2.rq | 0 .../targetNode2/invalid/case1/query1.rq | 0 .../targetNode2/shacl.ttl | 2 +- 72 files changed, 43 insertions(+), 44 deletions(-) rename core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/{ValueInPropertyShape.java => HasValueInPropertyShape.java} (89%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/and/invalid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/and/invalid/case2/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/and/invalid/case2/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/and/shacl.ttl (84%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/and/valid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/and/valid/case3/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/and/valid/case3/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/invalid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/invalid/case2/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/invalid/case2/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/invalid/case3/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/invalid/case3/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/invalid/case5/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/invalid/case5/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/shacl.ttl (89%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/valid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/valid/case2/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/valid/case2/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/valid/case3/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not/valid/case3/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/invalid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/invalid/case2/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/invalid/case2/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/invalid/case4/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/invalid/case4/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/invalid/case4/query3.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/invalid/case5/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/invalid/case5/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/shacl.ttl (82%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case2/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case2/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case3/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case3/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case4/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case5/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case6/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/not2/valid/case6/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/invalid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/invalid/case2/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/invalid/case2/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/invalid/case3/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/invalid/case3/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/invalid/case4/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/invalid/case4/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/shacl.ttl (91%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case2/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case2/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case3/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case3/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case4/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case5/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case5/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case6/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case6/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/simple/valid/case7/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/targetNode/shacl.ttl (90%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/targetNode/valid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/targetNode/valid/case2/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/targetNode/valid/case2/query2.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/targetNode2/invalid/case1/query1.rq (100%) rename core/sail/shacl/src/test/resources/test-cases/{valueIn => hasValueIn}/targetNode2/shacl.ttl (90%) diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DASH.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DASH.java index f0619623163..288692ff753 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DASH.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DASH.java @@ -29,8 +29,8 @@ public class DASH { public static final IRI AllObjectsTarget = createIRI("AllObjectsTarget"); public static final IRI AllSubjectsTarget = createIRI("AllSubjectsTarget"); - public static final IRI valueIn = createIRI("valueIn"); - public static final IRI ValueInConstraintComponent = createIRI("HasValueConstraintComponent"); + public static final IRI hasValueIn = createIRI("hasValueIn"); + public static final IRI HasValueInConstraintComponent = createIRI("HasValueInConstraintComponent"); private static IRI createIRI(String allObjectsTarget) { return vf.createIRI(NAMESPACE, allObjectsTarget); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ValueInPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/HasValueInPropertyShape.java similarity index 89% rename from core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ValueInPropertyShape.java rename to core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/HasValueInPropertyShape.java index 856c7242a65..4bed2c82a6f 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ValueInPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/HasValueInPropertyShape.java @@ -38,19 +38,19 @@ /** * @author Håvard Ottestad */ -public class ValueInPropertyShape extends PathPropertyShape { +public class HasValueInPropertyShape extends PathPropertyShape { - private final Set valueIn; - private static final Logger logger = LoggerFactory.getLogger(ValueInPropertyShape.class); + private final Set hasValueIn; + private static final Logger logger = LoggerFactory.getLogger(HasValueInPropertyShape.class); - ValueInPropertyShape(Resource id, SailRepositoryConnection connection, NodeShape nodeShape, boolean deactivated, + HasValueInPropertyShape(Resource id, SailRepositoryConnection connection, NodeShape nodeShape, boolean deactivated, PathPropertyShape parent, Resource path, - Resource valueIn) { + Resource hasValueIn) { super(id, connection, nodeShape, deactivated, parent, path); - this.valueIn = toSet(connection, valueIn); + this.hasValueIn = toSet(connection, hasValueIn); - assert (!this.valueIn.isEmpty()); + assert (!this.hasValueIn.isEmpty()); } @@ -76,10 +76,9 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, }); if (negateThisPlan) { - invalidTargets = new ValueInFilter(invalidTargets, valueIn).getTrueNode(UnBufferedPlanNode.class); + invalidTargets = new ValueInFilter(invalidTargets, hasValueIn).getTrueNode(UnBufferedPlanNode.class); } else { - invalidTargets = new ValueInFilter(invalidTargets, valueIn).getFalseNode(UnBufferedPlanNode.class); - + invalidTargets = new ValueInFilter(invalidTargets, hasValueIn).getFalseNode(UnBufferedPlanNode.class); } if (printPlans) { @@ -162,16 +161,16 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, @Override public SourceConstraintComponent getSourceConstraintComponent() { - return SourceConstraintComponent.ValueInConstraintComponent; + return SourceConstraintComponent.HasValueInConstraintComponent; } @Override public String buildSparqlValidNodes(String targetVar) { - return valueIn + return hasValueIn .stream() .map(value -> { - String objectVar = "?valueIn_" + UUID.randomUUID().toString().replace("-", ""); + String objectVar = "?hasValueIn_" + UUID.randomUUID().toString().replace("-", ""); if (value instanceof IRI) { return "BIND(<" + value + "> as " + objectVar + ")\n" @@ -192,7 +191,7 @@ public String buildSparqlValidNodes(String targetVar) { @Override public Stream getStatementPatterns() { - return valueIn + return hasValueIn .stream() .flatMap(value -> getPath().getStatementsPatterns(new Var("?this"), new Var(UUID.randomUUID().toString(), value))); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java index fbdbe5ad37d..88809fc3d94 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PropertyShape.java @@ -309,10 +309,10 @@ public static List getPropertyShapesInner(SailRepositoryConne shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), shaclProperties.getHasValue())); } - if (shaclProperties.getValueIn() != null && shaclSail.isDashDataShapes()) { - propertyShapes.add(new ValueInPropertyShape(propertyShapeId, connection, nodeShape, + if (shaclProperties.getHasValueIn() != null && shaclSail.isDashDataShapes()) { + propertyShapes.add(new HasValueInPropertyShape(propertyShapeId, connection, nodeShape, shaclProperties.isDeactivated(), parent, shaclProperties.getPath(), - shaclProperties.getValueIn())); + shaclProperties.getHasValueIn())); } return propertyShapes; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java index 187e251ad55..283360c4735 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java @@ -32,7 +32,7 @@ public class ShaclProperties { private Resource datatype; private Resource in; private Value hasValue; - private Resource valueIn; + private Resource hasValueIn; private Long minLength; private Long maxLength; @@ -197,11 +197,11 @@ public ShaclProperties(Resource propertyShapeId, SailRepositoryConnection connec } hasValue = object; break; - case "http://datashapes.org/dash#valueIn": - if (valueIn != null) { + case "http://datashapes.org/dash#hasValueIn": + if (hasValueIn != null) { throw new IllegalStateException(predicate + " already populated"); } - valueIn = (Resource) object; + hasValueIn = (Resource) object; break; case "http://www.w3.org/ns/shacl#targetShape": targetShape.add((Resource) object); @@ -331,7 +331,7 @@ public List getTargetShape() { return targetShape; } - public Resource getValueIn() { - return valueIn; + public Resource getHasValueIn() { + return hasValueIn; } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java index 797ead510e7..26037e78ce1 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java @@ -839,7 +839,7 @@ public boolean isShaclAdvancedFeatures() { /** * Support for DASH Data Shapes Vocabulary Unofficial Draft (http://datashapes.org/dash). Currently this enables - * support for dash:valueIn, dash:AllObjectsTarget and and dash:AllSubjectsTarget. + * support for dash:hasValueIn, dash:AllObjectsTarget and and dash:AllSubjectsTarget. * * EXPERIMENTAL! * @@ -853,7 +853,7 @@ public void setDashDataShapes(boolean dashDataShapes) { /** * Support for DASH Data Shapes Vocabulary Unofficial Draft (http://datashapes.org/dash). Currently this enables - * support for dash:valueIn, dash:AllObjectsTarget and dash:AllSubjectsTarget. + * support for dash:hasValueIn, dash:AllObjectsTarget and dash:AllSubjectsTarget. * * EXPERIMENTAL! * diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java index eb98a49771d..f561769717b 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/SourceConstraintComponent.java @@ -26,7 +26,7 @@ public enum SourceConstraintComponent { InConstraintComponent(SHACL.IN_CONSTRAINT_COMPONENT, ConstraintType.Other), HasValueConstraintComponent(SHACL.HAS_VALUE_CONSTRAINT_COMPONENT, ConstraintType.Other), - ValueInConstraintComponent(DASH.ValueInConstraintComponent, ConstraintType.Other), + HasValueInConstraintComponent(DASH.HasValueInConstraintComponent, ConstraintType.Other), UniqueLangConstraintComponent(SHACL.UNIQUE_LANG_CONSTRAINT_COMPONENT, ConstraintType.StringBased), MinExclusiveConstraintComponent(SHACL.MIN_EXCLUSIVE_CONSTRAINT_COMPONENT, ConstraintType.ValueRange), diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java index e456da1ca58..9268cf4d7b8 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java @@ -174,12 +174,12 @@ abstract public class AbstractShaclTest { "test-cases/hasValue/not2", "test-cases/hasValue/targetNode", "test-cases/hasValue/targetNode2", - "test-cases/valueIn/simple", - "test-cases/valueIn/and", - "test-cases/valueIn/not", - "test-cases/valueIn/not2", - "test-cases/valueIn/targetNode", - "test-cases/valueIn/targetNode2" + "test-cases/hasValueIn/simple", + "test-cases/hasValueIn/and", + "test-cases/hasValueIn/not", + "test-cases/hasValueIn/not2", + "test-cases/hasValueIn/targetNode", + "test-cases/hasValueIn/targetNode2" ) .distinct() .sorted() diff --git a/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl index c1cf94132de..93f98805243 100644 --- a/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl +++ b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl @@ -15,7 +15,7 @@ ex:PersonShape a sh:Shape ; sh:property [ sh:path rdf:type ; - dash:valueIn (rdfs:Resource rdfs:class); + dash:hasValueIn (rdfs:Resource rdfs:class); ] ] ; diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl index b4d1bc61c44..119f8a7702a 100644 --- a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl @@ -13,7 +13,7 @@ ex:PersonShape a sh:NodeShape ; sh:property [ sh:path rdf:type ; - dash:valueIn (ex:Person ex:SecondTarget) ; + dash:hasValueIn (ex:Person ex:SecondTarget) ; ] ] ; diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/invalid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/invalid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/invalid/case2/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/invalid/case2/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/invalid/case2/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/and/invalid/case2/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/invalid/case2/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/shacl.ttl similarity index 84% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/and/shacl.ttl rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/shacl.ttl index b559625ab94..a224a27412a 100644 --- a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/shacl.ttl @@ -14,14 +14,14 @@ ex:PersonShape [ sh:path ex:knows ; - dash:valueIn (ex:peter ex:mary ex:kate) ; + dash:hasValueIn (ex:peter ex:mary ex:kate) ; ] [ sh:path ex:knows ; - dash:valueIn (ex:steve) ; + dash:hasValueIn (ex:steve) ; ] diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/valid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/valid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/valid/case3/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/valid/case3/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/valid/case3/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/and/valid/case3/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/and/valid/case3/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case2/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case2/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case2/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case2/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case2/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case3/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case3/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case3/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case3/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case3/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case5/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case5/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case5/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/invalid/case5/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/invalid/case5/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/shacl.ttl similarity index 89% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/shacl.ttl rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/shacl.ttl index f5f3b95f1c9..1c0996efbdd 100644 --- a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/shacl.ttl @@ -12,6 +12,6 @@ ex:PersonShape sh:targetClass ex:Person ; sh:property [ sh:path ex:knows ; - sh:not [dash:valueIn (ex:peter ex:mary ex:kate) ]; + sh:not [dash:hasValueIn (ex:peter ex:mary ex:kate) ]; ] . diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case2/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case2/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case2/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case2/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case2/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case3/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case3/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case3/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not/valid/case3/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not/valid/case3/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case2/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case2/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case2/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case2/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case2/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case4/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case4/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case4/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case4/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query3.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case4/query3.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case4/query3.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case4/query3.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case5/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case5/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case5/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/invalid/case5/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/invalid/case5/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/shacl.ttl similarity index 82% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/shacl.ttl rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/shacl.ttl index a5dcc4578c7..e628a1511f5 100644 --- a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/shacl.ttl @@ -15,14 +15,14 @@ ex:PersonShape [ sh:path ex:knows ; - dash:valueIn (ex:peter ex:mary ex:kate) ; + dash:hasValueIn (ex:peter ex:mary ex:kate) ; ] [ sh:path ex:knows ; - dash:valueIn (ex:steve ex:mary ex:kate) ; + dash:hasValueIn (ex:steve ex:mary ex:kate) ; ] diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case2/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case2/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case2/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case2/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case2/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case3/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case3/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case3/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case3/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case3/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case4/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case4/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case4/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case5/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case5/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case5/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case6/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case6/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case6/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/not2/valid/case6/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/not2/valid/case6/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case2/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case2/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case2/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case2/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case2/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case3/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case3/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case3/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case3/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case3/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case4/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case4/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case4/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/invalid/case4/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/invalid/case4/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/shacl.ttl similarity index 91% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/shacl.ttl rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/shacl.ttl index 75cac87ea9d..4e91caae347 100644 --- a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/shacl.ttl @@ -12,6 +12,6 @@ ex:PersonShape sh:targetClass ex:Person ; sh:property [ sh:path ex:knows ; - dash:valueIn (ex:peter ex:mary ex:kate) ; + dash:hasValueIn (ex:peter ex:mary ex:kate) ; ] . diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case2/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case2/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case2/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case2/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case2/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case3/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case3/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case3/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case3/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case3/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case4/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case4/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case4/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case4/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case5/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case5/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case5/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case5/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case5/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case6/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case6/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case6/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case6/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case6/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case7/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case7/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/simple/valid/case7/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/simple/valid/case7/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/shacl.ttl similarity index 90% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/shacl.ttl rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/shacl.ttl index eeca2ab7e0e..a9845ffd6d4 100644 --- a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/shacl.ttl @@ -10,6 +10,6 @@ ex:PersonShape a sh:NodeShape ; sh:targetNode ex:peter ; - dash:valueIn (ex:peter ex:mary ex:kate) ; + dash:hasValueIn (ex:peter ex:mary ex:kate) ; . diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/valid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/valid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/valid/case2/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/valid/case2/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query2.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/valid/case2/query2.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode/valid/case2/query2.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode/valid/case2/query2.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/invalid/case1/query1.rq b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode2/invalid/case1/query1.rq similarity index 100% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/invalid/case1/query1.rq rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode2/invalid/case1/query1.rq diff --git a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode2/shacl.ttl similarity index 90% rename from core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/shacl.ttl rename to core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode2/shacl.ttl index fcba49c9d00..2c4552c60db 100644 --- a/core/sail/shacl/src/test/resources/test-cases/valueIn/targetNode2/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/hasValueIn/targetNode2/shacl.ttl @@ -10,6 +10,6 @@ ex:PersonShape a sh:NodeShape ; sh:targetNode ex:steve ; - dash:valueIn (ex:peter ex:mary ex:kate) ; + dash:hasValueIn (ex:peter ex:mary ex:kate) ; . From 5803dd27a771fecaf148d1991e8d0f3ecd8ced2d Mon Sep 17 00:00:00 2001 From: hmottestad Date: Fri, 10 Jul 2020 15:35:57 +0200 Subject: [PATCH 30/35] GH-2240 shacl limit validating results (#2334) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * GH-2240 started to support truncated reports Signed-off-by: Håvard Ottestad * GH-2240 tests Signed-off-by: Håvard Ottestad * GH-2240 added vocabulary Signed-off-by: Håvard Ottestad * fix test Signed-off-by: Håvard Ottestad * GH-2240 handle limits of zero Signed-off-by: Håvard Ottestad * GH-2240 test when limit is equal to size Signed-off-by: Håvard Ottestad * GH-2240 transactions should conform by default Signed-off-by: Håvard Ottestad * fixes from review Signed-off-by: Håvard Ottestad * GH-2240 calculate the effective limit per constraint based on the user set value with upper bound of the total limit Signed-off-by: Håvard Ottestad --- .gitignore | 1 + .../eclipse/rdf4j/model/vocabulary/RDF4J.java | 8 +- .../rdf4j/sail/shacl/AST/PlanGenerator.java | 2 - .../eclipse/rdf4j/sail/shacl/ShaclSail.java | 63 ++++ .../rdf4j/sail/shacl/ShaclSailConnection.java | 77 +++-- .../shacl/ShaclSailValidationException.java | 31 +- .../sail/shacl/config/ShaclSailConfig.java | 35 ++ .../sail/shacl/config/ShaclSailFactory.java | 2 + .../sail/shacl/config/ShaclSailSchema.java | 3 + .../planNodes/AbstractBulkJoinPlanNode.java | 1 - .../planNodes/BulkedExternalInnerJoin.java | 3 - .../BulkedExternalLeftOuterJoin.java | 3 - .../sail/shacl/results/ValidationReport.java | 30 +- .../results/lazy/LazyValidationReport.java | 122 +++++++ .../lazy/ValidationResultIterator.java | 125 ++++++++ .../eclipse/rdf4j/sail/shacl/TempTest.java | 7 - .../shacl/TruncatedValidationReportTest.java | 298 ++++++++++++++++++ .../sail/shacl/ValidationReportTest.java | 47 +-- .../shacl/config/ShaclSailConfigTest.java | 38 ++- .../shacl/config/ShaclSailFactoryTest.java | 7 + .../resources/shaclDatatypeAndMinCount.ttl | 17 + .../IteratorCloseableIteration.java | 4 +- 22 files changed, 807 insertions(+), 117 deletions(-) create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/lazy/LazyValidationReport.java create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/lazy/ValidationResultIterator.java create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TruncatedValidationReportTest.java create mode 100644 core/sail/shacl/src/test/resources/shaclDatatypeAndMinCount.ttl rename core/{sail/lucene-api/src/main/java/org/eclipse/rdf4j/sail/lucene/util => util/src/main/java/org/eclipse/rdf4j/common/iteration}/IteratorCloseableIteration.java (86%) diff --git a/.gitignore b/.gitignore index 08b7a450145..88f65593ed0 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ compliance/repository/overlays /core/sail/elasticsearch-store/tempElasticsearchDownload/* tempElasticsearchDownload cache.db +formatter-maven-cache.properties diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/RDF4J.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/RDF4J.java index f950921bd2d..8d8b0a41866 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/RDF4J.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/RDF4J.java @@ -39,6 +39,10 @@ public class RDF4J { * Context identifier for persisting SHACL shape data in the {@link org.eclipse.rdf4j.sail.shacl.ShaclSail} . * http://rdf4j.org/schema/rdf4j#SHACLShapeGraph */ - public final static IRI SHACL_SHAPE_GRAPH = SimpleValueFactory.getInstance() - .createIRI(NAMESPACE, "SHACLShapeGraph"); + public final static IRI SHACL_SHAPE_GRAPH = create("SHACLShapeGraph"); + public final static IRI TRUNCATED = create("truncated"); + + private static IRI create(String localName) { + return SimpleValueFactory.getInstance().createIRI(NAMESPACE, localName); + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java index 390c123b7c3..dc811eddd65 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/PlanGenerator.java @@ -9,9 +9,7 @@ package org.eclipse.rdf4j.sail.shacl.AST; import java.util.List; -import java.util.stream.Stream; -import org.eclipse.rdf4j.query.algebra.StatementPattern; import org.eclipse.rdf4j.sail.shacl.ConnectionsGroup; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNode; import org.eclipse.rdf4j.sail.shacl.planNodes.PlanNodeProvider; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java index 26037e78ce1..99b9bc803d9 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java @@ -190,6 +190,9 @@ public class ShaclSail extends NotifyingSailWrapper { private boolean shaclAdvancedFeatures = ShaclSailConfig.SHACL_ADVANCED_FEATURES_DEFAULT; private boolean dashDataShapes = ShaclSailConfig.DASH_DATA_SHAPES_DEFAULT; + private long validationResultsLimitTotal = -1; + private long validationResultsLimitPerConstraint = -1; + static { try { IMPLICIT_TARGET_CLASS_NODE_SHAPE = resourceAsString( @@ -863,4 +866,64 @@ public void setDashDataShapes(boolean dashDataShapes) { public boolean isDashDataShapes() { return dashDataShapes; } + + /** + * ValidationReports contain validation results. The number of validation results can be limited by the user. This + * can be useful to reduce the size of reports when there are a lot of failures, which increases validation speed + * and reduces memory usage. + * + * @return the limit for validation results per validation report per constraint, -1 for no limit + */ + public long getValidationResultsLimitPerConstraint() { + return validationResultsLimitPerConstraint; + } + + /** + * + * @return the effective limit per constraint with an upper bound of the total limit + */ + public long getEffectiveValidationResultsLimitPerConstraint() { + if (validationResultsLimitPerConstraint < 0) + return validationResultsLimitTotal; + if (validationResultsLimitTotal >= 0) { + return Math.min(validationResultsLimitTotal, validationResultsLimitPerConstraint); + } + + return validationResultsLimitPerConstraint; + } + + /** + * ValidationReports contain validation results. The number of validation results can be limited by the user. This + * can be useful to reduce the size of reports when there are a lot of failures, which increases validation speed + * and reduces memory usage. + * + * @param validationResultsLimitPerConstraint the limit for the number of validation results per report per + * constraint, -1 for no limit + */ + public void setValidationResultsLimitPerConstraint(long validationResultsLimitPerConstraint) { + this.validationResultsLimitPerConstraint = validationResultsLimitPerConstraint; + } + + /** + * ValidationReports contain validation results. The number of validation results can be limited by the user. This + * can be useful to reduce the size of reports when there are a lot of failures, which increases validation speed + * and reduces memory usage. + * + * @return the limit for validation results per validation report in total, -1 for no limit + */ + public long getValidationResultsLimitTotal() { + return validationResultsLimitTotal; + } + + /** + * ValidationReports contain validation results. The number of validation results can be limited by the user. This + * can be useful to reduce the size of reports when there are a lot of failures, which increases validation speed + * and reduces memory usage. + * + * @param validationResultsLimitTotal the limit for the number of validation results per report in total, -1 for no + * limit + */ + public void setValidationResultsLimitTotal(long validationResultsLimitTotal) { + this.validationResultsLimitTotal = validationResultsLimitTotal; + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java index db066d3c9f5..353d79dc560 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java @@ -8,9 +8,7 @@ package org.eclipse.rdf4j.sail.shacl; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Objects; @@ -44,6 +42,8 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.Tuple; import org.eclipse.rdf4j.sail.shacl.planNodes.ValidationExecutionLogger; import org.eclipse.rdf4j.sail.shacl.results.ValidationReport; +import org.eclipse.rdf4j.sail.shacl.results.lazy.LazyValidationReport; +import org.eclipse.rdf4j.sail.shacl.results.lazy.ValidationResultIterator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -64,8 +64,8 @@ public class ShaclSailConnection extends NotifyingSailConnectionWrapper implemen Sail addedStatements; Sail removedStatements; - private HashSet addedStatementsSet = new HashSet<>(); - private HashSet removedStatementsSet = new HashSet<>(); + private final HashSet addedStatementsSet = new HashSet<>(); + private final HashSet removedStatementsSet = new HashSet<>(); private boolean isShapeRefreshNeeded = false; private boolean shapesModifiedInCurrentTransaction = false; @@ -78,7 +78,9 @@ public class ShaclSailConnection extends NotifyingSailConnectionWrapper implemen private boolean preparedHasRun = false; - private SailRepositoryConnection shapesRepoConnection; + private final SailRepositoryConnection shapesRepoConnection; + + private boolean validationReportTruncated; // write lock private Lock writeLock; @@ -134,6 +136,8 @@ public void begin(IsolationLevel level) throws SailException { setupConnectionListener(); } + validationReportTruncated = false; + } private void setupConnectionListener() { @@ -300,11 +304,11 @@ private void refreshShapes() { } - private List validate(List nodeShapes, boolean validateEntireBaseSail) { + private ValidationReport validate(List nodeShapes, boolean validateEntireBaseSail) { try { if (!sail.isValidationEnabled()) { - return Collections.emptyList(); + return new ValidationReport(true); } try (ConnectionsGroup connectionsGroup = getConnectionsGroup()) { @@ -337,7 +341,7 @@ ConnectionsGroup getConnectionsGroup() { this::getRdfsSubClassOfReasoner); } - private static List performValidation(List nodeShapes, boolean validateEntireBaseSail, + private ValidationReport performValidation(List nodeShapes, boolean validateEntireBaseSail, ConnectionsGroup connectionsGroup) { long beforeValidation = 0; @@ -348,7 +352,7 @@ private static List performValidation(List nodeShapes, boolean } try { - Stream>> callableStream = nodeShapes + Stream> callableStream = nodeShapes .stream() .flatMap(nodeShape -> nodeShape .generatePlans(connectionsGroup, nodeShape, sail.isLogValidationPlans(), @@ -358,7 +362,7 @@ private static List performValidation(List nodeShapes, boolean ValidationExecutionLogger validationExecutionLogger = new ValidationExecutionLogger(); planNode.receiveLogger(validationExecutionLogger); - try (Stream stream = planNode.iterator().stream()) { + try (CloseableIteration iterator = planNode.iterator()) { if (GlobalValidationExecutionLogging.loggingEnabled) { PropertyShape propertyShape = ((EnrichWithShape) planNode).getPropertyShape(); logger.info("Start execution of plan " + propertyShape.getNodeShape().toString() + " : " @@ -370,7 +374,9 @@ private static List performValidation(List nodeShapes, boolean before = System.currentTimeMillis(); } - List collect = new ArrayList<>(stream.collect(Collectors.toList())); + ValidationResultIterator validationResults = new ValidationResultIterator(iterator, + sail.getEffectiveValidationResultsLimitPerConstraint()); + validationExecutionLogger.flush(); if (sail.isPerformanceLogging()) { @@ -387,34 +393,38 @@ private static List performValidation(List nodeShapes, boolean propertyShape.toString()); } - boolean valid = collect.isEmpty(); + if (sail.isLogValidationViolations()) { + List tuples = validationResults.getTuples(); + if (!validationResults.conforms()) { - if (!valid && sail.isLogValidationViolations()) { - PropertyShape propertyShape = ((EnrichWithShape) planNode).getPropertyShape(); + PropertyShape propertyShape = ((EnrichWithShape) planNode).getPropertyShape(); - logger.info( - "SHACL not valid. The following experimental debug results were produced: \n\tNodeShape: {}\n\tPropertyShape: {} \n\t\t{}", - propertyShape.getNodeShape().getId(), propertyShape.getId(), - collect.stream() - .map(a -> a.toString() + " -cause-> " + a.getCause()) - .collect(Collectors.joining("\n\t\t"))); + logger.info( + "SHACL not valid. The following experimental debug results were produced: \n\tNodeShape: {}\n\tPropertyShape: {} \n\t\t{}", + propertyShape.getNodeShape().getId(), propertyShape.getId(), + tuples.stream() + .map(a -> a.toString() + " -cause-> " + a.getCause()) + .collect(Collectors.joining("\n\t\t"))); + } } - return collect; + return validationResults; } }); + List validationResultIterators; + if (sail.isParallelValidation()) { - return callableStream + validationResultIterators = callableStream .map(sail::submitRunnableToExecutorService) // Creating a list is needed to actually make things run multi-threaded, without this the // laziness of java streams will make this run serially .collect(Collectors.toList()) .stream() - .flatMap(f -> { + .map(f -> { try { - return f.get().stream(); + return f.get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } @@ -422,15 +432,18 @@ private static List performValidation(List nodeShapes, boolean .collect(Collectors.toList()); } else { - return callableStream.flatMap(c -> { + validationResultIterators = callableStream.map(c -> { try { - return c.call().stream(); + return c.call(); } catch (Exception e) { throw new RuntimeException(e); } }).collect(Collectors.toList()); + } + return new LazyValidationReport(validationResultIterators, sail.getValidationResultsLimitTotal()); + } finally { if (sail.isPerformanceLogging()) { logger.info("Actual validation and generating plans took {} ms", @@ -603,7 +616,7 @@ public void prepare() throws SailException { prepareValidation(); - List invalidTuples = null; + ValidationReport invalidTuples = null; if (useSerializableValidation) { synchronized (sail) { @@ -625,7 +638,7 @@ public void prepare() throws SailException { invalidTuples = validate(nodeShapesAfterRefresh, shapesModifiedInCurrentTransaction); } - boolean valid = invalidTuples.isEmpty(); + boolean valid = invalidTuples.conforms(); if (sail.isPerformanceLogging()) { logger.info("prepare() including validation excluding locking and super.prepare() took {} ms", @@ -650,8 +663,7 @@ public void prepare() throws SailException { } - private List serializableValidation(List nodeShapesAfterRefresh) { - List invalidTuples; + private ValidationReport serializableValidation(List nodeShapesAfterRefresh) { try { try { try (ConnectionsGroup connectionsGroup = new ConnectionsGroup(sail, @@ -682,7 +694,7 @@ private List serializableValidation(List nodeShapesAfterRefres serializableConnection.flush(); - invalidTuples = performValidation(nodeShapesAfterRefresh, + return performValidation(nodeShapesAfterRefresh, shapesModifiedInCurrentTransaction, connectionsGroup); } finally { @@ -695,7 +707,6 @@ private List serializableValidation(List nodeShapesAfterRefres rdfsSubClassOfReasoner = null; } - return invalidTuples; } private void loadCachedNodeShapes() { @@ -766,7 +777,7 @@ public ValidationReport revalidate() { loadCachedNodeShapes(); prepareValidation(); - List validate = validate(this.nodeShapes, true); + ValidationReport validate = validate(this.nodeShapes, true); return new ShaclSailValidationException(validate).getValidationReport(); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java index 5aafd191909..4fbeb756814 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailValidationException.java @@ -8,25 +8,19 @@ package org.eclipse.rdf4j.sail.shacl; -import java.util.ArrayDeque; -import java.util.List; - import org.eclipse.rdf4j.exceptions.ValidationException; import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.vocabulary.SHACL; import org.eclipse.rdf4j.sail.SailException; -import org.eclipse.rdf4j.sail.shacl.AST.PropertyShape; -import org.eclipse.rdf4j.sail.shacl.planNodes.Tuple; import org.eclipse.rdf4j.sail.shacl.results.ValidationReport; -import org.eclipse.rdf4j.sail.shacl.results.ValidationResult; public class ShaclSailValidationException extends SailException implements ValidationException { - private List invalidTuples; + private final ValidationReport validationReport; - ShaclSailValidationException(List invalidTuples) { + ShaclSailValidationException(ValidationReport validationReport) { super("Failed SHACL validation"); - this.invalidTuples = invalidTuples; + this.validationReport = validationReport; } /** @@ -52,25 +46,6 @@ public Model validationReportAsModel() { */ @Deprecated public ValidationReport getValidationReport() { - ValidationReport validationReport = new ValidationReport(invalidTuples.isEmpty()); - - for (Tuple invalidTuple : invalidTuples) { - ValidationResult parent = null; - ArrayDeque propertyShapes = new ArrayDeque<>(invalidTuple.getCausedByPropertyShapes()); - - while (!propertyShapes.isEmpty()) { - - ValidationResult validationResult = new ValidationResult(propertyShapes.pop(), - invalidTuple.getLine().get(0), invalidTuple.getLine().get(invalidTuple.getLine().size() - 1)); - if (parent == null) { - validationReport.addValidationResult(validationResult); - } else { - parent.setDetail(validationResult); - } - parent = validationResult; - } - - } return validationReport; } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java index 415fd617300..4e6bd5a7f00 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java @@ -24,6 +24,7 @@ import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.impl.BooleanLiteral; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.util.Models; import org.eclipse.rdf4j.sail.config.AbstractDelegatingSailImplConfig; import org.eclipse.rdf4j.sail.config.SailConfigException; @@ -50,6 +51,8 @@ public class ShaclSailConfig extends AbstractDelegatingSailImplConfig { public static final boolean SERIALIZABLE_VALIDATION_DEFAULT = true; public static final boolean SHACL_ADVANCED_FEATURES_DEFAULT = false; public static final boolean DASH_DATA_SHAPES_DEFAULT = false; + public final static long VALIDATION_RESULTS_LIMIT_TOTAL_DEFAULT = -1; + public final static long VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT_DEFAULT = -1; private boolean parallelValidation = PARALLEL_VALIDATION_DEFAULT; private boolean undefinedTargetValidatesAllSubjects = UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS_DEFAULT; @@ -64,6 +67,10 @@ public class ShaclSailConfig extends AbstractDelegatingSailImplConfig { private boolean serializableValidation = SERIALIZABLE_VALIDATION_DEFAULT; private boolean shaclAdvancedFeatures = SHACL_ADVANCED_FEATURES_DEFAULT; private boolean dashDataShapes = DASH_DATA_SHAPES_DEFAULT; + private long validationResultsLimitTotal = VALIDATION_RESULTS_LIMIT_TOTAL_DEFAULT; + private long validationResultsLimitPerConstraint = VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT_DEFAULT; + + private static final SimpleValueFactory vf = SimpleValueFactory.getInstance(); public ShaclSailConfig() { super(ShaclSailFactory.SAIL_TYPE); @@ -185,6 +192,22 @@ public void setDashDataShapes(boolean dashDataShapes) { this.dashDataShapes = dashDataShapes; } + public long getValidationResultsLimitTotal() { + return validationResultsLimitTotal; + } + + public long getValidationResultsLimitPerConstraint() { + return validationResultsLimitPerConstraint; + } + + public void setValidationResultsLimitTotal(long validationResultsLimitTotal) { + this.validationResultsLimitTotal = validationResultsLimitTotal; + } + + public void setValidationResultsLimitPerConstraint(long validationResultsLimitPerConstraint) { + this.validationResultsLimitPerConstraint = validationResultsLimitPerConstraint; + } + @Override public Resource export(Model m) { Resource implNode = super.export(m); @@ -204,6 +227,11 @@ public Resource export(Model m) { m.add(implNode, SERIALIZABLE_VALIDATION, BooleanLiteral.valueOf(isSerializableValidation())); m.add(implNode, ShaclSailSchema.SHACL_ADVANCED_FEATURES, BooleanLiteral.valueOf(isShaclAdvancedFeatures())); m.add(implNode, ShaclSailSchema.DASH_DATA_SHAPES, BooleanLiteral.valueOf(isDashDataShapes())); + + m.add(implNode, ShaclSailSchema.VALIDATION_RESULTS_LIMIT_TOTAL, + vf.createLiteral(getValidationResultsLimitTotal())); + m.add(implNode, ShaclSailSchema.VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT, + vf.createLiteral(getValidationResultsLimitPerConstraint())); return implNode; } @@ -251,6 +279,13 @@ public void parse(Model m, Resource implNode) throws SailConfigException { Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.DASH_DATA_SHAPES, null)) .ifPresent(l -> setDashDataShapes(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.VALIDATION_RESULTS_LIMIT_TOTAL, null)) + .ifPresent(l -> setValidationResultsLimitTotal(l.longValue())); + + Models.objectLiteral( + m.getStatements(implNode, ShaclSailSchema.VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT, null)) + .ifPresent(l -> setValidationResultsLimitPerConstraint(l.longValue())); + } catch (IllegalArgumentException e) { throw new SailConfigException("error parsing Sail configuration", e); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java index 636f1204941..66aacfe5195 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java @@ -66,6 +66,8 @@ public Sail getSail(SailImplConfig config) throws SailConfigException { sail.setRdfsSubClassReasoning(shaclSailConfig.isRdfsSubClassReasoning()); sail.setShaclAdvancedFeatures(shaclSailConfig.isShaclAdvancedFeatures()); sail.setDashDataShapes(shaclSailConfig.isDashDataShapes()); + sail.setValidationResultsLimitTotal(shaclSailConfig.getValidationResultsLimitTotal()); + sail.setValidationResultsLimitPerConstraint(shaclSailConfig.getValidationResultsLimitPerConstraint()); } return sail; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java index 514b8d748d7..fd183c7cf2f 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java @@ -59,6 +59,9 @@ public class ShaclSailSchema { public final static IRI DASH_DATA_SHAPES = create("dashDataShapes"); + public final static IRI VALIDATION_RESULTS_LIMIT_TOTAL = create("validationResultsLimitTotal"); + public final static IRI VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT = create("validationResultsLimitPerConstraint"); + private static IRI create(String localName) { return SimpleValueFactory.getInstance().createIRI(NAMESPACE, localName); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java index de54f9bce61..99673443650 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/AbstractBulkJoinPlanNode.java @@ -19,7 +19,6 @@ import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.algebra.BindingSetAssignment; import org.eclipse.rdf4j.query.algebra.helpers.AbstractQueryModelVisitor; -import org.eclipse.rdf4j.query.explanation.Explanation; import org.eclipse.rdf4j.query.impl.ListBindingSet; import org.eclipse.rdf4j.query.impl.MapBindingSet; import org.eclipse.rdf4j.query.parser.ParsedQuery; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java index 2e2b93ddbd3..0c8e3bf5eb6 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalInnerJoin.java @@ -12,11 +12,8 @@ import org.apache.commons.text.StringEscapeUtils; import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.algebra.evaluation.util.ValueComparator; import org.eclipse.rdf4j.query.parser.ParsedQuery; -import org.eclipse.rdf4j.query.parser.ParsedTupleQuery; -import org.eclipse.rdf4j.query.parser.QueryParserUtil; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.memory.MemoryStoreConnection; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java index 89e618bc142..07623fbd4bf 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/planNodes/BulkedExternalLeftOuterJoin.java @@ -12,10 +12,7 @@ import org.apache.commons.text.StringEscapeUtils; import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.parser.ParsedQuery; -import org.eclipse.rdf4j.query.parser.QueryParserFactory; -import org.eclipse.rdf4j.query.parser.QueryParserRegistry; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.memory.MemoryStoreConnection; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationReport.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationReport.java index 6072174183d..7e12134043d 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationReport.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/ValidationReport.java @@ -14,10 +14,13 @@ import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.impl.BooleanLiteral; import org.eclipse.rdf4j.model.impl.DynamicModelFactory; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDF4J; import org.eclipse.rdf4j.model.vocabulary.SHACL; +import org.eclipse.rdf4j.sail.shacl.planNodes.Tuple; /** * The ValidationReport represents the report from a SHACL validation in an easy-to-use Java API. @@ -28,11 +31,17 @@ @Deprecated public class ValidationReport { - private Resource id = SimpleValueFactory.getInstance().createBNode(); + protected final Resource id = SimpleValueFactory.getInstance().createBNode(); - private boolean conforms; + protected boolean conforms = true; - private List validationResult = new ArrayList<>(); + protected final List validationResult = new ArrayList<>(); + protected boolean truncated = false; + List tuples; + + public ValidationReport() { + + } public ValidationReport(boolean conforms) { this.conforms = conforms; @@ -48,6 +57,7 @@ public Model asModel(Model model) { model.add(getId(), SHACL.CONFORMS, vf.createLiteral(conforms)); model.add(getId(), RDF.TYPE, SHACL.VALIDATION_REPORT); + model.add(getId(), RDF4J.TRUNCATED, BooleanLiteral.valueOf(truncated)); for (ValidationResult result : validationResult) { model.add(getId(), SHACL.RESULT, result.getId()); @@ -86,4 +96,18 @@ public String toString() { ", validationResult=" + Arrays.toString(validationResult.toArray()) + '}'; } + + /** + * Users can enable a limit for the number of validation results they want to accept. If the limit is reached the + * report will be marked as truncated. + * + * @return true if this SHACL validation report has been truncated. + */ + public boolean isTruncated() { + return truncated; + } + + public void setTuples(List collect) { + this.tuples = collect; + } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/lazy/LazyValidationReport.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/lazy/LazyValidationReport.java new file mode 100644 index 00000000000..44e5e5671ae --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/lazy/LazyValidationReport.java @@ -0,0 +1,122 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.results.lazy; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.rdf4j.common.annotation.InternalUseOnly; +import org.eclipse.rdf4j.model.Model; +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.impl.BooleanLiteral; +import org.eclipse.rdf4j.model.impl.DynamicModelFactory; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDF4J; +import org.eclipse.rdf4j.model.vocabulary.SHACL; +import org.eclipse.rdf4j.sail.shacl.results.ValidationReport; +import org.eclipse.rdf4j.sail.shacl.results.ValidationResult; + +/** + * A ValidationReport that will defer calculating any ValidationResults until the user asks for them + * + */ +@InternalUseOnly +@Deprecated +public class LazyValidationReport extends ValidationReport { + + private List validationResultIterators; + private final long limit; + + public LazyValidationReport(List validationResultIterators, long limit) { + + this.validationResultIterators = validationResultIterators; + this.limit = limit; + + } + + private void evaluateLazyAspect() { + if (validationResultIterators != null) { + long counter = 0; + for (ValidationResultIterator validationResultIterator : validationResultIterators) { + while (validationResultIterator.hasNext()) { + if (limit >= 0 && counter >= limit) { + truncated = true; + break; + } + counter++; + + validationResult.add(validationResultIterator.next()); + } + + this.conforms = conforms && validationResultIterator.conforms(); + this.truncated = truncated || validationResultIterator.isTruncated(); + } + + validationResultIterators = null; + + } + + } + + public Model asModel(Model model) { + evaluateLazyAspect(); + + SimpleValueFactory vf = SimpleValueFactory.getInstance(); + + model.add(getId(), SHACL.CONFORMS, vf.createLiteral(conforms)); + model.add(getId(), RDF.TYPE, SHACL.VALIDATION_REPORT); + model.add(getId(), RDF4J.TRUNCATED, BooleanLiteral.valueOf(truncated)); + + for (ValidationResult result : validationResult) { + model.add(getId(), SHACL.RESULT, result.getId()); + result.asModel(model); + } + + return model; + } + + public Model asModel() { + return asModel(new DynamicModelFactory().createEmptyModel()); + } + + public Resource getId() { + return id; + } + + /** + * @return false if the changes violated a SHACL Shape + */ + public boolean conforms() { + evaluateLazyAspect(); + return conforms; + } + + /** + * @return list of ValidationResult with more information about each violation + */ + public List getValidationResult() { + evaluateLazyAspect(); + return validationResult; + } + + @Override + public String toString() { + return "LazyValidationReport{" + + "conforms=" + conforms + + ", validationResult=" + Arrays.toString(validationResult.toArray()) + + '}'; + } + + public boolean isTruncated() { + evaluateLazyAspect(); + return truncated; + } + +} diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/lazy/ValidationResultIterator.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/lazy/ValidationResultIterator.java new file mode 100644 index 00000000000..cf5ad8007e6 --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/results/lazy/ValidationResultIterator.java @@ -0,0 +1,125 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl.results.lazy; + +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.rdf4j.common.annotation.InternalUseOnly; +import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.common.iteration.IterationWrapper; +import org.eclipse.rdf4j.common.iteration.IteratorCloseableIteration; +import org.eclipse.rdf4j.common.iteration.IteratorIteration; +import org.eclipse.rdf4j.sail.SailException; +import org.eclipse.rdf4j.sail.shacl.AST.PropertyShape; +import org.eclipse.rdf4j.sail.shacl.planNodes.Tuple; +import org.eclipse.rdf4j.sail.shacl.results.ValidationResult; + +@Deprecated +@InternalUseOnly +public class ValidationResultIterator implements Iterator { + + private final long limit; + private long counter = 0; + private boolean conforms = true; + private boolean truncated = false; + + private ValidationResult next = null; + private CloseableIteration tupleIterator; + + public ValidationResultIterator(CloseableIteration tupleIterator, long limit) { + this.limit = limit; + this.tupleIterator = tupleIterator; + getTuples(); + + } + + private void calculateNext() { + if (tupleIterator.hasNext()) { + conforms = false; + } + if (next == null && tupleIterator.hasNext()) { + if (limit < 0 || counter < limit) { + Tuple invalidTuple = tupleIterator.next(); + + ValidationResult parent = null; + ArrayDeque propertyShapes = new ArrayDeque<>(invalidTuple.getCausedByPropertyShapes()); + + while (!propertyShapes.isEmpty()) { + + ValidationResult validationResult = new ValidationResult( + propertyShapes.pop(), + invalidTuple.getLine().get(0), + invalidTuple.getLine().get(invalidTuple.getLine().size() - 1) + ); + + if (parent == null) { + next = validationResult; + } else { + parent.setDetail(validationResult); + } + parent = validationResult; + } + counter++; + } + + if (limit >= 0 && counter >= limit && tupleIterator.hasNext()) { + truncated = true; + } + + } + } + + public List getTuples() { + List actualList = new ArrayList<>(); + long localCounter = 0; + while (tupleIterator.hasNext() && (limit < 0 || localCounter++ < limit + 1)) { + actualList.add(tupleIterator.next()); + } + + tupleIterator = new IteratorCloseableIteration<>(actualList.iterator()); + + return Collections.unmodifiableList(actualList); + } + + public boolean conforms() { + calculateNext(); + return conforms; + } + + public boolean isTruncated() { + return truncated; + } + + @Override + public boolean hasNext() { + calculateNext(); + return next != null; + } + + @Override + public ValidationResult next() { + calculateNext(); + if (next == null) { + throw new IllegalStateException(); + } + + ValidationResult temp = next; + next = null; + return temp; + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TempTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TempTest.java index e48079d8f1d..30599b87140 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TempTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TempTest.java @@ -44,7 +44,6 @@ public static void afterClass() { public void a() throws Exception { SailRepository shaclRepository = Utils.getInitializedShaclRepository("shacl.ttl", false); - shaclRepository.init(); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { @@ -83,7 +82,6 @@ public void a() throws Exception { @Test public void b() throws Exception { SailRepository shaclRepository = Utils.getInitializedShaclRepository("shacl.ttl", false); - shaclRepository.init(); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { @@ -113,7 +111,6 @@ public void b() throws Exception { @Test(expected = RepositoryException.class) public void maxCount() throws Exception { SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclMax.ttl", false); - shaclRepository.init(); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { @@ -149,7 +146,6 @@ public void maxCount() throws Exception { public void minCount() throws Exception { SailRepository shaclRepository = Utils.getInitializedShaclRepository("shacl.ttl", false); - shaclRepository.init(); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { @@ -177,7 +173,6 @@ public void minCount() throws Exception { public void leftOuterJoin() throws Exception { SailRepository shaclRepository = Utils.getInitializedShaclRepository("shacl.ttl", false); - shaclRepository.init(); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { @@ -214,7 +209,6 @@ public void leftOuterJoin() throws Exception { public void testShapeWithoutTargetClassRemove() throws Exception { SailRepository shaclRepository = Utils.getInitializedShaclRepository("shacleNoTargetClass.ttl", true); - shaclRepository.init(); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { @@ -235,7 +229,6 @@ public void testShapeWithoutTargetClassRemove() throws Exception { public void testShapeWithoutTargetClassAdd() throws Exception { SailRepository shaclRepository = Utils.getInitializedShaclRepository("shacleNoTargetClass.ttl", true); - shaclRepository.init(); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TruncatedValidationReportTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TruncatedValidationReportTest.java new file mode 100644 index 00000000000..2cc77acd4c8 --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TruncatedValidationReportTest.java @@ -0,0 +1,298 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl; + +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.assertFalse; +import static junit.framework.TestCase.assertTrue; + +import java.io.IOException; +import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.rdf4j.model.BNode; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.BooleanLiteral; +import org.eclipse.rdf4j.model.vocabulary.FOAF; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDF4J; +import org.eclipse.rdf4j.repository.RepositoryException; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.sail.shacl.results.ValidationReport; +import org.eclipse.rdf4j.sail.shacl.results.ValidationResult; +import org.junit.Test; + +/** + * @author Håvard Ottestad + */ +public class TruncatedValidationReportTest { + + private static final int NUMBER_OF_FAILURES = 5000; + + @Test + public void testTotal() throws IOException { + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitTotal(10); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertTrue(validationReport.isTruncated()); + assertEquals(10, total); + + } + + @Test + public void testPerConstraint() throws IOException { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitPerConstraint(10); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertTrue(validationReport.isTruncated()); + assertEquals(10, collect.get(SourceConstraintComponent.MinCountConstraintComponent).longValue()); + assertEquals(10, collect.get(SourceConstraintComponent.DatatypeConstraintComponent).longValue()); + assertEquals(20, total); + + } + + @Test + public void testPerConstraint2() throws IOException { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitPerConstraint(10); + sail.setValidationResultsLimitTotal(1); + sail.setValidationResultsLimitTotal(-1); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertTrue(validationReport.isTruncated()); + assertEquals(10, collect.get(SourceConstraintComponent.MinCountConstraintComponent).longValue()); + assertEquals(10, collect.get(SourceConstraintComponent.DatatypeConstraintComponent).longValue()); + assertEquals(20, total); + + } + + @Test + public void testZeroTotal() throws IOException { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitTotal(0); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertTrue(validationReport.isTruncated()); + assertFalse(validationReport.conforms()); + assertEquals(0, total); + + } + + @Test + public void testZeroPerConstraint() throws IOException { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitPerConstraint(0); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertTrue(validationReport.isTruncated()); + assertFalse(validationReport.conforms()); + assertEquals(0, total); + + } + + @Test + public void testTotalAndPerConstraint() throws IOException { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitTotal(20); + sail.setValidationResultsLimitPerConstraint(5); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertTrue(validationReport.isTruncated()); + assertEquals(5, collect.get(SourceConstraintComponent.MinCountConstraintComponent).longValue()); + assertEquals(5, collect.get(SourceConstraintComponent.DatatypeConstraintComponent).longValue()); + assertEquals(10, total); + + } + + @Test + public void testTotalAndPerConstraint2() throws IOException { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitTotal(20); + sail.setValidationResultsLimitPerConstraint(15); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertTrue(validationReport.isTruncated()); + assertEquals(20, total); + + assertTrue(validationReport.asModel().contains(null, RDF4J.TRUNCATED, BooleanLiteral.TRUE)); + } + + @Test + public void testNoLimit() throws IOException { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertFalse(validationReport.isTruncated()); + assertEquals(NUMBER_OF_FAILURES, + collect.get(SourceConstraintComponent.MinCountConstraintComponent).longValue()); + assertEquals(NUMBER_OF_FAILURES, + collect.get(SourceConstraintComponent.DatatypeConstraintComponent).longValue()); + assertEquals(NUMBER_OF_FAILURES * 2, total); + + } + + @Test + public void testLimitIsEqualToSize() throws IOException { + + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitTotal(NUMBER_OF_FAILURES * 2); + sail.setValidationResultsLimitPerConstraint(NUMBER_OF_FAILURES); + + ValidationReport validationReport = getValidationReport(shaclRepository); + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertFalse(validationReport.isTruncated()); + assertEquals(NUMBER_OF_FAILURES, + collect.get(SourceConstraintComponent.MinCountConstraintComponent).longValue()); + assertEquals(NUMBER_OF_FAILURES, + collect.get(SourceConstraintComponent.DatatypeConstraintComponent).longValue()); + assertEquals(NUMBER_OF_FAILURES * 2, total); + + } + + @Test + public void testRevalidate() throws IOException { + SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); + + ShaclSail sail = (ShaclSail) shaclRepository.getSail(); + sail.setValidationResultsLimitPerConstraint(15); + sail.setValidationResultsLimitTotal(-1); + + sail.disableValidation(); + getValidationReport(shaclRepository); + sail.enableValidation(); + + ValidationReport validationReport; + try (SailRepositoryConnection connection = shaclRepository.getConnection()) { + connection.begin(); + validationReport = ((ShaclSailConnection) connection.getSailConnection()).revalidate(); + connection.commit(); + } + + shaclRepository.shutDown(); + + Map collect = validationReport.getValidationResult() + .stream() + .collect(Collectors.groupingBy(ValidationResult::getSourceConstraintComponent, Collectors.counting())); + long total = collect.values().stream().mapToLong(l -> l).sum(); + + assertTrue(validationReport.isTruncated()); + assertEquals(15, collect.get(SourceConstraintComponent.MinCountConstraintComponent).longValue()); + assertEquals(15, collect.get(SourceConstraintComponent.DatatypeConstraintComponent).longValue()); + assertEquals(30, total); + } + + private ValidationReport getValidationReport(SailRepository shaclRepository) { + ValidationReport validationReport = null; + try (SailRepositoryConnection connection = shaclRepository.getConnection()) { + connection.begin(); + for (int i = 0; i < NUMBER_OF_FAILURES; i++) { + ValueFactory vf = connection.getValueFactory(); + + BNode bNode = vf.createBNode(); + connection.add(bNode, RDF.TYPE, FOAF.PERSON); + connection.add(bNode, FOAF.AGE, vf.createLiteral("three")); + } + try { + connection.commit(); + } catch (RepositoryException e) { + validationReport = ((ShaclSailValidationException) e.getCause()).getValidationReport(); + } + } + return validationReport; + } + +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationReportTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationReportTest.java index 99d8c840908..01dd2740e87 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationReportTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationReportTest.java @@ -59,20 +59,29 @@ public void simpleFirstTest() throws IOException { Rio.write(actual, System.out, RDFFormat.TURTLE); - Model expected = Rio.parse(new StringReader("" + "@prefix ex: .\n" - + "@prefix rdf: .\n" - + "@prefix rdfs: .\n" - + "@prefix sh: .\n" + "\n" - + "_:node1d1gi0h02x12 a sh:ValidationReport;\n" + " sh:conforms false;\n" - + " sh:result _:node1d1gi0h02x13 .\n" + "\n" + "_:node1d1gi0h02x13 a sh:ValidationResult;\n" - + " sh:focusNode rdf:subject;\n" + " sh:resultPath rdfs:label;\n" - + " sh:sourceConstraintComponent sh:MinCountConstraintComponent;\n" - + " sh:sourceShape ex:PersonShapeProperty .\n" + "\n" - + "_:node1d1gi0h02x12 sh:result _:node1d1gi0h02x14 .\n" + "\n" - + "_:node1d1gi0h02x14 a sh:ValidationResult;\n" + " sh:focusNode rdfs:Class;\n" - + " sh:resultPath rdfs:label;\n" - + " sh:sourceConstraintComponent sh:MinCountConstraintComponent;\n" - + " sh:sourceShape ex:PersonShapeProperty ." + ""), "", RDFFormat.TURTLE); + Model expected = Rio.parse(new StringReader("" + "@prefix ex: .\n" + + "@prefix rdf: .\n" + + "@prefix rdfs: .\n" + + "@prefix sh: .\n" + + "\n" + + "_:node1ebr5j3f8x20 a sh:ValidationReport;\n" + + " false;\n" + + " sh:conforms false;\n" + + " sh:result _:node1ebr5j3f8x21 .\n" + + "\n" + + "_:node1ebr5j3f8x21 a sh:ValidationResult;\n" + + " sh:focusNode rdf:subject;\n" + + " sh:resultPath rdfs:label;\n" + + " sh:sourceConstraintComponent sh:MinCountConstraintComponent;\n" + + " sh:sourceShape ex:PersonShapeProperty .\n" + + "\n" + + "_:node1ebr5j3f8x20 sh:result _:node1ebr5j3f8x22 .\n" + + "\n" + + "_:node1ebr5j3f8x22 a sh:ValidationResult;\n" + + " sh:focusNode rdfs:Class;\n" + + " sh:resultPath rdfs:label;\n" + + " sh:sourceConstraintComponent sh:MinCountConstraintComponent;\n" + + " sh:sourceShape ex:PersonShapeProperty .\n" + ""), "", RDFFormat.TURTLE); assertTrue(Models.isomorphic(expected, actual)); @@ -107,15 +116,16 @@ public void withoutPathTest() throws IOException { "@prefix rdf: .\n" + "@prefix sh: .\n" + "\n" + - "_:node1ebu5r1fdx77 a sh:ValidationReport;\n" + + "_:node1ecfgke5gx80 a sh:ValidationReport;\n" + + " false;\n" + " sh:conforms false;\n" + - " sh:result _:node1ebu5r1fdx78 .\n" + + " sh:result _:node1ecfgke5gx81 .\n" + "\n" + - "_:node1ebu5r1fdx78 a sh:ValidationResult;\n" + + "_:node1ecfgke5gx81 a sh:ValidationResult;\n" + " sh:focusNode ex:node1;\n" + " sh:sourceConstraintComponent sh:ClassConstraintComponent;\n" + " sh:sourceShape ex:PersonShape;\n" + - " sh:value ex:node1 .\n" + " sh:value ex:node1 ." + ""), "", RDFFormat.TURTLE); assertTrue(Models.isomorphic(expected, actual)); @@ -157,6 +167,7 @@ public void nestedLogicalOrSupport() throws IOException { "@prefix sh: .\n" + "\n" + "[] a sh:ValidationReport;\n" + + " false;\n" + " sh:conforms false;\n" + " sh:result [ a sh:ValidationResult;\n" + " sh:detail [ a sh:ValidationResult;\n" + diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java index 71f29c4bf37..0a2dac21350 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java @@ -21,6 +21,8 @@ import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.SHACL_ADVANCED_FEATURES; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.VALIDATION_ENABLED; +import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT; +import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.VALIDATION_RESULTS_LIMIT_TOTAL; import static org.junit.Assert.assertTrue; import org.eclipse.rdf4j.model.BNode; @@ -50,6 +52,8 @@ public void defaultsCorrectlySet() { assertThat(shaclSailConfig.isSerializableValidation()).isTrue(); assertThat(shaclSailConfig.isShaclAdvancedFeatures()).isFalse(); assertThat(shaclSailConfig.isDashDataShapes()).isFalse(); + assertThat(shaclSailConfig.getValidationResultsLimitTotal()).isEqualTo(-1); + assertThat(shaclSailConfig.getValidationResultsLimitPerConstraint()).isEqualTo(-1); } @@ -60,20 +64,22 @@ public void parseFromModelSetValuesCorrectly() { BNode implNode = SimpleValueFactory.getInstance().createBNode(); ModelBuilder mb = new ModelBuilder().subject(implNode); - mb - .add(PARALLEL_VALIDATION, true) - .add(UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS, true) - .add(LOG_VALIDATION_PLANS, true) - .add(LOG_VALIDATION_VIOLATIONS, true) - .add(IGNORE_NO_SHAPES_LOADED_EXCEPTION, true) - .add(VALIDATION_ENABLED, true) - .add(CACHE_SELECT_NODES, true) - .add(GLOBAL_LOG_VALIDATION_EXECUTION, true) - .add(RDFS_SUB_CLASS_REASONING, false) - .add(PERFORMANCE_LOGGING, true) - .add(SHACL_ADVANCED_FEATURES, true) - .add(DASH_DATA_SHAPES, true) - .add(SERIALIZABLE_VALIDATION, false); + mb.add(PARALLEL_VALIDATION, true); + mb.add(UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS, true); + mb.add(LOG_VALIDATION_PLANS, true); + mb.add(LOG_VALIDATION_VIOLATIONS, true); + mb.add(IGNORE_NO_SHAPES_LOADED_EXCEPTION, true); + mb.add(VALIDATION_ENABLED, true); + mb.add(CACHE_SELECT_NODES, true); + mb.add(GLOBAL_LOG_VALIDATION_EXECUTION, true); + mb.add(RDFS_SUB_CLASS_REASONING, false); + mb.add(PERFORMANCE_LOGGING, true); + mb.add(SHACL_ADVANCED_FEATURES, true); + mb.add(DASH_DATA_SHAPES, true); + mb.add(SERIALIZABLE_VALIDATION, false); + + mb.add(VALIDATION_RESULTS_LIMIT_TOTAL, 100); + mb.add(VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT, 3); shaclSailConfig.parse(mb.build(), implNode); @@ -90,6 +96,8 @@ public void parseFromModelSetValuesCorrectly() { assertThat(shaclSailConfig.isSerializableValidation()).isFalse(); assertThat(shaclSailConfig.isShaclAdvancedFeatures()).isTrue(); assertThat(shaclSailConfig.isDashDataShapes()).isTrue(); + assertThat(shaclSailConfig.getValidationResultsLimitTotal()).isEqualTo(100); + assertThat(shaclSailConfig.getValidationResultsLimitPerConstraint()).isEqualTo(3); } @@ -138,6 +146,8 @@ public void exportAddsAllConfigData() { assertTrue(m.contains(node, SERIALIZABLE_VALIDATION, null)); assertTrue(m.contains(node, SHACL_ADVANCED_FEATURES, null)); assertTrue(m.contains(node, DASH_DATA_SHAPES, null)); + assertTrue(m.contains(node, VALIDATION_RESULTS_LIMIT_TOTAL, null)); + assertTrue(m.contains(node, VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT, null)); } diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java index 04df6ec0faa..612fac10b89 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java @@ -61,6 +61,9 @@ public void getSailWithCustomConfigSetsConfigurationCorrectly() { config.setShaclAdvancedFeatures(!config.isShaclAdvancedFeatures()); config.setDashDataShapes(!config.isDashDataShapes()); + config.setValidationResultsLimitTotal(100); + config.setValidationResultsLimitPerConstraint(3); + ShaclSail sail = (ShaclSail) subject.getSail(config); assertMatchesConfig(sail, config); } @@ -80,6 +83,10 @@ private void assertMatchesConfig(ShaclSail sail, ShaclSailConfig config) { assertThat(sail.isRdfsSubClassReasoning()).isEqualTo(config.isRdfsSubClassReasoning()); assertThat(sail.isShaclAdvancedFeatures()).isEqualTo(config.isShaclAdvancedFeatures()); assertThat(sail.isDashDataShapes()).isEqualTo(config.isDashDataShapes()); + assertThat(sail.getValidationResultsLimitTotal()).isEqualTo(config.getValidationResultsLimitTotal()); + assertThat(sail.getValidationResultsLimitPerConstraint()) + .isEqualTo(config.getValidationResultsLimitPerConstraint()); + } } diff --git a/core/sail/shacl/src/test/resources/shaclDatatypeAndMinCount.ttl b/core/sail/shacl/src/test/resources/shaclDatatypeAndMinCount.ttl new file mode 100644 index 00000000000..d7e8c88d5f0 --- /dev/null +++ b/core/sail/shacl/src/test/resources/shaclDatatypeAndMinCount.ttl @@ -0,0 +1,17 @@ +@base . +@prefix ex: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix sh: . +@prefix xsd: . +@prefix foaf: . + +ex:PersonShape + a sh:NodeShape ; + sh:targetClass foaf:Person ; + sh:property [ + sh:path foaf:age ; + sh:datatype xsd:int ; + sh:minCount 2 ; + ] . diff --git a/core/sail/lucene-api/src/main/java/org/eclipse/rdf4j/sail/lucene/util/IteratorCloseableIteration.java b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/IteratorCloseableIteration.java similarity index 86% rename from core/sail/lucene-api/src/main/java/org/eclipse/rdf4j/sail/lucene/util/IteratorCloseableIteration.java rename to core/util/src/main/java/org/eclipse/rdf4j/common/iteration/IteratorCloseableIteration.java index 93b68315598..76599d8d987 100644 --- a/core/sail/lucene-api/src/main/java/org/eclipse/rdf4j/sail/lucene/util/IteratorCloseableIteration.java +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/iteration/IteratorCloseableIteration.java @@ -6,13 +6,11 @@ * http://www.eclipse.org/org/documents/edl-v10.php. *******************************************************************************/ -package org.eclipse.rdf4j.sail.lucene.util; +package org.eclipse.rdf4j.common.iteration; import java.util.Iterator; import org.eclipse.rdf4j.common.annotation.InternalUseOnly; -import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.common.iteration.IteratorIteration; /** * @deprecated since 3.0. This feature is for internal use only: its existence, signature or behavior may change without From 3a463dd61f4dc267edbbd8f8504a9ab1af2b5357 Mon Sep 17 00:00:00 2001 From: Bart Hanssens Date: Wed, 15 Jul 2020 13:08:41 +0200 Subject: [PATCH 31/35] GH-2360 added missing DOAP classes/properties + small refactoring (#2361) Signed-off-by:Bart Hanssens --- .../eclipse/rdf4j/model/vocabulary/DOAP.java | 203 +++++++++++++----- 1 file changed, 149 insertions(+), 54 deletions(-) diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DOAP.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DOAP.java index da9993a595f..a3c05efb1bf 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DOAP.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/DOAP.java @@ -9,97 +9,192 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Namespace; -import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.SimpleNamespace; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; /** - * Constants for DOAP primitives and for the DOAP namespace. + * Constants for the Description of a Project. + * + * @see Description of a Project */ public class DOAP { - - /** - * The recommended prefix for the DOAP namespace: "doap" - */ - public static final String PREFIX = "doap"; - /** * The DOAP namespace: http://usefulinc.com/ns/doap# */ public static final String NAMESPACE = "http://usefulinc.com/ns/doap#"; /** - * An immutable {@link Namespace} constant that represents the DOAP namespace. + * Recommended prefix for the namespace: "doap" */ - public static final Namespace NS = new SimpleNamespace(PREFIX, NAMESPACE); + public static final String PREFIX = "doap"; /** - * Classes + * An immutable {@link Namespace} constant that represents the namespace. */ + public static final Namespace NS = new SimpleNamespace(PREFIX, NAMESPACE); - public final static IRI PROJECT; + // Classes + /** doap:ArchRepository */ + public static final IRI ARCH_REPOSITORY = create("ArchRepository"); - public final static IRI VERSION; + /** doap:BKRepository */ + public static final IRI BKREPOSITORY = create("BKRepository"); - /** - * Properties - */ + /** doap:BazaarBranch */ + public static final IRI BAZAAR_BRANCH = create("BazaarBranch"); + + /** doap:CVSRepository */ + public static final IRI CVSREPOSITORY = create("CVSRepository"); + + /** doap:DarcsRepository */ + public static final IRI DARCS_REPOSITORY = create("DarcsRepository"); + + /** doap:GitBranch */ + public static final IRI GIT_BRANCH = create("GitBranch"); + + /** doap:GitRepository */ + public static final IRI GIT_REPOSITORY = create("GitRepository"); + + /** doap:HgRepository */ + public static final IRI HG_REPOSITORY = create("HgRepository"); + + /** doap:Project */ + public static final IRI PROJECT = create("Project"); + + /** doap:Repository */ + public static final IRI REPOSITORY = create("Repository"); + + /** doap:SVNRepository */ + public static final IRI SVNREPOSITORY = create("SVNRepository"); + + /** doap:Specification */ + public static final IRI SPECIFICATION = create("Specification"); + + /** doap:Version */ + public static final IRI VERSION = create("Version"); + + // Properties + /** doap:anon-root */ + public static final IRI ANON_ROOT = create("anon-root"); + + /** doap:audience */ + public static final IRI AUDIENCE = create("audience"); + + /** doap:blog */ + public static final IRI BLOG = create("blog"); + + /** doap:browse */ + public static final IRI BROWSE = create("browse"); + + /** doap:bug-database */ + public static final IRI BUG_DATABASE = create("bug-database"); + + /** doap:category */ + public static final IRI CATEGORY = create("category"); + + /** doap:created */ + public static final IRI CREATED = create("created"); + + /** doap:description */ + public static final IRI DESCRIPTION = create("description"); + + /** doap:developer */ + public static final IRI DEVELOPER = create("developer"); + + /** doap:developer-forum */ + public static final IRI DEVELOPER_FORUM = create("developer-forum"); + + /** doap:documenter */ + public static final IRI DOCUMENTER = create("documenter"); + + /** doap:download-mirror */ + public static final IRI DOWNLOAD_MIRROR = create("download-mirror"); + + /** doap:download-page */ + public static final IRI DOWNLOAD_PAGE = create("download-page"); + + /** doap:file-release */ + public static final IRI FILE_RELEASE = create("file-release"); + + /** doap:helper */ + public static final IRI HELPER = create("helper"); + + /** doap:homepage */ + public static final IRI HOMEPAGE = create("homepage"); + + /** doap:implements */ + public static final IRI IMPLEMENTS = create("implements"); + + /** doap:language */ + public static final IRI LANGUAGE = create("language"); + + /** doap:license */ + public static final IRI LICENSE = create("license"); + + /** doap:location */ + public static final IRI LOCATION = create("location"); + + /** doap:mailing-list */ + public static final IRI MAILING_LIST = create("mailing-list"); + + /** doap:maintainer */ + public static final IRI MAINTAINER = create("maintainer"); - public final static IRI NAME; + /** doap:module */ + public static final IRI MODULE = create("module"); - public final static IRI HOMEPAGE; + /** doap:name */ + public static final IRI NAME = create("name"); - public final static IRI OLD_HOMEPAGE; + /** doap:old-homepage */ + public static final IRI OLD_HOMEPAGE = create("old-homepage"); - public final static IRI LICENSE; + /** doap:os */ + public static final IRI OS = create("os"); - public final static IRI DESCRIPTION; + /** doap:platform */ + public static final IRI PLATFORM = create("platform"); - public final static IRI PROGRAMMING_LANGUAGE; + /** doap:programming-language */ + public static final IRI PROGRAMMING_LANGUAGE = create("programming-language"); - public final static IRI IMPLEMENTS; + /** doap:release */ + public static final IRI RELEASE = create("release"); - public final static IRI CATEGORY; + /** doap:repository */ + public static final IRI REPOSITORY_PROP = create("repository"); - public final static IRI DOWNLOAD_PAGE; + /** doap:repositoryOf */ + public static final IRI REPOSITORY_OF = create("repositoryOf"); - public final static IRI MAILING_LIST; + /** doap:revision */ + public static final IRI REVISION = create("revision"); - public final static IRI BUG_DATABASE; + /** doap:screenshots */ + public static final IRI SCREENSHOTS = create("screenshots"); - public final static IRI BLOG; + /** doap:service-endpoint */ + public static final IRI SERVICE_ENDPOINT = create("service-endpoint"); - public final static IRI DEVELOPER; + /** doap:shortdesc */ + public static final IRI SHORTDESC = create("shortdesc"); - public final static IRI MAINTAINER; + /** doap:support-forum */ + public static final IRI SUPPORT_FORUM = create("support-forum"); - public final static IRI DOCUMENTER; + /** doap:tester */ + public static final IRI TESTER = create("tester"); - public final static IRI RELEASE; + /** doap:translator */ + public static final IRI TRANSLATOR = create("translator"); - public final static IRI CREATED; + /** doap:vendor */ + public static final IRI VENDOR = create("vendor"); - static { - ValueFactory factory = SimpleValueFactory.getInstance(); - PROJECT = factory.createIRI(DOAP.NAMESPACE, "Project"); - VERSION = factory.createIRI(DOAP.NAMESPACE, "Version"); + /** doap:wiki */ + public static final IRI WIKI = create("wiki"); - NAME = factory.createIRI(DOAP.NAMESPACE, "name"); - HOMEPAGE = factory.createIRI(DOAP.NAMESPACE, "homepage"); - OLD_HOMEPAGE = factory.createIRI(DOAP.NAMESPACE, "old-homepage"); - LICENSE = factory.createIRI(DOAP.NAMESPACE, "license"); - DESCRIPTION = factory.createIRI(DOAP.NAMESPACE, "description"); - PROGRAMMING_LANGUAGE = factory.createIRI(DOAP.NAMESPACE, "programming-language"); - IMPLEMENTS = factory.createIRI(DOAP.NAMESPACE, "implements"); - CATEGORY = factory.createIRI(DOAP.NAMESPACE, "category"); - DOWNLOAD_PAGE = factory.createIRI(DOAP.NAMESPACE, "download-page"); - MAILING_LIST = factory.createIRI(DOAP.NAMESPACE, "mailing-list"); - BUG_DATABASE = factory.createIRI(DOAP.NAMESPACE, "bug-database"); - BLOG = factory.createIRI(DOAP.NAMESPACE, "blog"); - DEVELOPER = factory.createIRI(DOAP.NAMESPACE, "developer"); - MAINTAINER = factory.createIRI(DOAP.NAMESPACE, "maintainer"); - DOCUMENTER = factory.createIRI(DOAP.NAMESPACE, "documenter"); - RELEASE = factory.createIRI(DOAP.NAMESPACE, "release"); - CREATED = factory.createIRI(DOAP.NAMESPACE, "created"); + private static IRI create(String localName) { + return SimpleValueFactory.getInstance().createIRI(DOAP.NAMESPACE, localName); } } From 954fd26b75314dec9b4b13d043ade30db5139a97 Mon Sep 17 00:00:00 2001 From: hmottestad Date: Mon, 20 Jul 2020 09:14:10 +0200 Subject: [PATCH 32/35] GH-2371 switch to rsx namespace for targetShape (#2372) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * GH-2371 switch to rsx namespace for targetShape Signed-off-by: Håvard Ottestad * fix tes Signed-off-by: Håvard Ottestad --- .../eclipse/rdf4j/model/vocabulary/RSX.java | 44 +++++++++++++++++++ .../eclipse/rdf4j/model/vocabulary/SHACL.java | 4 -- .../rdf4j/sail/shacl/AST/NodeShape.java | 2 +- .../rdf4j/sail/shacl/AST/ShaclProperties.java | 2 +- .../rdf4j/sail/shacl/AST/TargetShape.java | 24 +--------- .../eclipse/rdf4j/sail/shacl/ShaclSail.java | 27 +++++++----- .../sail/shacl/config/ShaclSailConfig.java | 19 ++++---- .../sail/shacl/config/ShaclSailFactory.java | 2 +- .../sail/shacl/config/ShaclSailSchema.java | 2 +- .../rdf4j/sail/shacl/AbstractShaclTest.java | 2 +- .../sail/shacl/ExtendedFeaturesetTest.java | 2 +- ...lSupportedPredicatesDocumentationTest.java | 6 ++- .../benchmark/ComplexTargetBenchmark.java | 2 +- .../benchmark/TargetBenchmarkInitialData.java | 2 +- .../shacl/config/ShaclSailConfigTest.java | 10 ++--- .../shacl/config/ShaclSailFactoryTest.java | 4 +- .../resources/shaclDatatypeTargetFilter.ttl | 3 +- .../shaclDatatypeTargetFilterWithUnion.ttl | 3 +- .../class/complexTargetShape/shacl.ttl | 3 +- .../class/complexTargetShape2/shacl.ttl | 3 +- .../class/simpleTargetShape/shacl.ttl | 3 +- .../notNodeShapeTargetShape/shacl.ttl | 3 +- .../datatype/notTargetShape/shacl.ttl | 3 +- 23 files changed, 105 insertions(+), 70 deletions(-) create mode 100644 core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/RSX.java diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/RSX.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/RSX.java new file mode 100644 index 00000000000..3e218c7c06d --- /dev/null +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/RSX.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.model.vocabulary; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Namespace; +import org.eclipse.rdf4j.model.impl.SimpleNamespace; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; + +/** + * Constants for the Eclipse RDF4J SHACL Extensions. + * + */ +public class RSX { + + /** The namespace (http://rdf4j.org/shacl-extensions#). */ + public static final String NAMESPACE = "http://rdf4j.org/shacl-extensions#"; + + /** + * Recommended prefix + */ + public static final String PREFIX = "rsx"; + + /** + * An immutable {@link Namespace} constant that represents the namespace. + */ + public static final Namespace NS = new SimpleNamespace(PREFIX, NAMESPACE); + + /* + * Primitive datatypes + */ + + /** http://rdf4j.org/shacl-extensions#targetShape */ + public final static IRI targetShape = create("targetShape"); + + private static IRI create(String localName) { + return SimpleValueFactory.getInstance().createIRI(RSX.NAMESPACE, localName); + } +} diff --git a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/SHACL.java b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/SHACL.java index ffb12deb823..6c2bc914525 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/SHACL.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/model/vocabulary/SHACL.java @@ -596,9 +596,6 @@ public class SHACL { /** sh:targetSubjectsOf */ public static final IRI TARGET_SUBJECTS_OF; - /** sh:targetShape */ - public static final IRI TARGET_SHAPE; - /** sh:uniqueLang */ public static final IRI UNIQUE_LANG; @@ -833,6 +830,5 @@ public class SHACL { XONE = factory.createIRI(NAMESPACE, "xone"); ZERO_OR_MORE_PATH = factory.createIRI(NAMESPACE, "zeroOrMorePath"); ZERO_OR_ONE_PATH = factory.createIRI(NAMESPACE, "zeroOrOnePath"); - TARGET_SHAPE = factory.createIRI(NAMESPACE, "targetShape"); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java index 0a4db7b3ca6..85598236850 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java @@ -251,7 +251,7 @@ public static List getShapes(SailRepositoryConnection connection, Sha shaclProperties.getTargetObjectsOf())); } - if (shaclSail.isShaclAdvancedFeatures()) { + if (shaclSail.isEclipseRdf4jShaclExtensions()) { shaclProperties.getTargetShape() .stream() .map(targetShape -> new TargetShape(shapeId, shaclSail, connection, diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java index 283360c4735..10d0138d080 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/ShaclProperties.java @@ -203,7 +203,7 @@ public ShaclProperties(Resource propertyShapeId, SailRepositoryConnection connec } hasValueIn = (Resource) object; break; - case "http://www.w3.org/ns/shacl#targetShape": + case "http://rdf4j.org/shacl-extensions#targetShape": targetShape.add((Resource) object); break; default: diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetShape.java index 2a5d34b038d..531973e769e 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/TargetShape.java @@ -35,7 +35,7 @@ import org.eclipse.rdf4j.sail.shacl.planNodes.UnorderedSelect; /** - * sh:targetObjectsOf + * rsx:targetShape * * @author Håvard Mikkelsen Ottestad */ @@ -51,7 +51,7 @@ public class TargetShape extends NodeShape { if (connection.hasStatement(targetShape, SHACL.PATH, null, false)) { throw new UnsupportedOperationException( - "Experimental sh:targetShape support only supports sh:NodeShape and not sh:PropertyShape"); + "Experimental rsx:targetShape support only supports sh:NodeShape and not sh:PropertyShape"); } this.targetShape = new NodeShape(targetShape, shaclSail, connection, false); @@ -151,26 +151,6 @@ public PlanNode getTargetFilter(ConnectionsGroup connectionsGroup, PlanNode pare .getTrueNode(UnBufferedPlanNode.class); } - private PlanNode getAllSubjectsPlan(SailConnection sailConnection) { - // @formatter:off - return new Unique( - new Sort( - new TrimTuple( - new UnorderedSelect( - sailConnection, - null, - null, - null, - UnorderedSelect.OutputPattern.SubjectPredicateObject - ), - 0, - 1) - ) - ); - // @formatter:on - - } - @Override public String toString() { return "TargetShape{" + diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java index 99b9bc803d9..5e8d86f22ca 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java @@ -32,7 +32,9 @@ import org.eclipse.rdf4j.common.concurrent.locks.ReadPrefReadWriteLockManager; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.vocabulary.DASH; import org.eclipse.rdf4j.model.vocabulary.RDF4J; +import org.eclipse.rdf4j.model.vocabulary.RSX; import org.eclipse.rdf4j.model.vocabulary.SHACL; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryResult; @@ -187,7 +189,7 @@ public class ShaclSail extends NotifyingSailWrapper { private boolean rdfsSubClassReasoning = ShaclSailConfig.RDFS_SUB_CLASS_REASONING_DEFAULT; private boolean serializableValidation = ShaclSailConfig.SERIALIZABLE_VALIDATION_DEFAULT; private boolean performanceLogging = ShaclSailConfig.PERFORMANCE_LOGGING_DEFAULT; - private boolean shaclAdvancedFeatures = ShaclSailConfig.SHACL_ADVANCED_FEATURES_DEFAULT; + private boolean eclipseRdf4jShaclExtensions = ShaclSailConfig.ECLIPSE_RDF4J_SHACL_EXTENSIONS_DEFAULT; private boolean dashDataShapes = ShaclSailConfig.DASH_DATA_SHAPES_DEFAULT; private long validationResultsLimitTotal = -1; @@ -244,7 +246,7 @@ synchronized boolean usesSingleConnection() { /** * Lists the predicates that have been implemented in the ShaclSail. All of these, and all combinations, * should work, please report any bugs. For sh:path, only single predicate paths, or single predicate inverse - * paths are supported. sh:targetShape requires that experimental support is enabled for that feature. + * paths are supported. DASH and RSX features may need to be enabled. * * @return List of IRIs (SHACL predicates) */ @@ -279,7 +281,8 @@ public static List getSupportedShaclPredicates() { SHACL.HAS_VALUE, SHACL.TARGET_PROP, SHACL.INVERSE_PATH, - SHACL.TARGET_SHAPE); + DASH.hasValueIn, + RSX.targetShape); } private final AtomicBoolean initialized = new AtomicBoolean(false); @@ -814,30 +817,30 @@ private void startMonitoring(ReferenceQueue referenceQueue, Reference } /** - * Support for SHACL Advanced Features W3C Working Group Note (https://www.w3.org/TR/shacl-af/). Enabling this - * currently enables support for sh:targetShape. + * Support for Eclipse RDF4J SHACL Extensions (http://rdf4j.org/shacl-extensions#). Enabling this currently enables + * support for rsx:targetShape. * * EXPERIMENTAL! * - * @param shaclAdvancedFeatures true to enable (default: false) + * @param eclipseRdf4jShaclExtensions true to enable (default: false) */ @Experimental - public void setShaclAdvancedFeatures(boolean shaclAdvancedFeatures) { - this.shaclAdvancedFeatures = shaclAdvancedFeatures; + public void setEclipseRdf4jShaclExtensions(boolean eclipseRdf4jShaclExtensions) { + this.eclipseRdf4jShaclExtensions = eclipseRdf4jShaclExtensions; forceRefreshShapes(); } /** - * Support for SHACL Advanced Features W3C Working Group Note (https://www.w3.org/TR/shacl-af/). Enabling this - * currently enables support for sh:targetShape. + * Support for Eclipse RDF4J SHACL Extensions (http://rdf4j.org/shacl-extensions#). Enabling this currently enables + * support for rsx:targetShape. * * EXPERIMENTAL! * * @return true if enabled */ @Experimental - public boolean isShaclAdvancedFeatures() { - return shaclAdvancedFeatures; + public boolean isEclipseRdf4jShaclExtensions() { + return eclipseRdf4jShaclExtensions; } /** diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java index 4e6bd5a7f00..cce17963ec8 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfig.java @@ -49,7 +49,7 @@ public class ShaclSailConfig extends AbstractDelegatingSailImplConfig { public static final boolean RDFS_SUB_CLASS_REASONING_DEFAULT = true; public static final boolean PERFORMANCE_LOGGING_DEFAULT = false; public static final boolean SERIALIZABLE_VALIDATION_DEFAULT = true; - public static final boolean SHACL_ADVANCED_FEATURES_DEFAULT = false; + public static final boolean ECLIPSE_RDF4J_SHACL_EXTENSIONS_DEFAULT = false; public static final boolean DASH_DATA_SHAPES_DEFAULT = false; public final static long VALIDATION_RESULTS_LIMIT_TOTAL_DEFAULT = -1; public final static long VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT_DEFAULT = -1; @@ -65,7 +65,7 @@ public class ShaclSailConfig extends AbstractDelegatingSailImplConfig { private boolean rdfsSubClassReasoning = RDFS_SUB_CLASS_REASONING_DEFAULT; private boolean performanceLogging = PERFORMANCE_LOGGING_DEFAULT; private boolean serializableValidation = SERIALIZABLE_VALIDATION_DEFAULT; - private boolean shaclAdvancedFeatures = SHACL_ADVANCED_FEATURES_DEFAULT; + private boolean eclipseRdf4jShaclExtensions = ECLIPSE_RDF4J_SHACL_EXTENSIONS_DEFAULT; private boolean dashDataShapes = DASH_DATA_SHAPES_DEFAULT; private long validationResultsLimitTotal = VALIDATION_RESULTS_LIMIT_TOTAL_DEFAULT; private long validationResultsLimitPerConstraint = VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT_DEFAULT; @@ -173,13 +173,13 @@ public void setSerializableValidation(boolean serializableValidation) { } @Experimental - public boolean isShaclAdvancedFeatures() { - return shaclAdvancedFeatures; + public boolean isEclipseRdf4jShaclExtensions() { + return eclipseRdf4jShaclExtensions; } @Experimental - public void setShaclAdvancedFeatures(boolean shaclAdvancedFeatures) { - this.shaclAdvancedFeatures = shaclAdvancedFeatures; + public void setEclipseRdf4jShaclExtensions(boolean eclipseRdf4jShaclExtensions) { + this.eclipseRdf4jShaclExtensions = eclipseRdf4jShaclExtensions; } @Experimental @@ -225,7 +225,8 @@ public Resource export(Model m) { m.add(implNode, RDFS_SUB_CLASS_REASONING, BooleanLiteral.valueOf(isRdfsSubClassReasoning())); m.add(implNode, PERFORMANCE_LOGGING, BooleanLiteral.valueOf(isPerformanceLogging())); m.add(implNode, SERIALIZABLE_VALIDATION, BooleanLiteral.valueOf(isSerializableValidation())); - m.add(implNode, ShaclSailSchema.SHACL_ADVANCED_FEATURES, BooleanLiteral.valueOf(isShaclAdvancedFeatures())); + m.add(implNode, ShaclSailSchema.ECLIPSE_RDF4J_SHACL_EXTENSIONS, + BooleanLiteral.valueOf(isEclipseRdf4jShaclExtensions())); m.add(implNode, ShaclSailSchema.DASH_DATA_SHAPES, BooleanLiteral.valueOf(isDashDataShapes())); m.add(implNode, ShaclSailSchema.VALIDATION_RESULTS_LIMIT_TOTAL, @@ -273,8 +274,8 @@ public void parse(Model m, Resource implNode) throws SailConfigException { Models.objectLiteral(m.getStatements(implNode, SERIALIZABLE_VALIDATION, null)) .ifPresent(l -> setSerializableValidation(l.booleanValue())); - Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.SHACL_ADVANCED_FEATURES, null)) - .ifPresent(l -> setShaclAdvancedFeatures(l.booleanValue())); + Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.ECLIPSE_RDF4J_SHACL_EXTENSIONS, null)) + .ifPresent(l -> setEclipseRdf4jShaclExtensions(l.booleanValue())); Models.objectLiteral(m.getStatements(implNode, ShaclSailSchema.DASH_DATA_SHAPES, null)) .ifPresent(l -> setDashDataShapes(l.booleanValue())); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java index 66aacfe5195..afcd099d221 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactory.java @@ -64,7 +64,7 @@ public Sail getSail(SailImplConfig config) throws SailConfigException { sail.setPerformanceLogging(shaclSailConfig.isPerformanceLogging()); sail.setSerializableValidation(shaclSailConfig.isSerializableValidation()); sail.setRdfsSubClassReasoning(shaclSailConfig.isRdfsSubClassReasoning()); - sail.setShaclAdvancedFeatures(shaclSailConfig.isShaclAdvancedFeatures()); + sail.setEclipseRdf4jShaclExtensions(shaclSailConfig.isEclipseRdf4jShaclExtensions()); sail.setDashDataShapes(shaclSailConfig.isDashDataShapes()); sail.setValidationResultsLimitTotal(shaclSailConfig.getValidationResultsLimitTotal()); sail.setValidationResultsLimitPerConstraint(shaclSailConfig.getValidationResultsLimitPerConstraint()); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java index fd183c7cf2f..37d91f786a7 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailSchema.java @@ -55,7 +55,7 @@ public class ShaclSailSchema { /** http://rdf4j.org/config/sail/shacl#serializableValidation */ public final static IRI SERIALIZABLE_VALIDATION = create("serializableValidation"); - public final static IRI SHACL_ADVANCED_FEATURES = create("shaclAdvancedFeatures"); + public final static IRI ECLIPSE_RDF4J_SHACL_EXTENSIONS = create("eclipseRdf4jShaclExtensions"); public final static IRI DASH_DATA_SHAPES = create("dashDataShapes"); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java index 9268cf4d7b8..3a6a49ecd09 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java @@ -632,7 +632,7 @@ private static SailRepository getShaclSail() { shaclSail.setParallelValidation(true); shaclSail.setLogValidationViolations(fullLogging); shaclSail.setGlobalLogValidationExecution(fullLogging); - shaclSail.setShaclAdvancedFeatures(true); + shaclSail.setEclipseRdf4jShaclExtensions(true); shaclSail.setDashDataShapes(true); repository.init(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ExtendedFeaturesetTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ExtendedFeaturesetTest.java index cf0970b14bd..c8527081478 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ExtendedFeaturesetTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ExtendedFeaturesetTest.java @@ -88,7 +88,7 @@ public void testThatTargetShapesCanBeEnabled() throws Throwable { .getInitializedShaclRepository("test-cases/class/simpleTargetShape/shacl.ttl", false); ((ShaclSail) shaclRepository.getSail()).setDashDataShapes(true); - ((ShaclSail) shaclRepository.getSail()).setShaclAdvancedFeatures(true); + ((ShaclSail) shaclRepository.getSail()).setEclipseRdf4jShaclExtensions(true); try (SailRepositoryConnection connection = shaclRepository.getConnection()) { connection.begin(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ShaclSailSupportedPredicatesDocumentationTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ShaclSailSupportedPredicatesDocumentationTest.java index a436b0421fa..ddd2fc5ee24 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ShaclSailSupportedPredicatesDocumentationTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ShaclSailSupportedPredicatesDocumentationTest.java @@ -19,6 +19,8 @@ import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Model; +import org.eclipse.rdf4j.model.vocabulary.DASH; +import org.eclipse.rdf4j.model.vocabulary.RSX; import org.eclipse.rdf4j.model.vocabulary.SHACL; import org.eclipse.rdf4j.rio.RDFFormat; import org.eclipse.rdf4j.rio.Rio; @@ -56,7 +58,9 @@ public void testShaclSailSupportedPredicatesDocumentation() throws IOException { Set predicatesInUseInTest = parse.predicates() .stream() - .filter(p -> p.getNamespace().equals(SHACL.NAMESPACE)) + .filter(p -> (p.getNamespace().equals(SHACL.NAMESPACE) || + p.getNamespace().equals(RSX.NAMESPACE) || + p.getNamespace().equals(DASH.NAMESPACE))) .collect(Collectors.toSet()); for (IRI predicate : predicatesInUseInTest) { diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexTargetBenchmark.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexTargetBenchmark.java index 20825e3c90f..c12c552a4a4 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexTargetBenchmark.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/ComplexTargetBenchmark.java @@ -114,7 +114,7 @@ public void invocationSetup() throws IOException, InterruptedException { repository = new SailRepository(Utils.getInitializedShaclSail(shape)); ((ShaclSail) repository.getSail()).setDashDataShapes(true); - ((ShaclSail) repository.getSail()).setShaclAdvancedFeatures(true); + ((ShaclSail) repository.getSail()).setEclipseRdf4jShaclExtensions(true); ((ShaclSail) repository.getSail()).disableValidation(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/TargetBenchmarkInitialData.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/TargetBenchmarkInitialData.java index 51aea3614c5..e3fe2e5bcbe 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/TargetBenchmarkInitialData.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/benchmark/TargetBenchmarkInitialData.java @@ -109,7 +109,7 @@ public void invocationSetup() throws IOException, InterruptedException { repository = new SailRepository(Utils.getInitializedShaclSail(shape)); ((ShaclSail) repository.getSail()).setDashDataShapes(true); - ((ShaclSail) repository.getSail()).setShaclAdvancedFeatures(true); + ((ShaclSail) repository.getSail()).setEclipseRdf4jShaclExtensions(true); ((ShaclSail) repository.getSail()).disableValidation(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java index 0a2dac21350..a561d92381e 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailConfigTest.java @@ -10,6 +10,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.CACHE_SELECT_NODES; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.DASH_DATA_SHAPES; +import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.ECLIPSE_RDF4J_SHACL_EXTENSIONS; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.GLOBAL_LOG_VALIDATION_EXECUTION; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.IGNORE_NO_SHAPES_LOADED_EXCEPTION; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.LOG_VALIDATION_PLANS; @@ -18,7 +19,6 @@ import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.PERFORMANCE_LOGGING; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.RDFS_SUB_CLASS_REASONING; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.SERIALIZABLE_VALIDATION; -import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.SHACL_ADVANCED_FEATURES; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.UNDEFINED_TARGET_VALIDATES_ALL_SUBJECTS; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.VALIDATION_ENABLED; import static org.eclipse.rdf4j.sail.shacl.config.ShaclSailSchema.VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT; @@ -50,7 +50,7 @@ public void defaultsCorrectlySet() { assertThat(shaclSailConfig.isRdfsSubClassReasoning()).isTrue(); assertThat(shaclSailConfig.isPerformanceLogging()).isFalse(); assertThat(shaclSailConfig.isSerializableValidation()).isTrue(); - assertThat(shaclSailConfig.isShaclAdvancedFeatures()).isFalse(); + assertThat(shaclSailConfig.isEclipseRdf4jShaclExtensions()).isFalse(); assertThat(shaclSailConfig.isDashDataShapes()).isFalse(); assertThat(shaclSailConfig.getValidationResultsLimitTotal()).isEqualTo(-1); assertThat(shaclSailConfig.getValidationResultsLimitPerConstraint()).isEqualTo(-1); @@ -74,7 +74,7 @@ public void parseFromModelSetValuesCorrectly() { mb.add(GLOBAL_LOG_VALIDATION_EXECUTION, true); mb.add(RDFS_SUB_CLASS_REASONING, false); mb.add(PERFORMANCE_LOGGING, true); - mb.add(SHACL_ADVANCED_FEATURES, true); + mb.add(ECLIPSE_RDF4J_SHACL_EXTENSIONS, true); mb.add(DASH_DATA_SHAPES, true); mb.add(SERIALIZABLE_VALIDATION, false); @@ -94,7 +94,7 @@ public void parseFromModelSetValuesCorrectly() { assertThat(shaclSailConfig.isRdfsSubClassReasoning()).isFalse(); assertThat(shaclSailConfig.isPerformanceLogging()).isTrue(); assertThat(shaclSailConfig.isSerializableValidation()).isFalse(); - assertThat(shaclSailConfig.isShaclAdvancedFeatures()).isTrue(); + assertThat(shaclSailConfig.isEclipseRdf4jShaclExtensions()).isTrue(); assertThat(shaclSailConfig.isDashDataShapes()).isTrue(); assertThat(shaclSailConfig.getValidationResultsLimitTotal()).isEqualTo(100); assertThat(shaclSailConfig.getValidationResultsLimitPerConstraint()).isEqualTo(3); @@ -144,7 +144,7 @@ public void exportAddsAllConfigData() { assertTrue(m.contains(node, RDFS_SUB_CLASS_REASONING, null)); assertTrue(m.contains(node, PERFORMANCE_LOGGING, null)); assertTrue(m.contains(node, SERIALIZABLE_VALIDATION, null)); - assertTrue(m.contains(node, SHACL_ADVANCED_FEATURES, null)); + assertTrue(m.contains(node, ECLIPSE_RDF4J_SHACL_EXTENSIONS, null)); assertTrue(m.contains(node, DASH_DATA_SHAPES, null)); assertTrue(m.contains(node, VALIDATION_RESULTS_LIMIT_TOTAL, null)); assertTrue(m.contains(node, VALIDATION_RESULTS_LIMIT_PER_CONSTRAINT, null)); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java index 612fac10b89..c8df83209ab 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/config/ShaclSailFactoryTest.java @@ -58,7 +58,7 @@ public void getSailWithCustomConfigSetsConfigurationCorrectly() { config.setPerformanceLogging(!config.isPerformanceLogging()); config.setSerializableValidation(!config.isSerializableValidation()); config.setRdfsSubClassReasoning(!config.isRdfsSubClassReasoning()); - config.setShaclAdvancedFeatures(!config.isShaclAdvancedFeatures()); + config.setEclipseRdf4jShaclExtensions(!config.isEclipseRdf4jShaclExtensions()); config.setDashDataShapes(!config.isDashDataShapes()); config.setValidationResultsLimitTotal(100); @@ -81,7 +81,7 @@ private void assertMatchesConfig(ShaclSail sail, ShaclSailConfig config) { assertThat(sail.isPerformanceLogging()).isEqualTo(config.isPerformanceLogging()); assertThat(sail.isSerializableValidation()).isEqualTo(config.isSerializableValidation()); assertThat(sail.isRdfsSubClassReasoning()).isEqualTo(config.isRdfsSubClassReasoning()); - assertThat(sail.isShaclAdvancedFeatures()).isEqualTo(config.isShaclAdvancedFeatures()); + assertThat(sail.isEclipseRdf4jShaclExtensions()).isEqualTo(config.isEclipseRdf4jShaclExtensions()); assertThat(sail.isDashDataShapes()).isEqualTo(config.isDashDataShapes()); assertThat(sail.getValidationResultsLimitTotal()).isEqualTo(config.getValidationResultsLimitTotal()); assertThat(sail.getValidationResultsLimitPerConstraint()) diff --git a/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilter.ttl b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilter.ttl index 2acb2eae217..e7164b7e769 100644 --- a/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilter.ttl +++ b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilter.ttl @@ -8,10 +8,11 @@ @prefix foaf: . @prefix rdf4j-sh: . @prefix dash: . +@prefix rsx: . ex:PersonShape a sh:NodeShape ; - sh:targetShape [ + rsx:targetShape [ a sh:Shape ; sh:property [ sh:path rdf:type ; diff --git a/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl index 93f98805243..7062567570e 100644 --- a/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl +++ b/core/sail/shacl/src/test/resources/shaclDatatypeTargetFilterWithUnion.ttl @@ -8,10 +8,11 @@ @prefix foaf: . @prefix rdf4j-sh: . @prefix dash: . +@prefix rsx: . ex:PersonShape a sh:NodeShape ; - sh:targetShape [ + rsx:targetShape [ a sh:Shape ; sh:property [ sh:path rdf:type ; diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/shacl.ttl index cf7284aebe9..4e66bac1508 100644 --- a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape/shacl.ttl @@ -6,10 +6,11 @@ @prefix sh: . @prefix xsd: . @prefix dash: . +@prefix rsx: . ex:PersonShape a sh:NodeShape ; - sh:targetShape [ + rsx:targetShape [ a sh:NodeShape ; sh:or ( [ sh:and ([sh:path rdf:type; sh:hasValue ex:Person] [sh:path rdf:type; sh:hasValue ex:Person]) ] diff --git a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/shacl.ttl index 5848700e73a..3bb21c6577c 100644 --- a/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/class/complexTargetShape2/shacl.ttl @@ -6,10 +6,11 @@ @prefix sh: . @prefix xsd: . @prefix dash: . +@prefix rsx: . ex:PersonShape a sh:NodeShape ; - sh:targetShape [ + rsx:targetShape [ a sh:NodeShape ; sh:and ( [ diff --git a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl index 119f8a7702a..b9a7704e79d 100644 --- a/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/class/simpleTargetShape/shacl.ttl @@ -6,10 +6,11 @@ @prefix sh: . @prefix xsd: . @prefix dash: . +@prefix rsx: . ex:PersonShape a sh:NodeShape ; - sh:targetShape [ + rsx:targetShape [ a sh:NodeShape ; sh:property [ sh:path rdf:type ; diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/shacl.ttl index a6e19ceac43..baec3ee1973 100644 --- a/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notNodeShapeTargetShape/shacl.ttl @@ -5,10 +5,11 @@ @prefix rdfs: . @prefix sh: . @prefix xsd: . +@prefix rsx: . ex:PersonShape a sh:NodeShape ; - sh:targetShape [ sh:property [sh:path rdf:type; sh:hasValue ex:Person ]]; + rsx:targetShape [ sh:property [sh:path rdf:type; sh:hasValue ex:Person ]]; sh:not [ sh:path ex:age ; sh:or ([sh:datatype xsd:boolean ] [ sh:datatype xsd:string ] ); diff --git a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/shacl.ttl b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/shacl.ttl index d0a93782b45..a911d828f31 100644 --- a/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/shacl.ttl +++ b/core/sail/shacl/src/test/resources/test-cases/datatype/notTargetShape/shacl.ttl @@ -5,10 +5,11 @@ @prefix rdfs: . @prefix sh: . @prefix xsd: . +@prefix rsx: . ex:PersonShape a sh:NodeShape ; - sh:targetShape [ sh:property [sh:path rdf:type; sh:hasValue ex:Person ]]; + rsx:targetShape [ sh:property [sh:path rdf:type; sh:hasValue ex:Person ]]; sh:property [ sh:path ex:age ; sh:not [ sh:datatype xsd:boolean ]; From 2efd164cbf5234c722d60b6de39d11ab55dca517 Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Tue, 21 Jul 2020 16:21:14 +1000 Subject: [PATCH 33/35] GH-2366 fedx task wrapper (#2370) * GH-2366: support wrapping of background tasks in FedX This change provides a configurable TaskWrapper infrastructure for wrapping background tasks. A TaskWrapper is a facility to wrap Runnable background tasks before they are passed to the Executor. Use-cases include injection of thread-local context variables, or more fine-granular error handling. All sub-queries sent by the federation engine that make use of the concurrency infrastructure (e.g. ControlledWorkerScheduler) are passing this wrapper. The concrete implementation can be configured using FedXConfig.withTaskWrapper(TaskWrapper). Signed-off-by: Andreas Schwarte * GH-2366: address review feedback + configurability for FedX repo factory Signed-off-by: Andreas Schwarte * GH-2366: refine interface definition Signed-off-by: Andreas Schwarte * GH-2366: formatting Signed-off-by: Andreas Schwarte * GH-2366: minor editorial call change Signed-off-by: Andreas Schwarte Co-authored-by: Andreas Schwarte --- .../eclipse/rdf4j/federated/FedXConfig.java | 28 ++++++++ .../rdf4j/federated/FederationManager.java | 22 +++++- .../concurrent/ControlledWorkerScheduler.java | 19 +++++- .../evaluation/concurrent/TaskWrapper.java | 67 +++++++++++++++++++ .../concurrent/TaskWrapperAware.java | 26 +++++++ .../repository/FedXRepositoryConfig.java | 20 ++++++ .../repository/FedXRepositoryWrapper.java | 4 ++ .../TaskWrapperIntegrationTest.java | 59 ++++++++++++++++ 8 files changed, 242 insertions(+), 3 deletions(-) create mode 100644 tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapper.java create mode 100644 tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapperAware.java create mode 100644 tools/federation/src/test/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapperIntegrationTest.java diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConfig.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConfig.java index af6f93d1dc1..c0f95b87189 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConfig.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FedXConfig.java @@ -7,12 +7,15 @@ *******************************************************************************/ package org.eclipse.rdf4j.federated; +import java.util.Optional; + import org.eclipse.rdf4j.federated.cache.SourceSelectionCache; import org.eclipse.rdf4j.federated.cache.SourceSelectionMemoryCache; import org.eclipse.rdf4j.federated.evaluation.FederationEvalStrategy; import org.eclipse.rdf4j.federated.evaluation.SailFederationEvalStrategy; import org.eclipse.rdf4j.federated.evaluation.SparqlFederationEvalStrategy; import org.eclipse.rdf4j.federated.evaluation.concurrent.ControlledWorkerScheduler; +import org.eclipse.rdf4j.federated.evaluation.concurrent.TaskWrapper; import org.eclipse.rdf4j.federated.monitoring.QueryLog; import org.eclipse.rdf4j.federated.monitoring.QueryPlanLog; import org.eclipse.rdf4j.federated.write.DefaultWriteStrategyFactory; @@ -61,6 +64,8 @@ public class FedXConfig { private Class writeStrategyFactory = DefaultWriteStrategyFactory.class; + private TaskWrapper taskWrapper = null; + private String prefixDeclarations = null; /* factory like setters */ @@ -292,6 +297,19 @@ public FedXConfig withSourceSelectionCacheSpec(String cacheSpec) { return this; } + /** + * Sets a {@link TaskWrapper} which may be used for wrapping any background {@link Runnable}s. If no such wrapper is + * explicitly configured, the unmodified task is returned. See {@link TaskWrapper} for more information. + * + * @param taskWrapper the {@link TaskWrapper} + * @return the current config + * @see TaskWrapper + */ + public FedXConfig withTaskWrapper(TaskWrapper taskWrapper) { + this.taskWrapper = taskWrapper; + return this; + } + /** * The (maximum) number of join worker threads used in the {@link ControlledWorkerScheduler} for join operations. * Default is 20. @@ -479,4 +497,14 @@ public Class getWriteStrategyFactory() { public boolean isDebugQueryPlan() { return debugQueryPlan; } + + /** + * Returns a {@link TaskWrapper} which may be used for wrapping any background {@link Runnable}s. If no such wrapper + * is explicitly configured, the unmodified task is returned. See {@link TaskWrapper} for more information. + * + * @return the {@link TaskWrapper}, an empty {@link Optional} if none is explicitly configured + */ + public Optional getTaskWrapper() { + return Optional.ofNullable(taskWrapper); + } } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FederationManager.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FederationManager.java index e02ea31ae2f..ffef6f42331 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FederationManager.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/FederationManager.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -23,6 +24,7 @@ import org.eclipse.rdf4j.federated.evaluation.concurrent.ControlledWorkerScheduler; import org.eclipse.rdf4j.federated.evaluation.concurrent.NamingThreadFactory; import org.eclipse.rdf4j.federated.evaluation.concurrent.Scheduler; +import org.eclipse.rdf4j.federated.evaluation.concurrent.TaskWrapper; import org.eclipse.rdf4j.federated.evaluation.union.ControlledWorkerUnion; import org.eclipse.rdf4j.federated.evaluation.union.SynchronousWorkerUnion; import org.eclipse.rdf4j.federated.evaluation.union.WorkerUnionBase; @@ -103,28 +105,46 @@ public void reset() { log.debug("Scheduler for join and union are reset."); } + Optional taskWrapper = federationContext.getConfig().getTaskWrapper(); if (joinScheduler != null) { joinScheduler.abort(); } joinScheduler = new ControlledWorkerScheduler<>(federationContext.getConfig().getJoinWorkerThreads(), "Join Scheduler"); + taskWrapper.ifPresent(joinScheduler::setTaskWrapper); if (unionScheduler != null) { unionScheduler.abort(); } unionScheduler = new ControlledWorkerScheduler<>(federationContext.getConfig().getUnionWorkerThreads(), "Union Scheduler"); + taskWrapper.ifPresent(unionScheduler::setTaskWrapper); if (leftJoinScheduler != null) { leftJoinScheduler.abort(); } leftJoinScheduler = new ControlledWorkerScheduler<>(federationContext.getConfig().getLeftJoinWorkerThreads(), "Left Join Scheduler"); + taskWrapper.ifPresent(leftJoinScheduler::setTaskWrapper); } + /** + * Returns the managed {@link Executor} which takes for properly handling any configured + * {@link FedXConfig#getTaskWrapper()} + * + * @return + */ public Executor getExecutor() { - return executor; + final Optional taskWrapper = federationContext.getConfig().getTaskWrapper(); + return (runnable) -> { + + // Note: for specific use-cases the runnable may be wrapped (e.g. to allow injection of thread-contexts). By + // default the unmodified runnable is returned from the task wrapper + Runnable wrappedRunnable = taskWrapper.map(tw -> tw.wrap(runnable)).orElse(runnable); + + executor.execute(wrappedRunnable); + }; } public FedX getFederation() { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ControlledWorkerScheduler.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ControlledWorkerScheduler.java index 877bc89c43e..346bd66eba7 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ControlledWorkerScheduler.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ControlledWorkerScheduler.java @@ -36,7 +36,7 @@ * @see ControlledWorkerJoin * @see ControlledWorkerBoundJoin */ -public class ControlledWorkerScheduler implements Scheduler { +public class ControlledWorkerScheduler implements Scheduler, TaskWrapperAware { private static final Logger log = LoggerFactory.getLogger(ControlledWorkerScheduler.class); @@ -46,10 +46,14 @@ public class ControlledWorkerScheduler implements Scheduler { private final int nWorkers; private final String name; + private TaskWrapper taskWrapper; /** * Construct a new instance with 20 workers. + * + * @deprecated use {@link #ControlledWorkerScheduler(int, String)}. Scheduled to be removed in 4.0 */ + @Deprecated public ControlledWorkerScheduler() { this(20, "FedX Worker"); } @@ -74,7 +78,13 @@ public ControlledWorkerScheduler(int nWorkers, String name) { @Override public void schedule(ParallelTask task) { - WorkerRunnable runnable = new WorkerRunnable(task); + Runnable runnable = new WorkerRunnable(task); + + // Note: for specific use-cases the runnable may be wrapped (e.g. to allow injection of thread-contexts). By + // default the unmodified runnable is used + if (taskWrapper != null) { + runnable = taskWrapper.wrap(runnable); + } Future future = executor.submit(runnable); @@ -247,4 +257,9 @@ public void shutdown() { } } + + @Override + public void setTaskWrapper(TaskWrapper taskWrapper) { + this.taskWrapper = taskWrapper; + } } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapper.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapper.java new file mode 100644 index 00000000000..e555e8fbaff --- /dev/null +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapper.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.federated.evaluation.concurrent; + +import java.util.concurrent.Callable; +import java.util.concurrent.Executor; + +import org.eclipse.rdf4j.federated.FedXConfig; + +/** + * A {@link TaskWrapper} is a facility to wrap {@link Runnable} background tasks before they are passed to the + * {@link Executor}. Use-cases include injection of thread-local context variables, or more fine-granular error + * handling. + * + *

+ * All sub-queries sent by the federation engine that make use of the concurrency infrastructure (e.g. + * {@link ControlledWorkerScheduler}) are passing this wrapper. + *

+ * + *

+ * The concrete implementation can be configured using {@link FedXConfig#withTaskWrapper(TaskWrapper)}. + *

+ * + * @author Andreas Schwarte + * @see ControlledWorkerScheduler + * @see FedXConfig#withTaskWrapper(TaskWrapper) + */ +public interface TaskWrapper { + + /** + * Wrap the given {@link Runnable} and add custom logic. + * + *

+ * Use cases include injection of state into the thread-local context, or more fine granular error handling. + *

+ * + *

+ * Note that when modifying state in {@link ThreadLocal} it must be reset properly in a try/finally block. + *

+ * + * @param runnable the task as generated by the FedX engine + * @return the wrapped {@link Runnable} + */ + Runnable wrap(Runnable runnable); + + /** + * Wrap the given {@link Callable} and add custom logic. + * + *

+ * Use cases include injection of state into the thread-local context, or more fine granular error handling. + *

+ * + *

+ * Note that when modifying state in {@link ThreadLocal} it must be reset properly in a try/finally block. + *

+ * + * @param callable the task as generated by the FedX engine + * @return the wrapped {@link Callable} + */ + Callable wrap(Callable callable); + +} diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapperAware.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapperAware.java new file mode 100644 index 00000000000..cb129716796 --- /dev/null +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapperAware.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.federated.evaluation.concurrent; + +/** + * Classes implementing this interface can accept a custom {@link TaskWrapper}. + * + * @author Andreas Schwarte + * + */ +public interface TaskWrapperAware { + + /** + * Set the {@link TaskWrapper} to the respective instance + * + * @param taskWrapper + * @return + */ + public void setTaskWrapper(TaskWrapper taskWrapper); + +} diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/repository/FedXRepositoryConfig.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/repository/FedXRepositoryConfig.java index a9d8e864ef1..4f91f485260 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/repository/FedXRepositoryConfig.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/repository/FedXRepositoryConfig.java @@ -9,6 +9,7 @@ import java.util.Set; +import org.eclipse.rdf4j.federated.FedXConfig; import org.eclipse.rdf4j.federated.util.Vocabulary.FEDX; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Model; @@ -91,6 +92,7 @@ public class FedXRepositoryConfig extends AbstractRepositoryImplConfig { /** * the location of the fedx configuration */ + @Deprecated private String fedxConfig; /** @@ -110,20 +112,30 @@ public class FedXRepositoryConfig extends AbstractRepositoryImplConfig { */ private Model members; + /** + * Initialized {@link FedXConfig} + */ + private FedXConfig config; + public FedXRepositoryConfig() { super(FedXRepositoryFactory.REPOSITORY_TYPE); } /** * @return the location of the FedX configuration + * @deprecated use {@link #getConfig()}, scheduled for removal in 4.0 */ + @Deprecated public String getFedxConfig() { return fedxConfig; } /** * Set the location of the FedX configuration + * + * @deprecated use {@link #setConfig(FedXConfig)}, scheduled for removal in 4.0 */ + @Deprecated public void setFedxConfig(String fedxConfig) { this.fedxConfig = fedxConfig; } @@ -144,6 +156,14 @@ public void setMembers(Model members) { this.members = members; } + public FedXConfig getConfig() { + return config; + } + + public void setConfig(FedXConfig config) { + this.config = config; + } + @Override public Resource export(Model m) { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/repository/FedXRepositoryWrapper.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/repository/FedXRepositoryWrapper.java index 53c6d01ae40..1cde25656a8 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/repository/FedXRepositoryWrapper.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/repository/FedXRepositoryWrapper.java @@ -111,6 +111,10 @@ public void initialize() throws RepositoryException { factory.withMembers(members); } + if (fedXConfig.getConfig() != null) { + factory.withConfig(fedXConfig.getConfig()); + } + fedxRepo = factory.create(); fedxRepo.init(); diff --git a/tools/federation/src/test/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapperIntegrationTest.java b/tools/federation/src/test/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapperIntegrationTest.java new file mode 100644 index 00000000000..4e641aa0a56 --- /dev/null +++ b/tools/federation/src/test/java/org/eclipse/rdf4j/federated/evaluation/concurrent/TaskWrapperIntegrationTest.java @@ -0,0 +1,59 @@ +package org.eclipse.rdf4j.federated.evaluation.concurrent; + +import java.util.Arrays; +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicInteger; + +import org.eclipse.rdf4j.federated.SPARQLBaseTest; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public class TaskWrapperIntegrationTest extends SPARQLBaseTest { + + private TestTaskWrapper taskWrapper = new TestTaskWrapper(); + + @Override + protected void initFedXConfig() { + fedxRule.withConfiguration(c -> c.withTaskWrapper(taskWrapper)); + } + + @BeforeEach + public void resetTaskCount() { + taskWrapper.taskCount.set(0); + } + + @Test + public void testTaskWrapper() throws Exception { + prepareTest(Arrays.asList("/tests/basic/data01endpoint1.ttl", "/tests/basic/data01endpoint2.ttl")); + execute("/tests/basic/query01.rq", "/tests/basic/query01.srx", false); + Assertions.assertTrue(taskWrapper.taskCount.get() > 0); + } + + @Test + public void testTaskWrapper_Union() throws Exception { + /* test union query (2 relevant endpoint) */ + prepareTest(Arrays.asList("/tests/medium/data1.ttl", "/tests/medium/data2.ttl", "/tests/medium/data3.ttl", + "/tests/medium/data4.ttl")); + execute("/tests/medium/query04.rq", "/tests/medium/query04.srx", false); + Assertions.assertTrue(taskWrapper.taskCount.get() > 0); + } + + static class TestTaskWrapper implements TaskWrapper { + + AtomicInteger taskCount = new AtomicInteger(0); + + @Override + public Runnable wrap(Runnable runnable) { + taskCount.incrementAndGet(); + return runnable; + } + + @Override + public Callable wrap(Callable callable) { + taskCount.incrementAndGet(); + return callable; + } + } + +} From e5980d44be0a675b0053f6121ee653fe21b27d37 Mon Sep 17 00:00:00 2001 From: Jeen Broekstra Date: Tue, 21 Jul 2020 16:21:59 +1000 Subject: [PATCH 34/35] GH-2362 pass TripleSource through to function evaluation (#2367) * GH-2362 pass TripleSource through to function evaluation * GH-2362 javadoc editorial * GH-2362 integration test for function evaluation using TripleSource * GH-2362 minor addition to javadoc deprecation notice --- .../CustomFunctionEvaluationTest.java | 52 +++++++++++++++++ .../TestTripleSourceCustomFunction.java | 58 +++++++++++++++++++ ...query.algebra.evaluation.function.Function | 1 + .../algebra/evaluation/function/Function.java | 36 +++++++++++- .../evaluation/function/FunctionRegistry.java | 3 + .../impl/StrictEvaluationStrategy.java | 2 +- 6 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/function/CustomFunctionEvaluationTest.java create mode 100644 compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/function/TestTripleSourceCustomFunction.java create mode 100644 compliance/sparql/src/test/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/function/CustomFunctionEvaluationTest.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/function/CustomFunctionEvaluationTest.java new file mode 100644 index 00000000000..3ebe0664500 --- /dev/null +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/function/CustomFunctionEvaluationTest.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.query.parser.sparql.function; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.StringReader; + +import org.eclipse.rdf4j.query.BindingSet; +import org.eclipse.rdf4j.query.TupleQueryResult; +import org.eclipse.rdf4j.repository.RepositoryConnection; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.rio.RDFFormat; +import org.eclipse.rdf4j.sail.memory.MemoryStore; +import org.junit.Before; +import org.junit.Test; + +/** + * Integration tests for evaluation of custom functions in SPARQL + * + * @author Jeen Broekstra + */ +public class CustomFunctionEvaluationTest { + + private SailRepository rep; + + @Before + public void setUp() { + rep = new SailRepository(new MemoryStore()); + } + + @Test + public void testTriplesourceRetrieval() throws Exception { + String data = " a . , ."; + String query = "SELECT ?s ?result WHERE { ?s a . BIND((?s) as ?result) }"; + + try (RepositoryConnection conn = rep.getConnection()) { + conn.add(new StringReader(data), "", RDFFormat.TURTLE); + + TupleQueryResult result = conn.prepareTupleQuery(query).evaluate(); + BindingSet bs = result.next(); + assertThat(bs.getValue("result").stringValue()).isEqualTo("related to ex:s2, ex:s3"); + } + + } + +} diff --git a/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/function/TestTripleSourceCustomFunction.java b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/function/TestTripleSourceCustomFunction.java new file mode 100644 index 00000000000..c306922ecf0 --- /dev/null +++ b/compliance/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/function/TestTripleSourceCustomFunction.java @@ -0,0 +1,58 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.query.parser.sparql.function; + +import java.util.List; + +import org.eclipse.rdf4j.model.IRI; +import org.eclipse.rdf4j.model.Statement; +import org.eclipse.rdf4j.model.Value; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.query.QueryResults; +import org.eclipse.rdf4j.query.algebra.evaluation.TripleSource; +import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; +import org.eclipse.rdf4j.query.algebra.evaluation.function.Function; + +/** + * A test-only function that evaluates against the supplied triple source. It looks up the 'ex:related' relations for + * the given input IRI and outputs a single literal of the form "related to v1, v2, v3". + * + * @author Jeen Broekstra + * + */ +public class TestTripleSourceCustomFunction implements Function { + + @Override + public String getURI() { + return "urn:triplesourceCustomFunction"; + } + + @Override + public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException { + throw new UnsupportedOperationException("can only evaluate with triplesource"); + } + + @Override + public Value evaluate(TripleSource tripleSource, Value... args) throws ValueExprEvaluationException { + IRI subject = (IRI) args[0]; + IRI related = tripleSource.getValueFactory().createIRI("ex:related"); + List relatedStatements = QueryResults + .asList(tripleSource.getStatements(subject, related, null)); + + StringBuilder functionResult = new StringBuilder(); + functionResult.append("related to "); + for (Statement st : relatedStatements) { + functionResult.append(st.getObject().stringValue()); + functionResult.append(", "); + } + functionResult.setLength(functionResult.length() - 2); + + return tripleSource.getValueFactory().createLiteral(functionResult.toString()); + } + +} diff --git a/compliance/sparql/src/test/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function b/compliance/sparql/src/test/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function new file mode 100644 index 00000000000..56b0fdfa6cc --- /dev/null +++ b/compliance/sparql/src/test/resources/META-INF/services/org.eclipse.rdf4j.query.algebra.evaluation.function.Function @@ -0,0 +1 @@ +org.eclipse.rdf4j.query.parser.sparql.function.TestTripleSourceCustomFunction \ No newline at end of file diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/Function.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/Function.java index 6b04065bb4f..748d248fc68 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/Function.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/Function.java @@ -9,14 +9,46 @@ import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.query.algebra.evaluation.TripleSource; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; /** + * A query function, which can be a built-in function in the query language, or a custom function as documented in the + * SPARQL 1.1 Query Language Recommendation. + * * @author Arjohn Kampman + * @author Jeen Broekstra + * @see FunctionRegistry */ public interface Function { - public String getURI(); + String getURI(); - public Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException; + /** + * Evaluate the function over the supplied input arguments, using the supplied {@link ValueFactory} to produce the + * result. + * + * @param valueFactory a {@link ValueFactory} to use for producing the function result. + * @param args the function input arguments. + * @return the function result value. + * @throws ValueExprEvaluationException + * @deprecated since 3.3.0. Use {@link #evaluate(TripleSource, Value...)} instead. A reference to a ValueFactory can + * be retrieved using {@link TripleSource#getValueFactory()} if needed. + */ + @Deprecated + Value evaluate(ValueFactory valueFactory, Value... args) throws ValueExprEvaluationException; + + /** + * Evaluate the function over the supplied input arguments. + * + * @param tripleSource the {@link TripleSource} used in the query evaluation. This can be used to access the current + * state of the store. + * @param args the function input arguments. + * @return the function result value. + * @throws ValueExprEvaluationException + * @since 3.3.0 + */ + default Value evaluate(TripleSource tripleSource, Value... args) throws ValueExprEvaluationException { + return evaluate(tripleSource.getValueFactory(), args); + } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/FunctionRegistry.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/FunctionRegistry.java index 5683e396fb5..7a406c057b1 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/FunctionRegistry.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/function/FunctionRegistry.java @@ -10,6 +10,9 @@ import org.eclipse.rdf4j.common.lang.service.ServiceRegistry; /** + * A ServiceRegistry for implementations of the {@link Function} interface. Functions are registered by their + * {@link Function#getURI() IRI}. + * * @author Arjohn Kampman */ public class FunctionRegistry extends ServiceRegistry { diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategy.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategy.java index e25555c4e5c..1abaca07e81 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategy.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/StrictEvaluationStrategy.java @@ -1545,7 +1545,7 @@ public Value evaluate(FunctionCall node, BindingSet bindings) argValues[i] = evaluate(args.get(i), bindings); } - return function.evaluate(tripleSource.getValueFactory(), argValues); + return function.evaluate(tripleSource, argValues); } From 7261fbea2d114f39c5ecc9b6d7f2f4e049545978 Mon Sep 17 00:00:00 2001 From: hmottestad Date: Tue, 21 Jul 2020 19:10:32 +0200 Subject: [PATCH 35/35] GH-2350 transaction settings (#2351) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * GH-2350 initial commit Signed-off-by: Håvard Ottestad * forgot some varargs Signed-off-by: Håvard Ottestad * bug fix Signed-off-by: Håvard Ottestad * added default methods Signed-off-by: Håvard Ottestad * WIP transaction settings Signed-off-by: Håvard Ottestad * formatter Signed-off-by: Håvard Ottestad * WIP testing the http repo Signed-off-by: Håvard Ottestad * GH-2350 seems to work now Signed-off-by: Håvard Ottestad * GH-2350 fix compatibility issues in REST API / ProtocolSession * GH-2350 fix tests and japicmp plugin Signed-off-by: Håvard Ottestad * wip Signed-off-by: Håvard Ottestad * Gh-2350 introduced interning of transaction settings and some simplification Signed-off-by: Håvard Ottestad * GH-2350 refactored AbstractSailConnection to make backward compatible overrides easier The idea is that begin(IsolationLevel) now redirects to begin(TransactionSettings...). Any existing impl that overrides begin(IsolationLevel) but is at least smart enough to still call the super will automatically support processing of other transaction settings. * GH-2350 replace intern pass-through methods with use of an SPI registry * GH-2350 migrated to a receive transaction settings approach for sails instead of more complex begin methods Signed-off-by: Håvard Ottestad * GH-2350 fix some test failures Signed-off-by: Håvard Ottestad * updated docs Signed-off-by: Håvard Ottestad * fixes from review Signed-off-by: Håvard Ottestad * revert docker changes Signed-off-by: Håvard Ottestad * removed override method in the sparql connection for handling transaction settings Signed-off-by: Håvard Ottestad * fixed a pom file and added docs Signed-off-by: Håvard Ottestad * fixes from review Signed-off-by: Håvard Ottestad Co-authored-by: Jeen Broekstra --- compliance/repository/pom.xml | 6 + .../http/client/RDF4JProtocolSession.java | 26 +- .../http/client/SPARQLProtocolSession.java | 3 +- .../eclipse/rdf4j/http/protocol/Protocol.java | 14 +- .../org/eclipse/rdf4j/IsolationLevel.java | 23 +- .../eclipse/rdf4j/repository/Repository.java | 17 +- .../repository/RepositoryConnection.java | 156 +++++++----- .../base/RepositoryConnectionWrapper.java | 6 + .../http/HTTPRepositoryConnection.java | 22 ++ .../sail/SailRepositoryConnection.java | 55 +++- .../repository/sparql/SPARQLConnection.java | 1 + .../java/org/eclipse/rdf4j/sail/Sail.java | 1 + .../eclipse/rdf4j/sail/SailConnection.java | 18 ++ .../sail/helpers/AbstractSailConnection.java | 20 +- .../sail/helpers/SailConnectionWrapper.java | 9 +- .../rdf4j/sail/helpers/SailWrapper.java | 1 + .../sail/extensiblestore/ExtensibleStore.java | 1 - .../rdf4j/sail/federation/Federation.java | 1 + ...ctForwardChainingInferencerConnection.java | 5 +- ...SchemaCachingRDFSInferencerConnection.java | 2 +- .../rdf4j/sail/shacl/AST/NodeShape.java | 4 +- .../rdf4j/sail/shacl/AST/OrPropertyShape.java | 2 +- .../rdf4j/sail/shacl/ConnectionsGroup.java | 22 +- .../eclipse/rdf4j/sail/shacl/ShaclSail.java | 48 +++- .../rdf4j/sail/shacl/ShaclSailConnection.java | 130 +++++++--- .../sail/shacl/ValidationApproachFactory.java | 38 +++ ...mmon.transaction.TransactionSettingFactory | 1 + .../rdf4j/sail/shacl/AbstractShaclTest.java | 19 +- .../shacl/BulkValidationSettingsTest.java | 199 +++++++++++++++ .../shacl/TruncatedValidationReportTest.java | 6 + .../shacl/ValidationApproachFactoryTest.java | 38 +++ .../transaction/TransactionSetting.java | 37 +++ .../TransactionSettingFactory.java | 37 +++ .../TransactionSettingRegistry.java | 51 ++++ .../common/transaction/package-info.java | 4 + pom.xml | 2 + .../repository/transaction/Transaction.java | 22 +- .../TransactionStartController.java | 46 +++- .../http/server/TransactionSettingsTest.java | 237 ++++++++++++++++++ 39 files changed, 1161 insertions(+), 169 deletions(-) create mode 100644 core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ValidationApproachFactory.java create mode 100644 core/sail/shacl/src/main/resources/META-INF/services/org.eclipse.rdf4j.common.transaction.TransactionSettingFactory create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/BulkValidationSettingsTest.java create mode 100644 core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationApproachFactoryTest.java create mode 100644 core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSetting.java create mode 100644 core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSettingFactory.java create mode 100644 core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSettingRegistry.java create mode 100644 core/util/src/main/java/org/eclipse/rdf4j/common/transaction/package-info.java create mode 100644 tools/server/src/test/java/org/eclipse/rdf4j/http/server/TransactionSettingsTest.java diff --git a/compliance/repository/pom.xml b/compliance/repository/pom.xml index c7beb571a14..e069f3a3e7b 100644 --- a/compliance/repository/pom.xml +++ b/compliance/repository/pom.xml @@ -53,6 +53,12 @@ ${project.version} test
+ + ${project.groupId} + rdf4j-rio-nquads + ${project.version} + test + org.eclipse.jetty jetty-server diff --git a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSession.java b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSession.java index e5780b0a618..42ce6801b02 100644 --- a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSession.java +++ b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/RDF4JProtocolSession.java @@ -7,6 +7,8 @@ *******************************************************************************/ package org.eclipse.rdf4j.http.client; +import static org.eclipse.rdf4j.http.protocol.Protocol.TRANSACTION_SETTINGS_PREFIX; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -54,6 +56,7 @@ import org.eclipse.rdf4j.OpenRDFUtil; import org.eclipse.rdf4j.RDF4JException; import org.eclipse.rdf4j.common.io.IOUtil; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.http.protocol.Protocol; import org.eclipse.rdf4j.http.protocol.Protocol.Action; import org.eclipse.rdf4j.http.protocol.UnauthorizedException; @@ -608,6 +611,11 @@ public void getStatements(Resource subj, IRI pred, Value obj, boolean includeInf public synchronized void beginTransaction(IsolationLevel isolationLevel) throws RDF4JException, IOException, UnauthorizedException { + beginTransaction((TransactionSetting) isolationLevel); + } + + public synchronized void beginTransaction(TransactionSetting... transactionSettings) + throws RDF4JException, IOException, UnauthorizedException { checkRepositoryURL(); if (transactionURL != null) { @@ -620,11 +628,22 @@ public synchronized void beginTransaction(IsolationLevel isolationLevel) method.setHeader("Content-Type", Protocol.FORM_MIME_TYPE + "; charset=utf-8"); List params = new ArrayList<>(); - if (isolationLevel != null) { + + for (TransactionSetting transactionSetting : transactionSettings) { + if (transactionSetting == null) { + continue; + } + if (transactionSetting instanceof IsolationLevel) { + // also send isolation level with dedicated parameter for backward compatibility with older RDF4J + // Server + IsolationLevel isolationLevel = (IsolationLevel) transactionSetting; + params.add(new BasicNameValuePair(Protocol.ISOLATION_LEVEL_PARAM_NAME, + isolationLevel.getURI().stringValue())); + } params.add( new BasicNameValuePair( - Protocol.ISOLATION_LEVEL_PARAM_NAME, - isolationLevel.getURI().stringValue() + TRANSACTION_SETTINGS_PREFIX + transactionSetting.getName(), + transactionSetting.getValue() ) ); } @@ -1154,5 +1173,4 @@ private T applyAdditionalHeaders(T method) { } return method; } - } diff --git a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/SPARQLProtocolSession.java b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/SPARQLProtocolSession.java index cf4ba06eb97..ca439d5889c 100644 --- a/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/SPARQLProtocolSession.java +++ b/core/http/client/src/main/java/org/eclipse/rdf4j/http/client/SPARQLProtocolSession.java @@ -1101,7 +1101,8 @@ static RDFFormat getContentTypeSerialisation(HttpResponse response) { } throw new RepositoryException("Unsupported content-type for SHACL Validation Report: " - + Arrays.toString(response.getHeaders("Content-Type"))); + + Arrays.toString(response.getHeaders("Content-Type")) + + "! If the format seems correct, then you may need a maven dependency for that."); } diff --git a/core/http/protocol/src/main/java/org/eclipse/rdf4j/http/protocol/Protocol.java b/core/http/protocol/src/main/java/org/eclipse/rdf4j/http/protocol/Protocol.java index d0b134ae263..240d804b3ee 100644 --- a/core/http/protocol/src/main/java/org/eclipse/rdf4j/http/protocol/Protocol.java +++ b/core/http/protocol/src/main/java/org/eclipse/rdf4j/http/protocol/Protocol.java @@ -78,11 +78,12 @@ public static enum TIMEOUT { * Protocol version. * *
    + *
  • 11: since RDF4J 3.3.0
  • *
  • 10: since RDF4J 3.1.0
  • *
  • 9: since RDF4J 3.0.0
  • *
*/ - public static final String VERSION = "10"; + public static final String VERSION = "11"; /** * Parameter name for the 'subject' parameter of a statement query. @@ -182,9 +183,20 @@ public static enum TIMEOUT { /** * Parameter name for the isolation level used in transactions. + * + * @deprecated since 3.3.0. Use transaction-setting__isolation-level instead. + * @see #TRANSACTION_SETTINGS_PREFIX */ + @Deprecated public static final String ISOLATION_LEVEL_PARAM_NAME = "isolation-level"; + /** + * Prefix for transaction settings in the query param + * + * @since 3.3.0 + */ + public static final String TRANSACTION_SETTINGS_PREFIX = "transaction-setting__"; + /** * Parameter name for the action parameter used in transactions. */ diff --git a/core/model/src/main/java/org/eclipse/rdf4j/IsolationLevel.java b/core/model/src/main/java/org/eclipse/rdf4j/IsolationLevel.java index b6dd177bbed..f64d01f255e 100644 --- a/core/model/src/main/java/org/eclipse/rdf4j/IsolationLevel.java +++ b/core/model/src/main/java/org/eclipse/rdf4j/IsolationLevel.java @@ -7,16 +7,22 @@ *******************************************************************************/ package org.eclipse.rdf4j; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.model.IRI; /** - * A Transaction Isolation Level. Defaul levels supported by Sesame are provided by {@link IsolationLevels}, third-party + * A Transaction Isolation Level. Default levels supported by RDF4J are provided by {@link IsolationLevels}, third-party * triplestore implementors may choose to add additional IsolationLevel implementations if their triplestore's isolation * contract is different from what is provided by default. * * @author Jeen Broekstra */ -public interface IsolationLevel { +public interface IsolationLevel extends TransactionSetting { + + /** + * Shared constant for the {@link TransactionSetting} name used for isolation levels. + */ + static String NAME = IsolationLevel.class.getCanonicalName(); /** * Verifies if this transaction isolation level is compatible with the supplied other isolation level - that is, if @@ -31,8 +37,21 @@ public interface IsolationLevel { /** * Get a URI uniquely representing this isolation level. * + * @deprecated use getName() and getValue() instead. + * * @return a URI that uniquely represents this isolation level. */ + @Deprecated IRI getURI(); + @Override + default String getName() { + return NAME; + } + + @Override + default String getValue() { + return this.toString(); + } + } diff --git a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/Repository.java b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/Repository.java index bf767adcc32..69a714024f7 100644 --- a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/Repository.java +++ b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/Repository.java @@ -31,14 +31,14 @@ public interface Repository { * * @param dataDir the directory where data for this repository is stored */ - public void setDataDir(File dataDir); + void setDataDir(File dataDir); /** * Get the directory where data and logging for this repository is stored. * * @return the directory where data for this repository is stored. */ - public File getDataDir(); + File getDataDir(); /** * Initializes this repository. @@ -47,7 +47,7 @@ public interface Repository { * @deprecated Use {@link #init()} instead. */ @Deprecated - public void initialize() throws RepositoryException; + void initialize() throws RepositoryException; /** * Initializes this repository. A repository needs to be initialized before it can be used, however explicitly @@ -67,19 +67,19 @@ default void init() throws RepositoryException { * * @return true iff the repository has been initialized. */ - public boolean isInitialized(); + boolean isInitialized(); /** * Shuts the repository down, releasing any resources that it keeps hold of. Once shut down, the repository can no * longer be used until it is re-initialized. */ - public void shutDown() throws RepositoryException; + void shutDown() throws RepositoryException; /** * Checks whether this repository is writable, i.e. if the data contained in this repository can be changed. The * writability of the repository is determined by the writability of the Sail that this repository operates on. */ - public boolean isWritable() throws RepositoryException; + boolean isWritable() throws RepositoryException; /** * Opens a connection to this repository that can be used for querying and updating the contents of the repository. @@ -99,12 +99,13 @@ default void init() throws RepositoryException { * @return A connection that allows operations on this repository. * @throws RepositoryException If something went wrong during the creation of the Connection. */ - public RepositoryConnection getConnection() throws RepositoryException; + RepositoryConnection getConnection() throws RepositoryException; /** * Gets a ValueFactory for this Repository. * * @return A repository-specific ValueFactory. */ - public ValueFactory getValueFactory(); + ValueFactory getValueFactory(); + } diff --git a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/RepositoryConnection.java b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/RepositoryConnection.java index 6d87fb5e45d..0766c9faa1b 100644 --- a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/RepositoryConnection.java +++ b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/RepositoryConnection.java @@ -15,6 +15,7 @@ import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.common.iteration.Iteration; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Namespace; import org.eclipse.rdf4j.model.Resource; @@ -93,35 +94,35 @@ public interface RepositoryConnection extends AutoCloseable { /** * Returns the Repository object to which this connection belongs. */ - public Repository getRepository(); + Repository getRepository(); /** * Set the parser configuration this connection should use for RDFParser-based operations. * * @param config a Rio RDF Parser configuration. */ - public void setParserConfig(ParserConfig config); + void setParserConfig(ParserConfig config); /** * Returns the parser configuration this connection uses for Rio-based operations. * * @return a Rio RDF parser configuration. */ - public ParserConfig getParserConfig(); + ParserConfig getParserConfig(); /** * Gets a ValueFactory for this RepositoryConnection. * * @return A repository-specific ValueFactory. */ - public ValueFactory getValueFactory(); + ValueFactory getValueFactory(); /** * Checks whether this connection is open. A connection is open from the moment it is created until it is closed. * * @see #close() */ - public boolean isOpen() throws RepositoryException; + boolean isOpen() throws RepositoryException; /** * Closes the connection, freeing resources. If a {@link #begin() transaction} is {@link #isActive() active} on the @@ -134,7 +135,7 @@ public interface RepositoryConnection extends AutoCloseable { * @throws RepositoryException If the connection could not be closed. */ @Override - public default void close() throws RepositoryException { + default void close() throws RepositoryException { if (isOpen() && isActive()) { rollback(); } @@ -154,7 +155,7 @@ public default void close() throws RepositoryException { * @throws UnsupportedOperationException If the prepareQuery method is not supported by this repository. * @see #prepareQuery(QueryLanguage, String) */ - public default Query prepareQuery(String query) throws RepositoryException, MalformedQueryException { + default Query prepareQuery(String query) throws RepositoryException, MalformedQueryException { return prepareQuery(QueryLanguage.SPARQL, query); } @@ -174,7 +175,7 @@ public default Query prepareQuery(String query) throws RepositoryException, Malf * @throws UnsupportedOperationException If the prepareQuery method is not supported by this * repository. */ - public Query prepareQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException; + Query prepareQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException; /** * Prepares a query for evaluation on this repository (optional operation). @@ -192,7 +193,7 @@ public default Query prepareQuery(String query) throws RepositoryException, Malf * @throws UnsupportedOperationException If the prepareQuery method is not supported by this * repository. */ - public Query prepareQuery(QueryLanguage ql, String query, String baseURI) + Query prepareQuery(QueryLanguage ql, String query, String baseURI) throws RepositoryException, MalformedQueryException; /** @@ -206,7 +207,7 @@ public Query prepareQuery(QueryLanguage ql, String query, String baseURI) * @throws MalformedQueryException If the supplied query is malformed. * @see #prepareTupleQuery(QueryLanguage, String) */ - public default TupleQuery prepareTupleQuery(String query) throws RepositoryException, MalformedQueryException { + default TupleQuery prepareTupleQuery(String query) throws RepositoryException, MalformedQueryException { return prepareTupleQuery(QueryLanguage.SPARQL, query); } @@ -222,7 +223,7 @@ public default TupleQuery prepareTupleQuery(String query) throws RepositoryExcep * @throws MalformedQueryException If the supplied query is malformed. * @throws UnsupportedQueryLanguageException If the supplied query language is not supported. */ - public TupleQuery prepareTupleQuery(QueryLanguage ql, String query) + TupleQuery prepareTupleQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException; /** @@ -237,7 +238,7 @@ public TupleQuery prepareTupleQuery(QueryLanguage ql, String query) * @throws MalformedQueryException If the supplied query is malformed. * @throws UnsupportedQueryLanguageException If the supplied query language is not supported. */ - public TupleQuery prepareTupleQuery(QueryLanguage ql, String query, String baseURI) + TupleQuery prepareTupleQuery(QueryLanguage ql, String query, String baseURI) throws RepositoryException, MalformedQueryException; /** @@ -251,7 +252,7 @@ public TupleQuery prepareTupleQuery(QueryLanguage ql, String query, String baseU * @throws MalformedQueryException If the supplied query is malformed. * @see #prepareGraphQuery(QueryLanguage, String) */ - public default GraphQuery prepareGraphQuery(String query) throws RepositoryException, MalformedQueryException { + default GraphQuery prepareGraphQuery(String query) throws RepositoryException, MalformedQueryException { return prepareGraphQuery(QueryLanguage.SPARQL, query); } @@ -266,7 +267,7 @@ public default GraphQuery prepareGraphQuery(String query) throws RepositoryExcep * @throws MalformedQueryException If the supplied query is malformed. * @throws UnsupportedQueryLanguageException If the supplied query language is not supported. */ - public GraphQuery prepareGraphQuery(QueryLanguage ql, String query) + GraphQuery prepareGraphQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException; /** @@ -281,7 +282,7 @@ public GraphQuery prepareGraphQuery(QueryLanguage ql, String query) * @throws MalformedQueryException If the supplied query is malformed. * @throws UnsupportedQueryLanguageException If the supplied query language is not supported. */ - public GraphQuery prepareGraphQuery(QueryLanguage ql, String query, String baseURI) + GraphQuery prepareGraphQuery(QueryLanguage ql, String query, String baseURI) throws RepositoryException, MalformedQueryException; /** @@ -295,7 +296,7 @@ public GraphQuery prepareGraphQuery(QueryLanguage ql, String query, String baseU * @throws MalformedQueryException If the supplied SPARQL query is malformed. * @see #prepareBooleanQuery(QueryLanguage, String) */ - public default BooleanQuery prepareBooleanQuery(String query) throws RepositoryException, MalformedQueryException { + default BooleanQuery prepareBooleanQuery(String query) throws RepositoryException, MalformedQueryException { return prepareBooleanQuery(QueryLanguage.SPARQL, query); } @@ -311,7 +312,7 @@ public default BooleanQuery prepareBooleanQuery(String query) throws RepositoryE * @throws MalformedQueryException If the supplied query is malformed. * @throws UnsupportedQueryLanguageException If the supplied query language is not supported. */ - public BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query) + BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query) throws RepositoryException, MalformedQueryException; /** @@ -326,7 +327,7 @@ public BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query) * @throws MalformedQueryException If the supplied query is malformed. * @throws UnsupportedQueryLanguageException If the supplied query language is not supported. */ - public BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query, String baseURI) + BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query, String baseURI) throws RepositoryException, MalformedQueryException; /** @@ -338,7 +339,7 @@ public BooleanQuery prepareBooleanQuery(QueryLanguage ql, String query, String b * @throws MalformedQueryException If the supplied update operation string is malformed. * @see #prepareUpdate(QueryLanguage, String) */ - public default Update prepareUpdate(String update) throws RepositoryException, MalformedQueryException { + default Update prepareUpdate(String update) throws RepositoryException, MalformedQueryException { return prepareUpdate(QueryLanguage.SPARQL, update); } @@ -351,7 +352,7 @@ public default Update prepareUpdate(String update) throws RepositoryException, M * @return a {@link Update} ready to be executed on this {@link RepositoryConnection}. * @throws MalformedQueryException If the supplied update operation string is malformed. */ - public Update prepareUpdate(QueryLanguage ql, String update) throws RepositoryException, MalformedQueryException; + Update prepareUpdate(QueryLanguage ql, String update) throws RepositoryException, MalformedQueryException; /** * Prepares an Update operation. @@ -363,7 +364,7 @@ public default Update prepareUpdate(String update) throws RepositoryException, M * @return a {@link Update} ready to be executed on this {@link RepositoryConnection}. * @throws MalformedQueryException If the supplied update operation string is malformed. */ - public Update prepareUpdate(QueryLanguage ql, String update, String baseURI) + Update prepareUpdate(QueryLanguage ql, String update, String baseURI) throws RepositoryException, MalformedQueryException; /** @@ -372,7 +373,7 @@ public Update prepareUpdate(QueryLanguage ql, String update, String baseURI) * * @return a RepositoryResult object containing Resources that are used as context identifiers. */ - public RepositoryResult getContextIDs() throws RepositoryException; + RepositoryResult getContextIDs() throws RepositoryException; /** * Gets all statements with a specific subject, predicate and/or object from the repository. The result is @@ -388,7 +389,7 @@ public Update prepareUpdate(QueryLanguage ql, String update, String baseURI) * lazy Iterator-like object containing {@link Statement}s and optionally throwing a * {@link RepositoryException} when an error when a problem occurs during retrieval. */ - public default RepositoryResult getStatements(Resource subj, IRI pred, Value obj, Resource... contexts) + default RepositoryResult getStatements(Resource subj, IRI pred, Value obj, Resource... contexts) throws RepositoryException { return getStatements(subj, pred, obj, true, contexts); } @@ -410,7 +411,7 @@ public default RepositoryResult getStatements(Resource subj, IRI pred * @deprecated since 2.0. Use {@link #getStatements(Resource, IRI, Value, boolean, Resource...)} instead. */ @Deprecated - public default RepositoryResult getStatements(Resource subj, URI pred, Value obj, + default RepositoryResult getStatements(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException { return getStatements(subj, (IRI) pred, obj, includeInferred, contexts); } @@ -430,7 +431,7 @@ public default RepositoryResult getStatements(Resource subj, URI pred * lazy Iterator-like object containing {@link Statement}s and optionally throwing a * {@link RepositoryException} when an error when a problem occurs during retrieval. */ - public RepositoryResult getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, + RepositoryResult getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException; /** @@ -446,7 +447,7 @@ public RepositoryResult getStatements(Resource subj, IRI pred, Value * considered if available * @return true If a matching statement is in the repository in the specified context, false otherwise. */ - public boolean hasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) + boolean hasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException; /** @@ -464,7 +465,7 @@ public boolean hasStatement(Resource subj, IRI pred, Value obj, boolean includeI * @deprecated since 2.0. Use {@link #hasStatement(Resource, IRI, Value, boolean, Resource...)} instead. */ @Deprecated - public default boolean hasStatement(Resource subj, URI pred, Value obj, boolean includeInferred, + default boolean hasStatement(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws RepositoryException { return hasStatement(subj, (IRI) pred, obj, includeInferred, contexts); } @@ -479,7 +480,7 @@ public default boolean hasStatement(Resource subj, URI pred, Value obj, boolean * considered if available * @return true If the repository contains the specified statement, false otherwise. */ - public boolean hasStatement(Statement st, boolean includeInferred, Resource... contexts) throws RepositoryException; + boolean hasStatement(Statement st, boolean includeInferred, Resource... contexts) throws RepositoryException; /** * Exports all statements with a specific subject, predicate and/or object from the repository, optionally from the @@ -496,7 +497,7 @@ public default boolean hasStatement(Resource subj, URI pred, Value obj, boolean * if available * @throws RDFHandlerException If the handler encounters an unrecoverable error. */ - public void exportStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, RDFHandler handler, + void exportStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException; /** @@ -508,7 +509,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @param handler The handler that will handle the RDF data. * @throws RDFHandlerException If the handler encounters an unrecoverable error. */ - public void export(RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException; + void export(RDFHandler handler, Resource... contexts) throws RepositoryException, RDFHandlerException; /** * Returns the number of (explicit) statements that are in the specified contexts in this repository. @@ -517,7 +518,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * optional. If no contexts are supplied the method operates on the entire repository. * @return The number of explicit statements from the specified contexts in this repository. */ - public long size(Resource... contexts) throws RepositoryException; + long size(Resource... contexts) throws RepositoryException; /** * Returns true if this repository does not contain any (explicit) statements. @@ -525,7 +526,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @return true if this repository is empty, false otherwise. * @throws RepositoryException If the repository could not be checked to be empty. */ - public boolean isEmpty() throws RepositoryException; + boolean isEmpty() throws RepositoryException; /** * Enables or disables auto-commit mode for the connection. If a connection is in auto-commit mode, then all updates @@ -542,7 +543,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @see #commit() */ @Deprecated - public void setAutoCommit(boolean autoCommit) throws RepositoryException; + void setAutoCommit(boolean autoCommit) throws RepositoryException; /** * Indicates if the connection is in auto-commit mode. The connection is in auto-commit mode when no transaction is @@ -556,7 +557,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @throws RepositoryException If a repository access error occurs. */ @Deprecated - public boolean isAutoCommit() throws RepositoryException; + boolean isAutoCommit() throws RepositoryException; /** * Indicates if a transaction is currently active on the connection. A transaction is active if {@link #begin()} has @@ -567,7 +568,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * instance when communication with a repository fails or times out. * @throws RepositoryException */ - public boolean isActive() throws UnknownTransactionStateException, RepositoryException; + boolean isActive() throws UnknownTransactionStateException, RepositoryException; /** * Sets the transaction isolation level for the next transaction(s) on this connection. If the level is set to a @@ -577,14 +578,14 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @param level the transaction isolation level to set. * @throws IllegalStateException if the method is called while a transaction is already active. */ - public void setIsolationLevel(IsolationLevel level) throws IllegalStateException; + void setIsolationLevel(IsolationLevel level) throws IllegalStateException; /** * Retrieves the current {@link IsolationLevel transaction isolation level} of the connection. * * @return the current transaction isolation level. */ - public IsolationLevel getIsolationLevel(); + IsolationLevel getIsolationLevel(); /** * Begins a new transaction, requiring {@link #commit()} or {@link #rollback()} to be called to end the transaction. @@ -599,7 +600,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @see #rollback() * @see #setIsolationLevel(IsolationLevel) */ - public void begin() throws RepositoryException; + void begin() throws RepositoryException; /** * Begins a new transaction with the supplied {@link IsolationLevel}, requiring {@link #commit()} or @@ -622,7 +623,40 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @see #rollback() * @see #setIsolationLevel(IsolationLevel) */ - public void begin(IsolationLevel level) throws RepositoryException; + void begin(IsolationLevel level) throws RepositoryException; + + /** + * Begins a new transaction with the supplied {@link TransactionSetting}, requiring {@link #commit()} or + * {@link #rollback()} to be called to end the transaction. + * + * @param settings The {@link TransactionSetting} (zero or more) for this transaction. If an isolation level is + * provided in the settings this will be used for the transaction. If none is provided then the + * default will be used. Behaviour of this method is undefined if more than one isolation level is + * provided. Behaviour of this method is undefined if one or more settings is null. + * @throws RepositoryException If the connection could not start the transaction. Possible reasons this may happen + * are: + *
    + *
  • a transaction is already {@link #isActive() active} on the current connection. + *
  • the specified {@link IsolationLevel} is not supported by the store, and no + * compatible level could be found. + *
+ * @see #begin() + * @see #isActive() + * @see #commit() + * @see #rollback() + * @see #setIsolationLevel(IsolationLevel) + * @since 3.3.0 + */ + default void begin(TransactionSetting... settings) { + for (TransactionSetting setting : settings) { + if (setting instanceof IsolationLevel) { + begin(((IsolationLevel) setting)); + return; + } + } + + begin(); + } /** * Commits the active transaction. This operation ends the active transaction. @@ -635,7 +669,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @see #begin() * @see #rollback() */ - public void commit() throws RepositoryException; + void commit() throws RepositoryException; /** * Rolls back all updates in the active transaction. This operation ends the active transaction. @@ -648,7 +682,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @see #begin() * @see #commit() */ - public void rollback() throws RepositoryException; + void rollback() throws RepositoryException; /** * Adds RDF data from an InputStream to the repository, optionally to one or more named contexts. @@ -666,7 +700,7 @@ public void exportStatements(Resource subj, IRI pred, Value obj, boolean include * @throws RepositoryException If the data could not be added to the repository, for example because the * repository is not writable. */ - public void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) + void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException; /** @@ -686,7 +720,7 @@ public void add(InputStream in, String baseURI, RDFFormat dataFormat, Resource.. * @throws RepositoryException If the data could not be added to the repository, for example because the * repository is not writable. */ - public void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts) + void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException; /** @@ -709,7 +743,7 @@ public void add(Reader reader, String baseURI, RDFFormat dataFormat, Resource... * @throws RepositoryException If the data could not be added to the repository, for example because the * repository is not writable. */ - public void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts) + void add(URL url, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException; /** @@ -730,7 +764,7 @@ public void add(URL url, String baseURI, RDFFormat dataFormat, Resource... conte * @throws RepositoryException If the data could not be added to the repository, for example because the * repository is not writable. */ - public void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) + void add(File file, String baseURI, RDFFormat dataFormat, Resource... contexts) throws IOException, RDFParseException, RepositoryException; /** @@ -748,7 +782,7 @@ public void add(File file, String baseURI, RDFFormat dataFormat, Resource... con * @throws RepositoryException If the data could not be added to the repository, for example because the repository * is not writable. */ - public void add(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException; + void add(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException; /** * Adds a statement with the specified subject, predicate and object to this repository, optionally to one or more @@ -767,7 +801,7 @@ public void add(File file, String baseURI, RDFFormat dataFormat, Resource... con * @deprecated since 2.0. Use {@link #add(Resource, IRI, Value, Resource...)} instead. */ @Deprecated - public default void add(Resource subject, URI predicate, Value object, Resource... contexts) + default void add(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException { this.add(subject, (IRI) predicate, object, contexts); } @@ -784,7 +818,7 @@ public default void add(Resource subject, URI predicate, Value object, Resource. * @throws RepositoryException If the statement could not be added to the repository, for example because the * repository is not writable. */ - public void add(Statement st, Resource... contexts) throws RepositoryException; + void add(Statement st, Resource... contexts) throws RepositoryException; /** * Adds the supplied statements to this repository, optionally to one or more named contexts. @@ -798,7 +832,7 @@ public default void add(Resource subject, URI predicate, Value object, Resource. * @throws RepositoryException If the statements could not be added to the repository, for example because the * repository is not writable. */ - public void add(Iterable statements, Resource... contexts) throws RepositoryException; + void add(Iterable statements, Resource... contexts) throws RepositoryException; /** * Adds the supplied statements to this repository, optionally to one or more named contexts. @@ -814,7 +848,7 @@ public default void add(Resource subject, URI predicate, Value object, Resource. * @throws RepositoryException If the statements could not be added to the repository, for example because the * repository is not writable. */ - public void add(Iteration statements, Resource... contexts) + void add(Iteration statements, Resource... contexts) throws RepositoryException, E; /** @@ -846,7 +880,7 @@ default void add(RepositoryResult statements, Resource... contexts) * @throws RepositoryException If the statement(s) could not be removed from the repository, for example because the * repository is not writable. */ - public void remove(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException; + void remove(Resource subject, IRI predicate, Value object, Resource... contexts) throws RepositoryException; /** * Removes the statement(s) with the specified subject, predicate and object from the repository, optionally @@ -862,7 +896,7 @@ default void add(RepositoryResult statements, Resource... contexts) * @deprecated since 2.0. Use {@link #remove(Resource, IRI, Value, Resource...)} instead. */ @Deprecated - public default void remove(Resource subject, URI predicate, Value object, Resource... contexts) + default void remove(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException { this.remove(subject, (IRI) predicate, object, contexts); } @@ -877,7 +911,7 @@ public default void remove(Resource subject, URI predicate, Value object, Resour * @throws RepositoryException If the statement could not be removed from the repository, for example because the * repository is not writable. */ - public void remove(Statement st, Resource... contexts) throws RepositoryException; + void remove(Statement st, Resource... contexts) throws RepositoryException; /** * Removes the supplied statements from the specified contexts in this repository. @@ -889,7 +923,7 @@ public default void remove(Resource subject, URI predicate, Value object, Resour * @throws RepositoryException If the statements could not be added to the repository, for example because the * repository is not writable. */ - public void remove(Iterable statements, Resource... contexts) throws RepositoryException; + void remove(Iterable statements, Resource... contexts) throws RepositoryException; /** * Removes the supplied statements from a specific context in this repository, ignoring any context information @@ -904,7 +938,7 @@ public default void remove(Resource subject, URI predicate, Value object, Resour * @throws RepositoryException If the statements could not be removed from the repository, for example because the * repository is not writable. */ - public void remove(Iteration statements, Resource... contexts) + void remove(Iteration statements, Resource... contexts) throws RepositoryException, E; /** @@ -932,7 +966,7 @@ default void remove(RepositoryResult statements, Resource... contexts * @throws RepositoryException If the statements could not be removed from the repository, for example because the * repository is not writable. */ - public void clear(Resource... contexts) throws RepositoryException; + void clear(Resource... contexts) throws RepositoryException; /** * Gets all declared namespaces as a RepositoryResult of {@link Namespace} objects. Each Namespace object consists @@ -942,7 +976,7 @@ default void remove(RepositoryResult statements, Resource... contexts * use. * @throws RepositoryException If the namespaces could not be read from the repository. */ - public RepositoryResult getNamespaces() throws RepositoryException; + RepositoryResult getNamespaces() throws RepositoryException; /** * Gets the namespace that is associated with the specified prefix, if any. @@ -953,7 +987,7 @@ default void remove(RepositoryResult statements, Resource... contexts * @throws RepositoryException If the namespace could not be read from the repository. * @throws NullPointerException In case prefix is null. */ - public String getNamespace(String prefix) throws RepositoryException; + String getNamespace(String prefix) throws RepositoryException; /** * Sets the prefix for a namespace. @@ -964,7 +998,7 @@ default void remove(RepositoryResult statements, Resource... contexts * repository is not writable. * @throws NullPointerException In case prefix or name is null. */ - public void setNamespace(String prefix, String name) throws RepositoryException; + void setNamespace(String prefix, String name) throws RepositoryException; /** * Removes a namespace declaration by removing the association between a prefix and a namespace name. @@ -973,13 +1007,13 @@ default void remove(RepositoryResult statements, Resource... contexts * @throws RepositoryException If the namespace prefix could not be removed. * @throws NullPointerException In case prefix is null. */ - public void removeNamespace(String prefix) throws RepositoryException; + void removeNamespace(String prefix) throws RepositoryException; /** * Removes all namespace declarations from the repository. * * @throws RepositoryException If the namespace declarations could not be removed. */ - public void clearNamespaces() throws RepositoryException; + void clearNamespaces() throws RepositoryException; } diff --git a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/base/RepositoryConnectionWrapper.java b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/base/RepositoryConnectionWrapper.java index def4175bcd4..7048133774b 100644 --- a/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/base/RepositoryConnectionWrapper.java +++ b/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/base/RepositoryConnectionWrapper.java @@ -15,6 +15,7 @@ import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.common.iteration.Iteration; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Namespace; import org.eclipse.rdf4j.model.Resource; @@ -458,6 +459,11 @@ public void begin(IsolationLevel level) throws RepositoryException { getDelegate().begin(level); } + @Override + public void begin(TransactionSetting... settings) { + getDelegate().begin(settings); + } + @Override public void setIsolationLevel(IsolationLevel level) throws IllegalStateException { getDelegate().setIsolationLevel(level); diff --git a/core/repository/http/src/main/java/org/eclipse/rdf4j/repository/http/HTTPRepositoryConnection.java b/core/repository/http/src/main/java/org/eclipse/rdf4j/repository/http/HTTPRepositoryConnection.java index 87ad8181b9d..e7c8aab0500 100644 --- a/core/repository/http/src/main/java/org/eclipse/rdf4j/repository/http/HTTPRepositoryConnection.java +++ b/core/repository/http/src/main/java/org/eclipse/rdf4j/repository/http/HTTPRepositoryConnection.java @@ -28,6 +28,7 @@ import org.eclipse.rdf4j.OpenRDFUtil; import org.eclipse.rdf4j.RDF4JException; import org.eclipse.rdf4j.common.iteration.CloseableIteratorIteration; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.http.client.HttpClientDependent; import org.eclipse.rdf4j.http.client.RDF4JProtocolSession; import org.eclipse.rdf4j.http.protocol.Protocol; @@ -165,6 +166,27 @@ public void begin() throws RepositoryException { } } + @Override + public void begin(TransactionSetting... settings) { + verifyIsOpen(); + verifyNotTxnActive("Connection already has an active transaction"); + + if (this.getRepository().useCompatibleMode()) { + active = true; + return; + } + + try { + client.beginTransaction(settings); + active = true; + } catch (RepositoryException e) { + throw e; + } catch (RDF4JException | IllegalStateException | IOException e) { + throw new RepositoryException(e); + } + + } + /** * Prepares a {@Link Query} for evaluation on this repository. Note that the preferred way of preparing queries is * to use the more specific {@link #prepareTupleQuery(QueryLanguage, String, String)}, diff --git a/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/SailRepositoryConnection.java b/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/SailRepositoryConnection.java index 1c63fece4ee..0f7709be50f 100644 --- a/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/SailRepositoryConnection.java +++ b/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/SailRepositoryConnection.java @@ -7,15 +7,15 @@ *******************************************************************************/ package org.eclipse.rdf4j.repository.sail; -import java.io.IOException; -import java.io.StringReader; -import java.util.List; +import java.util.Arrays; +import java.util.Objects; import java.util.Optional; import org.apache.http.client.HttpClient; import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.OpenRDFUtil; import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.http.client.HttpClientDependent; import org.eclipse.rdf4j.http.client.HttpClientSessionManager; import org.eclipse.rdf4j.http.client.SessionManagerDependent; @@ -28,10 +28,7 @@ import org.eclipse.rdf4j.query.Query; import org.eclipse.rdf4j.query.QueryLanguage; import org.eclipse.rdf4j.query.Update; -import org.eclipse.rdf4j.query.algebra.DeleteData; -import org.eclipse.rdf4j.query.algebra.InsertData; import org.eclipse.rdf4j.query.algebra.TupleExpr; -import org.eclipse.rdf4j.query.algebra.UpdateExpr; import org.eclipse.rdf4j.query.algebra.evaluation.federation.FederatedServiceResolver; import org.eclipse.rdf4j.query.algebra.evaluation.federation.FederatedServiceResolverClient; import org.eclipse.rdf4j.query.parser.ParsedBooleanQuery; @@ -40,7 +37,6 @@ import org.eclipse.rdf4j.query.parser.ParsedTupleQuery; import org.eclipse.rdf4j.query.parser.ParsedUpdate; import org.eclipse.rdf4j.query.parser.QueryParserUtil; -import org.eclipse.rdf4j.query.parser.sparql.SPARQLUpdateDataBlockParser; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.repository.RepositoryException; import org.eclipse.rdf4j.repository.RepositoryReadOnlyException; @@ -146,7 +142,14 @@ public void setHttpClient(HttpClient client) { @Override public void begin() throws RepositoryException { try { - sailConnection.begin(getIsolationLevel()); + // always call receiveTransactionSettings(...) before calling begin(); + sailConnection.setTransactionSettings(new TransactionSetting[0]); + + if (getIsolationLevel() != null) { + sailConnection.begin(getIsolationLevel()); + } else { + sailConnection.begin(); + } } catch (SailException e) { throw new RepositoryException(e); } @@ -155,7 +158,41 @@ public void begin() throws RepositoryException { @Override public void begin(IsolationLevel level) throws RepositoryException { try { - sailConnection.begin(level); + // always call receiveTransactionSettings(...) before calling begin(); + sailConnection.setTransactionSettings(new TransactionSetting[0]); + + if (level != null) { + sailConnection.begin(level); + } else { + sailConnection.begin(); + } + } catch (SailException e) { + throw new RepositoryException(e); + } + } + + @Override + public void begin(TransactionSetting... settings) { + try { + // Asserts to catch any of these issues in our tests. These asserts don't run in production since they are + // slow. Nulls in the transaction settings or multiple isolation levels have undefined behaviour. + assert Arrays.stream(settings).noneMatch(Objects::isNull) : "No transaction settings should be null!"; + assert Arrays.stream(settings) + .filter(setting -> setting instanceof IsolationLevel) + .count() <= 1 : "There should never be more than one isolation level"; + + sailConnection.setTransactionSettings(settings); + + for (TransactionSetting setting : settings) { + if (setting instanceof IsolationLevel) { + sailConnection.begin((IsolationLevel) setting); + return; + } + } + + // if none of the transaction settings are isolation levels + sailConnection.begin(); + } catch (SailException e) { throw new RepositoryException(e); } diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnection.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnection.java index bdb20fffdca..d1c68169c8a 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnection.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/SPARQLConnection.java @@ -23,6 +23,7 @@ import org.eclipse.rdf4j.common.iteration.ExceptionConvertingIteration; import org.eclipse.rdf4j.common.iteration.Iteration; import org.eclipse.rdf4j.common.iteration.SingletonIteration; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.http.client.HttpClientDependent; import org.eclipse.rdf4j.http.client.SPARQLProtocolSession; import org.eclipse.rdf4j.model.BNode; diff --git a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/Sail.java b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/Sail.java index 81ecab67056..82cd8028401 100644 --- a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/Sail.java +++ b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/Sail.java @@ -105,4 +105,5 @@ default void init() throws SailException { * returned by {@link #getConnection()}. */ IsolationLevel getDefaultIsolationLevel(); + } diff --git a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/SailConnection.java b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/SailConnection.java index e31fd5d31da..61433279af8 100644 --- a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/SailConnection.java +++ b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/SailConnection.java @@ -12,6 +12,7 @@ import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.common.annotation.Experimental; import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Namespace; import org.eclipse.rdf4j.model.Resource; @@ -187,6 +188,22 @@ default boolean hasStatement(Resource subj, IRI pred, Value obj, boolean include */ void begin(IsolationLevel level) throws UnknownSailTransactionStateException, SailException; + /** + * Pass any transaction-specific settings to the SailConnection. This method needs to be called before the + * transaction is {@link #begin() started }. + *

+ * Sail implementations can override this method to receive the transaction settings (to inspect and/or pass them + * along to any wrapped sail objects). Remember to call super.setTransactionSettings(settings) if you + * override this method. + * + * @param settings the transaction settings on which the next transaction operates. It may or may not contain the + * isolation level. + * @since 3.3.0 + */ + default void setTransactionSettings(TransactionSetting... settings) { + + } + /** * Flushes any pending updates and notify changes to listeners as appropriate. This is an optional call; calling or * not calling this method should have no effect on the outcome of other calls. This method exists to give the @@ -477,4 +494,5 @@ default Explanation explain(Explanation.Level level, TupleExpr tupleExpr, Datase BindingSet bindings, boolean includeInferred, int timeoutSeconds) { throw new UnsupportedOperationException(); } + } diff --git a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/AbstractSailConnection.java b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/AbstractSailConnection.java index 1906d2bedcc..b7517bd85a2 100644 --- a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/AbstractSailConnection.java +++ b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/AbstractSailConnection.java @@ -8,15 +8,18 @@ package org.eclipse.rdf4j.sail.helpers; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.IdentityHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.stream.Collectors; import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.IsolationLevels; @@ -145,20 +148,20 @@ protected void verifyIsActive() throws SailException { @Override public void begin() throws SailException { - begin(null); + begin(sailBase.getDefaultIsolationLevel()); } @Override - public void begin(IsolationLevel level) throws SailException { - if (level == null) { - level = this.sailBase.getDefaultIsolationLevel(); + public void begin(IsolationLevel isolationLevel) throws SailException { + if (isolationLevel == null) { + isolationLevel = sailBase.getDefaultIsolationLevel(); } - IsolationLevel compatibleLevel = IsolationLevels.getCompatibleIsolationLevel(level, - this.sailBase.getSupportedIsolationLevels()); + IsolationLevel compatibleLevel = IsolationLevels.getCompatibleIsolationLevel(isolationLevel, + sailBase.getSupportedIsolationLevels()); if (compatibleLevel == null) { throw new UnknownSailTransactionStateException( - "Isolation level " + level + " not compatible with this Sail"); + "Isolation level " + isolationLevel + " not compatible with this Sail"); } this.transactionIsolationLevel = compatibleLevel; @@ -378,6 +381,7 @@ public final void commit() throws SailException { if (isActive()) { endUpdate(null); } + connectionLock.readLock().lock(); try { verifyIsOpen(); @@ -686,6 +690,7 @@ protected boolean pendingAdds() { /** * @deprecated Use {@link #connectionLock} directly instead. */ + @Deprecated protected org.eclipse.rdf4j.common.concurrent.locks.Lock getSharedConnectionLock() throws SailException { return new JavaLock(connectionLock.readLock()); } @@ -693,6 +698,7 @@ protected org.eclipse.rdf4j.common.concurrent.locks.Lock getSharedConnectionLock /** * @deprecated Use {@link #connectionLock} directly instead. */ + @Deprecated protected org.eclipse.rdf4j.common.concurrent.locks.Lock getExclusiveConnectionLock() throws SailException { return new JavaLock(connectionLock.writeLock()); } diff --git a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/SailConnectionWrapper.java b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/SailConnectionWrapper.java index 30dab2fc6ce..d143b8d50e5 100644 --- a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/SailConnectionWrapper.java +++ b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/SailConnectionWrapper.java @@ -11,6 +11,7 @@ import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Namespace; import org.eclipse.rdf4j.model.Resource; @@ -45,7 +46,7 @@ public class SailConnectionWrapper implements SailConnection, FederatedServiceRe /** * The wrapped SailConnection. */ - private SailConnection wrappedCon; + private final SailConnection wrappedCon; /*--------------* * Constructors * @@ -216,6 +217,11 @@ public void begin(IsolationLevel level) throws SailException { wrappedCon.begin(level); } + @Override + public void setTransactionSettings(TransactionSetting... settings) { + wrappedCon.setTransactionSettings(settings); + } + @Override public void flush() throws SailException { wrappedCon.flush(); @@ -230,4 +236,5 @@ public void prepare() throws SailException { public boolean isActive() throws UnknownSailTransactionStateException { return wrappedCon.isActive(); } + } diff --git a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/SailWrapper.java b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/SailWrapper.java index 108f54b3e0a..856def73f22 100644 --- a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/SailWrapper.java +++ b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/SailWrapper.java @@ -131,4 +131,5 @@ public IsolationLevel getDefaultIsolationLevel() { verifyBaseSailSet(); return baseSail.getDefaultIsolationLevel(); } + } diff --git a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStore.java b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStore.java index 3c08fe11664..59ad5ec687d 100644 --- a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStore.java +++ b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleStore.java @@ -155,5 +155,4 @@ public EvaluationStatisticsEnum getEvaluationStatisticsType() { public ExtensibleStatementHelper getExtensibleStatementHelper() { return ExtensibleStatementHelper.getDefaultImpl(); } - } diff --git a/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/Federation.java b/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/Federation.java index 820298504b0..10097af73d5 100644 --- a/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/Federation.java +++ b/core/sail/federation/src/main/java/org/eclipse/rdf4j/sail/federation/Federation.java @@ -359,4 +359,5 @@ public List getSupportedIsolationLevels() { public IsolationLevel getDefaultIsolationLevel() { return IsolationLevels.NONE; } + } diff --git a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/AbstractForwardChainingInferencerConnection.java b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/AbstractForwardChainingInferencerConnection.java index 3b7e336e182..9ccd7c13748 100644 --- a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/AbstractForwardChainingInferencerConnection.java +++ b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/AbstractForwardChainingInferencerConnection.java @@ -114,14 +114,11 @@ public void flushUpdates() throws SailException { @Override public void begin() throws SailException { - this.begin(null); + this.begin(sail.getDefaultIsolationLevel()); } @Override public void begin(IsolationLevel level) throws SailException { - if (level == null) { - level = sail.getDefaultIsolationLevel(); - } IsolationLevel compatibleLevel = IsolationLevels.getCompatibleIsolationLevel(level, sail.getSupportedIsolationLevels()); diff --git a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerConnection.java b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerConnection.java index 7a12166643c..b7a84977a75 100644 --- a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerConnection.java +++ b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/SchemaCachingRDFSInferencerConnection.java @@ -767,7 +767,7 @@ public void rollback() @Override public void begin() throws SailException { - this.begin(null); + this.begin(sail.getDefaultIsolationLevel()); } @Override diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java index 85598236850..39933bcdb31 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/NodeShape.java @@ -109,7 +109,7 @@ public Stream generatePlans(ConnectionsGroup connectionsGroup, NodeSha SailConnection removedStatements; if (validateEntireBaseSail) { - if (connectionsGroup.getSail().isCacheSelectNodes()) { + if (connectionsGroup.getTransactionSettings().isCacheSelectNodes()) { PlanNode overrideTargetNode = getPlan(connectionsGroup, printPlans, null, false, false); overrideTargetNodeBufferedSplitter = new BufferedSplitter(overrideTargetNode); } else { @@ -285,7 +285,7 @@ public static List getShapes(SailRepositoryConnection connection, Sha if (shaclSail.isUndefinedTargetValidatesAllSubjects() && propertyShapes.isEmpty()) { logger.info( - "isUndefinedTargetValidatesAllSubjects() is deprecated, please use .setExperimentalDashSupport(true) and use the custom targets from http://datashapes.org/dash#AllSubjectsTarget"); + "isUndefinedTargetValidatesAllSubjects() is deprecated, please use .setDashDataShapes(true) and use the custom targets from http://datashapes.org/dash#AllSubjectsTarget"); propertyShapes .add(new NodeShape(shapeId, shaclSail, connection, shaclProperties.isDeactivated())); diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/OrPropertyShape.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/OrPropertyShape.java index 49273a99475..170684d0cae 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/OrPropertyShape.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/AST/OrPropertyShape.java @@ -131,7 +131,7 @@ public PlanNode getPlan(ConnectionsGroup connectionsGroup, boolean printPlans, targetNodesToValidate = new BufferedSplitter(new Unique(unionAll(collect))); } else { - if (connectionsGroup.getSail().isCacheSelectNodes()) { + if (connectionsGroup.getTransactionSettings().isCacheSelectNodes()) { targetNodesToValidate = new BufferedSplitter(overrideTargetNode.getPlanNode()); } else { targetNodesToValidate = overrideTargetNode; diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ConnectionsGroup.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ConnectionsGroup.java index 197680354b8..0f16d6cd5c6 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ConnectionsGroup.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ConnectionsGroup.java @@ -14,6 +14,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; import org.eclipse.rdf4j.common.annotation.InternalUseOnly; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.sail.Sail; import org.eclipse.rdf4j.sail.SailConnection; import org.eclipse.rdf4j.sail.shacl.planNodes.BufferedSplitter; @@ -29,14 +30,14 @@ @InternalUseOnly public class ConnectionsGroup implements Closeable { - private final ShaclSail sail; - private final SailConnection baseConnection; private final SailConnection previousStateConnection; private final Sail addedStatements; private final Sail removedStatements; + private final ShaclSailConnection.Settings transactionSettings; + private final Stats stats; private final RdfsSubClassOfReasonerProvider rdfsSubClassOfReasonerProvider; @@ -46,16 +47,17 @@ public class ConnectionsGroup implements Closeable { // used to cache Select plan nodes so that we don't query a store for the same data during the same validation step. private final Map selectNodeCache = new HashMap<>(); - ConnectionsGroup(ShaclSail sail, SailConnection baseConnection, + ConnectionsGroup(SailConnection baseConnection, SailConnection previousStateConnection, Sail addedStatements, Sail removedStatements, - Stats stats, RdfsSubClassOfReasonerProvider rdfsSubClassOfReasonerProvider) { - this.sail = sail; + Stats stats, RdfsSubClassOfReasonerProvider rdfsSubClassOfReasonerProvider, + ShaclSailConnection.Settings transactionSettings) { this.baseConnection = baseConnection; this.previousStateConnection = previousStateConnection; this.addedStatements = addedStatements; this.removedStatements = removedStatements; this.stats = stats; this.rdfsSubClassOfReasonerProvider = rdfsSubClassOfReasonerProvider; + this.transactionSettings = transactionSettings; } public SailConnection getPreviousStateConnection() { @@ -81,17 +83,13 @@ public void close() { } } - public ShaclSail getSail() { - return sail; - } - public SailConnection getBaseConnection() { return baseConnection; } synchronized public PlanNode getCachedNodeFor(PlanNode select) { - if (!sail.isCacheSelectNodes()) { + if (!transactionSettings.isCacheSelectNodes()) { return select; } @@ -108,6 +106,10 @@ public Stats getStats() { return stats; } + public ShaclSailConnection.Settings getTransactionSettings() { + return transactionSettings; + } + interface RdfsSubClassOfReasonerProvider { RdfsSubClassOfReasoner getRdfsSubClassOfReasoner(); } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java index 5e8d86f22ca..caf57af0947 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSail.java @@ -26,10 +26,12 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.io.IOUtils; +import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.IsolationLevels; import org.eclipse.rdf4j.common.annotation.Experimental; import org.eclipse.rdf4j.common.concurrent.locks.Lock; import org.eclipse.rdf4j.common.concurrent.locks.ReadPrefReadWriteLockManager; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Statement; import org.eclipse.rdf4j.model.vocabulary.DASH; @@ -886,8 +888,9 @@ public long getValidationResultsLimitPerConstraint() { * @return the effective limit per constraint with an upper bound of the total limit */ public long getEffectiveValidationResultsLimitPerConstraint() { - if (validationResultsLimitPerConstraint < 0) + if (validationResultsLimitPerConstraint < 0) { return validationResultsLimitTotal; + } if (validationResultsLimitTotal >= 0) { return Math.min(validationResultsLimitTotal, validationResultsLimitPerConstraint); } @@ -929,4 +932,47 @@ public long getValidationResultsLimitTotal() { public void setValidationResultsLimitTotal(long validationResultsLimitTotal) { this.validationResultsLimitTotal = validationResultsLimitTotal; } + + @Override + public IsolationLevel getDefaultIsolationLevel() { + return super.getDefaultIsolationLevel(); + } + + public static class TransactionSettings { + + public enum ValidationApproach implements TransactionSetting { + + Disabled("Disabled"), + Auto("Auto"), + Bulk("Bulk"); + + private final String value; + + ValidationApproach(String value) { + this.value = value; + } + + @Override + public String getName() { + return ValidationApproach.class.getCanonicalName(); + } + + @Override + public String getValue() { + return value; + } + + } + + private final String value; + + TransactionSettings(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + } + } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java index 353d79dc560..d236cb28323 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ShaclSailConnection.java @@ -22,6 +22,7 @@ import org.eclipse.rdf4j.IsolationLevels; import org.eclipse.rdf4j.common.concurrent.locks.Lock; import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; @@ -80,8 +81,6 @@ public class ShaclSailConnection extends NotifyingSailConnectionWrapper implemen private final SailRepositoryConnection shapesRepoConnection; - private boolean validationReportTruncated; - // write lock private Lock writeLock; @@ -90,6 +89,9 @@ public class ShaclSailConnection extends NotifyingSailConnectionWrapper implemen private IsolationLevel currentIsolationLevel = null; + private Settings transactionSettings; + private TransactionSetting[] transactionSettingsRaw = new TransactionSetting[0]; + ShaclSailConnection(ShaclSail sail, NotifyingSailConnection connection, SailConnection previousStateConnection, SailConnection serializableConnection, SailConnection previousStateSerializableConnection, @@ -100,8 +102,17 @@ public class ShaclSailConnection extends NotifyingSailConnectionWrapper implemen this.previousStateSerializableConnection = previousStateSerializableConnection; this.shapesRepoConnection = shapesRepoConnection; this.sail = sail; + this.transactionSettings = getDefaultSettings(sail); + } - setupConnectionListener(); + private Settings getDefaultSettings(ShaclSail sail) { + return new Settings(sail.isCacheSelectNodes(), sail.isValidationEnabled()); + } + + @Override + public void setTransactionSettings(TransactionSetting... settings) { + super.setTransactionSettings(settings); + this.transactionSettingsRaw = settings; } @Override @@ -111,7 +122,18 @@ public void begin() throws SailException { @Override public void begin(IsolationLevel level) throws SailException { + currentIsolationLevel = level; + + transactionSettings = getDefaultSettings(sail); + Arrays.stream(transactionSettingsRaw) + .filter(Objects::nonNull) + .forEach(setting -> { + if (setting instanceof ShaclSail.TransactionSettings.ValidationApproach) { + transactionSettings.validationApproach = (ShaclSail.TransactionSettings.ValidationApproach) setting; + } + }); + assert addedStatements == null; assert removedStatements == null; @@ -122,29 +144,41 @@ public void begin(IsolationLevel level) throws SailException { synchronized (sail) { super.begin(level); hasStatement(null, null, null, false); // actually force a transaction to start - shapesRepoConnection.begin(level); - previousStateConnection.begin(level); + shapesRepoConnection.begin(currentIsolationLevel); + previousStateConnection.begin(currentIsolationLevel); previousStateConnection.hasStatement(null, null, null, false); // actually force a transaction to start - } stats.setBaseSailEmpty(isEmpty()); - if (stats.isBaseSailEmpty()) { + + if (transactionSettings.getValidationApproach() == ShaclSail.TransactionSettings.ValidationApproach.Disabled || + transactionSettings.getValidationApproach() == ShaclSail.TransactionSettings.ValidationApproach.Bulk) { + removeConnectionListener(this); + } else if (stats.isBaseSailEmpty()) { removeConnectionListener(this); - connectionListenerActive = false; } else { - setupConnectionListener(); + addConnectionListener(this); } - validationReportTruncated = false; + } + @Override + public void addConnectionListener(SailConnectionListener listener) { + if (!connectionListenerActive && isValidationEnabled()) { + super.addConnectionListener(this); + connectionListenerActive = true; + } } - private void setupConnectionListener() { - if (!connectionListenerActive && sail.isValidationEnabled()) { - addConnectionListener(this); + boolean isValidationEnabled() { + return transactionSettings.getValidationApproach() != ShaclSail.TransactionSettings.ValidationApproach.Disabled; + } + + @Override + public void removeConnectionListener(SailConnectionListener listener) { + super.removeConnectionListener(listener); + connectionListenerActive = false; - } } private Sail getNewMemorySail() { @@ -160,6 +194,7 @@ public void commit() throws SailException { if (!preparedHasRun) { prepare(); } + long before = 0; if (sail.isPerformanceLogging()) { before = System.currentTimeMillis(); @@ -307,7 +342,7 @@ private void refreshShapes() { private ValidationReport validate(List nodeShapes, boolean validateEntireBaseSail) { try { - if (!sail.isValidationEnabled()) { + if (!isValidationEnabled()) { return new ValidationReport(true); } @@ -322,7 +357,7 @@ private ValidationReport validate(List nodeShapes, boolean validateEn private void prepareValidation() { - if (!sail.isValidationEnabled()) { + if (!isValidationEnabled()) { return; } @@ -336,17 +371,15 @@ private void prepareValidation() { ConnectionsGroup getConnectionsGroup() { - return new ConnectionsGroup(sail, new VerySimpleRdfsBackwardsChainingConnection(this, rdfsSubClassOfReasoner), + return new ConnectionsGroup(new VerySimpleRdfsBackwardsChainingConnection(this, rdfsSubClassOfReasoner), previousStateConnection, addedStatements, removedStatements, stats, - this::getRdfsSubClassOfReasoner); + this::getRdfsSubClassOfReasoner, transactionSettings); } private ValidationReport performValidation(List nodeShapes, boolean validateEntireBaseSail, ConnectionsGroup connectionsGroup) { long beforeValidation = 0; - ShaclSail sail = connectionsGroup.getSail(); - if (sail.isPerformanceLogging()) { beforeValidation = System.currentTimeMillis(); } @@ -414,10 +447,10 @@ private ValidationReport performValidation(List nodeShapes, boolean v List validationResultIterators; - if (sail.isParallelValidation()) { + if (isParallelValidation()) { validationResultIterators = callableStream - .map(sail::submitRunnableToExecutorService) + .map(this.sail::submitRunnableToExecutorService) // Creating a list is needed to actually make things run multi-threaded, without this the // laziness of java streams will make this run serially .collect(Collectors.toList()) @@ -452,6 +485,11 @@ private ValidationReport performValidation(List nodeShapes, boolean v } } + private boolean isParallelValidation() { + // bulk validation should use little memory so should not run validation in parallel + return sail.isParallelValidation() && !isBulkValidation(); + } + void fillAddedAndRemovedStatementRepositories() { long before = 0; @@ -573,8 +611,10 @@ public void prepare() throws SailException { before = System.currentTimeMillis(); } - boolean useSerializableValidation = sail.isSerializableValidation() - && currentIsolationLevel == IsolationLevels.SNAPSHOT; + boolean useSerializableValidation = sail.isSerializableValidation() && + currentIsolationLevel == IsolationLevels.SNAPSHOT && + !isBulkValidation() && + isValidationEnabled(); if (useSerializableValidation) { if (!(writeLock != null && writeLock.isActive())) { @@ -595,14 +635,16 @@ public void prepare() throws SailException { stats.setEmpty(isEmpty()); - if (addedStatementsSet.isEmpty() && removedStatementsSet.isEmpty() && !shapesModifiedInCurrentTransaction) { + if (connectionListenerActive && addedStatementsSet.isEmpty() && removedStatementsSet.isEmpty() + && !shapesModifiedInCurrentTransaction) { if (!(stats.isBaseSailEmpty() && !stats.isEmpty())) { logger.debug("Nothing has changed, nothing to validate."); return; } } - if (shapesModifiedInCurrentTransaction && addedStatementsSet.isEmpty() && removedStatementsSet.isEmpty()) { + if (shapesModifiedInCurrentTransaction && addedStatementsSet.isEmpty() && removedStatementsSet.isEmpty() + && !isBulkValidation()) { // we can optimize which shapes to revalidate since no data has changed. assert nodeShapesBeforeRefresh != nodeShapesAfterRefresh; @@ -635,7 +677,9 @@ public void prepare() throws SailException { // readLock = sail.convertToReadLock(writeLock); // writeLock = null; // } - invalidTuples = validate(nodeShapesAfterRefresh, shapesModifiedInCurrentTransaction); + + invalidTuples = validate(nodeShapesAfterRefresh, + shapesModifiedInCurrentTransaction || isBulkValidation()); } boolean valid = invalidTuples.conforms(); @@ -648,6 +692,7 @@ public void prepare() throws SailException { if (!valid) { throw new ShaclSailValidationException(invalidTuples); } + } finally { if (readLock != null) { @@ -663,13 +708,17 @@ public void prepare() throws SailException { } + private boolean isBulkValidation() { + return transactionSettings.getValidationApproach() == ShaclSail.TransactionSettings.ValidationApproach.Bulk; + } + private ValidationReport serializableValidation(List nodeShapesAfterRefresh) { try { try { - try (ConnectionsGroup connectionsGroup = new ConnectionsGroup(sail, + try (ConnectionsGroup connectionsGroup = new ConnectionsGroup( new VerySimpleRdfsBackwardsChainingConnection(serializableConnection, rdfsSubClassOfReasoner), previousStateSerializableConnection, addedStatements, removedStatements, stats, - () -> getRdfsSubClassOfReasoner())) { + this::getRdfsSubClassOfReasoner, transactionSettings)) { connectionsGroup.getBaseConnection().begin(IsolationLevels.SNAPSHOT); // actually force a transaction to start @@ -695,7 +744,7 @@ private ValidationReport serializableValidation(List nodeShapesAfterR serializableConnection.flush(); return performValidation(nodeShapesAfterRefresh, - shapesModifiedInCurrentTransaction, connectionsGroup); + shapesModifiedInCurrentTransaction || isBulkValidation(), connectionsGroup); } finally { serializableConnection.rollback(); @@ -782,4 +831,25 @@ public ValidationReport revalidate() { return new ShaclSailValidationException(validate).getValidationReport(); } + public static class Settings { + + private ShaclSail.TransactionSettings.ValidationApproach validationApproach = ShaclSail.TransactionSettings.ValidationApproach.Auto; + private boolean cacheSelectedNodes = false; + + public Settings(boolean cacheSelectNodes, boolean validationEnabled) { + this.cacheSelectedNodes = cacheSelectNodes; + if (!validationEnabled) + validationApproach = ShaclSail.TransactionSettings.ValidationApproach.Disabled; + } + + public ShaclSail.TransactionSettings.ValidationApproach getValidationApproach() { + return validationApproach; + } + + public boolean isCacheSelectNodes() { + return cacheSelectedNodes && validationApproach != ShaclSail.TransactionSettings.ValidationApproach.Bulk; + } + + } + } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ValidationApproachFactory.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ValidationApproachFactory.java new file mode 100644 index 00000000000..20a7aaa0ee8 --- /dev/null +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ValidationApproachFactory.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl; + +import java.util.Optional; + +import org.eclipse.rdf4j.common.transaction.TransactionSetting; +import org.eclipse.rdf4j.common.transaction.TransactionSettingFactory; +import org.eclipse.rdf4j.sail.shacl.ShaclSail.TransactionSettings.ValidationApproach; + +/** + * Factory class for producing instances of {@link ValidationApproach} from string values. + * + * @author Jeen Broekstra + * + */ +public class ValidationApproachFactory implements TransactionSettingFactory { + + @Override + public String getName() { + return ValidationApproach.class.getCanonicalName(); + } + + @Override + public Optional getTransactionSetting(String value) { + try { + return Optional.of(ValidationApproach.valueOf(value)); + } catch (IllegalArgumentException e) { + return Optional.empty(); + } + } + +} diff --git a/core/sail/shacl/src/main/resources/META-INF/services/org.eclipse.rdf4j.common.transaction.TransactionSettingFactory b/core/sail/shacl/src/main/resources/META-INF/services/org.eclipse.rdf4j.common.transaction.TransactionSettingFactory new file mode 100644 index 00000000000..7a083a328c6 --- /dev/null +++ b/core/sail/shacl/src/main/resources/META-INF/services/org.eclipse.rdf4j.common.transaction.TransactionSettingFactory @@ -0,0 +1 @@ +org.eclipse.rdf4j.sail.shacl.ValidationApproachFactory \ No newline at end of file diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java index 3a6a49ecd09..3c746ae5c82 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/AbstractShaclTest.java @@ -48,6 +48,7 @@ import org.eclipse.rdf4j.rio.WriterConfig; import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings; import org.eclipse.rdf4j.sail.memory.MemoryStore; +import org.eclipse.rdf4j.sail.shacl.ShaclSail.TransactionSettings.ValidationApproach; import org.eclipse.rdf4j.sail.shacl.results.ValidationReport; import org.junit.AfterClass; import org.junit.runner.RunWith; @@ -539,11 +540,10 @@ static void runTestCaseRevalidate(String shaclPath, String dataPath, ExpectedRes throw new RuntimeException(e); } - ValidationReport report; + ValidationReport report = new ValidationReport(true); try (SailRepositoryConnection shaclSailConnection = shaclRepository.getConnection()) { - ((ShaclSail) shaclRepository.getSail()).disableValidation(); - shaclSailConnection.begin(isolationLevel); + shaclSailConnection.begin(isolationLevel, ValidationApproach.Disabled); URL resource = AbstractShaclTest.class.getClassLoader().getResource(dataPath); List queries = FileUtils.listFiles(new File(resource.getFile()), FILENAME_EXTENSION, false) @@ -563,12 +563,15 @@ static void runTestCaseRevalidate(String shaclPath, String dataPath, ExpectedRes shaclSailConnection.commit(); - ((ShaclSail) shaclRepository.getSail()).enableValidation(); - - shaclSailConnection.begin(); - report = ((ShaclSailConnection) shaclSailConnection.getSailConnection()).revalidate(); + shaclSailConnection.begin(ValidationApproach.Bulk); - shaclSailConnection.commit(); + try { + shaclSailConnection.commit(); + } catch (RepositoryException e) { + if (e.getCause() instanceof ShaclSailValidationException) { + report = ((ShaclSailValidationException) e.getCause()).getValidationReport(); + } + } } shaclRepository.shutDown(); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/BulkValidationSettingsTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/BulkValidationSettingsTest.java new file mode 100644 index 00000000000..0073a542f30 --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/BulkValidationSettingsTest.java @@ -0,0 +1,199 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ + +package org.eclipse.rdf4j.sail.shacl; + +import java.io.InputStream; + +import org.eclipse.rdf4j.IsolationLevels; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDF4J; +import org.eclipse.rdf4j.model.vocabulary.RDFS; +import org.eclipse.rdf4j.repository.RepositoryConnection; +import org.eclipse.rdf4j.repository.RepositoryException; +import org.eclipse.rdf4j.repository.sail.SailRepository; +import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; +import org.eclipse.rdf4j.rio.RDFFormat; +import org.eclipse.rdf4j.sail.memory.MemoryStore; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * @author Håvard Ottestad + */ +public class BulkValidationSettingsTest { + + @BeforeClass + public static void beforeClass() { + GlobalValidationExecutionLogging.loggingEnabled = false; + } + + @Test + public void testValid() throws Exception { + + SailRepository repository = new SailRepository(new ShaclSail(new MemoryStore())); + + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.NONE); + + try (InputStream shapesData = Utils.class.getClassLoader().getResourceAsStream("shacl.ttl")) { + connection.add(shapesData, "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + } + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + connection.add(RDFS.RESOURCE, RDFS.LABEL, connection.getValueFactory().createLiteral("a")); + connection.commit(); + + } + + } + + @Test(expected = ShaclSailValidationException.class) + public void testInvalid() throws Throwable { + + SailRepository repository = new SailRepository(new ShaclSail(new MemoryStore())); + + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.NONE); + + try (InputStream shapesData = Utils.class.getClassLoader().getResourceAsStream("shacl.ttl")) { + connection.add(shapesData, "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + } + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + try { + connection.commit(); + } catch (RepositoryException e) { + throw e.getCause(); + } + + } + + } + + @Test(expected = ShaclSailValidationException.class) + public void testInvalidSnapshot() throws Throwable { + + SailRepository repository = new SailRepository(new ShaclSail(new MemoryStore())); + + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.SNAPSHOT); + + try (InputStream shapesData = Utils.class.getClassLoader().getResourceAsStream("shacl.ttl")) { + connection.add(shapesData, "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + } + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + try { + connection.commit(); + } catch (RepositoryException e) { + throw e.getCause(); + } + + } + + } + + @Test + public void testInvalidRollsBackCorrectly() { + + SailRepository repository = new SailRepository(new ShaclSail(new MemoryStore())); + + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.NONE); + + try (InputStream shapesData = Utils.class.getClassLoader().getResourceAsStream("shacl.ttl")) { + connection.add(shapesData, "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + } + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + + connection.commit(); + + } catch (Exception ignored) { + + } + + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(IsolationLevels.NONE); + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + connection.commit(); + + } + + } + + @Test(expected = ShaclSailValidationException.class) + public void testValidationDisabled() throws Throwable { + + SailRepository repository = new SailRepository(new ShaclSail(new MemoryStore())); + + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Disabled); + + try (InputStream shapesData = Utils.class.getClassLoader().getResourceAsStream("shacl.ttl")) { + connection.add(shapesData, "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + } + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + + connection.commit(); + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk); + try (SailRepositoryConnection connection1 = repository.getConnection()) { + + try { + connection.commit(); + } catch (RepositoryException e) { + throw e.getCause(); + } + } + + } + + } + + @Test + public void testValidationDisabledSnapshotSerializableValidation() throws Throwable { + + SailRepository repository = new SailRepository(new ShaclSail(new MemoryStore())); + + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Disabled, IsolationLevels.SNAPSHOT); + + try (InputStream shapesData = Utils.class.getClassLoader().getResourceAsStream("shacl.ttl")) { + connection.add(shapesData, "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + } + + connection.commit(); + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.CLASS); + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Disabled, IsolationLevels.SNAPSHOT); + + try (SailRepositoryConnection connection1 = repository.getConnection()) { + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + + connection.commit(); + + } + + } + + } + +} diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TruncatedValidationReportTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TruncatedValidationReportTest.java index 2cc77acd4c8..c5c5ae3325d 100644 --- a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TruncatedValidationReportTest.java +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/TruncatedValidationReportTest.java @@ -27,6 +27,7 @@ import org.eclipse.rdf4j.repository.sail.SailRepositoryConnection; import org.eclipse.rdf4j.sail.shacl.results.ValidationReport; import org.eclipse.rdf4j.sail.shacl.results.ValidationResult; +import org.junit.BeforeClass; import org.junit.Test; /** @@ -36,6 +37,11 @@ public class TruncatedValidationReportTest { private static final int NUMBER_OF_FAILURES = 5000; + @BeforeClass + public static void beforeClass() { + GlobalValidationExecutionLogging.loggingEnabled = false; + } + @Test public void testTotal() throws IOException { SailRepository shaclRepository = Utils.getInitializedShaclRepository("shaclDatatypeAndMinCount.ttl", true); diff --git a/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationApproachFactoryTest.java b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationApproachFactoryTest.java new file mode 100644 index 00000000000..4ca248afae1 --- /dev/null +++ b/core/sail/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/ValidationApproachFactoryTest.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.sail.shacl; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.eclipse.rdf4j.common.transaction.TransactionSettingRegistry; +import org.eclipse.rdf4j.sail.shacl.ShaclSail.TransactionSettings.ValidationApproach; +import org.junit.Test; + +/** + * Unit tests for the {@link ValidationApproachFactory} class + * + * @author Jeen Broekstra + * + */ +public class ValidationApproachFactoryTest { + + @Test + public void testGetTransactionSetting() { + ValidationApproachFactory factory = new ValidationApproachFactory(); + + assertThat(factory.getTransactionSetting(ValidationApproach.Auto.getValue())).isNotEmpty(); + assertThat(factory.getTransactionSetting("unrecognized value")).isEmpty(); + } + + @Test + public void testRegistry() { + assertThat(TransactionSettingRegistry.getInstance().getAll()) + .extracting("class") + .containsOnlyOnce(ValidationApproachFactory.class); + } +} diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSetting.java b/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSetting.java new file mode 100644 index 00000000000..ad90eca015d --- /dev/null +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSetting.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.common.transaction; + +/** + * A configuration setting that can be passed at the beginning of a repository transaction to influence behavior within + * the scope of that transaction only. + * + * @author Håvard Ottestad + * @author Jeen Broekstra + */ +public interface TransactionSetting { + + /** + * The globally unique transaction settings name. Warning: do not use double underscore (__) in the name. + * + * @return the name of this setting, typically its canonical class name + */ + default String getName() { + return getClass().getCanonicalName(); + } + + /** + * The value for this transaction setting. + * + * @return a string representation of the value + */ + default String getValue() { + return this.toString(); + } + +} diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSettingFactory.java b/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSettingFactory.java new file mode 100644 index 00000000000..60e28891fa1 --- /dev/null +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSettingFactory.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.common.transaction; + +import java.util.Optional; + +/** + * A TransactionSettingFactory returns a {@link TransactionSetting} implementation for a given value. + * + * @author Jeen Broekstra + * @see TransactionSettingRegistry + * + * @since 3.3.0 + */ +public interface TransactionSettingFactory { + + /** + * Name of {@link TransactionSetting} this factory produces + * + * @return the name of the {@link TransactionSetting} produced by this factory + */ + String getName(); + + /** + * Retrieve a {@link TransactionSetting} with the supplied value. + * + * @param value the {@link TransactionSetting} value + * @return an optional {@link TransactionSetting}, empty if the factory can not produce one for the given value. + */ + Optional getTransactionSetting(String value); + +} diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSettingRegistry.java b/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSettingRegistry.java new file mode 100644 index 00000000000..3ac9d136bd1 --- /dev/null +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/TransactionSettingRegistry.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.common.transaction; + +import org.eclipse.rdf4j.common.lang.service.ServiceRegistry; + +/** + * + * A {@link ServiceRegistry} for creating/retrieving {@link TransactionSetting}s in a transparent way. + * + * @author Jeen Broekstra + * + * @since 3.3.0 + * + */ +public class TransactionSettingRegistry extends ServiceRegistry { + + /** + * Internal helper class to avoid continuous synchronized checking. + */ + private static class TransactionSettingRegistryHolder { + public static final TransactionSettingRegistry instance = new TransactionSettingRegistry(); + } + + /** + * Gets the TransactionSettingRegistry singleton. + * + * @return The registry singleton. + */ + public static TransactionSettingRegistry getInstance() { + return TransactionSettingRegistryHolder.instance; + } + + /** + * private constructor: singleton + */ + private TransactionSettingRegistry() { + super(TransactionSettingFactory.class); + } + + @Override + protected String getKey(TransactionSettingFactory factory) { + return factory.getName(); + } + +} diff --git a/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/package-info.java b/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/package-info.java new file mode 100644 index 00000000000..94bc1af8787 --- /dev/null +++ b/core/util/src/main/java/org/eclipse/rdf4j/common/transaction/package-info.java @@ -0,0 +1,4 @@ +/** + * Common classes and interfaces for transaction settings + */ +package org.eclipse.rdf4j.common.transaction; \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5c91e16d227..51a69c2fda3 100644 --- a/pom.xml +++ b/pom.xml @@ -842,6 +842,8 @@ @org.eclipse.rdf4j.common.annotation.InternalUseOnly @org.eclipse.rdf4j.common.annotation.Experimental + org.eclipse.rdf4j.IsolationLevel#getValue() + org.eclipse.rdf4j.IsolationLevel#getName() diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/Transaction.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/Transaction.java index 43b0ac55e91..da06c335860 100644 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/Transaction.java +++ b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/Transaction.java @@ -20,6 +20,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.eclipse.rdf4j.IsolationLevel; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; @@ -89,7 +90,7 @@ class Transaction implements AutoCloseable { /** * Counter of the active operations submitted to the executor */ - private AtomicInteger activeOperations = new AtomicInteger(); + private final AtomicInteger activeOperations = new AtomicInteger(); /** * Create a new Transaction for the given {@link Repository}. @@ -116,13 +117,14 @@ UUID getID() { /** * Start the transaction. * - * @param level the {@link IsolationLevel} to use for this transction. + * @param settings the {@link TransactionSetting}s to use for this transaction (including {@link IsolationLevel}). + * Optional vararg argument. * @throws InterruptedException if the transaction thread is interrupted * @throws ExecutionException if an error occurs while starting the transaction. */ - void begin(IsolationLevel level) throws InterruptedException, ExecutionException { + void begin(TransactionSetting... settings) throws InterruptedException, ExecutionException { Future result = submit(() -> { - txnConnection.begin(level); + txnConnection.begin(settings); return true; }); getFromFuture(result); @@ -157,17 +159,17 @@ void commit() throws InterruptedException, ExecutionException { /** * Prepares a query for evaluation on this transaction. * - * @param ql The {@link QueryLanguage query language} in which the query is formulated. - * @param query The query string. - * @param baseURI The base URI to resolve any relative URIs that are in the query against, can be null if - * the query does not contain any relative URIs. + * @param queryLanguage The {@link QueryLanguage query language} in which the query is formulated. + * @param query The query string. + * @param baseURI The base URI to resolve any relative URIs that are in the query against, can be + * null if the query does not contain any relative URIs. * @return A query ready to be evaluated on this repository. * @throws InterruptedException if the transaction thread is interrupted * @throws ExecutionException if an error occurs while executing the operation. */ - Query prepareQuery(QueryLanguage queryLn, String queryStr, String baseURI) + Query prepareQuery(QueryLanguage queryLanguage, String query, String baseURI) throws InterruptedException, ExecutionException { - Future result = submit(() -> txnConnection.prepareQuery(queryLn, queryStr, baseURI)); + Future result = submit(() -> txnConnection.prepareQuery(queryLanguage, query, baseURI)); return getFromFuture(result); } diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/TransactionStartController.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/TransactionStartController.java index ec800daf69d..fc5de38923b 100644 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/TransactionStartController.java +++ b/tools/server-spring/src/main/java/org/eclipse/rdf4j/http/server/repository/transaction/TransactionStartController.java @@ -10,6 +10,7 @@ import static javax.servlet.http.HttpServletResponse.SC_CREATED; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -20,6 +21,8 @@ import org.eclipse.rdf4j.IsolationLevel; import org.eclipse.rdf4j.IsolationLevels; +import org.eclipse.rdf4j.common.transaction.TransactionSetting; +import org.eclipse.rdf4j.common.transaction.TransactionSettingRegistry; import org.eclipse.rdf4j.common.webapp.views.SimpleResponseView; import org.eclipse.rdf4j.http.protocol.Protocol; import org.eclipse.rdf4j.http.server.ClientHTTPException; @@ -43,10 +46,10 @@ */ public class TransactionStartController extends AbstractController { - private Logger logger = LoggerFactory.getLogger(this.getClass()); + private final Logger logger = LoggerFactory.getLogger(this.getClass()); public TransactionStartController() throws ApplicationContextException { - setSupportedMethods(new String[] { METHOD_POST }); + setSupportedMethods(METHOD_POST); } @Override @@ -74,26 +77,55 @@ private ModelAndView startTransaction(Repository repository, HttpServletRequest ProtocolUtil.logRequestParameters(request); Map model = new HashMap<>(); - IsolationLevel isolationLevel = null; + ArrayList transactionSettings = new ArrayList<>(); + + final IsolationLevel[] isolationLevel = { null }; + + // process legacy isolation level param for backward compatibility with older clients final String isolationLevelString = request.getParameter(Protocol.ISOLATION_LEVEL_PARAM_NAME); if (isolationLevelString != null) { final IRI level = SimpleValueFactory.getInstance().createIRI(isolationLevelString); - // FIXME this needs to be adapted to accommodate custom isolation levels - // from third party stores. for (IsolationLevel standardLevel : IsolationLevels.values()) { if (standardLevel.getURI().equals(level)) { - isolationLevel = standardLevel; + isolationLevel[0] = standardLevel; break; } } } + request.getParameterMap().forEach((k, v) -> { + if (k.startsWith(Protocol.TRANSACTION_SETTINGS_PREFIX)) { + String settingsName = k.replace(Protocol.TRANSACTION_SETTINGS_PREFIX, ""); + + // FIXME we should make the isolation level an SPI impl as well so that it will work with non-standard + // isolation levels + if (settingsName.equals(IsolationLevels.NONE.getName())) { + isolationLevel[0] = IsolationLevels.valueOf(v[0]); + transactionSettings.add(isolationLevel[0]); + } else { + TransactionSettingRegistry.getInstance() + .get(settingsName) + .flatMap(factory -> factory.getTransactionSetting(v[0])) + .ifPresent(transactionSettings::add); + } + } + }); + Transaction txn = null; boolean allGood = false; try { txn = new Transaction(repository); - txn.begin(isolationLevel); + + if (transactionSettings.isEmpty()) { + if (isolationLevel[0] == null) { + txn.begin(); + } else { + txn.begin(isolationLevel[0]); + } + } else { + txn.begin(transactionSettings.toArray(new TransactionSetting[0])); + } UUID txnId = txn.getID(); diff --git a/tools/server/src/test/java/org/eclipse/rdf4j/http/server/TransactionSettingsTest.java b/tools/server/src/test/java/org/eclipse/rdf4j/http/server/TransactionSettingsTest.java new file mode 100644 index 00000000000..b62be3a18be --- /dev/null +++ b/tools/server/src/test/java/org/eclipse/rdf4j/http/server/TransactionSettingsTest.java @@ -0,0 +1,237 @@ +/******************************************************************************* + * Copyright (c) 2020 Eclipse RDF4J contributors. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Distribution License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + *******************************************************************************/ +package org.eclipse.rdf4j.http.server; + +import static org.junit.Assert.fail; + +import java.io.StringReader; + +import org.eclipse.rdf4j.IsolationLevels; +import org.eclipse.rdf4j.http.client.shacl.RemoteShaclValidationException; +import org.eclipse.rdf4j.http.protocol.Protocol; +import org.eclipse.rdf4j.model.Resource; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.model.impl.SimpleValueFactory; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDF4J; +import org.eclipse.rdf4j.model.vocabulary.RDFS; +import org.eclipse.rdf4j.repository.Repository; +import org.eclipse.rdf4j.repository.RepositoryConnection; +import org.eclipse.rdf4j.repository.RepositoryException; +import org.eclipse.rdf4j.repository.http.HTTPRepository; +import org.eclipse.rdf4j.rio.RDFFormat; +import org.eclipse.rdf4j.sail.shacl.ShaclSail; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class TransactionSettingsTest { + + private static TestServer server; + + private static final ValueFactory vf = SimpleValueFactory.getInstance(); + + @BeforeClass + public static void startServer() throws Exception { + server = new TestServer(); + try { + server.start(); + } catch (Exception e) { + server.stop(); + throw e; + } + } + + @AfterClass + public static void stopServer() throws Exception { + server.stop(); + } + + String shacl = "@base .\n" + + "@prefix ex: .\n" + + "@prefix owl: .\n" + + "@prefix rdf: .\n" + + "@prefix rdfs: .\n" + + "@prefix sh: .\n" + + "@prefix xsd: .\n" + + "\n" + + "ex:PersonShape\n" + + "\ta sh:NodeShape ;\n" + + "\tsh:targetClass rdfs:Resource ;\n" + + "\tsh:property ex:PersonShapeProperty .\n" + + "\n" + + "\n" + + "ex:PersonShapeProperty\n" + + " sh:path rdfs:label ;\n" + + " sh:minCount 1 ."; + + @Before + public void before() { + Repository repository = new HTTPRepository( + Protocol.getRepositoryLocation(TestServer.SERVER_URL, TestServer.TEST_SHACL_REPO_ID)); + try (RepositoryConnection connection = repository.getConnection()) { + connection.setIsolationLevel(IsolationLevels.NONE); + connection.begin(); + connection.remove((Resource) null, null, null); + connection.remove((Resource) null, null, null, RDF4J.SHACL_SHAPE_GRAPH); + connection.commit(); + } + } + + @Test + public void testValid() throws Exception { + + Repository repository = new HTTPRepository( + Protocol.getRepositoryLocation(TestServer.SERVER_URL, TestServer.TEST_SHACL_REPO_ID)); + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.NONE); + + connection.add(new StringReader(shacl), "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + connection.add(RDFS.RESOURCE, RDFS.LABEL, connection.getValueFactory().createLiteral("a")); + connection.commit(); + + } + + } + + @Test(expected = RemoteShaclValidationException.class) + public void testInvalid() throws Throwable { + + Repository repository = new HTTPRepository( + Protocol.getRepositoryLocation(TestServer.SERVER_URL, TestServer.TEST_SHACL_REPO_ID)); + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.NONE); + + connection.add(new StringReader(shacl), "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + try { + connection.commit(); + } catch (RepositoryException e) { + throw e.getCause(); + } + + } + + } + + @Test(expected = RemoteShaclValidationException.class) + public void testInvalidSnapshot() throws Throwable { + + Repository repository = new HTTPRepository( + Protocol.getRepositoryLocation(TestServer.SERVER_URL, TestServer.TEST_SHACL_REPO_ID)); + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.SNAPSHOT); + + connection.add(new StringReader(shacl), "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + try { + connection.commit(); + } catch (RepositoryException e) { + throw e.getCause(); + } + + } + + } + + @Test + public void testInvalidRollsBackCorrectly() { + + Repository repository = new HTTPRepository( + Protocol.getRepositoryLocation(TestServer.SERVER_URL, TestServer.TEST_SHACL_REPO_ID)); + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.NONE); + + connection.add(new StringReader(shacl), "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + + connection.commit(); + + } catch (Exception ignored) { + + } + + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(IsolationLevels.NONE); + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + connection.commit(); + + } + + } + + @Test(expected = RemoteShaclValidationException.class) + public void testValidationDisabled() throws Throwable { + + Repository repository = new HTTPRepository( + Protocol.getRepositoryLocation(TestServer.SERVER_URL, TestServer.TEST_SHACL_REPO_ID)); + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Disabled, IsolationLevels.NONE); + + connection.add(new StringReader(shacl), "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + + connection.commit(); + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Bulk, IsolationLevels.SNAPSHOT); + try (RepositoryConnection connection1 = repository.getConnection()) { + + try { + connection.commit(); + } catch (RepositoryException e) { + throw e.getCause(); + } + } + + } + + } + + @Test + public void testValidationDisabledSnapshotSerializableValidation() throws Throwable { + + Repository repository = new HTTPRepository( + Protocol.getRepositoryLocation(TestServer.SERVER_URL, TestServer.TEST_SHACL_REPO_ID)); + try (RepositoryConnection connection = repository.getConnection()) { + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Disabled, IsolationLevels.SNAPSHOT); + + connection.add(new StringReader(shacl), "", RDFFormat.TURTLE, RDF4J.SHACL_SHAPE_GRAPH); + + connection.commit(); + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.CLASS); + + connection.begin(ShaclSail.TransactionSettings.ValidationApproach.Disabled, IsolationLevels.SNAPSHOT); + + try (RepositoryConnection connection1 = repository.getConnection()) { + + connection.add(RDFS.RESOURCE, RDF.TYPE, RDFS.RESOURCE); + + connection.commit(); + + } + + } + + } + +}