diff --git a/compliance/pom.xml b/compliance/pom.xml index f1f901ce146..103007f58ae 100644 --- a/compliance/pom.xml +++ b/compliance/pom.xml @@ -13,7 +13,6 @@ rio model sparql - shacl lucene solr elasticsearch diff --git a/compliance/shacl/pom.xml b/compliance/shacl/pom.xml deleted file mode 100644 index 3cb2f1e81a0..00000000000 --- a/compliance/shacl/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 4.0.0 - - org.eclipse.rdf4j - rdf4j-compliance - 5.0.0-SNAPSHOT - - rdf4j-shacl-compliance - RDF4J: SHACL compliance tests - Tests for the SHACL constraint language implementation - - - ${project.groupId} - rdf4j-shacl-testsuite - ${project.version} - - - ${project.groupId} - rdf4j-shacl - ${project.version} - - - diff --git a/compliance/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/SHACLComplianceTest.java b/compliance/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/SHACLComplianceTest.java deleted file mode 100644 index 5afeaf08d6b..00000000000 --- a/compliance/shacl/src/test/java/org/eclipse/rdf4j/sail/shacl/SHACLComplianceTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.shacl; - -import org.eclipse.rdf4j.model.Model; -import org.eclipse.rdf4j.sail.Sail; -import org.eclipse.rdf4j.sail.memory.MemoryStore; -import org.eclipse.rdf4j.testsuite.shacl.manifest.AbstractSHACLTest; -import org.eclipse.rdf4j.testsuite.shacl.manifest.SHACLManifestTestSuiteFactory; -import org.eclipse.rdf4j.testsuite.shacl.manifest.SHACLManifestTestSuiteFactory.TestFactory; - -import junit.framework.TestSuite; - -/** - * Tests the SHACL implementation against the w3c test suite - * - * @author James Leigh - * @deprecated This test suite is not maintained. Use {@see org.eclipse.rdf4j.sail.shacl.W3cComplianceTest} instead. We - * may un-deprecate this suite in the future. - */ -@Deprecated -public class SHACLComplianceTest extends AbstractSHACLTest { - - // set this to true to run all tests! - final static boolean RUN_ALL = false; - - public static TestSuite suite() throws Exception { - String[] ignoredDirectories = { "targets", "sparql", "complex", "misc", "node", "path", "validation-reports", - "property" }; - if (RUN_ALL) { - ignoredDirectories = new String[0]; - } - - return new SHACLManifestTestSuiteFactory().createTestSuite(new TestFactory() { - - @Override - public AbstractSHACLTest createSHACLTest(String testURI, String label, Model shapesGraph, Model dataGraph, - boolean failure, boolean conforms) { - return new SHACLComplianceTest(testURI, label, shapesGraph, dataGraph, failure, conforms); - } - - @Override - public String getName() { - return SHACLComplianceTest.class.getName(); - } - - }, true, true, false, ignoredDirectories); - } - - public SHACLComplianceTest(String testURI, String label, Model shapesGraph, Model dataGraph, boolean failure, - boolean conforms) { - super(testURI, label, shapesGraph, dataGraph, failure, conforms); - } - - @Override - protected Sail newSail() { - return new ShaclSail(new MemoryStore()); - } - -} diff --git a/core/common/io/src/main/java/org/eclipse/rdf4j/common/net/ParsedURI.java b/core/common/io/src/main/java/org/eclipse/rdf4j/common/net/ParsedURI.java deleted file mode 100644 index 62490eba926..00000000000 --- a/core/common/io/src/main/java/org/eclipse/rdf4j/common/net/ParsedURI.java +++ /dev/null @@ -1,548 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ - -package org.eclipse.rdf4j.common.net; - -import java.util.LinkedList; -import java.util.StringTokenizer; - -/** - * A replacement for Java's own URI: java.net.URI. Java's implementation is quite buggy in that it doesn't resolve - * relative URIs correctly. - *

- * Note: this implementation is not guaranteed to handle ipv6 addresses correctly (yet). - * - * @deprecated use {@link ParsedIRI} instead - */ -@Deprecated(since = "2.3") -public class ParsedURI implements java.lang.Cloneable { - - /* - * // Tesing method public static void main(String[] args) throws Exception { URI baseURI = new URI(args[0]); - * baseURI.normalize(); URI uri = null; for (int i = 0; i < 100; i++) { uri = baseURI.resolve(args[1]); } try { - * Thread.sleep(1000); } catch (Exception e) {} long startTime = System.currentTimeMillis(); for (int i = 0; i < - * 100; i++) { uri = baseURI.resolve(args[1]); } long endTime = System.currentTimeMillis(); - * System.out.println(args[0] + " was parsed as:"); System.out.println("scheme = " + uri.getScheme()); - * System.out.println("schemeSpecificPart = " + uri.getSchemeSpecificPart()); System.out.println("authority = " + - * uri.getAuthority()); System.out.println("path = " + uri.getPath()); System.out.println("query = " + - * uri.getQuery()); System.out.println("fragment = " + uri.getFragment()); System.out.println("full URI = " + - * uri.toString()); System.out.println(" parsed 100 times in " + (endTime-startTime) + "ms"); } - */ - - /*-----------* - * Variables * - *-----------*/ - - // For all URIs: - private String _scheme; - - private String _schemeSpecificPart; - - private String _fragment; - - // For hierarchical URIs: - private String _authority; - - private String _path; - - private String _query; - - /*--------------* - * Constructors * - *--------------*/ - - public ParsedURI(String uriSpec) { - _parse(uriSpec); - } - - public ParsedURI(String scheme, String schemeSpecificPart, String fragment) { - _scheme = scheme; - _schemeSpecificPart = schemeSpecificPart; - _fragment = fragment; - } - - public ParsedURI(String scheme, String authority, String path, String query, String fragment) { - _scheme = scheme; - _authority = authority; - _path = path; - _query = query; - _fragment = fragment; - } - - /*-----------------------* - * Public access methods * - *-----------------------*/ - - public boolean isHierarchical() { - return _path != null; - } - - public boolean isOpaque() { - return _path == null; - } - - public boolean isAbsolute() { - return _scheme != null; - } - - public boolean isRelative() { - return _scheme == null; - } - - /** - * Checks whether this URI is a relative URI that references itself (i.e. it only contains an anchor). - */ - public boolean isSelfReference() { - return _scheme == null && _authority == null && _query == null && _path.length() == 0; - } - - public String getScheme() { - return _scheme; - } - - public String getSchemeSpecificPart() { - return _schemeSpecificPart; - } - - public String getAuthority() { - return _authority; - } - - public String getPath() { - return _path; - } - - public String getQuery() { - return _query; - } - - public String getFragment() { - return _fragment; - } - - /*------------------------------* - * Methods for normalizing URIs * - *------------------------------*/ - - /** - * Normalizes the path of this URI if it has one. Normalizing a path means that any unnecessary '.' and '..' - * segments are removed. For example, the URI http://server.com/a/b/../c/./d would be normalized to - * http://server.com/a/c/d. A URI doens't have a path if it is opaque. - */ - public void normalize() { - if (_path == null) { - return; - } - - // Remove any '.' segments: - - _path = _path.replace("/./", "/"); - - if (_path.startsWith("./")) { - // Remove both characters - _path = _path.substring(2); - } - - if (_path.endsWith("/.")) { - // Remove only the last dot, not the slash! - _path = _path.substring(0, _path.length() - 1); - } - - if (_path.indexOf("/../") == -1 && !_path.endsWith("/..")) { - // There are no '..' segments that can be removed. We're done and - // don't have to execute the time-consuming code following this - // if-statement - return; - } - - // Split the path into its segments - - LinkedList segments = new LinkedList<>(); - - StringTokenizer st = new StringTokenizer(_path, "/"); - - while (st.hasMoreTokens()) { - segments.add(st.nextToken()); - } - - boolean lastSegmentRemoved = false; - - // Remove all unnecessary '..' segments - - int i = 1; - while (i < segments.size()) { - String segment = segments.get(i); - - if (segment.equals("..")) { - String prevSegment = segments.get(i - 1); - - if (prevSegment.equals("..")) { - // two consecutive '..' segments at position i-1 and i, - // continue at i + 2 - i += 2; - } else { - // Bingo! Remove these two segments... - if (i == segments.size() - 1) { - lastSegmentRemoved = true; - } - - segments.remove(i); - segments.remove(i - 1); - - // ...and continue at position (i + 1 - 2) == (i - 1)... - - // ...but only if i > 1, position 0 does not need to be - // checked. - - if (i > 1) { - i--; - } - } - } else { - // Not a '..' segment, check next - i++; - } - } - - // Construct the normalized path - - StringBuilder newPath = new StringBuilder(_path.length()); - - if (_path.startsWith("/")) { - newPath.append('/'); - } - - int segmentCount = segments.size(); - for (i = 0; i < segmentCount - 1; i++) { - newPath.append(segments.get(i)); - newPath.append('/'); - } - - if (segmentCount > 0) { - String lastSegment = segments.get(segmentCount - 1); - newPath.append(lastSegment); - - if (_path.endsWith("/") || lastSegmentRemoved) { - newPath.append('/'); - } - } - - _path = newPath.toString(); - } - - /** - * Resolves a relative URI using this URI as the base URI. - */ - public ParsedURI resolve(String relURISpec) { - // This algorithm is based on the algorithm specified in chapter 5 of - // RFC 2396: URI Generic Syntax. See http://www.ietf.org/rfc/rfc2396.txt - - // RFC, step 1: - ParsedURI relURI = new ParsedURI(relURISpec); - - return this.resolve(relURI); - } - - /** - * Resolves a relative URI using this URI as the base URI. - */ - public ParsedURI resolve(ParsedURI relURI) { - // This algorithm is based on the algorithm specified in chapter 5 of - // RFC 2396: URI Generic Syntax. See http://www.ietf.org/rfc/rfc2396.txt - - // RFC, step 3: - if (relURI.isAbsolute()) { - return relURI; - } - - // relURI._scheme == null - - // RFC, step 2: - if (relURI._authority == null && relURI._query == null && relURI._path.length() == 0) { - // Reference to this URI - ParsedURI result = (ParsedURI) this.clone(); - - // Inherit any fragment identifier from relURI - result._fragment = relURI._fragment; - - return result; - } - - // We can start combining the URIs - String scheme, authority, path, query, fragment; - boolean normalizeURI = false; - - scheme = this._scheme; - query = relURI._query; - fragment = relURI._fragment; - - // RFC, step 4: - if (relURI._authority != null) { - authority = relURI._authority; - path = relURI._path; - } else { - authority = this._authority; - - // RFC, step 5: - if (relURI._path.startsWith("/")) { - path = relURI._path; - } else if (relURI._path.length() == 0) { - path = this._path; - } else { - // RFC, step 6: - path = this._path; - - if (path == null) { - path = "/"; - } else { - if (!path.endsWith("/")) { - // Remove the last segment of the path. Note: if - // lastSlashIdx is -1, the path will become empty, - // which is fixed later. - int lastSlashIdx = path.lastIndexOf('/'); - path = path.substring(0, lastSlashIdx + 1); - } - - if (path.length() == 0) { - // No path means: start at root. - path = "/"; - } - } - - // Append the path of the relative URI - path += relURI._path; - - // Path needs to be normalized. - normalizeURI = true; - } - } - - ParsedURI result = new ParsedURI(scheme, authority, path, query, fragment); - - if (normalizeURI) { - result.normalize(); - } - - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(64); - - if (_scheme != null) { - sb.append(_scheme); - if (!isJarScheme(_scheme)) { - sb.append(':'); - } - } - - if (isOpaque()) { - // Opaque URI - if (_schemeSpecificPart != null) { - sb.append(_schemeSpecificPart); - } - } else { - // Hierachical URI - if (_authority != null) { - sb.append("//"); - sb.append(_authority); - } - - sb.append(_path); - - if (_query != null) { - sb.append('?'); - sb.append(_query); - } - } - - if (_fragment != null) { - sb.append('#'); - sb.append(_fragment); - } - - return sb.toString(); - } - - // Overrides Object.clone() - @Override - public Object clone() { - try { - return super.clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException(e); - } - } - - /*--------------------------* - * Methods for parsing URIs * - *--------------------------*/ - - private static boolean isJarScheme(String s) { - return (s.length() > 4 && s.substring(0, 4).equalsIgnoreCase("jar:")); - } - - private void _parse(String uri) { - if (isJarScheme(uri)) { - // uriString is e.g. - // jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class - // Treat the part up to and including the exclamation mark as the - // scheme and - // the rest as the path to enable 'correct' resolving of relative URIs - int idx = uri.indexOf('!'); - if (idx != -1) { - String scheme = uri.substring(0, idx + 1); - String path = uri.substring(idx + 1); - - _scheme = scheme; - _authority = null; - _path = path; - _query = null; - _fragment = null; - - return; - } - } - - if (_parseScheme(uri)) { - // A scheme was found; _scheme and _schemeSpecificPart are now set - if (_schemeSpecificPart.startsWith("/")) { - // Hierachical URI - String rest = _schemeSpecificPart; - rest = _parseAuthority(rest); - rest = _parsePath(rest); - rest = _parseQuery(rest); - _parseFragment(rest); - } else { - // Opaque URI - String rest = _schemeSpecificPart; - rest = _parseOpaquePart(rest); - _parseFragment(rest); - } - } else { - // No scheme was found - String rest = uri; - rest = _parseAuthority(rest); - rest = _parsePath(rest); - rest = _parseQuery(rest); - _parseFragment(rest); - } - } - - private boolean _parseScheme(String uri) { - // Query cannot contain a ':', '/', '?' or '#' character - - // Try to find the scheme in the URI - char c = 0; - int i = 0; - - for (; i < uri.length(); i++) { - c = uri.charAt(i); - if (c == ':' || c == '/' || c == '?' || c == '#') { - // c is equal to one of the illegal chars - break; - } - } - - if (c == ':' && i > 0) { - // We've found a scheme - _scheme = uri.substring(0, i); - _schemeSpecificPart = uri.substring(i + 1); - return true; - } - - // No scheme found, uri is relative - return false; - } - - private String _parseAuthority(String s) { - // Query cannot contain a '/', '?' or '#' character - - if (s.startsWith("//")) { - // Authority present, could be empty though. - int i = 2; - for (; i < s.length(); i++) { - char c = s.charAt(i); - if (c == '/' || c == '?' || c == '#') { - // c is equal to one of the illegal chars - break; - } - } - - _authority = s.substring(2, i); - return s.substring(i); - } - - return s; - } - - private String _parsePath(String s) { - // Query cannot contain a '?' or '#' character - - int i = 0; - for (; i < s.length(); i++) { - char c = s.charAt(i); - if (c == '?' || c == '#') { - // c is equal to one of the illegal chars - break; - } - } - - _path = s.substring(0, i); - - return s.substring(i); - } - - private String _parseQuery(String s) { - // Query must start with a '?' and cannot contain a '#' character - - if (s.startsWith("?")) { - int i = 1; - for (; i < s.length(); i++) { - char c = s.charAt(i); - if (c == '#') { - // c is equal to one of the illegal chars - break; - } - } - - _query = s.substring(1, i); - return s.substring(i); - } else { - return s; - } - } - - private String _parseOpaquePart(String s) { - // Opaque part cannot contain a '#' character - - int i = 0; - for (; i < s.length(); i++) { - char c = s.charAt(i); - if (c == '#') { - // c is equal to one of the illegal chars - break; - } - } - - _schemeSpecificPart = s.substring(0, i); - - return s.substring(i); - } - - private void _parseFragment(String s) { - // Fragment must start with a '#' - if (s.startsWith("#")) { - _fragment = s.substring(1); - } - } -} diff --git a/core/common/io/src/test/java/org/eclipse/rdf4j/common/net/ParsedURITest.java b/core/common/io/src/test/java/org/eclipse/rdf4j/common/net/ParsedURITest.java deleted file mode 100644 index 338066b7433..00000000000 --- a/core/common/io/src/test/java/org/eclipse/rdf4j/common/net/ParsedURITest.java +++ /dev/null @@ -1,234 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.common.net; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.Test; - -/** - * @author Joseph Walton - * @author James Leigh - */ -public class ParsedURITest { - - @Test - public void absoluteHttpUriIsDescribedCorrectly() { - ParsedURI uri = new ParsedURI("http://example.test/"); - assertTrue(uri.isAbsolute()); - assertTrue(uri.isHierarchical()); - assertEquals("http", uri.getScheme()); - assertFalse(uri.isOpaque()); - } - - @Test - public void uriReferenceIsDescribedCorrectly() { - ParsedURI uri = new ParsedURI("/path"); - assertFalse(uri.isAbsolute()); - assertTrue(uri.isHierarchical()); - assertNull(uri.getScheme()); - assertFalse(uri.isOpaque()); - } - - @Test - public void jarUrisAppearAsAbsoluteAndHierarchical() { - ParsedURI uri = new ParsedURI("jar:http://example.test/bar/baz.jar!/COM/foo/Quux.class"); - assertTrue(uri.isAbsolute()); - assertTrue(uri.isHierarchical()); - assertFalse(uri.isOpaque()); - assertEquals("/COM/foo/Quux.class", uri.getPath()); - - uri.normalize(); - assertEquals("/COM/foo/Quux.class", uri.getPath()); - } - - @Test - public void jarUriWithHttpStringifiesToOriginalForm() { - ParsedURI uri = new ParsedURI("jar:http://example.test/bar/baz.jar!/COM/foo/Quux.class"); - assertEquals("jar:http://example.test/bar/baz.jar!/COM/foo/Quux.class", uri.toString()); - } - - @Test - public void jarUriWithFileStringifiesToOriginalForm() { - ParsedURI uri = new ParsedURI("jar:file:///some-file.jar!/another-file"); - assertEquals("jar:file:///some-file.jar!/another-file", uri.toString()); - } - - @Test - public void resolvesAnAbsoluteUriRelativeToABaseJarUri() { - ParsedURI uri = new ParsedURI("jar:file:///some-file.jar!/some-nested-file"); - assertEquals("http://example.test/", uri.resolve("http://example.test/").toString()); - } - - @Test - public void resolvesAPathRelativeUriRelativeToABaseJarUri() { - ParsedURI uri = new ParsedURI("jar:file:///some-file.jar!/some-nested-file"); - assertEquals("jar:file:///some-file.jar!/another-file", uri.resolve("another-file").toString()); - } - - @Test - public void resolvesAPathAbsoluteUriRelativeToABaseJarUri() { - ParsedURI uri = new ParsedURI("jar:file:///some-file.jar!/nested-directory/some-nested-file"); - assertEquals("jar:file:///some-file.jar!/another-file", uri.resolve("/another-file").toString()); - } - - @Test - public void testRoundTripQueryString() { - assertRoundTrip( - "http://localhost:8080/callimachus/pipelines/render-html.xpl?result&template=http%3A%2F%2Flocalhost%3A8080%2Fcallimachus%2Fconcept-view.xhtml%3Ftemplate%26realm%3Dhttp%3A%2F%2Flocalhost%3A8080%2F&this=http%3A%2F%2Flocalhost%3A8080%2Fsun&query=view"); - } - - private void assertRoundTrip(String uri) { - assertResolves(uri, "http://example.com/", uri); - } - - @Test - public void testParentFile() { - assertResolves("../dir", "http://example.com/dir/dir/file", "http://example.com/dir/dir"); - } - - @Test - public void testRootFile() { - assertResolves("/dir", "http://example.com/dir/dir", "http://example.com/dir"); - } - - @Test - public void testFrag() { - assertResolves("#frag", "http://example.com/dir/dir/file?qs#frag", "http://example.com/dir/dir/file?qs#frag"); - } - - @Test - public void testIdentity() { - assertResolves("", "http://example.com/dir/dir/file?qs", "http://example.com/dir/dir/file?qs"); - } - - @Test - public void testOpaque() { - assertResolves("urn:test", "http://example.com/dir/dir/file?qs#frag", "urn:test"); - } - - @Test - public void testFragment() { - assertResolves("#frag2", "http://example.com/dir/dir/file?qs#frag", "http://example.com/dir/dir/file?qs#frag2"); - } - - @Test - public void testQueryString() { - assertResolves("?qs2#frag", "http://example.com/dir/dir/file?qs#frag", - "http://example.com/dir/dir/file?qs2#frag"); - } - - @Test - public void testDirectory() { - assertResolves(".", "http://example.com/dir/dir/file?qs#frag", "http://example.com/dir/dir/"); - } - - @Test - public void testSameDirectory() { - assertResolves("file2?qs#frag", "http://example.com/dir/dir/file?qs#frag", - "http://example.com/dir/dir/file2?qs#frag"); - } - - @Test - public void testNestedDirectory() { - assertResolves("nested/file?qs#frag", "http://example.com/dir/dir/file?qs#frag", - "http://example.com/dir/dir/nested/file?qs#frag"); - } - - @Test - public void testParentDirectory() { - assertResolves("../file?qs#frag", "http://example.com/dir/dir/file?qs#frag", - "http://example.com/dir/file?qs#frag"); - } - - @Test - public void testOtherDirectory() { - assertResolves("../dir2/file?qs#frag", "http://example.com/dir/dir/file?qs#frag", - "http://example.com/dir/dir2/file?qs#frag"); - } - - @Test - public void testSameAuthority() { - assertResolves("/dir2/dir/file?qs#frag", "http://example.com/dir/dir/file?qs#frag", - "http://example.com/dir2/dir/file?qs#frag"); - } - - @Test - public void testIdentityDir() { - assertResolves("", "http://example.com/dir/dir/", "http://example.com/dir/dir/"); - } - - @Test - public void testOpaqueDir() { - assertResolves("urn:test", "http://example.com/dir/dir/", "urn:test"); - } - - @Test - public void testFragmentDir() { - assertResolves("#frag2", "http://example.com/dir/dir/", "http://example.com/dir/dir/#frag2"); - } - - @Test - public void testQueryStringDir() { - assertResolves("?qs2", "http://example.com/dir/dir/", "http://example.com/dir/dir/?qs2"); - } - - @Test - public void testDirectoryDir() { - assertResolves("file", "http://example.com/dir/dir/", "http://example.com/dir/dir/file"); - } - - @Test - public void testSameDirectoryDir() { - assertResolves("file2?qs#frag", "http://example.com/dir/dir/", "http://example.com/dir/dir/file2?qs#frag"); - } - - @Test - public void testNestedDirectoryDir() { - assertResolves("nested/", "http://example.com/dir/dir/", "http://example.com/dir/dir/nested/"); - } - - @Test - public void testNestedDirectoryFileDir() { - assertResolves("nested/file?qs#frag", "http://example.com/dir/dir/", - "http://example.com/dir/dir/nested/file?qs#frag"); - } - - @Test - public void testParentDirectoryDir() { - assertResolves("../file?qs#frag", "http://example.com/dir/dir/", "http://example.com/dir/file?qs#frag"); - } - - @Test - public void testOtherDirectoryDir() { - assertResolves("../dir2/", "http://example.com/dir/dir/", "http://example.com/dir/dir2/"); - } - - @Test - public void testOtherDirectoryFileDir() { - assertResolves("../dir2/file?qs#frag", "http://example.com/dir/dir/", - "http://example.com/dir/dir2/file?qs#frag"); - } - - @Test - public void testSameAuthorityDir() { - assertResolves("/dir2/dir/file?qs#frag", "http://example.com/dir/dir/", - "http://example.com/dir2/dir/file?qs#frag"); - } - - private void assertResolves(String relative, String base, String absolute) { - assertEquals(absolute, new ParsedURI(base).resolve(relative).toString()); - } - -} diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/AbstractCloseableIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/AbstractCloseableIteration.java index ab86f83225e..dacca523479 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/AbstractCloseableIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/AbstractCloseableIteration.java @@ -17,7 +17,6 @@ *

* Instances of this class is not safe to be accessed from multiple threads at the same time. */ -@Deprecated(since = "4.1.0") public abstract class AbstractCloseableIteration implements CloseableIteration { /*-----------* @@ -56,9 +55,6 @@ public final void close() { /** * Called by {@link #close} when it is called for the first time. This method is only called once on each iteration. * By default, this method does nothing. - * - * @throws X */ - protected void handleClose() { - } + abstract protected void handleClose(); } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IteratorIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/AbstractCloseableIteratorIteration.java similarity index 53% rename from core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IteratorIteration.java rename to core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/AbstractCloseableIteratorIteration.java index 9a5e45e6b46..28b3609296d 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IteratorIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/AbstractCloseableIteratorIteration.java @@ -12,37 +12,62 @@ package org.eclipse.rdf4j.common.iteration; import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.Objects; /** * An Iteration that can convert an {@link Iterator} to a {@link CloseableIteration}. */ -@Deprecated(since = "4.1.0") -public class IteratorIteration implements CloseableIteration { +public abstract class AbstractCloseableIteratorIteration extends AbstractCloseableIteration { - private final Iterator iter; + private Iterator iter; - public IteratorIteration(Iterator iter) { - assert iter != null; - this.iter = iter; + public AbstractCloseableIteratorIteration() { } + protected abstract Iterator getIterator(); + @Override public boolean hasNext() { - return iter.hasNext(); + if (isClosed()) { + return false; + } + + if (iter == null) { + iter = getIterator(); + } + + boolean result = iter.hasNext(); + if (!result) { + close(); + } + return result; } @Override public E next() { + if (isClosed()) { + throw new NoSuchElementException("Iteration has been closed"); + } + + if (iter == null) { + iter = getIterator(); + } + return iter.next(); } @Override public void remove() { - iter.remove(); - } + if (isClosed()) { + throw new IllegalStateException("Iteration has been closed"); + } - @Override - public void close() { + if (iter == null) { + iter = getIterator(); + } + iter.remove(); } + } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteration.java index c270ae65115..15890fe2aa7 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteration.java @@ -30,12 +30,7 @@ * } * * - * @deprecated In the future this interface will stop extending {@link CloseableIteration} and instead declare the same - * interface methods directly. The interface will also stop requiring implementations to automatically close - * when exhausted, instead making this an optional feature and requiring the user to always call close. This - * interface may also be removed. */ -@Deprecated(since = "4.1.0") public interface CloseableIteration extends Iterator, AutoCloseable { /** diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteratorIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteratorIteration.java index fa3bb0ad987..a54f33b1b9f 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteratorIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/CloseableIteratorIteration.java @@ -18,33 +18,21 @@ /** * An Iteration that can convert an {@link Iterator} to a {@link CloseableIteration}. */ -@Deprecated(since = "4.1.0") -public class CloseableIteratorIteration extends AbstractCloseableIteration { +public class CloseableIteratorIteration implements CloseableIteration { private Iterator iter; - /** - * Creates an uninitialized CloseableIteratorIteration, needs to be initialized by calling - * {@link #setIterator(Iterator)} before it can be used. + * Flag indicating whether this iteration has been closed. */ - public CloseableIteratorIteration() { - } + private boolean closed = false; /** * Creates a CloseableIteratorIteration that wraps the supplied iterator. */ public CloseableIteratorIteration(Iterator iter) { - setIterator(iter); - } - - protected void setIterator(Iterator iter) { this.iter = Objects.requireNonNull(iter, "Iterator was null"); } - protected boolean hasIterator() { - return iter != null; - } - @Override public boolean hasNext() { if (isClosed()) { @@ -75,4 +63,28 @@ public void remove() { iter.remove(); } + + protected void handleClose() { + + } + + /** + * Checks whether this CloseableIteration has been closed. + * + * @return true if the CloseableIteration has been closed, false otherwise. + */ + public final boolean isClosed() { + return closed; + } + + /** + * Calls {@link #handleClose()} upon first call and makes sure the resource closures are only executed once. + */ + @Override + public final void close() { + if (!closed) { + closed = true; + handleClose(); + } + } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ConvertingIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ConvertingIteration.java index 6fbf65bc55f..403dc343c25 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ConvertingIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ConvertingIteration.java @@ -18,7 +18,6 @@ * A CloseableIteration that converts an iteration over objects of type S (the source type) to an iteration * over objects of type T (the target type). */ -@Deprecated(since = "4.1.0") public abstract class ConvertingIteration extends AbstractCloseableIteration { /*-----------* @@ -59,7 +58,7 @@ protected ConvertingIteration(CloseableIteration iter) { * */ @Override - public boolean hasNext() { + public final boolean hasNext() { if (isClosed()) { return false; } @@ -78,7 +77,7 @@ public boolean hasNext() { * @throws IllegalStateException If the iteration has been closed. */ @Override - public T next() { + public final T next() { if (isClosed()) { throw new NoSuchElementException("The iteration has been closed."); } @@ -94,7 +93,7 @@ public T next() { * {@link #next}. */ @Override - public void remove() { + public final void remove() { if (isClosed()) { throw new IllegalStateException("The iteration has been closed."); } @@ -106,10 +105,6 @@ public void remove() { */ @Override protected void handleClose() { - try { - super.handleClose(); - } finally { - iter.close(); - } + iter.close(); } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DelayedIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DelayedIteration.java index 012c31fe2ac..f7cd118b943 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DelayedIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DelayedIteration.java @@ -19,7 +19,6 @@ * or where a created iteration consumes scarce resources like JDBC-connections or memory. Subclasses must implement the * createIteration method, which is called once when the iteration is first needed. */ -@Deprecated(since = "4.1.0") public abstract class DelayedIteration extends AbstractCloseableIteration { /*-----------* @@ -60,10 +59,7 @@ public boolean hasNext() { CloseableIteration resultIter = iter; if (resultIter == null) { // Underlying iterator has not yet been initialized - resultIter = iter; - if (resultIter == null) { - resultIter = iter = createIteration(); - } + resultIter = iter = createIteration(); } return resultIter.hasNext(); @@ -80,10 +76,8 @@ public E next() { CloseableIteration resultIter = iter; if (resultIter == null) { // Underlying iterator has not yet been initialized - resultIter = iter; - if (resultIter == null) { - resultIter = iter = createIteration(); - } + resultIter = iter = createIteration(); + } return resultIter.next(); @@ -111,12 +105,8 @@ public void remove() { */ @Override protected void handleClose() { - try { - super.handleClose(); - } finally { - if (iter != null) { - iter.close(); - } + if (iter != null) { + iter.close(); } } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DistinctIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DistinctIteration.java index c065273e45a..7dcb2c8d325 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DistinctIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DistinctIteration.java @@ -18,7 +18,6 @@ /** * An Iteration that filters any duplicate elements from an underlying iterator. */ -@Deprecated(since = "4.1.0") public class DistinctIteration extends FilterIteration { /*-----------* @@ -68,6 +67,11 @@ protected boolean accept(E object) { } } + @Override + protected void handleClose() { + + } + /** * @param object * @return true if the object is in the excludeSet diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DualUnionIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DualUnionIteration.java index e8db59efdfb..e581e85a59a 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DualUnionIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/DualUnionIteration.java @@ -16,7 +16,6 @@ /** * Provides a bag union of the two provided iterations. */ -@Deprecated(since = "4.1.0") public class DualUnionIteration implements CloseableIteration { private CloseableIteration iteration1; @@ -111,7 +110,6 @@ public final E next() { * Fetches the next element if it hasn't been fetched yet and stores it in {@link #nextElement}. * * @return The next element, or null if there are no more results. - * @throws X If there is an issue getting the next element or closing the iteration. */ private E lookAhead() { if (nextElement == null) { diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/EmptyIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/EmptyIteration.java index f8c6961e781..e2efccf8dbd 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/EmptyIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/EmptyIteration.java @@ -12,6 +12,7 @@ package org.eclipse.rdf4j.common.iteration; import java.util.NoSuchElementException; +import java.util.function.Consumer; import java.util.stream.Stream; /** @@ -20,23 +21,11 @@ * @implNote In the future this class will stop extending AbstractCloseableIteration and instead implement * CloseableIteration directly. */ -@Deprecated(since = "4.1.0") -public final class EmptyIteration extends AbstractCloseableIteration { +public final class EmptyIteration implements CloseableIteration { - /*--------------* - * Constructors * - *--------------*/ - - /** - * Creates a new EmptyIteration. - */ public EmptyIteration() { } - /*---------* - * Methods * - *---------*/ - @Override public boolean hasNext() { return false; @@ -57,4 +46,13 @@ public Stream stream() { return Stream.empty(); } + @Override + public void close() { + + } + + @Override + public void forEachRemaining(Consumer action) { + } + } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ExceptionConvertingIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ExceptionConvertingIteration.java index de3459baab1..590edca7b21 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ExceptionConvertingIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ExceptionConvertingIteration.java @@ -58,7 +58,6 @@ protected ExceptionConvertingIteration(CloseableIteration iter) { * Checks whether the underlying Iteration contains more elements. * * @return true if the underlying Iteration contains more elements, false otherwise. - * @throws X */ @Override public boolean hasNext() { @@ -79,7 +78,6 @@ public boolean hasNext() { /** * Returns the next element from the wrapped Iteration. * - * @throws X * @throws java.util.NoSuchElementException If all elements have been returned. * @throws IllegalStateException If the Iteration has been closed. */ @@ -128,13 +126,9 @@ public void remove() { @Override protected void handleClose() { try { - super.handleClose(); - } finally { - try { - iter.close(); - } catch (RuntimeException e) { - throw convert(e); - } + iter.close(); + } catch (RuntimeException e) { + throw convert(e); } } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/FilterIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/FilterIteration.java index e57b758e29a..6147109d73a 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/FilterIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/FilterIteration.java @@ -17,14 +17,23 @@ * A CloseableIteration that wraps another Iteration, applying a filter on the objects that are returned. Subclasses * must implement the accept method to indicate which objects should be returned. */ -@Deprecated(since = "4.1.0") -public abstract class FilterIteration extends IterationWrapper { +public abstract class FilterIteration implements CloseableIteration { + /** + * The wrapped Iteration. + * + * @deprecated This will be changed to private, possibly with an accessor in future. Do not rely on it. + */ + private final CloseableIteration wrappedIter; /*-----------* * Variables * *-----------*/ private E nextElement; + /** + * Flag indicating whether this iteration has been closed. + */ + private boolean closed = false; /*--------------* * Constructors * @@ -34,7 +43,8 @@ public abstract class FilterIteration extends IterationWrapper { * @param iter */ protected FilterIteration(CloseableIteration iter) { - super(iter); + assert iter != null; + this.wrappedIter = iter; } /*---------* @@ -74,9 +84,36 @@ public E next() { } private void findNextElement() { + if (nextElement != null) { + return; + } + try { - while (!isClosed() && nextElement == null && super.hasNext()) { - E candidate = super.next(); + if (!isClosed()) { + if (Thread.currentThread().isInterrupted()) { + close(); + return; + } else { + boolean result = wrappedIter.hasNext(); + if (!result) { + close(); + return; + } + } + } + while (nextElement == null && wrappedIter.hasNext()) { + E result; + if (Thread.currentThread().isInterrupted()) { + close(); + return; + } + try { + result = wrappedIter.next(); + } catch (NoSuchElementException e) { + close(); + throw e; + } + E candidate = result; if (accept(candidate)) { nextElement = candidate; @@ -95,16 +132,54 @@ private void findNextElement() { * * @param object The object to be tested. * @return true if the object should be returned, false otherwise. - * @throws X */ protected abstract boolean accept(E object); + /** + * Removes the last element that has been returned from the wrapped Iteration. + * + * @throws UnsupportedOperationException If the wrapped Iteration does not support the remove operation. + * @throws IllegalStateException if the Iteration has been closed, or if {@link #next} has not yet been + * called, or {@link #remove} has already been called after the last call to + * {@link #next}. + */ @Override - protected void handleClose() { + public void remove() { + if (isClosed()) { + throw new IllegalStateException("The iteration has been closed."); + } else if (Thread.currentThread().isInterrupted()) { + close(); + throw new IllegalStateException("The iteration has been interrupted."); + } try { - super.handleClose(); - } finally { - nextElement = null; + wrappedIter.remove(); + } catch (IllegalStateException e) { + close(); + throw e; + } + } + + private boolean isClosed() { + return closed; + } + + /** + * Closes this Iteration and also closes the wrapped Iteration if it is a {@link CloseableIteration}. + */ + abstract protected void handleClose(); + + /** + * Calls {@link #handleClose()} upon first call and makes sure the resource closures are only executed once. + */ + @Override + public final void close() { + if (!closed) { + closed = true; + try { + wrappedIter.close(); + } finally { + handleClose(); + } } } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IntersectIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IntersectIteration.java index 55b495908b8..5e912086c85 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IntersectIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IntersectIteration.java @@ -22,7 +22,6 @@ * Note that duplicates can also be filtered by wrapping this Iteration in a {@link DistinctIteration}, but that has a * bit more overhead as it adds a second hash table lookup. */ -@Deprecated(since = "4.1.0") public class IntersectIteration extends FilterIteration { /*-----------* @@ -127,11 +126,6 @@ protected boolean accept(E object) { return false; } - // this method does not seem to "addSecondSet" since the second set seems to be ignored - public Set addSecondSet(CloseableIteration arg2, Set set) { - return Iterations.addAll(arg2, setMaker.get()); - } - protected boolean removeFromIncludeSet(E object) { return includeSet.remove(object); } @@ -146,19 +140,9 @@ protected Set makeSet() { @Override protected void handleClose() { - try { - super.handleClose(); - } finally { - if (arg2 != null) { - arg2.close(); - } + if (arg2 != null) { + arg2.close(); } } - protected long clearIncludeSet() { - long size = includeSet.size(); - includeSet.clear(); - return size; - } - } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IterationSpliterator.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IterationSpliterator.java deleted file mode 100644 index c4ef42ca008..00000000000 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IterationSpliterator.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.common.iteration; - -import java.util.Objects; -import java.util.Spliterator; -import java.util.Spliterators; -import java.util.function.Consumer; - -/** - * A {@link Spliterator} implementation that wraps an {@link CloseableIteration}. It handles occurrence of checked - * exceptions by wrapping them in RuntimeExceptions, and in addition ensures that the wrapped Iteration is closed when - * exhausted (if it's a {@link CloseableIteration}). - * - * @author Jeen Broekstra - */ -@Deprecated(since = "4.1.0") -public class IterationSpliterator extends Spliterators.AbstractSpliterator { - - private final CloseableIteration iteration; - - /** - * Creates a {@link Spliterator} implementation that wraps the supplied {@link CloseableIteration}. It handles - * occurrence of checked exceptions by wrapping them in RuntimeExceptions, and in addition ensures that the wrapped - * Iteration is closed when exhausted (if it's a {@link CloseableIteration}). - * - * @param iteration the iteration to wrap - */ - public IterationSpliterator(final CloseableIteration iteration) { - super(Long.MAX_VALUE, Spliterator.IMMUTABLE | Spliterator.NONNULL); - this.iteration = iteration; - } - - @Override - public boolean tryAdvance(Consumer action) { - Objects.requireNonNull(action, "action may not be null"); - - // we start by assuming that we need to close the iteration, in case an error occurs - // this could be handled in the catch part, but then we would need to catch throwable...which is not recommended - boolean needsToBeClosed = true; - try { - if (iteration.hasNext()) { - action.accept(iteration.next()); - // since the iteration might have more elements we don't need to close it - needsToBeClosed = false; - return true; - } - return false; - } finally { - if (needsToBeClosed) { - try { - if (iteration != null) - iteration.close(); - } catch (Exception ignored) { - } - } - } - } - - @Override - public void forEachRemaining(final Consumer action) { - Objects.requireNonNull(action, "action may not be null"); - try { - while (iteration.hasNext()) { - action.accept(iteration.next()); - } - } finally { - try { - if (iteration != null) - iteration.close(); - } catch (Exception ignored) { - } - } - } -} diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IterationWrapper.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IterationWrapper.java index 504acb4a8f4..9f51bcf4387 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IterationWrapper.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/IterationWrapper.java @@ -121,10 +121,6 @@ public void remove() { */ @Override protected void handleClose() { - try { - super.handleClose(); - } finally { - wrappedIter.close(); - } + wrappedIter.close(); } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/Iterations.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/Iterations.java index 28562e8246e..85184886f60 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/Iterations.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/Iterations.java @@ -23,34 +23,34 @@ /** * This class consists exclusively of static methods that operate on or return Iterations. It is the * Iteration-equivalent of java.util.Collections. + * */ -@Deprecated(since = "4.1.0") public class Iterations { /** * Get a List containing all elements obtained from the specified iteration. * - * @param iter the {@link CloseableIteration} to get the elements from + * @param iteration the {@link CloseableIteration} to get the elements from * @return a List containing all elements obtained from the specified iteration. */ - public static List asList(CloseableIteration iter) { - try (iter) { + public static List asList(CloseableIteration iteration) { + try (iteration) { // stream.collect is slightly slower than addAll for lists List list = new ArrayList<>(); // addAll closes the iteration - return addAll(iter, list); + return addAll(iteration, list); } } /** * Get a Set containing all elements obtained from the specified iteration. * - * @param iter the {@link CloseableIteration} to get the elements from + * @param iteration the {@link CloseableIteration} to get the elements from * @return a Set containing all elements obtained from the specified iteration. */ - public static Set asSet(CloseableIteration iter) { - try (Stream stream = iter.stream()) { + public static Set asSet(CloseableIteration iteration) { + try (Stream stream = iteration.stream()) { return stream.collect(Collectors.toSet()); } } @@ -59,15 +59,14 @@ public static Set asSet(CloseableIterationcollection object that was supplied to this method. */ - public static > C addAll(CloseableIteration iter, - C collection) { - try (iter) { - while (iter.hasNext()) { - collection.add(iter.next()); + public static > C addAll(CloseableIteration iteration, C collection) { + try (iteration) { + while (iteration.hasNext()) { + collection.add(iteration.next()); } } @@ -108,7 +107,7 @@ public static Stream stream(CloseableIteration iteration) { * @param separator The separator to insert between the object strings. * @return A String representation of the objects provided by the supplied iteration. */ - public static String toString(CloseableIteration iteration, String separator) { + public static String toString(CloseableIteration iteration, String separator) { try (iteration) { StringBuilder sb = new StringBuilder(); toString(iteration, separator, sb); @@ -125,9 +124,7 @@ public static String toString(CloseableIteration iterat * @param separator The separator to insert between the object strings. * @param sb A StringBuilder to append the iteration string to. */ - public static void toString(CloseableIteration iteration, String separator, - StringBuilder sb) - throws X { + public static void toString(CloseableIteration iteration, String separator, StringBuilder sb) { try (iteration) { while (iteration.hasNext()) { sb.append(iteration.next()); @@ -147,13 +144,15 @@ public static void toString(CloseableIteration iteratio * @param setMaker the Supplier that constructs a new set * @return a Set containing all elements obtained from the specified iteration. */ - public static Set asSet(CloseableIteration iteration, + public static Set asSet(CloseableIteration iteration, Supplier> setMaker) { - Set set = setMaker.get(); - while (iteration.hasNext()) { - set.add(iteration.next()); + try (iteration) { + Set set = setMaker.get(); + while (iteration.hasNext()) { + set.add(iteration.next()); + } + return set; } - return set; } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/LimitIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/LimitIteration.java index e3280077856..ee4c22e46f9 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/LimitIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/LimitIteration.java @@ -17,7 +17,6 @@ * An Iteration that limits the amount of elements that it returns from an underlying Iteration to a fixed amount. This * class returns the first limit elements from the underlying Iteration and drops the rest. */ -@Deprecated(since = "4.1.0") public class LimitIteration extends IterationWrapper { /*-----------* @@ -47,7 +46,6 @@ public class LimitIteration extends IterationWrapper { public LimitIteration(CloseableIteration iter, long limit) { super(iter); - assert iter != null; assert limit >= 0; this.limit = limit; diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/LookAheadIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/LookAheadIteration.java index 03b14dbed0b..7e7b114f4bf 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/LookAheadIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/LookAheadIteration.java @@ -18,7 +18,6 @@ * super class for Iterations that have no easy way to tell if there are any more results, but still should implement * the java.util.Iteration interface. */ -@Deprecated(since = "4.1.0") public abstract class LookAheadIteration extends AbstractCloseableIteration { /*-----------* @@ -73,7 +72,6 @@ public final E next() { * Fetches the next element if it hasn't been fetched yet and stores it in {@link #nextElement}. * * @return The next element, or null if there are no more results. - * @throws X If there is an issue getting the next element or closing the iteration. */ private E lookAhead() { if (nextElement == null) { @@ -94,8 +92,4 @@ public void remove() { throw new UnsupportedOperationException(); } - @Override - protected void handleClose() { - nextElement = null; - } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/MinusIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/MinusIteration.java index 1df41bdddbc..596fee80495 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/MinusIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/MinusIteration.java @@ -22,7 +22,6 @@ * Note that duplicates can also be filtered by wrapping this Iteration in a {@link DistinctIteration}, but that has a * bit more overhead as it adds a second hash table lookup. */ -@Deprecated(since = "4.1.0") public class MinusIteration extends FilterIteration { /*-----------* @@ -124,11 +123,8 @@ protected boolean accept(E object) { @Override protected void handleClose() { - try { - super.handleClose(); - } finally { - if (rightArg != null) - rightArg.close(); + if (rightArg != null) { + rightArg.close(); } } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/OffsetIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/OffsetIteration.java index 66be1546ff4..b509358b44d 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/OffsetIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/OffsetIteration.java @@ -14,7 +14,6 @@ /** * An Iteration that skips the first offset elements from an underlying Iteration. */ -@Deprecated(since = "4.1.0") public class OffsetIteration extends FilterIteration { /*-----------* @@ -66,4 +65,9 @@ protected boolean accept(E object) { return true; } } + + @Override + protected void handleClose() { + + } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/QueueIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/QueueIteration.java index b3b11a59ea0..789d361adba 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/QueueIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/QueueIteration.java @@ -24,7 +24,6 @@ * * @author James Leigh */ -@Deprecated(since = "4.1.0") public abstract class QueueIteration extends LookAheadIteration { private final AtomicBoolean done = new AtomicBoolean(false); @@ -156,15 +155,11 @@ public E getNextElement() { @Override public void handleClose() { - try { - super.handleClose(); - } finally { - done.set(true); - do { - queue.clear(); // ensure extra room is available - } while (!queue.offer(afterLast)); - checkException(); - } + done.set(true); + do { + queue.clear(); // ensure extra room is available + } while (!queue.offer(afterLast)); + checkException(); } public void checkException() throws T { diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ReducedIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ReducedIteration.java index 5e62199dfc4..be6b0f2ebc8 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ReducedIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/ReducedIteration.java @@ -15,7 +15,6 @@ * * @author Arjohn Kampman */ -@Deprecated(since = "4.1.0") public class ReducedIteration extends FilterIteration { private E previousObject; @@ -33,4 +32,9 @@ protected boolean accept(E nextObject) { return true; } } + + @Override + protected void handleClose() { + + } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/SilentIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/SilentIteration.java index 36b9d03d0c8..cc2d6e0b613 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/SilentIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/SilentIteration.java @@ -21,7 +21,6 @@ * * @author Jeen Broekstra */ -@Deprecated(since = "4.1.0") public class SilentIteration extends IterationWrapper { private static final Logger logger = LoggerFactory.getLogger(SilentIteration.class); diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/SingletonIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/SingletonIteration.java index 154551cfffa..00827c392ff 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/SingletonIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/SingletonIteration.java @@ -16,19 +16,10 @@ /** * An Iteration that contains exactly one element. */ -@Deprecated(since = "4.1.0") public class SingletonIteration extends AbstractCloseableIteration { - /*-----------* - * Variables * - *-----------*/ - private E value; - /*--------------* - * Constructors * - *--------------*/ - /** * Creates a new EmptyIteration. */ @@ -36,10 +27,6 @@ public SingletonIteration(E value) { this.value = value; } - /*---------* - * Methods * - *---------*/ - @Override public boolean hasNext() { return value != null; diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/TimeLimitIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/TimeLimitIteration.java index f7f3a043383..da0f542223d 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/TimeLimitIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/TimeLimitIteration.java @@ -20,7 +20,6 @@ /** * @author Arjohn Kampman */ -@Deprecated(since = "4.1.0") public abstract class TimeLimitIteration extends IterationWrapper { private static final Timer timer = new Timer("TimeLimitIteration", true); diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/UnionIteration.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/UnionIteration.java index 334cfa0ad7a..164fb493199 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/UnionIteration.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iteration/UnionIteration.java @@ -21,7 +21,6 @@ * An Iteration that returns the bag union of the results of a number of Iterations. 'Bag union' means that the * UnionIteration does not filter duplicate objects. */ -@Deprecated(since = "4.1.0") public class UnionIteration extends LookAheadIteration { /*-----------* @@ -92,30 +91,25 @@ protected E getNextElement() { @Override protected void handleClose() { try { - // Close this iteration, this will prevent lookAhead() from calling - // getNextElement() again - super.handleClose(); - } finally { - try { - List collectedExceptions = new ArrayList<>(); - while (argIter.hasNext()) { - try { - CloseableIteration next = argIter.next(); - if (next != null) { - next.close(); - } - } catch (Throwable e) { - collectedExceptions.add(e); + List collectedExceptions = new ArrayList<>(); + while (argIter.hasNext()) { + try { + CloseableIteration next = argIter.next(); + if (next != null) { + next.close(); } + } catch (Throwable e) { + collectedExceptions.add(e); } - if (!collectedExceptions.isEmpty()) { - throw new UndeclaredThrowableException(collectedExceptions.get(0)); - } - } finally { - if (currentIter != null) { - currentIter.close(); - } + } + if (!collectedExceptions.isEmpty()) { + throw new UndeclaredThrowableException(collectedExceptions.get(0)); + } + } finally { + if (currentIter != null) { + currentIter.close(); } } + } } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/AbstractCloseableIterator.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/AbstractCloseableIterator.java index 709f2c8e6cf..bce3545c700 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/AbstractCloseableIterator.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/AbstractCloseableIterator.java @@ -58,8 +58,6 @@ public final void close() throws IOException { /** * Called by {@link #close} when it is called for the first time. This method is only called once on each iteration. * By default, this method does nothing. - * - * @throws X */ protected void handleClose() throws IOException { } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/FilterIterator.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/FilterIterator.java index 190a0a47eea..4d60284b9b3 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/FilterIterator.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/FilterIterator.java @@ -70,7 +70,6 @@ public void remove() { * * @param object The object to be tested. * @return true if the object should be returned, false otherwise. - * @throws X */ protected abstract boolean accept(E object); } diff --git a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/LookAheadIterator.java b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/LookAheadIterator.java index 026b3ac724a..155155b9128 100644 --- a/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/LookAheadIterator.java +++ b/core/common/iterator/src/main/java/org/eclipse/rdf4j/common/iterator/LookAheadIterator.java @@ -74,8 +74,6 @@ public final E next() { /** * Fetches the next element if it hasn't been fetched yet and stores it in {@link #nextElement}. - * - * @throws X */ private void lookAhead() { if (nextElement == null && !isClosed()) { diff --git a/core/common/text/src/main/java/org/eclipse/rdf4j/common/text/StringUtil.java b/core/common/text/src/main/java/org/eclipse/rdf4j/common/text/StringUtil.java index 298a7f8ede4..442b648478f 100644 --- a/core/common/text/src/main/java/org/eclipse/rdf4j/common/text/StringUtil.java +++ b/core/common/text/src/main/java/org/eclipse/rdf4j/common/text/StringUtil.java @@ -24,58 +24,6 @@ public class StringUtil { Arrays.sort(IRI_DONT_ESCAPE); } - /** - * Substitute String "old" by String "new" in String "text" everywhere. This is a static util function that I could - * not place anywhere more appropriate. The name of this function is from the good-old awk time. - * - * @param olds The String to be substituted. - * @param news The String is the new content. - * @param text The String in which the substitution is done. - * @return The result String containing the substitutions; if no substitutions were made, the result is 'text'. - * @deprecated use {@link String#replace(CharSequence, CharSequence) instead}. - */ - @Deprecated(since = "4.0.0") - public static String gsub(String olds, String news, String text) { - if (olds == null || olds.length() == 0) { - // Nothing to substitute. - return text; - } - if (text == null) { - return null; - } - - // Search for any occurences of 'olds'. - int oldsIndex = text.indexOf(olds); - if (oldsIndex == -1) { - // Nothing to substitute. - return text; - } - - // We're going to do some substitutions. - StringBuilder buf = new StringBuilder(text.length()); - int prevIndex = 0; - - while (oldsIndex >= 0) { - // First, add the text between the previous and the current - // occurence. - buf.append(text.substring(prevIndex, oldsIndex)); - - // Then add the substition pattern - buf.append(news); - - // Remember the index for the next loop. - prevIndex = oldsIndex + olds.length(); - - // Search for the next occurence. - oldsIndex = text.indexOf(olds, prevIndex); - } - - // Add the part after the last occurence. - buf.append(text.substring(prevIndex)); - - return buf.toString(); - } - private static String hex(int c) { return Integer.toHexString(c).toUpperCase(Locale.US); } diff --git a/core/model-vocabulary/src/main/java/org/eclipse/rdf4j/model/vocabulary/XSD.java b/core/model-vocabulary/src/main/java/org/eclipse/rdf4j/model/vocabulary/XSD.java index e2921be26d6..1562549b02e 100644 --- a/core/model-vocabulary/src/main/java/org/eclipse/rdf4j/model/vocabulary/XSD.java +++ b/core/model-vocabulary/src/main/java/org/eclipse/rdf4j/model/vocabulary/XSD.java @@ -193,216 +193,4 @@ public class XSD { /** http://www.w3.org/2001/XMLSchema#yearMonthDuration */ public final static IRI YEARMONTHDURATION = CoreDatatype.XSD.YEARMONTHDURATION.getIri(); - private static IRI create(String localName) { - return Vocabularies.createIRI(org.eclipse.rdf4j.model.vocabulary.XSD.NAMESPACE, localName); - } - - @Deprecated(since = "5.0.0", forRemoval = true) - public enum Datatype { - - DURATION(CoreDatatype.XSD.DURATION.getIri(), true, true, false, false, false, false, false), - DATETIME(CoreDatatype.XSD.DATETIME.getIri(), true, false, false, false, false, false, true), - DATETIMESTAMP(CoreDatatype.XSD.DATETIMESTAMP.getIri(), false, false, false, true, false, false, true), - DAYTIMEDURATION(CoreDatatype.XSD.DAYTIMEDURATION.getIri(), false, true, false, true, false, false, false), - TIME(CoreDatatype.XSD.TIME.getIri(), true, false, false, false, false, false, true), - DATE(CoreDatatype.XSD.DATE.getIri(), true, false, false, false, false, false, true), - GYEARMONTH(CoreDatatype.XSD.GYEARMONTH.getIri(), true, false, false, false, false, false, true), - GYEAR(CoreDatatype.XSD.GYEAR.getIri(), true, false, false, false, false, false, true), - GMONTHDAY(CoreDatatype.XSD.GMONTHDAY.getIri(), true, false, false, false, false, false, true), - GDAY(CoreDatatype.XSD.GDAY.getIri(), true, false, false, false, false, false, true), - GMONTH(CoreDatatype.XSD.GMONTH.getIri(), true, false, false, false, false, false, true), - STRING(CoreDatatype.XSD.STRING.getIri(), true, false, false, false, false, false, false), - BOOLEAN(CoreDatatype.XSD.BOOLEAN.getIri(), true, false, false, false, false, false, false), - BASE64BINARY(CoreDatatype.XSD.BASE64BINARY.getIri(), true, false, false, false, false, false, false), - HEXBINARY(CoreDatatype.XSD.HEXBINARY.getIri(), true, false, false, false, false, false, false), - FLOAT(CoreDatatype.XSD.FLOAT.getIri(), true, false, false, false, false, true, false), - DECIMAL(CoreDatatype.XSD.DECIMAL.getIri(), true, false, false, false, true, false, false), - DOUBLE(CoreDatatype.XSD.DOUBLE.getIri(), true, false, false, false, false, true, false), - ANYURI(CoreDatatype.XSD.ANYURI.getIri(), true, false, false, false, false, false, false), - QNAME(CoreDatatype.XSD.QNAME.getIri(), true, false, false, false, false, false, false), - NOTATION(CoreDatatype.XSD.NOTATION.getIri(), true, false, false, false, false, false, false), - NORMALIZEDSTRING(CoreDatatype.XSD.NORMALIZEDSTRING.getIri(), false, false, false, true, false, false, false), - TOKEN(CoreDatatype.XSD.TOKEN.getIri(), false, false, false, true, false, false, false), - LANGUAGE(CoreDatatype.XSD.LANGUAGE.getIri(), false, false, false, true, false, false, false), - NMTOKEN(CoreDatatype.XSD.NMTOKEN.getIri(), false, false, false, true, false, false, false), - NMTOKENS(CoreDatatype.XSD.NMTOKENS.getIri(), false, false, false, true, false, false, false), - NAME(CoreDatatype.XSD.NAME.getIri(), false, false, false, true, false, false, false), - NCNAME(CoreDatatype.XSD.NCNAME.getIri(), false, false, false, true, false, false, false), - ID(CoreDatatype.XSD.ID.getIri(), false, false, false, true, false, false, false), - IDREF(CoreDatatype.XSD.IDREF.getIri(), false, false, false, true, false, false, false), - IDREFS(CoreDatatype.XSD.IDREFS.getIri(), false, false, false, true, false, false, false), - ENTITY(CoreDatatype.XSD.ENTITY.getIri(), false, false, false, true, false, false, false), - ENTITIES(CoreDatatype.XSD.ENTITIES.getIri(), false, false, false, true, false, false, false), - INTEGER(CoreDatatype.XSD.INTEGER.getIri(), false, false, true, true, true, false, false), - LONG(CoreDatatype.XSD.LONG.getIri(), false, false, true, true, true, false, false), - INT(CoreDatatype.XSD.INT.getIri(), false, false, true, true, true, false, false), - SHORT(CoreDatatype.XSD.SHORT.getIri(), false, false, true, true, true, false, false), - BYTE(CoreDatatype.XSD.BYTE.getIri(), false, false, true, true, true, false, false), - NON_POSITIVE_INTEGER(CoreDatatype.XSD.NON_POSITIVE_INTEGER.getIri(), false, false, true, true, true, false, - false), - NEGATIVE_INTEGER(CoreDatatype.XSD.NEGATIVE_INTEGER.getIri(), false, false, true, true, true, false, false), - NON_NEGATIVE_INTEGER(CoreDatatype.XSD.NON_NEGATIVE_INTEGER.getIri(), false, false, true, true, true, false, - false), - POSITIVE_INTEGER(CoreDatatype.XSD.POSITIVE_INTEGER.getIri(), false, false, true, true, true, false, false), - UNSIGNED_LONG(CoreDatatype.XSD.UNSIGNED_LONG.getIri(), false, false, true, true, true, false, false), - UNSIGNED_INT(CoreDatatype.XSD.UNSIGNED_INT.getIri(), false, false, true, true, true, false, false), - UNSIGNED_SHORT(CoreDatatype.XSD.UNSIGNED_SHORT.getIri(), false, false, true, true, true, false, false), - UNSIGNED_BYTE(CoreDatatype.XSD.UNSIGNED_BYTE.getIri(), false, false, true, true, true, false, false), - YEARMONTHDURATION(CoreDatatype.XSD.YEARMONTHDURATION.getIri(), false, true, false, true, false, false, false); - - private final IRI iri; - private final boolean primitive; - private final boolean duration; - private final boolean integer; - private final boolean derived; - private final boolean decimal; - private final boolean floatingPoint; - private final boolean calendar; - private final CoreDatatype.XSD coreDatatype; - - Datatype(IRI iri, boolean primitive, boolean duration, boolean integer, boolean derived, boolean decimal, - boolean floatingPoint, boolean calendar) { - this.iri = iri; - this.primitive = primitive; - this.duration = duration; - this.integer = integer; - this.derived = derived; - this.decimal = decimal; - this.floatingPoint = floatingPoint; - this.calendar = calendar; - this.coreDatatype = CoreDatatype.from(iri).asXSDDatatype().orElseThrow(); - } - - /** - * Checks whether the supplied datatype is a primitive XML Schema datatype. - * - * @return true if the datatype is a primitive type - */ - public boolean isPrimitiveDatatype() { - return primitive; - } - - /** - * Checks whether the supplied datatype is a derived XML Schema datatype. - * - * @return true if the datatype is a derived type - */ - public boolean isDerivedDatatype() { - return derived; - } - - /** - * Checks whether the supplied datatype is a built-in XML Schema datatype. - * - * @return true if it is a primitive or derived XML Schema type - */ - public boolean isBuiltInDatatype() { - return isPrimitiveDatatype() || isDerivedDatatype(); - } - - /** - * Checks whether the supplied datatype is a numeric datatype, i.e.if it is equal to xsd:float, xsd:double, - * xsd:decimal or one of the datatypes derived from xsd:decimal. - * - * @return true of it is a decimal or floating point type - */ - public boolean isNumericDatatype() { - return isDecimalDatatype() || isFloatingPointDatatype(); - } - - /** - * Checks whether the supplied datatype is equal to xsd:decimal or one of the built-in datatypes that is derived - * from xsd:decimal. - * - * @return true if it is a decimal datatype - */ - public boolean isDecimalDatatype() { - return decimal; - } - - /** - * Checks whether the supplied datatype is equal to xsd:integer or one of the built-in datatypes that is derived - * from xsd:integer. - * - * @return true if it is an integer type - */ - public boolean isIntegerDatatype() { - return integer; - } - - /** - * Checks whether the supplied datatype is equal to xsd:float or xsd:double. - * - * @return true if it is a floating point type - */ - public boolean isFloatingPointDatatype() { - return floatingPoint; - } - - /** - * Checks whether the supplied datatype is equal to xsd:dateTime, xsd:date, xsd:time, xsd:gYearMonth, - * xsd:gMonthDay, xsd:gYear, xsd:gMonth or xsd:gDay.These are the primitive datatypes that represent dates - * and/or times. - * - * @return true if it is a calendar type - * @see XMLGregorianCalendar - */ - public boolean isCalendarDatatype() { - return calendar; - } - - /** - * Checks whether the supplied datatype is equal to xsd:duration, xsd:dayTimeDuration, xsd:yearMonthDuration. - * These are the datatypes that represents durations. - * - * @return true if it is a duration type - * @see Duration - */ - public boolean isDurationDatatype() { - return duration; - } - - /** - * Checks whether the supplied datatype is ordered.The values of an ordered datatype can be compared to each - * other using operators like < and >. - * - * @return true if the datatype is ordered - */ - public boolean isOrderedDatatype() { - return isNumericDatatype() || isCalendarDatatype(); - } - - public IRI getIri() { - return iri; - } - - public CoreDatatype getCoreDatatype() { - return coreDatatype; - } - - private static final Map> reverseLookup = new HashMap<>(); - - private static final Map> reverseLookupXSDDatatype = new EnumMap<>( - CoreDatatype.XSD.class); - - static { - for (Datatype value : Datatype.values()) { - reverseLookup.put(value.iri, Optional.of(value)); - reverseLookupXSDDatatype.put(value.coreDatatype, Optional.of(value)); - } - } - - public static Optional from(IRI datatype) { - return reverseLookup.getOrDefault(datatype, Optional.empty()); - } - - public static Optional from(CoreDatatype.XSD datatype) { - if (datatype == null) { - return Optional.empty(); - } - return reverseLookupXSDDatatype.getOrDefault(datatype, Optional.empty()); - } - - } - } 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 5d540d79390..02c39595441 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 @@ -57,11 +57,6 @@ public static String getLabel(Value v, String fallback) { return v instanceof Literal ? getLabel((Literal) v, fallback) : fallback; } - @Deprecated(since = "5.0.0", forRemoval = true) - public static String getLabel(Optional v, String fallback) { - return v != null ? getLabel(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 13af1ffa324..aada20f5ddb 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 @@ -877,33 +877,4 @@ public void testCanCreateLiteralObjectObject() { } - /** - * Test method for {@link org.eclipse.rdf4j.model.util.Literals#getLabel(Optional, String)}} . - */ - @Test - public void testGetLabelForOptional() { - - 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() { - - 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")); - } } diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResultUtil.java b/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResultUtil.java deleted file mode 100644 index 3790e4cfb4c..00000000000 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/QueryResultUtil.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query; - -/** - * @author Jeen Broekstra - * @deprecated Use {@link QueryResults} instead. - */ -@Deprecated(since = "2.0") -public class QueryResultUtil extends QueryResults { - -} 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 90448a63c1f..89ade8c1499 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 @@ -12,7 +12,6 @@ import java.io.InputStream; import java.lang.ref.Cleaner; -import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -72,9 +71,10 @@ public class QueryResults extends Iterations { * @param iteration the source iteration to get the statements from. * @return a {@link Model} containing all statements obtained from the specified source iteration. */ - public static Model asModel(CloseableIteration iteration) - throws QueryEvaluationException { - return asModel(iteration, new DynamicModelFactory()); + public static Model asModel(CloseableIteration iteration) throws QueryEvaluationException { + try (iteration) { + return asModel(iteration, new DynamicModelFactory()); + } } /** @@ -84,12 +84,13 @@ public static Model asModel(CloseableIteration iteration) * @param modelFactory the ModelFactory used to instantiate the model that gets returned. * @return a {@link Model} containing all statements obtained from the specified source iteration. */ - public static Model asModel(CloseableIteration iteration, - ModelFactory modelFactory) + public static Model asModel(CloseableIteration iteration, ModelFactory modelFactory) throws QueryEvaluationException { - Model model = modelFactory.createEmptyModel(); - addAll(iteration, model); - return model; + try (iteration) { + Model model = modelFactory.createEmptyModel(); + addAll(iteration, model); + return model; + } } /** @@ -99,11 +100,13 @@ public static Model asModel(CloseableIteration iteration, * @return a List containing all elements obtained from the specified query result. */ public static List asList(QueryResult queryResult) throws QueryEvaluationException { - // stream.collect is slightly slower than addAll for lists - List list = new ArrayList<>(); + try (queryResult) { + // stream.collect is slightly slower than addAll for lists + List list = new ArrayList<>(); - // addAll closes the iteration - return addAll(queryResult, list); + // addAll closes the iteration + return addAll(queryResult, list); + } } /** @@ -242,13 +245,10 @@ public static GraphQueryResult limitResults(GraphQueryResult queryResult, long l * @param baseURI The base URI for the RDF document. * @param format The {@link RDFFormat} of the RDF document. * @return A {@link GraphQueryResult} that parses in the background, and must be closed to prevent resource leaks. - * @deprecated WeakReference callerReference argument will be removed */ - @Deprecated(since = "4.1.2") - public static GraphQueryResult parseGraphBackground(InputStream in, String baseURI, RDFFormat format, - WeakReference callerReference) + public static GraphQueryResult parseGraphBackground(InputStream in, String baseURI, RDFFormat format) throws UnsupportedRDFormatException { - return parseGraphBackground(in, baseURI, Rio.createParser(format), callerReference); + return parseGraphBackground(in, baseURI, Rio.createParser(format)); } /** @@ -261,12 +261,8 @@ public static GraphQueryResult parseGraphBackground(InputStream in, String baseU * @param baseURI The base URI for the RDF document. * @param parser The {@link RDFParser}. * @return A {@link GraphQueryResult} that parses in the background, and must be closed to prevent resource leaks. - * @deprecated WeakReference callerReference argument will be removed */ - @Deprecated(since = "4.1.2") - public static GraphQueryResult parseGraphBackground(InputStream in, String baseURI, RDFParser parser, - WeakReference callerReference) { - assert callerReference == null; + public static GraphQueryResult parseGraphBackground(InputStream in, String baseURI, RDFParser parser) { RDFFormat format = parser.getRDFFormat(); BackgroundGraphResult result = new BackgroundGraphResult( new QueueCursor<>(new LinkedBlockingQueue<>(1)), @@ -346,27 +342,32 @@ public static void report(GraphQueryResult graphQueryResult, RDFHandler rdfHandl * @throws QueryEvaluationException */ public static boolean equals(TupleQueryResult tqr1, TupleQueryResult tqr2) throws QueryEvaluationException { - List list1 = Iterations.asList(tqr1); - List list2 = Iterations.asList(tqr2); + try (tqr1; tqr2) { + List list1 = Iterations.asList(tqr1); + List list2 = Iterations.asList(tqr2); - // Compare the number of statements in both sets - if (list1.size() != list2.size()) { - return false; - } + // Compare the number of statements in both sets + if (list1.size() != list2.size()) { + return false; + } - return matchBindingSets(list1, list2); + return matchBindingSets(list1, list2); + } } public static boolean isSubset(TupleQueryResult tqr1, TupleQueryResult tqr2) throws QueryEvaluationException { - List list1 = Iterations.asList(tqr1); - List list2 = Iterations.asList(tqr2); + try (tqr1; tqr2) { - // Compare the number of statements in both sets - if (list1.size() > list2.size()) { - return false; - } + List list1 = Iterations.asList(tqr1); + List list2 = Iterations.asList(tqr2); - return matchBindingSets(list1, list2); + // Compare the number of statements in both sets + if (list1.size() > list2.size()) { + return false; + } + + return matchBindingSets(list1, list2); + } } /** @@ -380,10 +381,12 @@ public static boolean isSubset(TupleQueryResult tqr1, TupleQueryResult tqr2) thr * @see Models#isomorphic(Iterable, Iterable) */ public static boolean equals(GraphQueryResult result1, GraphQueryResult result2) throws QueryEvaluationException { - Set graph1 = Iterations.asSet(result1); - Set graph2 = Iterations.asSet(result2); + try (result1; result2) { + Set graph1 = Iterations.asSet(result1); + Set graph2 = Iterations.asSet(result2); - return Models.isomorphic(graph1, graph2); + return Models.isomorphic(graph1, graph2); + } } private static boolean matchBindingSets(List queryResult1, @@ -543,14 +546,13 @@ public static boolean bindingSetsCompatible(BindingSet bs1, BindingSet bs2) { Set bs2BindingNames = bs2.getBindingNames(); - for (String bindingName : bs1BindingNames) { - - if (bs2BindingNames.contains(bindingName)) { - Value value1 = bs1.getValue(bindingName); + for (Binding binding : bs1) { + if (bs2BindingNames.contains(binding.getName())) { + Value value1 = binding.getValue(); // if a variable is unbound in one set it is compatible if (value1 != null) { - Value value2 = bs2.getValue(bindingName); + Value value2 = bs2.getValue(binding.getName()); // if a variable is unbound in one set it is compatible if (value2 != null && !value1.equals(value2)) { @@ -559,6 +561,7 @@ public static boolean bindingSetsCompatible(BindingSet bs1, BindingSet bs2) { } } + } return true; @@ -619,11 +622,7 @@ public void remove() throws QueryEvaluationException { @Override public void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - filter.close(); - } + filter.close(); } @Override @@ -687,11 +686,7 @@ public void remove() throws QueryEvaluationException { @Override public void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - filter.close(); - } + filter.close(); } @Override diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/TupleQueryResultHandlerBase.java b/core/query/src/main/java/org/eclipse/rdf4j/query/TupleQueryResultHandlerBase.java deleted file mode 100644 index 95485024e55..00000000000 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/TupleQueryResultHandlerBase.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query; - -/** - * @author Jeen Broekstra - * @deprecated since 2.0. Use {@link AbstractTupleQueryResultHandler} instead. - */ -@Deprecated(since = "2.0") -public class TupleQueryResultHandlerBase extends AbstractTupleQueryResultHandler { - -} diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/BackgroundGraphResult.java b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/BackgroundGraphResult.java index 9ad807c32f6..79bd055f6e6 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/BackgroundGraphResult.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/BackgroundGraphResult.java @@ -31,7 +31,6 @@ * * @author James Leigh */ -@Deprecated(since = "4.1.0") public class BackgroundGraphResult extends IterationWrapper implements GraphQueryResult, Runnable, RDFHandler { diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/BindingImpl.java b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/BindingImpl.java deleted file mode 100644 index fc0460d7a07..00000000000 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/BindingImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.impl; - -import org.eclipse.rdf4j.model.Value; - -/** - * @author Jeen Broekstra - * @deprecated Use {@link SimpleBinding} instead. - */ -@Deprecated(since = "2.0") -public class BindingImpl extends SimpleBinding { - - private static final long serialVersionUID = 1L; - - public BindingImpl(String name, Value value) { - super(name, value); - } - -} diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/DatasetImpl.java b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/DatasetImpl.java deleted file mode 100644 index cf818fd3fed..00000000000 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/DatasetImpl.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.impl; - -/** - * @author Jeen Broekstra - * @deprecated Use {@link SimpleDataset} instead. - */ -@Deprecated(since = "2.0") -public class DatasetImpl extends SimpleDataset { - - private static final long serialVersionUID = 1L; - -} diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/GraphQueryResultImpl.java b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/GraphQueryResultImpl.java deleted file mode 100644 index da47c3418cb..00000000000 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/GraphQueryResultImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.impl; - -import java.util.Map; - -import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.model.Statement; - -/** - * @author Jeen Broekstra - * @deprecated since 2.0. Use {@link IteratingGraphQueryResult} instead. - */ -@Deprecated(since = "2.0") -public class GraphQueryResultImpl extends IteratingGraphQueryResult { - - public GraphQueryResultImpl(Map namespaces, - CloseableIteration statementIter) { - super(namespaces, statementIter); - } - -} diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/IteratingGraphQueryResult.java b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/IteratingGraphQueryResult.java index f1348f5271c..9b2e2bbb653 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/IteratingGraphQueryResult.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/IteratingGraphQueryResult.java @@ -26,7 +26,6 @@ * @author Arjohn Kampman * @author Jeen Broekstra */ -@Deprecated(since = "4.1.0") public class IteratingGraphQueryResult extends IterationWrapper implements GraphQueryResult { diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/IteratingTupleQueryResult.java b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/IteratingTupleQueryResult.java index 4b59aafe843..4a2794b8bc7 100644 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/IteratingTupleQueryResult.java +++ b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/IteratingTupleQueryResult.java @@ -24,7 +24,6 @@ /** * An iterating implementation of the {@link TupleQueryResult} interface. */ -@Deprecated(since = "4.1.0") public class IteratingTupleQueryResult extends IterationWrapper implements TupleQueryResult { diff --git a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/TupleQueryResultImpl.java b/core/query/src/main/java/org/eclipse/rdf4j/query/impl/TupleQueryResultImpl.java deleted file mode 100644 index b800e419f65..00000000000 --- a/core/query/src/main/java/org/eclipse/rdf4j/query/impl/TupleQueryResultImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.impl; - -import java.util.List; - -import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.query.BindingSet; - -/** - * @author Jeen Broekstra - * @deprecated Use {@link IteratingTupleQueryResult} instead. - */ -@Deprecated(since = "2.0") -public class TupleQueryResultImpl extends IteratingTupleQueryResult { - - public TupleQueryResultImpl(List bindingNames, - CloseableIteration bindingSetIter) { - super(bindingNames, bindingSetIter); - } - -} diff --git a/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/FilterIterationTest.java b/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/FilterIterationTest.java index a8f8615c5b2..a5753d79cd3 100644 --- a/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/FilterIterationTest.java +++ b/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/FilterIterationTest.java @@ -16,13 +16,18 @@ public class FilterIterationTest extends CloseableIterationTest { @Override protected CloseableIteration createTestIteration() { - return new FilterIteration(createStringList1Iteration()) { + return new FilterIteration<>(createStringList1Iteration()) { @Override protected boolean accept(String object) { return "3".equals(object); } + @Override + protected void handleClose() { + + } + }; } diff --git a/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/IteratorIterationTest.java b/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/IteratorIterationTest.java deleted file mode 100644 index ffecef51861..00000000000 --- a/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/IteratorIterationTest.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.common.iteration; - -public class IteratorIterationTest extends IterationTest { - - @Override - protected CloseableIteration createTestIteration() { - return new IteratorIteration<>(stringList1.iterator()); - } - - @Override - protected int getTestIterationSize() { - return stringList1.size(); - } -} diff --git a/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/LookAheadIterationTest.java b/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/LookAheadIterationTest.java index 2afb16e3640..bbbc938f616 100644 --- a/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/LookAheadIterationTest.java +++ b/core/query/src/test/java/org/eclipse/rdf4j/common/iteration/LookAheadIterationTest.java @@ -18,7 +18,12 @@ public class LookAheadIterationTest extends CloseableIterationTest { protected CloseableIteration createTestIteration() { final Iterator iter = stringList1.iterator(); - return new LookAheadIteration() { + return new LookAheadIteration<>() { + + @Override + protected void handleClose() { + + } @Override protected String getNextElement() { 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 23035e7128f..1b93ee48eab 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 @@ -258,6 +258,10 @@ public Map getNamespaces() throws QueryEvaluationException { return null; } + @Override + protected void handleClose() { + + } } @Test diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ArrayBindingSet.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ArrayBindingSet.java index 242cb73a71b..a7b665cb9c2 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ArrayBindingSet.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/ArrayBindingSet.java @@ -46,6 +46,7 @@ public class ArrayBindingSet extends AbstractBindingSet implements MutableBindin // Creating a LinkedHashSet is expensive, so we should cache the binding names set private Set bindingNamesSetCache; + private boolean empty; private final boolean[] whichBindingsHaveBeenSet; @@ -62,6 +63,7 @@ public ArrayBindingSet(String... names) { this.bindingNames = names; this.values = new Value[names.length]; this.whichBindingsHaveBeenSet = new boolean[names.length]; + this.empty = true; } public ArrayBindingSet(BindingSet toCopy, Set names, String[] namesArray) { @@ -77,14 +79,17 @@ public ArrayBindingSet(BindingSet toCopy, Set names, String[] namesArray this.whichBindingsHaveBeenSet[i] = true; } } + this.empty = toCopy.isEmpty(); } public ArrayBindingSet(ArrayBindingSet toCopy, String... names) { this.bindingNames = names; + this.values = Arrays.copyOf(toCopy.values, toCopy.values.length); this.whichBindingsHaveBeenSet = Arrays.copyOf(toCopy.whichBindingsHaveBeenSet, toCopy.whichBindingsHaveBeenSet.length); + this.empty = toCopy.empty; } /** @@ -105,6 +110,7 @@ public BiConsumer getDirectSetBinding(String bindingName return (v, a) -> { a.values[index] = v; a.whichBindingsHaveBeenSet[index] = true; + a.empty = false; a.clearCache(); }; } @@ -120,6 +126,7 @@ public BiConsumer getDirectAddBinding(String bindingName assert !a.whichBindingsHaveBeenSet[index] : "variable already bound: " + bindingName; a.values[index] = v; a.whichBindingsHaveBeenSet[index] = true; + a.empty = false; a.clearCache(); }; @@ -244,6 +251,9 @@ public Iterator iterator() { @Override public int size() { + if (empty) { + return 0; + } int size = 0; for (boolean value : whichBindingsHaveBeenSet) { @@ -364,20 +374,25 @@ public void setBinding(String name, Value value) { this.values[index] = value; this.whichBindingsHaveBeenSet[index] = value != null; + if (value == null) { + this.empty = true; + for (boolean b : whichBindingsHaveBeenSet) { + if (b) { + this.empty = false; + break; + } + } + } clearCache(); } @Override public boolean isEmpty() { - for (int index = 0; index < values.length; index++) { - if (whichBindingsHaveBeenSet[index]) { - return false; - } - } - return true; + return empty; } private void clearCache() { bindingNamesSetCache = null; } + } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/QueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/QueryEvaluationStep.java index 59c3662b90f..2fef22f46ab 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/QueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/QueryEvaluationStep.java @@ -25,13 +25,15 @@ */ @FunctionalInterface public interface QueryEvaluationStep { + + EmptyIteration EMPTY_ITERATION = new EmptyIteration<>(); + QueryEvaluationStep EMPTY = bindings -> EMPTY_ITERATION; + /** * Utility class that removes code duplication and makes a precompiled QueryEvaluationStep available as an iteration * that may be created and used later. */ - @Deprecated(since = "4.1.0", forRemoval = true) - class DelayedEvaluationIteration - extends DelayedIteration { + class DelayedEvaluationIteration extends DelayedIteration { private final QueryEvaluationStep arg; private final BindingSet bs; @@ -47,9 +49,6 @@ protected CloseableIteration createIteration() } } - EmptyIteration EMPTY_ITERATION = new EmptyIteration<>(); - QueryEvaluationStep EMPTY = bindings -> EMPTY_ITERATION; - CloseableIteration evaluate(BindingSet bindings); /** @@ -64,7 +63,7 @@ static QueryEvaluationStep minimal(EvaluationStrategy strategy, TupleExpr expr) } static QueryEvaluationStep empty() { - return bs -> new EmptyIteration<>(); + return EMPTY; } /** diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/DefaultEvaluationStrategy.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/DefaultEvaluationStrategy.java index ee50f83d191..dffc3cc2a26 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/DefaultEvaluationStrategy.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/DefaultEvaluationStrategy.java @@ -23,7 +23,6 @@ import org.eclipse.rdf4j.collection.factory.impl.DefaultCollectionFactory; import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.common.iteration.DistinctIteration; -import org.eclipse.rdf4j.common.iteration.EmptyIteration; import org.eclipse.rdf4j.common.iteration.IterationWrapper; import org.eclipse.rdf4j.common.iteration.LookAheadIteration; import org.eclipse.rdf4j.common.iteration.ReducedIteration; @@ -250,11 +249,7 @@ public BindingSet getNextElement() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - iter.close(); - } + iter.close(); } }; } @@ -396,7 +391,7 @@ public CloseableIteration evaluate(TupleExpr expr, BindingSet bindin } else if (expr instanceof SingletonSet) { result = precompile(expr).evaluate(bindings); } else if (expr instanceof EmptySet) { - result = new EmptyIteration<>(); + result = QueryEvaluationStep.EMPTY_ITERATION; } else if (expr instanceof ZeroLengthPath) { result = precompile(expr).evaluate(bindings); } else if (expr instanceof ArbitraryLengthPath) { @@ -628,13 +623,13 @@ protected QueryEvaluationStep prepare(Filter node, QueryEvaluationContext contex // If we have a failed compilation we always return false. // Which means empty. so let's short circuit that. // ves = new QueryValueEvaluationStep.ConstantQueryValueEvaluationStep(BooleanLiteral.FALSE); - return bs -> new EmptyIteration<>(); + return bs -> QueryEvaluationStep.EMPTY_ITERATION; } return bs -> { CloseableIteration evaluate = null; try { evaluate = arg.evaluate(bs); - return new FilterIterator(node, evaluate, ves, DefaultEvaluationStrategy.this); + return new FilterIterator(evaluate, ves, DefaultEvaluationStrategy.this); } catch (Throwable t) { if (evaluate != null) { evaluate.close(); @@ -843,7 +838,7 @@ protected QueryEvaluationStep prepare(SingletonSet singletonSet, QueryEvaluation protected QueryEvaluationStep prepare(EmptySet emptySet, QueryEvaluationContext context) throws QueryEvaluationException { - return bindings -> new EmptyIteration<>(); + return bindings -> QueryEvaluationStep.EMPTY_ITERATION; } @Override diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/BindingSetAssignmentQueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/BindingSetAssignmentQueryEvaluationStep.java index 10eb79540fc..096339d3d3b 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/BindingSetAssignmentQueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/BindingSetAssignmentQueryEvaluationStep.java @@ -44,7 +44,7 @@ public CloseableIteration evaluate(BindingSet bindings) { // we need to verify that new binding assignments do not overwrite existing bindings CloseableIteration result; - result = new LookAheadIteration() { + result = new LookAheadIteration<>() { @Override protected BindingSet getNextElement() throws QueryEvaluationException { @@ -77,6 +77,11 @@ protected BindingSet getNextElement() throws QueryEvaluationException { } return nextResult; } + + @Override + protected void handleClose() { + + } }; return result; diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/JoinQueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/JoinQueryEvaluationStep.java index 66c726afa29..5343911f905 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/JoinQueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/JoinQueryEvaluationStep.java @@ -43,7 +43,7 @@ public JoinQueryEvaluationStep(EvaluationStrategy strategy, Join join, QueryEval joinAttributes, context); join.setAlgorithm(HashJoinIteration.class.getSimpleName()); } else { - eval = bindings -> new JoinIterator(leftPrepared, rightPrepared, bindings); + eval = bindings -> JoinIterator.getInstance(leftPrepared, rightPrepared, bindings); join.setAlgorithm(JoinIterator.class.getSimpleName()); } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/LeftJoinQueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/LeftJoinQueryEvaluationStep.java index 669b00d814a..7d86ec5cd9e 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/LeftJoinQueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/LeftJoinQueryEvaluationStep.java @@ -103,7 +103,7 @@ public CloseableIteration evaluate(BindingSet bindings) { if (containsNone) { // left join is "well designed" leftJoin.setAlgorithm(LeftJoinIterator.class.getSimpleName()); - return new LeftJoinIterator(left, right, condition, bindings, leftJoin.getBindingNames()); + return LeftJoinIterator.getInstance(left, right, condition, bindings, leftJoin.getBindingNames()); } else { Set problemVars = new HashSet<>(optionalVars); problemVars.retainAll(bindings.getBindingNames()); diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/RdfStarQueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/RdfStarQueryEvaluationStep.java index 57608c574b5..5def1a2c362 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/RdfStarQueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/RdfStarQueryEvaluationStep.java @@ -90,6 +90,11 @@ protected boolean accept(Triple triple) throws QueryEvaluationException { } return true; } + + @Override + protected void handleClose() { + + } }; return new ConvertingIteration<>(filterIter) { diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/ReificationRdfStarQueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/ReificationRdfStarQueryEvaluationStep.java index 4ec734e749d..2dcd652307a 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/ReificationRdfStarQueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/ReificationRdfStarQueryEvaluationStep.java @@ -66,9 +66,7 @@ protected Resource convert(Statement sourceObject) // the expected values from TripleRef pattern and supplied bindings collection return new LookAheadIteration<>() { @Override - protected void handleClose() - throws QueryEvaluationException { - super.handleClose(); + protected void handleClose() throws QueryEvaluationException { iter.close(); } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/StatementPatternQueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/StatementPatternQueryEvaluationStep.java index 53c712b76db..01f96d6138c 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/StatementPatternQueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/StatementPatternQueryEvaluationStep.java @@ -41,6 +41,8 @@ */ public class StatementPatternQueryEvaluationStep implements QueryEvaluationStep { + public static final EmptyIteration EMPTY_ITERATION = new EmptyIteration<>(); + public static final Resource[] DEFAULT_CONTEXT = { null }; public static final Resource[] ALL_CONTEXT = new Resource[0]; private static final Function RETURN_NULL_VALUE_RESOURCE_ARRAY = v -> null; @@ -206,22 +208,22 @@ private static Function makeGetVarValue(Var var, QueryEvaluat @Override public CloseableIteration evaluate(BindingSet bindings) { if (emptyGraph) { - return EMPTY_ITERATION; + return QueryEvaluationStep.EMPTY_ITERATION; } else if (bindings.isEmpty()) { ConvertStatementToBindingSetIterator iteration = getIteration(); if (iteration == null) { - return EMPTY_ITERATION; + return QueryEvaluationStep.EMPTY_ITERATION; } return iteration; } else if (unboundTest.test(bindings)) { // the variable must remain unbound for this solution see // https://www.w3.org/TR/sparql11-query/#assignment - return EMPTY_ITERATION; + return QueryEvaluationStep.EMPTY_ITERATION; } else { JoinStatementWithBindingSetIterator iteration = getIteration(bindings); if (iteration == null) { - return EMPTY_ITERATION; + return QueryEvaluationStep.EMPTY_ITERATION; } return iteration; } @@ -281,13 +283,19 @@ private ConvertStatementToBindingSetIterator getIteration() { } Value subject = statementPattern.getSubjectVar().getValue(); + + if (subject != null && !subject.isResource()) { + return null; + } + Value predicate = statementPattern.getPredicateVar().getValue(); - Value object = statementPattern.getObjectVar().getValue(); - if (subject != null && !subject.isResource() || predicate != null && !predicate.isIRI()) { + if (predicate != null && !predicate.isIRI()) { return null; } + Value object = statementPattern.getObjectVar().getValue(); + CloseableIteration iteration = null; try { iteration = tripleSource.getStatements((Resource) subject, (IRI) predicate, object, contexts); @@ -324,6 +332,11 @@ private CloseableIteration handleFilter(Resource[] contexts protected boolean accept(Statement object) throws QueryEvaluationException { return filter.test(object); } + + @Override + protected void handleClose() { + + } }; } else { return iteration; diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/UnionQueryEvaluationStep.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/UnionQueryEvaluationStep.java index 63dbd1a1e28..29690ddccf3 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/UnionQueryEvaluationStep.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/evaluationsteps/UnionQueryEvaluationStep.java @@ -35,9 +35,9 @@ public CloseableIteration evaluate(BindingSet bindings) { evaluate = leftQes.evaluate(bindings); evaluate1 = rightQes.evaluate(bindings); - if (evaluate instanceof EmptyIteration) { + if (evaluate == QueryEvaluationStep.EMPTY_ITERATION) { return evaluate1; - } else if (evaluate1 instanceof EmptyIteration) { + } else if (evaluate1 == QueryEvaluationStep.EMPTY_ITERATION) { return evaluate; } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/CrossProductIteration.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/CrossProductIteration.java index 566d3320f14..fc5dbe9155e 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/CrossProductIteration.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/CrossProductIteration.java @@ -71,10 +71,6 @@ protected BindingSet getNextElement() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - resultIteration.close(); - } + resultIteration.close(); } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/DescribeIteration.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/DescribeIteration.java index 929cb0a5d26..7d29768cf29 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/DescribeIteration.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/DescribeIteration.java @@ -27,6 +27,8 @@ import org.eclipse.rdf4j.query.algebra.StatementPattern; import org.eclipse.rdf4j.query.algebra.Var; import org.eclipse.rdf4j.query.algebra.evaluation.EvaluationStrategy; +import org.eclipse.rdf4j.query.algebra.evaluation.QueryEvaluationStep; +import org.eclipse.rdf4j.query.algebra.evaluation.QueryValueEvaluationStep; /** * Iteration that implements a simplified version of Symmetric Concise Bounded Description (omitting reified @@ -35,7 +37,6 @@ * @author Jeen Broekstra * @see Concise Bounded Description - alternatives */ -@Deprecated(since = "4.1.0") public class DescribeIteration extends LookAheadIteration { protected final static String VARNAME_SUBJECT = "subject"; @@ -208,7 +209,7 @@ protected BindingSet getNextElement() throws QueryEvaluationException { protected CloseableIteration createNextIteration(Value subject, Value object) throws QueryEvaluationException { if (subject == null && object == null) { - return new EmptyIteration<>(); + return QueryEvaluationStep.EMPTY_ITERATION; } Var subjVar = new Var(VARNAME_SUBJECT, subject); @@ -222,17 +223,11 @@ protected CloseableIteration createNextIteration(Value subject, Valu @Override protected void handleClose() throws QueryEvaluationException { try { - super.handleClose(); - - } finally { - try { - if (currentDescribeExprIter != null) { - currentDescribeExprIter.close(); - } - } finally { - sourceIter.close(); + if (currentDescribeExprIter != null) { + currentDescribeExprIter.close(); } - + } finally { + sourceIter.close(); } } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ExtensionIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ExtensionIterator.java index fed881bf324..8c6fbbd65ff 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ExtensionIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ExtensionIterator.java @@ -28,7 +28,6 @@ import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.impl.QueryEvaluationContext; -@Deprecated(since = "4.1.0") public class ExtensionIterator extends ConvertingIteration { private final Consumer setter; diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/FilterIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/FilterIterator.java index 2c3d6beb308..38537524fdc 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/FilterIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/FilterIterator.java @@ -23,14 +23,11 @@ import org.eclipse.rdf4j.query.MutableBindingSet; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.algebra.Filter; -import org.eclipse.rdf4j.query.algebra.QueryModelNode; -import org.eclipse.rdf4j.query.algebra.SubQueryValueOperator; import org.eclipse.rdf4j.query.algebra.evaluation.EvaluationStrategy; import org.eclipse.rdf4j.query.algebra.evaluation.QueryValueEvaluationStep; import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.impl.QueryEvaluationContext; -@Deprecated(since = "4.1.0") public class FilterIterator extends FilterIteration { private final QueryValueEvaluationStep condition; @@ -40,8 +37,8 @@ public class FilterIterator extends FilterIteration { * Constructors * *--------------*/ - public FilterIterator(Filter filter, CloseableIteration iter, - QueryValueEvaluationStep condition, EvaluationStrategy strategy) throws QueryEvaluationException { + public FilterIterator(CloseableIteration iter, QueryValueEvaluationStep condition, + EvaluationStrategy strategy) throws QueryEvaluationException { super(iter); this.condition = condition; this.strategy = strategy; @@ -58,6 +55,11 @@ protected boolean accept(BindingSet bindings) throws QueryEvaluationException { } } + @Override + protected void handleClose() { + + } + /** * This is used to make sure that no variable is seen by the filter that are not in scope. Historically important in * subquery cases. 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 d0bb8764341..a860d9430f9 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 @@ -14,7 +14,6 @@ import java.util.Collection; import java.util.Collections; import java.util.Iterator; -import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Random; @@ -30,7 +29,7 @@ import org.eclipse.rdf4j.collection.factory.api.BindingSetKey; import org.eclipse.rdf4j.collection.factory.api.CollectionFactory; import org.eclipse.rdf4j.collection.factory.impl.DefaultCollectionFactory; -import org.eclipse.rdf4j.common.iteration.CloseableIteratorIteration; +import org.eclipse.rdf4j.common.iteration.AbstractCloseableIteratorIteration; import org.eclipse.rdf4j.common.transaction.QueryEvaluationMode; import org.eclipse.rdf4j.model.Literal; import org.eclipse.rdf4j.model.Value; @@ -74,7 +73,7 @@ * @author Jerven Bolleman * @author Tomas Kovachev */ -public class GroupIterator extends CloseableIteratorIteration { +public class GroupIterator extends AbstractCloseableIteratorIteration { /*-----------* * Constants * @@ -130,30 +129,11 @@ public GroupIterator(EvaluationStrategy strategy, Group group, BindingSet parent @Override public void handleClose() throws QueryEvaluationException { - try { - cf.close(); - } finally { - super.handleClose(); - } - } - - @Override - public boolean hasNext() throws QueryEvaluationException { - if (!super.hasIterator()) { - super.setIterator(createIterator()); - } - return super.hasNext(); + cf.close(); } @Override - public BindingSet next() throws QueryEvaluationException { - if (!super.hasIterator()) { - super.setIterator(createIterator()); - } - return super.next(); - } - - private Iterator createIterator() throws QueryEvaluationException { + protected Iterator getIterator() throws QueryEvaluationException { List> aggregates = makeAggregates(); Supplier makeNewBindingSet; diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/HashJoinIteration.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/HashJoinIteration.java index 09b302ebdfa..6d67e3e3fda 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/HashJoinIteration.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/HashJoinIteration.java @@ -178,37 +178,33 @@ protected BindingSet getNextElement() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { try { - super.handleClose(); + if (leftIter != null) { + leftIter.close(); + } } finally { try { - if (leftIter != null) { - leftIter.close(); + if (rightIter != null) { + rightIter.close(); } } finally { try { - if (rightIter != null) { - rightIter.close(); + Iterator toCloseHashTableValues = hashTableValues; + hashTableValues = null; + if (toCloseHashTableValues != null) { + closeHashValue(toCloseHashTableValues); } } finally { try { - Iterator toCloseHashTableValues = hashTableValues; - hashTableValues = null; - if (toCloseHashTableValues != null) { - closeHashValue(toCloseHashTableValues); + Iterator toCloseScanList = scanList; + scanList = null; + if (toCloseScanList != null) { + disposeCache(toCloseScanList); } } finally { - try { - Iterator toCloseScanList = scanList; - scanList = null; - if (toCloseScanList != null) { - disposeCache(toCloseScanList); - } - } finally { - Map> toCloseHashTable = hashTable; - hashTable = null; - if (toCloseHashTable != null) { - disposeHashTable(toCloseHashTable); - } + Map> toCloseHashTable = hashTable; + hashTable = null; + if (toCloseHashTable != null) { + disposeHashTable(toCloseHashTable); } } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIterator.java index 0501ceb997c..c81bbed2174 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIterator.java @@ -10,10 +10,7 @@ *******************************************************************************/ package org.eclipse.rdf4j.query.algebra.evaluation.iterator; -import java.util.NoSuchElementException; - import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.common.iteration.EmptyIteration; import org.eclipse.rdf4j.common.iteration.LookAheadIteration; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryEvaluationException; @@ -30,38 +27,33 @@ */ public class JoinIterator extends LookAheadIteration { - /*-----------* - * Variables * - *-----------*/ - private final CloseableIteration leftIter; private CloseableIteration rightIter; private final QueryEvaluationStep preparedRight; - /*--------------* - * Constructors * - *--------------*/ - public JoinIterator(QueryEvaluationStep leftPrepared, - QueryEvaluationStep rightPrepared, BindingSet bindings) throws QueryEvaluationException { + QueryEvaluationStep preparedRight, BindingSet bindings) throws QueryEvaluationException { leftIter = leftPrepared.evaluate(bindings); + this.preparedRight = preparedRight; + } - // Initialize with empty iteration so that var is never null - rightIter = new EmptyIteration<>(); - this.preparedRight = rightPrepared; + private JoinIterator(CloseableIteration leftIter, QueryEvaluationStep preparedRight) + throws QueryEvaluationException { + this.leftIter = leftIter; + this.preparedRight = preparedRight; } -// public JoinIterator(EvaluationStrategy strategy, Join join, BindingSet bindings, QueryEvaluationContext context) -// throws QueryEvaluationException { -// leftIter = strategy.evaluate(join.getLeftArg(), bindings); -// -// // Initialize with empty iteration so that var is never null -// rightIter = new EmptyIteration<>(); -// preparedRight = strategy.precompile(join.getRightArg(), context); -// join.setAlgorithm(this); -// } + public static CloseableIteration getInstance(QueryEvaluationStep leftPrepared, + QueryEvaluationStep preparedRight, BindingSet bindings) { + CloseableIteration leftIter = leftPrepared.evaluate(bindings); + if (leftIter == QueryEvaluationStep.EMPTY_ITERATION) { + return leftIter; + } + + return new JoinIterator(leftIter, preparedRight); + } /*---------* * Methods * @@ -69,23 +61,21 @@ public JoinIterator(QueryEvaluationStep leftPrepared, @Override protected BindingSet getNextElement() throws QueryEvaluationException { - - try { - while (rightIter.hasNext() || leftIter.hasNext()) { - if (rightIter.hasNext()) { - return rightIter.next(); - } - - // Right iteration exhausted + if (rightIter != null) { + if (rightIter.hasNext()) { + return rightIter.next(); + } else { rightIter.close(); + } + } - if (leftIter.hasNext()) { - rightIter = preparedRight.evaluate(leftIter.next()); - } + while (leftIter.hasNext()) { + rightIter = preparedRight.evaluate(leftIter.next()); + if (rightIter.hasNext()) { + return rightIter.next(); + } else { + rightIter.close(); } - } catch (NoSuchElementException ignore) { - // probably, one of the iterations has been closed concurrently in - // handleClose() } return null; @@ -94,11 +84,9 @@ protected BindingSet getNextElement() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { try { - super.handleClose(); + leftIter.close(); } finally { - try { - leftIter.close(); - } finally { + if (rightIter != null) { rightIter.close(); } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/LeftJoinIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/LeftJoinIterator.java index 15c853319fd..45022b5f59b 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/LeftJoinIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/LeftJoinIterator.java @@ -14,7 +14,6 @@ import java.util.Set; import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.common.iteration.EmptyIteration; import org.eclipse.rdf4j.common.iteration.LookAheadIteration; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.query.Binding; @@ -31,7 +30,6 @@ import org.eclipse.rdf4j.query.algebra.evaluation.util.QueryEvaluationUtility; public class LeftJoinIterator extends LookAheadIteration { - /*-----------* * Variables * *-----------*/ @@ -61,8 +59,7 @@ public LeftJoinIterator(EvaluationStrategy strategy, LeftJoin join, BindingSet b leftIter = strategy.evaluate(join.getLeftArg(), bindings); - // Initialize with empty iteration so that var is never null - rightIter = new EmptyIteration<>(); + rightIter = null; prepareRightArg = strategy.precompile(join.getRightArg(), context); join.setAlgorithm(this); @@ -82,25 +79,58 @@ public LeftJoinIterator(QueryEvaluationStep left, QueryEvaluationStep right, Que leftIter = left.evaluate(bindings); // Initialize with empty iteration so that var is never null - rightIter = new EmptyIteration<>(); + rightIter = null; prepareRightArg = right; this.joinCondition = joinCondition; } + public LeftJoinIterator(CloseableIteration leftIter, QueryEvaluationStep prepareRightArg, + QueryValueEvaluationStep joinCondition, Set scopeBindingNamse) { + this.scopeBindingNames = scopeBindingNamse; + this.leftIter = leftIter; + this.rightIter = null; + this.prepareRightArg = prepareRightArg; + this.joinCondition = joinCondition; + } + + public static CloseableIteration getInstance(QueryEvaluationStep left, + QueryEvaluationStep prepareRightArg, QueryValueEvaluationStep joinCondition, BindingSet bindings, + Set scopeBindingNamse) { + + CloseableIteration leftIter = left.evaluate(bindings); + + if (leftIter == QueryEvaluationStep.EMPTY_ITERATION) { + return leftIter; + } else { + return new LeftJoinIterator(leftIter, prepareRightArg, joinCondition, scopeBindingNamse); + } + + } + /*---------* * Methods * *---------*/ @Override protected BindingSet getNextElement() throws QueryEvaluationException { + try { CloseableIteration nextRightIter = rightIter; - while (nextRightIter.hasNext() || leftIter.hasNext()) { + while (nextRightIter == null || nextRightIter.hasNext() || leftIter.hasNext()) { BindingSet leftBindings = null; - if (!nextRightIter.hasNext()) { + if (nextRightIter == null) { + if (leftIter.hasNext()) { + // Use left arg's bindings in case join fails + leftBindings = leftIter.next(); + nextRightIter = rightIter = prepareRightArg.evaluate(leftBindings); + } else { + return null; + } + + } else if (!nextRightIter.hasNext()) { // Use left arg's bindings in case join fails leftBindings = leftIter.next(); @@ -108,6 +138,11 @@ protected BindingSet getNextElement() throws QueryEvaluationException { nextRightIter = rightIter = prepareRightArg.evaluate(leftBindings); } + if (nextRightIter == QueryEvaluationStep.EMPTY_ITERATION) { + rightIter = null; + return leftBindings; + } + while (nextRightIter.hasNext()) { BindingSet rightBindings = nextRightIter.next(); @@ -136,9 +171,12 @@ protected BindingSet getNextElement() throws QueryEvaluationException { } if (leftBindings != null) { + rightIter = null; // Join failed, return left arg's bindings return leftBindings; } + + return null; } } catch (NoSuchElementException ignore) { // probably, one of the iterations has been closed concurrently in @@ -156,11 +194,9 @@ private boolean isTrue(QueryValueEvaluationStep expr, QueryBindingSet bindings) @Override protected void handleClose() throws QueryEvaluationException { try { - super.handleClose(); + leftIter.close(); } finally { - try { - leftIter.close(); - } finally { + if (rightIter != null) { rightIter.close(); } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/MultiProjectionIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/MultiProjectionIterator.java index d292617c287..69d527ebe35 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/MultiProjectionIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/MultiProjectionIterator.java @@ -97,14 +97,10 @@ protected BindingSet getNextElement() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { try { - super.handleClose(); + iter.close(); } finally { - try { - iter.close(); - } finally { - nextProjectionIdx = -1; - Arrays.fill(previousBindings, null); - } + nextProjectionIdx = -1; + Arrays.fill(previousBindings, null); } } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/OrderIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/OrderIterator.java index dd5cd489328..7b3dd00b74f 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/OrderIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/OrderIterator.java @@ -43,9 +43,154 @@ * @author James Leigh * @author Arjohn Kampman */ -@Deprecated(since = "4.1.0") public class OrderIterator extends DelayedIteration { + /*-----------* + * Variables * + *-----------*/ + + private final CloseableIteration iter; + + private final Comparator comparator; + + private final long limit; + + private final boolean distinct; + + private final List> serialized = new LinkedList<>(); + + /** + * Number of items cached before internal collection is synced to disk. If set to 0, no disk-syncing is done and all + * internal caching is kept in memory. + */ + private final long iterationSyncThreshold; + + /*--------------* + * Constructors * + *--------------*/ + + public OrderIterator(CloseableIteration iter, Comparator comparator) { + this(iter, comparator, Long.MAX_VALUE, false); + } + + public OrderIterator(CloseableIteration iter, Comparator comparator, long limit, + boolean distinct) { + this(iter, comparator, limit, distinct, Integer.MAX_VALUE); + } + + public OrderIterator(CloseableIteration iter, Comparator comparator, long limit, + boolean distinct, long iterationSyncThreshold) { + this.iter = iter; + this.comparator = comparator; + this.limit = limit; + this.distinct = distinct; + this.iterationSyncThreshold = iterationSyncThreshold > 0 ? iterationSyncThreshold : Integer.MAX_VALUE; + } + + /*---------* + * Methods * + *---------*/ + + @Override + protected CloseableIteration createIteration() throws QueryEvaluationException { + BindingSet threshold = null; + List list = new LinkedList<>(); + int limit2 = limit >= Integer.MAX_VALUE / 2 ? Integer.MAX_VALUE : (int) limit * 2; + int syncThreshold = (int) Math.min(iterationSyncThreshold, Integer.MAX_VALUE); + try { + while (iter.hasNext()) { + if (list.size() >= syncThreshold && list.size() < limit) { + SerializedQueue queue = new SerializedQueue<>("orderiter"); + sort(list).forEach(queue::add); + serialized.add(queue); + decrement(list.size() - queue.size()); + list = new ArrayList<>(list.size()); + if (threshold == null && serialized.stream().mapToLong(SerializedQueue::size).sum() >= limit) { + Stream stream = serialized.stream().map(SerializedQueue::peekLast); + threshold = stream.sorted(comparator).skip(serialized.size() - 1).findFirst().orElseThrow(); + } + } else if (list.size() >= limit2 || !distinct && threshold == null && list.size() >= limit) { + List sorted = new ArrayList<>(limit2); + sort(list).forEach(sorted::add); + decrement(list.size() - sorted.size()); + list = sorted; + if (sorted.size() >= limit) { + threshold = sorted.get(sorted.size() - 1); + } + } + BindingSet next = iter.next(); + if (threshold == null || comparator.compare(next, threshold) < 0) { + list.add(next); + increment(); + } + } + } catch (IOException e) { + throw new QueryEvaluationException(e); + } finally { + iter.close(); + } + + List> iterators = new ArrayList<>(serialized.size() + 1); + serialized + .stream() + .map(SerializedQueue::iterator) + .forEach(iterators::add); + + iterators.add(sort(list).iterator()); + + SortedIterators iterator = new SortedIterators<>(comparator, distinct, iterators); + + return new LimitIteration<>(new CloseableIteratorIteration<>(iterator), limit); + } + + protected void increment() throws QueryEvaluationException { + // give subclasses a chance to stop query evaluation + } + + protected void decrement(int amount) throws QueryEvaluationException { + // let subclasses know that the expected result size is smaller + } + + private Stream sort(Collection collection) { + BindingSet[] array = collection.toArray(new BindingSet[collection.size()]); + Arrays.parallelSort(array, comparator); + Stream stream = Stream.of(array); + if (distinct) { + stream = stream.distinct(); + } + if (limit < Integer.MAX_VALUE) { + stream = stream.limit(limit); + } + return stream; + } + + @Override + public void remove() throws QueryEvaluationException { + throw new UnsupportedOperationException(); + } + + @Override + protected void handleClose() throws QueryEvaluationException { + try { + super.handleClose(); + } finally { + try { + iter.close(); + } finally { + serialized.stream().map(queue -> { + try { + queue.close(); + return null; + } catch (IOException e) { + return e; + } + }).filter(exec -> exec != null).findFirst().ifPresent(exec -> { + throw new QueryEvaluationException(exec); + }); + } + } + } + private static class SerializedQueue extends AbstractQueue implements Closeable { private final File file; @@ -223,150 +368,4 @@ private void advance(int i) { } - /*-----------* - * Variables * - *-----------*/ - - private final CloseableIteration iter; - - private final Comparator comparator; - - private final long limit; - - private final boolean distinct; - - private final List> serialized = new LinkedList<>(); - - /** - * Number of items cached before internal collection is synced to disk. If set to 0, no disk-syncing is done and all - * internal caching is kept in memory. - */ - private final long iterationSyncThreshold; - - /*--------------* - * Constructors * - *--------------*/ - - public OrderIterator(CloseableIteration iter, - Comparator comparator) { - this(iter, comparator, Long.MAX_VALUE, false); - } - - public OrderIterator(CloseableIteration iter, - Comparator comparator, long limit, boolean distinct) { - this(iter, comparator, limit, distinct, Integer.MAX_VALUE); - } - - public OrderIterator(CloseableIteration iter, - Comparator comparator, long limit, boolean distinct, long iterationSyncThreshold) { - this.iter = iter; - this.comparator = comparator; - this.limit = limit; - this.distinct = distinct; - this.iterationSyncThreshold = iterationSyncThreshold > 0 ? iterationSyncThreshold : Integer.MAX_VALUE; - } - - /*---------* - * Methods * - *---------*/ - - @Override - protected CloseableIteration createIteration() throws QueryEvaluationException { - BindingSet threshold = null; - List list = new LinkedList<>(); - int limit2 = limit >= Integer.MAX_VALUE / 2 ? Integer.MAX_VALUE : (int) limit * 2; - int syncThreshold = (int) Math.min(iterationSyncThreshold, Integer.MAX_VALUE); - try { - while (iter.hasNext()) { - if (list.size() >= syncThreshold && list.size() < limit) { - SerializedQueue queue = new SerializedQueue<>("orderiter"); - sort(list).forEach(queue::add); - serialized.add(queue); - decrement(list.size() - queue.size()); - list = new ArrayList<>(list.size()); - if (threshold == null && serialized.stream().mapToLong(SerializedQueue::size).sum() >= limit) { - Stream stream = serialized.stream().map(SerializedQueue::peekLast); - threshold = stream.sorted(comparator).skip(serialized.size() - 1).findFirst().orElseThrow(); - } - } else if (list.size() >= limit2 || !distinct && threshold == null && list.size() >= limit) { - List sorted = new ArrayList<>(limit2); - sort(list).forEach(sorted::add); - decrement(list.size() - sorted.size()); - list = sorted; - if (sorted.size() >= limit) { - threshold = sorted.get(sorted.size() - 1); - } - } - BindingSet next = iter.next(); - if (threshold == null || comparator.compare(next, threshold) < 0) { - list.add(next); - increment(); - } - } - } catch (IOException e) { - throw new QueryEvaluationException(e); - } finally { - iter.close(); - } - - List> iterators = new ArrayList<>(serialized.size() + 1); - serialized - .stream() - .map(SerializedQueue::iterator) - .forEach(iterators::add); - - iterators.add(sort(list).iterator()); - - SortedIterators iterator = new SortedIterators<>(comparator, distinct, iterators); - - return new LimitIteration<>(new CloseableIteratorIteration<>(iterator), limit); - } - - protected void increment() throws QueryEvaluationException { - // give subclasses a chance to stop query evaluation - } - - protected void decrement(int amount) throws QueryEvaluationException { - // let subclasses know that the expected result size is smaller - } - - private Stream sort(Collection collection) { - BindingSet[] array = collection.toArray(new BindingSet[collection.size()]); - Arrays.parallelSort(array, comparator); - Stream stream = Stream.of(array); - if (distinct) { - stream = stream.distinct(); - } - if (limit < Integer.MAX_VALUE) { - stream = stream.limit(limit); - } - return stream; - } - - @Override - public void remove() throws QueryEvaluationException { - throw new UnsupportedOperationException(); - } - - @Override - protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - try { - iter.close(); - } finally { - serialized.stream().map(queue -> { - try { - queue.close(); - return null; - } catch (IOException e) { - return e; - } - }).filter(exec -> exec != null).findFirst().ifPresent(exec -> { - throw new QueryEvaluationException(exec); - }); - } - } - } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PathIteration.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PathIteration.java index 0caf5294097..b46946a76b8 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PathIteration.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/PathIteration.java @@ -215,12 +215,8 @@ private void addBinding(MutableBindingSet bs, String name, Value value) { @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - if (currentIter != null) { - currentIter.close(); - } + if (currentIter != null) { + currentIter.close(); } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ProjectionIterator.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ProjectionIterator.java index efb3176f309..668ff104942 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ProjectionIterator.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ProjectionIterator.java @@ -28,7 +28,6 @@ import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet; import org.eclipse.rdf4j.query.algebra.evaluation.impl.QueryEvaluationContext; -@Deprecated(since = "4.1.0") public class ProjectionIterator extends ConvertingIteration { /*-----------* @@ -43,6 +42,25 @@ public class ProjectionIterator extends ConvertingIteration valueWithSourceName; + BiConsumer setTarget; + + public BindingSetMapper(Function valueWithSourceName, + BiConsumer setTarget) { + this.valueWithSourceName = valueWithSourceName; + this.setTarget = setTarget; + } + + public Function getValueWithSourceName() { + return valueWithSourceName; + } + + public BiConsumer getSetTarget() { + return setTarget; + } + } + public ProjectionIterator(Projection projection, CloseableIteration iter, BindingSet parentBindings, QueryEvaluationContext context) throws QueryEvaluationException { super(iter); @@ -50,22 +68,39 @@ public ProjectionIterator(Projection projection, CloseableIteration boolean isOuterProjection = determineOuterProjection(projection); boolean includeAllParentBindings = !isOuterProjection; - BiConsumer consumer = null; - for (ProjectionElem pe : projectionElemList.getElements()) { - String projectionName = pe.getProjectionAlias().orElse(pe.getName()); - Function valueWithSourceName = context.getValue(pe.getName()); - BiConsumer setTarget = context.setBinding(projectionName); - BiConsumer next = (resultBindings, sourceBindings) -> { - Value targetValue = valueWithSourceName.apply(sourceBindings); - if (!includeAllParentBindings && targetValue == null) { - targetValue = valueWithSourceName.apply(parentBindings); + BindingSetMapper[] array = projectionElemList.getElements() + .stream() + .map(pe -> { + String projectionName = pe.getProjectionAlias().orElse(pe.getName()); + return new BindingSetMapper(context.getValue(pe.getName()), context.setBinding(projectionName)); + }) + .toArray(BindingSetMapper[]::new); + + BiConsumer consumer; + + if (includeAllParentBindings) { + consumer = (resultBindings, sourceBindings) -> { + for (BindingSetMapper bindingSetMapper : array) { + Value targetValue = bindingSetMapper.valueWithSourceName.apply(sourceBindings); + if (targetValue != null) { + bindingSetMapper.setTarget.accept(targetValue, resultBindings); + } } - if (targetValue != null) { - setTarget.accept(targetValue, resultBindings); + }; + } else { + consumer = (resultBindings, sourceBindings) -> { + for (BindingSetMapper bindingSetMapper : array) { + Value targetValue = bindingSetMapper.valueWithSourceName.apply(sourceBindings); + if (targetValue == null) { + targetValue = bindingSetMapper.valueWithSourceName.apply(parentBindings); + } + if (targetValue != null) { + bindingSetMapper.setTarget.accept(targetValue, resultBindings); + } } }; - consumer = andThen(consumer, next); } + if (projectionElemList.getElements().isEmpty()) { consumer = (resultBindings, sourceBindings) -> { // If there are no projection elements we do nothing. diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/QueryContextIteration.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/QueryContextIteration.java index 4983891a013..4df8990d136 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/QueryContextIteration.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/QueryContextIteration.java @@ -74,15 +74,11 @@ public void remove() throws QueryEvaluationException { @Override public void handleClose() throws QueryEvaluationException { + queryContext.begin(); try { - super.handleClose(); + iter.close(); } finally { - queryContext.begin(); - try { - iter.close(); - } finally { - queryContext.end(); - } + queryContext.end(); } } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/SPARQLMinusIteration.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/SPARQLMinusIteration.java index ce3e4a0cf42..e0a8a429ec8 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/SPARQLMinusIteration.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/SPARQLMinusIteration.java @@ -13,6 +13,7 @@ import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Set; +import java.util.stream.Collectors; import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.common.iteration.FilterIteration; @@ -28,7 +29,6 @@ * @author Jeen * @see SPARQL Algebra Documentation */ -@Deprecated(since = "4.1.0") public class SPARQLMinusIteration extends FilterIteration { /*-----------* @@ -40,6 +40,8 @@ public class SPARQLMinusIteration extends FilterIteration { private boolean initialized; private Set excludeSet; + private Set excludeSetBindingNames; + private boolean excludeSetBindingNamesAreAllTheSame; /*--------------* * Constructors * @@ -71,20 +73,50 @@ protected boolean accept(BindingSet bindingSet) { if (!initialized) { // Build set of elements-to-exclude from right argument excludeSet = makeSet(getRightArg()); + excludeSetBindingNames = excludeSet.stream() + .map(BindingSet::getBindingNames) + .flatMap(Set::stream) + .collect(Collectors.toSet()); + excludeSetBindingNamesAreAllTheSame = excludeSet.stream().allMatch(b -> { + Set bindingNames = b.getBindingNames(); + if (bindingNames.size() == excludeSetBindingNames.size()) { + return bindingNames.containsAll(excludeSetBindingNames); + } + return false; + }); + initialized = true; } - for (BindingSet excluded : excludeSet) { - Set bindingNames = bindingSet.getBindingNames(); - boolean hasSharedBindings = false; + Set bindingNames = bindingSet.getBindingNames(); + boolean hasSharedBindings = false; - for (String bindingName : excluded.getBindingNames()) { + if (excludeSetBindingNamesAreAllTheSame) { + for (String bindingName : excludeSetBindingNames) { if (bindingNames.contains(bindingName)) { hasSharedBindings = true; break; } } + if (!hasSharedBindings) { + return true; + } + } + + for (BindingSet excluded : excludeSet) { + + if (!excludeSetBindingNamesAreAllTheSame) { + hasSharedBindings = false; + for (String bindingName : excluded.getBindingNames()) { + if (bindingNames.contains(bindingName)) { + hasSharedBindings = true; + break; + } + } + + } + // two bindingsets that share no variables are compatible by // definition, however, the formal // definition of SPARQL MINUS indicates that such disjoint sets should @@ -117,12 +149,8 @@ protected Set makeSet(CloseableIteration rightArg) { @Override protected void handleClose() { - try { - super.handleClose(); - } finally { - if (rightArg != null) { - rightArg.close(); - } + if (rightArg != null) { + rightArg.close(); } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ZeroLengthPathIteration.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ZeroLengthPathIteration.java index 03dfecaedec..6e5d85b159c 100644 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ZeroLengthPathIteration.java +++ b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/ZeroLengthPathIteration.java @@ -172,4 +172,9 @@ private CloseableIteration createIteration() throws QueryEvaluationE public Var createAnonVar(String varName) { return new Var(varName, true); } + + @Override + protected void handleClose() { + + } } diff --git a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/Statements.java b/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/Statements.java deleted file mode 100644 index 471d1a7571f..00000000000 --- a/core/queryalgebra/evaluation/src/main/java/org/eclipse/rdf4j/query/algebra/evaluation/util/Statements.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 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. - * - * SPDX-License-Identifier: BSD-3-Clause - ******************************************************************************/ - -package org.eclipse.rdf4j.query.algebra.evaluation.util; - -/** - * @deprecated since 2.0. Use {@link TripleSources} instead. - */ -@Deprecated(since = "2.0") -public final class Statements extends TripleSources { - -} 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 e4b8177fbdb..0ea0502b062 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 @@ -48,6 +48,11 @@ public static CloseableIteration listResources(final Resource subj, protected boolean accept(Value v) throws QueryEvaluationException { return v instanceof Resource; } + + @Override + protected void handleClose() { + + } }) { @Override @@ -157,6 +162,11 @@ public static CloseableIteration getSubjectURIs(IRI predicate, protected boolean accept(Statement stmt) throws QueryEvaluationException { return stmt.getSubject() instanceof IRI; } + + @Override + protected void handleClose() { + + } }) { @Override @@ -176,6 +186,11 @@ public static CloseableIteration getObjectResources(Resource subject, protected boolean accept(Statement stmt) throws QueryEvaluationException { return stmt.getObject() instanceof Resource; } + + @Override + protected void handleClose() { + + } }) { @Override @@ -195,6 +210,11 @@ public static CloseableIteration getObjectURIs(Resource subject, protected boolean accept(Statement stmt) throws QueryEvaluationException { return stmt.getObject() instanceof IRI; } + + @Override + protected void handleClose() { + + } }) { @Override @@ -214,6 +234,11 @@ public static CloseableIteration getObjectLiterals(Resource subject, protected boolean accept(Statement stmt) throws QueryEvaluationException { return stmt.getObject() instanceof Literal; } + + @Override + protected void handleClose() { + + } }) { @Override 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 00eedda651a..a7dfebcf593 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 @@ -67,7 +67,8 @@ class CommonBaseSource { public CloseableIteration getRdfStarTriples(Resource subj, IRI pred, Value obj) throws QueryEvaluationException { - return new AbstractCloseableIteration() { + return new AbstractCloseableIteration<>() { + final Iterator iter = triples.iterator(); @Override @@ -86,6 +87,11 @@ public Triple next() public void remove() throws QueryEvaluationException { } + + @Override + protected void handleClose() { + + } }; } diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIteratorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIteratorTest.java index 33d910457e9..8f7dd1f84ed 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIteratorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/JoinIteratorTest.java @@ -106,11 +106,11 @@ private void testBindingSetAssignmentJoin(int expectedSize, int n, BindingSet bi right.setBindingSets(rightb); } - JoinIterator lrIter = new JoinIterator(evaluator.precompile(left), evaluator.precompile(right), bindings); + var lrIter = JoinIterator.getInstance(evaluator.precompile(left), evaluator.precompile(right), bindings); Set lr = Iterations.asSet(lrIter); assertEquals(expectedSize, lr.size()); - JoinIterator rlIter = new JoinIterator(evaluator.precompile(right), evaluator.precompile(left), bindings); + var rlIter = JoinIterator.getInstance(evaluator.precompile(right), evaluator.precompile(left), bindings); Set rl = Iterations.asSet(rlIter); assertEquals(expectedSize, rl.size()); diff --git a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/OrderIteratorTest.java b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/OrderIteratorTest.java index a327098a548..91f58f792f2 100644 --- a/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/OrderIteratorTest.java +++ b/core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/iterator/OrderIteratorTest.java @@ -20,9 +20,11 @@ import java.util.Comparator; import java.util.Iterator; import java.util.List; +import java.util.NoSuchElementException; +import java.util.Objects; import java.util.Set; -import org.eclipse.rdf4j.common.iteration.CloseableIteratorIteration; +import org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration; import org.eclipse.rdf4j.model.Value; import org.eclipse.rdf4j.query.Binding; import org.eclipse.rdf4j.query.BindingSet; @@ -35,34 +37,52 @@ */ public class OrderIteratorTest { - class IterationStub extends CloseableIteratorIteration { + private static class IterationStub extends AbstractCloseableIteration { int hasNextCount = 0; int nextCount = 0; int removeCount = 0; + private Iterator iter; public IterationStub(Iterator iterator) { - super(iterator); + this.iter = iterator; } @Override public boolean hasNext() throws QueryEvaluationException { hasNextCount++; - return super.hasNext(); + if (isClosed()) { + return false; + } + + boolean result = iter.hasNext(); + if (!result) { + close(); + } + return result; } @Override public BindingSet next() throws QueryEvaluationException { nextCount++; - return super.next(); + if (isClosed()) { + throw new NoSuchElementException("Iteration has been closed"); + } + + return iter.next(); } @Override public void remove() { removeCount++; } + + @Override + protected void handleClose() { + + } } class SizeComparator implements Comparator { diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareAll.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareAll.java index 4d430d0f4e6..40b045c86cd 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareAll.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareAll.java @@ -12,7 +12,6 @@ import org.eclipse.rdf4j.query.algebra.Compare.CompareOp; -@Deprecated(forRemoval = true, since = "4.2.1") public class CompareAll extends CompareSubQueryValueOperator { /*-----------* diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareAny.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareAny.java index 1022324cf48..108591b5ab4 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareAny.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareAny.java @@ -12,7 +12,6 @@ import org.eclipse.rdf4j.query.algebra.Compare.CompareOp; -@Deprecated(forRemoval = true, since = "4.2.1") public class CompareAny extends CompareSubQueryValueOperator { /*-----------* diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareSubQueryValueOperator.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareSubQueryValueOperator.java index f3d67fa7ef5..dd5c7da3dba 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareSubQueryValueOperator.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/CompareSubQueryValueOperator.java @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.query.algebra; -@Deprecated(forRemoval = true, since = "4.2.1") public abstract class CompareSubQueryValueOperator extends SubQueryValueOperator { /*-----------* diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Join.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Join.java index bf8bf7b12e4..ad3c48175b6 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Join.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/Join.java @@ -38,15 +38,6 @@ public Join(TupleExpr leftArg, TupleExpr rightArg) { * Methods * *---------*/ - /** - * @return true if the right argument of this Join contains a projection, false otherwise. - * @deprecated Use {@link TupleExprs#containsProjection(TupleExpr)} instead. - */ - @Deprecated(since = "2.0") - public boolean hasSubSelectInRightArg() { - return TupleExprs.containsSubquery(rightArg); - } - @Override public Set getBindingNames() { Set bindingNames = new LinkedHashSet<>(16); diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/QueryModelNodeBase.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/QueryModelNodeBase.java deleted file mode 100644 index 552b6baa8e1..00000000000 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/QueryModelNodeBase.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.algebra; - -/** - * @author Jeen Broekstra - * @deprecated Use {@link AbstractQueryModelNode} instead. - */ -@Deprecated(since = "2.0") -public abstract class QueryModelNodeBase extends AbstractQueryModelNode { - - private static final long serialVersionUID = 1L; - -} 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 a653205eb17..d2d5d636862 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 @@ -196,7 +196,7 @@ private int add(Var var, String[] names, int i) { @Override public Iterator iterator() { - return Arrays.asList(values).iterator(); + return new SmallStringSetIterator(values); } @Override @@ -205,6 +205,28 @@ public int size() { } } + private static final class SmallStringSetIterator implements Iterator { + + private int index = 0; + private final String[] values; + private final int length; + + public SmallStringSetIterator(String[] values) { + this.values = values; + this.length = values.length; + } + + @Override + public boolean hasNext() { + return index < length; + } + + @Override + public String next() { + return values[index++]; + } + } + public List getVarList() { List varList = this.varList; if (varList == null) { diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/SubQueryValueOperator.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/SubQueryValueOperator.java index f7311b999df..cce863196ec 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/SubQueryValueOperator.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/SubQueryValueOperator.java @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.rdf4j.query.algebra; -@Deprecated(forRemoval = true, since = "4.2.1") public abstract class SubQueryValueOperator extends AbstractQueryModelNode implements ValueExpr { /*-----------* diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/TupleFunctionCall.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/TupleFunctionCall.java index 7a8411d96bd..8794bbbe4a8 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/TupleFunctionCall.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/TupleFunctionCall.java @@ -18,7 +18,7 @@ /** * A call to a TupleFunction. This is an optional extension to the query model. */ -public class TupleFunctionCall extends QueryModelNodeBase implements TupleExpr { +public class TupleFunctionCall extends AbstractQueryModelNode implements TupleExpr { private String uri; diff --git a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/TupleExprs.java b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/TupleExprs.java index 9bd90d23da9..789f0328979 100644 --- a/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/TupleExprs.java +++ b/core/queryalgebra/model/src/main/java/org/eclipse/rdf4j/query/algebra/helpers/TupleExprs.java @@ -127,34 +127,6 @@ public static boolean isVariableScopeChange(TupleExpr expr) { return false; } - /** - * Verifies if the supplied {@link TupleExpr} contains a {@link Projection}. If the supplied TupleExpr is a - * {@link Join} or contains a {@link Join}, projections inside that Join's arguments will not be taken into account. - * - * @param t a tuple expression. - * @return true if the TupleExpr contains a projection (outside of a Join), false - * otherwise. - * @deprecated Use {@link #containsSubquery(TupleExpr)} instead. - */ - @Deprecated(since = "2.0") - public static boolean containsProjection(TupleExpr t) { - Deque queue = new ArrayDeque<>(); - queue.add(t); - while (!queue.isEmpty()) { - TupleExpr n = queue.removeFirst(); - if (n instanceof Projection) { - return true; - } else if (n instanceof Join) { - // projections already inside a Join need not be - // taken into account - return false; - } else { - queue.addAll(getChildren(n)); - } - } - return false; - } - /** * Returns {@link TupleExpr} children of the given node. * diff --git a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserQuery.java b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserQuery.java index 2bdaf1cecee..82eb545303b 100644 --- a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserQuery.java +++ b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserQuery.java @@ -65,8 +65,7 @@ public String toString() { return parsedQuery.toString(); } - @Deprecated(since = "4.1.0") - protected class QueryInterruptIteration extends TimeLimitIteration { + private static class QueryInterruptIteration extends TimeLimitIteration { public QueryInterruptIteration(CloseableIteration iter, long timeLimit) { diff --git a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserUpdate.java b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserUpdate.java index fa24f7f86ea..bb86911185f 100644 --- a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserUpdate.java +++ b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/impl/AbstractParserUpdate.java @@ -51,7 +51,7 @@ protected Dataset getMergedDataset(Dataset sparqlDefinedDataset) { return sparqlDefinedDataset; } - final DatasetImpl mergedDataset = new DatasetImpl(); + final SimpleDataset mergedDataset = new SimpleDataset(); final boolean hasWithClause = sparqlDefinedDataset.getDefaultInsertGraph() != null; final Set sparqlDefaultGraphs = sparqlDefinedDataset.getDefaultGraphs(); diff --git a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserQuery.java b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserQuery.java index d895c0d193d..bdf9fbb84f0 100644 --- a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserQuery.java +++ b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserQuery.java @@ -65,8 +65,7 @@ public String toString() { return parsedQuery.toString(); } - @Deprecated(since = "4.1.0") - protected class QueryInterruptIteration extends TimeLimitIteration { + private static class QueryInterruptIteration extends TimeLimitIteration { public QueryInterruptIteration(CloseableIteration iter, long timeLimit) { diff --git a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserUpdate.java b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserUpdate.java index b9d3d1ed449..687339c8923 100644 --- a/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserUpdate.java +++ b/core/queryparser/api/src/main/java/org/eclipse/rdf4j/query/parser/impl/AbstractParserUpdate.java @@ -15,7 +15,7 @@ import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.query.Dataset; import org.eclipse.rdf4j.query.impl.AbstractUpdate; -import org.eclipse.rdf4j.query.impl.DatasetImpl; +import org.eclipse.rdf4j.query.impl.SimpleDataset; import org.eclipse.rdf4j.query.parser.ParsedUpdate; /** @@ -53,7 +53,7 @@ protected Dataset getMergedDataset(Dataset sparqlDefinedDataset) { return sparqlDefinedDataset; } - final DatasetImpl mergedDataset = new DatasetImpl(); + final SimpleDataset mergedDataset = new SimpleDataset(); final boolean hasWithClause = sparqlDefinedDataset.getDefaultInsertGraph() != null; final Set sparqlDefaultGraphs = sparqlDefinedDataset.getDefaultGraphs(); diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLQueries.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLQueries.java index 72b75d23237..969d79d59b6 100644 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLQueries.java +++ b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLQueries.java @@ -50,14 +50,14 @@ public static String getPrefixClauses(Iterable namespaces) { * @since 3.6.0 */ public static String escape(String s) { - s = StringUtil.gsub("\\", "\\\\", s); - s = StringUtil.gsub("\t", "\\t", s); - s = StringUtil.gsub("\n", "\\n", s); - s = StringUtil.gsub("\r", "\\r", s); - s = StringUtil.gsub("\b", "\\b", s); - s = StringUtil.gsub("\f", "\\f", s); - s = StringUtil.gsub("\"", "\\\"", s); - s = StringUtil.gsub("'", "\\'", s); + s = s.replace("\\", "\\\\"); + s = s.replace("\t", "\\t"); + s = s.replace("\n", "\\n"); + s = s.replace("\r", "\\r"); + s = s.replace("\b", "\\b"); + s = s.replace("\f", "\\f"); + s = s.replace("\"", "\\\""); + s = s.replace("'", "\\'"); return s; } diff --git a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLUtil.java b/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLUtil.java deleted file mode 100644 index 27fac305129..00000000000 --- a/core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLUtil.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.parser.sparql; - -/** - * SPARQL-related utility methods. - * - * @author Arjohn Kampman - * @deprecated since 3.6.0 Use {@link SPARQLQueries} instead. - */ -@Deprecated(since = "3.6.0") -public class SPARQLUtil extends SPARQLQueries { - - /** - * @deprecated since 3.6.0. Use {@link SPARQLQueries#escape(String)} instead. - */ - @Deprecated(since = "3.6.0") - public static String encodeString(String string) { - return escape(string); - } - - /** - * @deprecated since 3.6.0. Use {@link SPARQLQueries#unescape(String)} instead. - */ - @Deprecated(since = "3.6.0") - public static String decodeString(String string) { - return unescape(string); - } -} diff --git a/core/queryresultio/api/src/main/java/org/eclipse/rdf4j/query/resultio/helpers/BackgroundTupleResult.java b/core/queryresultio/api/src/main/java/org/eclipse/rdf4j/query/resultio/helpers/BackgroundTupleResult.java index d7bb190a2ba..dd032232469 100644 --- a/core/queryresultio/api/src/main/java/org/eclipse/rdf4j/query/resultio/helpers/BackgroundTupleResult.java +++ b/core/queryresultio/api/src/main/java/org/eclipse/rdf4j/query/resultio/helpers/BackgroundTupleResult.java @@ -30,7 +30,6 @@ * * @author James Leigh */ -@Deprecated(since = "4.1.0") public class BackgroundTupleResult extends IteratingTupleQueryResult implements Runnable, TupleQueryResultHandler { private final TupleQueryResultParser parser; diff --git a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONParserBase.java b/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONParserBase.java deleted file mode 100644 index fb910a8f7f3..00000000000 --- a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqljson/SPARQLJSONParserBase.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.sparqljson; - -/** - * @author Jeen Broekstra - * @deprecated Use {@link AbstractSPARQLJSONParser} instead. - */ -@Deprecated(since = "2.0") -public abstract class SPARQLJSONParserBase extends AbstractSPARQLJSONParser { - -} diff --git a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONParser.java b/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONParser.java deleted file mode 100644 index 2bd74ee3a97..00000000000 --- a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONParser.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.sparqlstarjson; - -/** - * @deprecated moved to {@link org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONParser} - */ -@Deprecated(since = "3.4.0") -public class SPARQLStarResultsJSONParser - extends org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONParser { - -} diff --git a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONParserFactory.java b/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONParserFactory.java deleted file mode 100644 index 02eb2a0168c..00000000000 --- a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONParserFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.sparqlstarjson; - -/** - * @deprecated Moved to {@link org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONParserFactory} - */ -@Deprecated(since = "3.4.0") -public class SPARQLStarResultsJSONParserFactory - extends org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONParserFactory { -} diff --git a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONWriter.java b/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONWriter.java deleted file mode 100644 index 10abd9c531b..00000000000 --- a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONWriter.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.sparqlstarjson; - -import java.io.OutputStream; - -/** - * @deprecated Moved to {@link org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONWriter} - */ -@Deprecated(since = "3.4.0") -public class SPARQLStarResultsJSONWriter - extends org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONWriter { - - public SPARQLStarResultsJSONWriter(OutputStream out) { - super(out); - } - -} diff --git a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONWriterFactory.java b/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONWriterFactory.java deleted file mode 100644 index 27330467dc6..00000000000 --- a/core/queryresultio/sparqljson/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlstarjson/SPARQLStarResultsJSONWriterFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.sparqlstarjson; - -/** - * @deprecated Moved to {@link org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONWriterFactory} - */ -@Deprecated(since = "3.4.0") -public class SPARQLStarResultsJSONWriterFactory - extends org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLStarResultsJSONWriterFactory { -} 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 d7b9c831d4f..20f17a74b57 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 @@ -121,19 +121,6 @@ public Writer getWriter() { return xmlWriter.getWriter(); } - /** - * Enables/disables addition of indentation characters and newlines in the XML document. By default, pretty-printing - * is set to true. If set to false, no indentation and newlines are added to the XML document. - * This method has to be used before writing starts (that is, before {@link #startDocument} is called). - * - * @deprecated Use {@link #getWriterConfig()} .set(BasicWriterSettings.PRETTY_PRINT, prettyPrint) instead. - */ - @Deprecated - public void setPrettyPrint(boolean prettyPrint) { - getWriterConfig().set(BasicWriterSettings.PRETTY_PRINT, prettyPrint); - xmlWriter.setPrettyPrint(prettyPrint); - } - protected void endDocument() throws IOException { xmlWriter.endTag(ROOT_TAG); diff --git a/core/queryresultio/sparqlxml/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlxml/SPARQLXMLParserBase.java b/core/queryresultio/sparqlxml/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlxml/SPARQLXMLParserBase.java deleted file mode 100644 index 4e22cd761ef..00000000000 --- a/core/queryresultio/sparqlxml/src/main/java/org/eclipse/rdf4j/query/resultio/sparqlxml/SPARQLXMLParserBase.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.sparqlxml; - -/** - * @author Jeen Broekstra - * @deprecated Use {@link AbstractSPARQLXMLParser} instead. - */ -@Deprecated(since = "2.0") -public abstract class SPARQLXMLParserBase extends AbstractSPARQLXMLParser { - -} 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 ce208fce404..07b109a3a25 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 @@ -214,11 +214,11 @@ private void writeLiteral(Literal lit) throws IOException { } private static String encodeString(String s) { - s = StringUtil.gsub("\\", "\\\\", s); - s = StringUtil.gsub("\t", "\\t", s); - s = StringUtil.gsub("\n", "\\n", s); - s = StringUtil.gsub("\r", "\\r", s); - s = StringUtil.gsub("\"", "\\\"", s); + s = s.replace("\\", "\\\\"); + s = s.replace("\t", "\\t"); + s = s.replace("\n", "\\n"); + s = s.replace("\r", "\\r"); + s = s.replace("\"", "\\\""); return s; } diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVMappingStrategy.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVMappingStrategy.java deleted file mode 100644 index 84fcdfa55f9..00000000000 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVMappingStrategy.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.textstar.tsv; - -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLResultsTSVMappingStrategy; - -/** - * Extends {@link SPARQLResultsTSVMappingStrategy} with support for parsing a {@link org.eclipse.rdf4j.model.Triple}. - * - * @author Pavel Mihaylov - * @deprecated Functionality has been folded into {@link SPARQLResultsTSVMappingStrategy} - */ -@Deprecated(since = "3.4.0") -public class SPARQLStarResultsTSVMappingStrategy extends SPARQLResultsTSVMappingStrategy { - public SPARQLStarResultsTSVMappingStrategy(ValueFactory valueFactory) { - super(valueFactory); - } -} diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVParser.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVParser.java deleted file mode 100644 index 3763a7d89f4..00000000000 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVParser.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.textstar.tsv; - -/** - * @deprecated Moved to {@link org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLStarResultsTSVParser}. - */ -@Deprecated(since = "3.4.0") -public class SPARQLStarResultsTSVParser extends org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLStarResultsTSVParser { -} diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVParserFactory.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVParserFactory.java deleted file mode 100644 index cabd78d2507..00000000000 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVParserFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.textstar.tsv; - -/** - * @deprecated since 3.4.0 - moved to - * {@link org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLStarResultsTSVParserFactory}. - */ -@Deprecated -public class SPARQLStarResultsTSVParserFactory - extends org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLStarResultsTSVParserFactory { -} diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVWriter.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVWriter.java deleted file mode 100644 index 66d1bfb8f3b..00000000000 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVWriter.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.textstar.tsv; - -import java.io.OutputStream; - -/** - * @deprecated Moved to {@link org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLStarResultsTSVWriter}. - */ -@Deprecated(since = "3.4.0") -public class SPARQLStarResultsTSVWriter extends org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLStarResultsTSVWriter { - - public SPARQLStarResultsTSVWriter(OutputStream out) { - super(out); - } -} diff --git a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVWriterFactory.java b/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVWriterFactory.java deleted file mode 100644 index 55e048c8373..00000000000 --- a/core/queryresultio/text/src/main/java/org/eclipse/rdf4j/query/resultio/textstar/tsv/SPARQLStarResultsTSVWriterFactory.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.query.resultio.textstar.tsv; - -/** - * @deprecated Moved to {@link org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLStarResultsTSVWriterFactory}. - */ -@Deprecated(since = "3.4.0") -public class SPARQLStarResultsTSVWriterFactory - extends org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLStarResultsTSVWriterFactory { -} 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 6942a4c294f..527b96d70ed 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 @@ -69,12 +69,8 @@ public void remove() throws RepositoryException { @Override protected void handleClose() throws RepositoryException { - try { - super.handleClose(); - } finally { - if (wrappedIter != null) { - wrappedIter.close(); - } + if (wrappedIter != null) { + wrappedIter.close(); } } diff --git a/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/SailGraphQuery.java b/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/SailGraphQuery.java index 6520b39ba4f..4462fb7d26d 100644 --- a/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/SailGraphQuery.java +++ b/core/repository/sail/src/main/java/org/eclipse/rdf4j/repository/sail/SailGraphQuery.java @@ -72,6 +72,11 @@ protected boolean accept(BindingSet bindingSet) { && bindingSet.getValue("object") instanceof Value && (context == null || context instanceof Resource); } + + @Override + protected void handleClose() { + + } }; bindingsIter3 = enforceMaxQueryTime(bindingsIter2); diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/CollectionIteration.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/CollectionIteration.java index bc285622cc9..cc32cdd1840 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/CollectionIteration.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/CollectionIteration.java @@ -57,4 +57,8 @@ public void remove() { throw new UnsupportedOperationException("Remove not supported on CollectionIteration"); } + @Override + protected void handleClose() { + + } } diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/JoinExecutorBase.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/JoinExecutorBase.java index f3e59da63e1..1f17a192504 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/JoinExecutorBase.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/JoinExecutorBase.java @@ -137,22 +137,18 @@ public T getNextElement() throws QueryEvaluationException { public void handleClose() throws QueryEvaluationException { closed = true; try { - super.handleClose(); + rightQueue.close(); } finally { try { - rightQueue.close(); + CloseableIteration toCloseRightIter = rightIter; + rightIter = null; + if (toCloseRightIter != null) { + toCloseRightIter.close(); + } } finally { - try { - CloseableIteration toCloseRightIter = rightIter; - rightIter = null; - if (toCloseRightIter != null) { - toCloseRightIter.close(); - } - } finally { - CloseableIteration toCloseLeftIter = leftIter; - if (toCloseLeftIter != null) { - toCloseLeftIter.close(); - } + CloseableIteration toCloseLeftIter = leftIter; + if (toCloseLeftIter != null) { + toCloseLeftIter.close(); } } } diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/SPARQLCrossProductIteration.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/SPARQLCrossProductIteration.java index 8620703e8a7..f5811b1e726 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/SPARQLCrossProductIteration.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/SPARQLCrossProductIteration.java @@ -74,10 +74,6 @@ protected BindingSet getNextElement() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - resultIteration.close(); - } + resultIteration.close(); } } diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/ServiceJoinConversionIteration.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/ServiceJoinConversionIteration.java index 3617ab9ed0e..e04e9742bcc 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/ServiceJoinConversionIteration.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/ServiceJoinConversionIteration.java @@ -26,9 +26,7 @@ * * @author Andreas Schwarte */ -@Deprecated(since = "4.1.0") -public class ServiceJoinConversionIteration - extends ConvertingIteration { +public class ServiceJoinConversionIteration extends ConvertingIteration { protected final List bindings; diff --git a/core/rio/binary/src/test/java/org/eclipse/rdf4j/rio/binary/BinaryRDFWriterBackgroundTest.java b/core/rio/binary/src/test/java/org/eclipse/rdf4j/rio/binary/BinaryRDFWriterBackgroundTest.java index 9513cbec87e..b526befa100 100644 --- a/core/rio/binary/src/test/java/org/eclipse/rdf4j/rio/binary/BinaryRDFWriterBackgroundTest.java +++ b/core/rio/binary/src/test/java/org/eclipse/rdf4j/rio/binary/BinaryRDFWriterBackgroundTest.java @@ -32,8 +32,8 @@ public BinaryRDFWriterBackgroundTest() { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } @Override 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 871a40a4f8e..21127788d88 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 @@ -66,8 +66,8 @@ protected void setupParserConfig(ParserConfig config) { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } @Test diff --git a/core/rio/nquads/src/test/java/org/eclipse/rdf4j/rio/nquads/NQuadsWriterBackgroundTest.java b/core/rio/nquads/src/test/java/org/eclipse/rdf4j/rio/nquads/NQuadsWriterBackgroundTest.java index 004df3de113..149f402f80f 100644 --- a/core/rio/nquads/src/test/java/org/eclipse/rdf4j/rio/nquads/NQuadsWriterBackgroundTest.java +++ b/core/rio/nquads/src/test/java/org/eclipse/rdf4j/rio/nquads/NQuadsWriterBackgroundTest.java @@ -27,8 +27,8 @@ public NQuadsWriterBackgroundTest() { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } } diff --git a/core/rio/ntriples/src/main/java/org/eclipse/rdf4j/rio/ntriples/NTriplesUtil.java b/core/rio/ntriples/src/main/java/org/eclipse/rdf4j/rio/ntriples/NTriplesUtil.java deleted file mode 100644 index 2971351e950..00000000000 --- a/core/rio/ntriples/src/main/java/org/eclipse/rdf4j/rio/ntriples/NTriplesUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.rio.ntriples; - -/** - * @deprecated since 4.0. Use {@link org.eclipse.rdf4j.rio.helpers.NTriplesUtil} instead. Utility methods for N-Triples - * encoding/decoding. - */ -@Deprecated -public class NTriplesUtil extends org.eclipse.rdf4j.rio.helpers.NTriplesUtil { -} diff --git a/core/rio/ntriples/src/test/java/org/eclipse/rdf4j/rio/ntriples/NTriplesWriterBackgroundTest.java b/core/rio/ntriples/src/test/java/org/eclipse/rdf4j/rio/ntriples/NTriplesWriterBackgroundTest.java index 9c1cd0f08c2..fa80da3c2f2 100644 --- a/core/rio/ntriples/src/test/java/org/eclipse/rdf4j/rio/ntriples/NTriplesWriterBackgroundTest.java +++ b/core/rio/ntriples/src/test/java/org/eclipse/rdf4j/rio/ntriples/NTriplesWriterBackgroundTest.java @@ -32,8 +32,8 @@ public NTriplesWriterBackgroundTest() { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } } diff --git a/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONStreamingWriterTest.java b/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONStreamingWriterTest.java index 14b548bfc84..e32af32a809 100644 --- a/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONStreamingWriterTest.java +++ b/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONStreamingWriterTest.java @@ -37,8 +37,8 @@ public RDFJSONStreamingWriterTest() { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } @Override diff --git a/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONWriterTest.java b/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONWriterTest.java index 54621f3bc88..1a723edc7be 100644 --- a/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONWriterTest.java +++ b/core/rio/rdfjson/src/test/java/org/eclipse/rdf4j/rio/rdfjson/RDFJSONWriterTest.java @@ -36,8 +36,8 @@ public RDFJSONWriterTest() { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } @Override diff --git a/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLPrettyWriterBackgroundTest.java b/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLPrettyWriterBackgroundTest.java index 31534c0be62..9bd6b0d9ceb 100644 --- a/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLPrettyWriterBackgroundTest.java +++ b/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLPrettyWriterBackgroundTest.java @@ -54,8 +54,8 @@ protected void setupWriterConfig(WriterConfig config) { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } /** diff --git a/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLWriterBackgroundTest.java b/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLWriterBackgroundTest.java index 0087d2c0499..96f0f05cb72 100644 --- a/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLWriterBackgroundTest.java +++ b/core/rio/rdfxml/src/test/java/org/eclipse/rdf4j/rio/rdfxml/RDFXMLWriterBackgroundTest.java @@ -34,8 +34,8 @@ protected void setupWriterConfig(WriterConfig config) { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } } diff --git a/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trig/TriGPrettyWriterBackgroundTest.java b/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trig/TriGPrettyWriterBackgroundTest.java index 1b00a55810a..1bb45046f79 100644 --- a/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trig/TriGPrettyWriterBackgroundTest.java +++ b/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trig/TriGPrettyWriterBackgroundTest.java @@ -39,8 +39,8 @@ protected void setupWriterConfig(WriterConfig config) { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } } diff --git a/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trig/TriGWriterBackgroundTest.java b/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trig/TriGWriterBackgroundTest.java index e75397e711a..de8994b2ddc 100644 --- a/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trig/TriGWriterBackgroundTest.java +++ b/core/rio/trig/src/test/java/org/eclipse/rdf4j/rio/trig/TriGWriterBackgroundTest.java @@ -37,8 +37,8 @@ protected void setupWriterConfig(WriterConfig config) { protected Model parse(InputStream reader, String baseURI) throws RDFParseException, RDFHandlerException { return QueryResults - .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat(), - null)); + .asModel(QueryResults.parseGraphBackground(reader, baseURI, rdfParserFactory.getRDFFormat() + )); } } diff --git a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/ArrangedWriter.java b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/ArrangedWriter.java deleted file mode 100644 index 37495723b95..00000000000 --- a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/ArrangedWriter.java +++ /dev/null @@ -1,430 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2017 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.rio.turtle; - -import java.util.Collection; -import java.util.Comparator; -import java.util.Deque; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.TreeMap; -import java.util.TreeSet; - -import org.eclipse.rdf4j.model.BNode; -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Literal; -import org.eclipse.rdf4j.model.Model; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.Triple; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.impl.LinkedHashModel; -import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.rio.RDFFormat; -import org.eclipse.rdf4j.rio.RDFHandlerException; -import org.eclipse.rdf4j.rio.RDFWriter; -import org.eclipse.rdf4j.rio.RioSetting; -import org.eclipse.rdf4j.rio.WriterConfig; -import org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter; -import org.eclipse.rdf4j.rio.helpers.BasicWriterSettings; - -/** - * Internal wrapper that sorts statements for pretty printing and repeats blank nodes if inlining them. - * - * @author James Leigh - * @since 2.3 - * @deprecated Pretty printing / bnode inlining logic has been moved to {@link TurtleWriter} internally. - */ -@Deprecated(since = "3.3.1") -public class ArrangedWriter extends AbstractRDFWriter { - - private final static int DEFAULT_QUEUE_SIZE = 100; - - private final RDFWriter delegate; - - private boolean repeatBlankNodes; - - private int targetQueueSize; - - private int queueSize = 0; - - private final Deque stack = new LinkedList<>(); - - private final Map prefixes = new TreeMap<>(); - - private final Map> stmtBySubject = new LinkedHashMap<>(); - - private final Model blanks = new LinkedHashModel(); - - private final Model blankReferences = new LinkedHashModel(); - - private final Comparator comparator = (Statement s1, Statement s2) -> { - IRI p1 = s1.getPredicate(); - IRI p2 = s2.getPredicate(); - if (p1.equals(RDF.TYPE) && !p2.equals(RDF.TYPE)) { - return -1; - } else if (!p1.equals(RDF.TYPE) && p2.equals(RDF.TYPE)) { - return 1; - } - int cmp = p1.stringValue().compareTo(p2.stringValue()); - if (cmp != 0) { - return cmp; - } - Value o1 = s1.getObject(); - Value o2 = s2.getObject(); - if (o1.equals(o2)) { - return 0; - } - if (!(o1 instanceof BNode) && o2 instanceof BNode) { - return -1; - } else if (o1 instanceof BNode && !(o2 instanceof BNode)) { - return 1; - } - if (!(o1 instanceof IRI) && o2 instanceof IRI) { - return -1; - } else if (o1 instanceof IRI && !(o2 instanceof IRI)) { - return 1; - } - if (!(o1 instanceof Triple) && o2 instanceof Triple) { - return -1; - } else if (o1 instanceof Triple && !(o2 instanceof Triple)) { - return 1; - } - int str_cmp = o1.stringValue().compareTo(o2.stringValue()); - if (str_cmp != 0) { - return str_cmp; - } - Literal lit1 = (Literal) o1; - Literal lit2 = (Literal) o2; - int dt_cmp = lit1.getDatatype().stringValue().compareTo(lit2.getDatatype().stringValue()); - if (dt_cmp != 0) { - return dt_cmp; - } - return lit1.getLanguage().orElse("").compareTo(lit2.getLanguage().orElse("")); - }; - - public ArrangedWriter(RDFWriter delegate) { - this(delegate, 0); - } - - public ArrangedWriter(RDFWriter delegate, int size) { - this(delegate, size, size == -1); - } - - public ArrangedWriter(RDFWriter delegate, int size, boolean repeatBlankNodes) { - this.delegate = delegate; - this.targetQueueSize = size; - this.repeatBlankNodes = repeatBlankNodes; - } - - @Override - public RDFFormat getRDFFormat() { - return delegate.getRDFFormat(); - } - - @Override - public RDFWriter setWriterConfig(WriterConfig config) { - return delegate.setWriterConfig(config); - } - - @Override - public WriterConfig getWriterConfig() { - return delegate.getWriterConfig(); - } - - @Override - public Collection> getSupportedSettings() { - return delegate.getSupportedSettings(); - } - - @Override - public RDFWriter set(RioSetting setting, T value) { - return delegate.set(setting, value); - } - - @Override - public void startRDF() throws RDFHandlerException { - super.startRDF(); - if (getWriterConfig().get(BasicWriterSettings.INLINE_BLANK_NODES)) { - targetQueueSize = -1; - repeatBlankNodes = true; - } else if (getWriterConfig().get(BasicWriterSettings.PRETTY_PRINT)) { - targetQueueSize = DEFAULT_QUEUE_SIZE; - } - delegate.startRDF(); - } - - @Override - public void endRDF() throws RDFHandlerException { - trimNamespaces(); - flushStatements(); - delegate.endRDF(); - } - - @Override - public void handleNamespace(String prefix, String uri) throws RDFHandlerException { - flushStatements(); - if (targetQueueSize == 0) { - delegate.handleNamespace(prefix, uri); - } else if (!prefixes.containsKey(uri)) { - prefixes.put(uri, prefix); - } - } - - @Override - public void handleComment(String comment) throws RDFHandlerException { - flushStatements(); - delegate.handleComment(comment); - } - - @Override - protected synchronized void consumeStatement(Statement st) throws RDFHandlerException { - if (targetQueueSize == 0) { - delegate.handleStatement(st); - } else { - queueStatement(st); - } - while (targetQueueSize >= 0 && queueSize > targetQueueSize) { - flushNamespaces(); - delegate.handleStatement(nextStatement()); - } - } - - private synchronized Statement nextStatement() { - if (stmtBySubject.isEmpty() && blanks.isEmpty()) { - assert queueSize == 0; - return null; - } - Set stmts = null; - while (stmts == null) { - SubjectInContext last = stack.peekLast(); - stmts = stmtBySubject.get(last); - if (stmts == null && last != null && blanks.contains(last.getSubject(), null, null, last.getContext())) { - stmts = queueBlankStatements(last); - } else if (stmts == null) { - stack.pollLast(); - } - if (stack.isEmpty() && stmtBySubject.isEmpty()) { - Statement st = blanks.iterator().next(); - stmts = queueBlankStatements(new SubjectInContext(st)); - } else if (stack.isEmpty()) { - stmts = stmtBySubject.values().iterator().next(); - } - } - Iterator iter = stmts.iterator(); - Statement next = iter.next(); - queueSize--; - iter.remove(); - SubjectInContext key = new SubjectInContext(next); - if (!key.equals(stack.peekLast())) { - stack.addLast(key); - } - if (!iter.hasNext()) { - stmtBySubject.remove(key); - } - Value obj = next.getObject(); - if (obj instanceof BNode) { - // follow blank nodes before continuing with this subject - SubjectInContext bkey = new SubjectInContext((BNode) obj, next.getContext()); - if (stack.contains(bkey)) { - // cycle detected - if (repeatBlankNodes) { - throw new RDFHandlerException("Blank node cycle detected. Try disabling " - + BasicWriterSettings.INLINE_BLANK_NODES.getKey()); - } - } else { - stack.addLast(bkey); - } - } - return next; - } - - private synchronized Set queueBlankStatements(SubjectInContext key) { - Model firstMatch = blanks.filter(key.getSubject(), null, null, key.getContext()); - Model matches = firstMatch.isEmpty() ? blankReferences.filter(key.getSubject(), null, null, key.getContext()) - : firstMatch; - if (matches.isEmpty()) { - return null; - } - Set set = stmtBySubject.get(key); - if (set == null) { - stmtBySubject.put(key, set = new TreeSet<>(comparator)); - } - set.addAll(matches); - if (firstMatch.isEmpty()) { - // repeat blank node values - queueSize += matches.size(); - } else { - if (repeatBlankNodes && key.getSubject() instanceof BNode && isStillReferenced(key)) { - blankReferences.addAll(matches); - } - blanks.remove(key.getSubject(), null, null, key.getContext()); - } - return set; - } - - private boolean isStillReferenced(SubjectInContext key) { - if (blanks.contains(null, null, key.getSubject(), key.getContext())) { - return true; - } - for (SubjectInContext subj : stack) { - Set stmts = stmtBySubject.get(subj); - if (stmts != null) { - for (Statement st : stmts) { - if (st.getObject().equals(key.getSubject()) || Objects.equals(st.getContext(), key.getContext())) { - return true; - } - } - } - } - return false; - } - - private synchronized void queueStatement(Statement st) { - SubjectInContext key = new SubjectInContext(st); - Set stmts = stmtBySubject.get(key); - if (stmts == null && st.getSubject() instanceof BNode && !stack.contains(key)) { - blanks.add(st); - } else { - if (stmts == null) { - stmtBySubject.put(key, stmts = new TreeSet<>(comparator)); - } - stmts.add(st); - } - queueSize++; - } - - private synchronized void flushStatements() throws RDFHandlerException { - if (!stmtBySubject.isEmpty() || !blanks.isEmpty()) { - flushNamespaces(); - Statement st; - while ((st = nextStatement()) != null) { - delegate.handleStatement(st); - } - assert queueSize == 0; - } - } - - private synchronized void flushNamespaces() throws RDFHandlerException { - Map namespaces = new TreeMap<>(); - for (Map.Entry e : prefixes.entrySet()) { - namespaces.put(e.getValue(), e.getKey()); - } - for (Map.Entry e : namespaces.entrySet()) { - delegate.handleNamespace(e.getKey(), e.getValue()); - } - prefixes.clear(); - } - - private synchronized void trimNamespaces() { - if (!prefixes.isEmpty()) { - Set used = new HashSet<>(prefixes.size()); - for (Set stmts : stmtBySubject.values()) { - getUsedNamespaces(stmts, used); - } - getUsedNamespaces(blanks, used); - prefixes.keySet().retainAll(used); - } - } - - private void getUsedNamespaces(Set stmts, Set used) { - for (Statement st : stmts) { - if (st.getSubject() instanceof IRI) { - IRI uri = (IRI) st.getSubject(); - used.add(uri.getNamespace()); - } - used.add(st.getPredicate().getNamespace()); - if (st.getObject() instanceof IRI) { - IRI uri = (IRI) st.getObject(); - used.add(uri.getNamespace()); - } else if (st.getObject() instanceof Literal) { - Literal lit = (Literal) st.getObject(); - if (lit.getDatatype() != null) { - used.add(lit.getDatatype().getNamespace()); - } - } - } - } - - private class SubjectInContext { - - private final Resource subject; - - private final Resource context; - - private SubjectInContext(Statement st) { - this(st.getSubject(), st.getContext()); - } - - private SubjectInContext(Resource subject, Resource context) { - assert subject != null; - this.subject = subject; - this.context = context; - } - - public Resource getSubject() { - return subject; - } - - public Resource getContext() { - return context; - } - - @Override - public String toString() { - if (context == null) { - return subject.toString(); - } else { - return subject.toString() + " [" + context.toString() + "]"; - } - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + subject.hashCode(); - result = prime * result + ((context == null) ? 0 : context.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - SubjectInContext other = (SubjectInContext) obj; - if (!subject.equals(other.subject)) { - return false; - } - if (context == null) { - if (other.context != null) { - return false; - } - } else if (!context.equals(other.context)) { - return false; - } - return true; - } - } - -} diff --git a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleUtil.java b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleUtil.java index a6165a8cd36..1643919509b 100644 --- a/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleUtil.java +++ b/core/rio/turtle/src/main/java/org/eclipse/rdf4j/rio/turtle/TurtleUtil.java @@ -415,11 +415,11 @@ public static boolean isPN_LOCAL(String name) { * @return encoded string */ public static String encodeString(String s) { - s = StringUtil.gsub("\\", "\\\\", s); - s = StringUtil.gsub("\t", "\\t", s); - s = StringUtil.gsub("\n", "\\n", s); - s = StringUtil.gsub("\r", "\\r", s); - s = StringUtil.gsub("\"", "\\\"", s); + s = s.replace("\\", "\\\\"); + s = s.replace("\t", "\\t"); + s = s.replace("\n", "\\n"); + s = s.replace("\r", "\\r"); + s = s.replace("\"", "\\\""); return s; } @@ -433,8 +433,8 @@ public static String encodeLongString(String s) { // TODO: not all double quotes need to be escaped. It suffices to encode // the ones that form sequences of 3 or more double quotes, and the ones // at the end of a string. - s = StringUtil.gsub("\\", "\\\\", s); - s = StringUtil.gsub("\"", "\\\"", s); + s = s.replace("\\", "\\\\"); + s = s.replace("\"", "\\\""); return s; } @@ -445,17 +445,17 @@ public static String encodeLongString(String s) { */ @Deprecated public static String encodeURIString(String s) { - s = StringUtil.gsub("\\", "\\u005C", s); - s = StringUtil.gsub("\t", "\\u0009", s); - s = StringUtil.gsub("\n", "\\u000A", s); - s = StringUtil.gsub("\r", "\\u000D", s); - s = StringUtil.gsub("\"", "\\u0022", s); - s = StringUtil.gsub("`", "\\u0060", s); - s = StringUtil.gsub("^", "\\u005E", s); - s = StringUtil.gsub("|", "\\u007C", s); - s = StringUtil.gsub("<", "\\u003C", s); - s = StringUtil.gsub(">", "\\u003E", s); - s = StringUtil.gsub(" ", "\\u0020", s); + s = s.replace("\\", "\\u005C"); + s = s.replace("\t", "\\u0009"); + s = s.replace("\n", "\\u000A"); + s = s.replace("\r", "\\u000D"); + s = s.replace("\"", "\\u0022"); + s = s.replace("`", "\\u0060"); + s = s.replace("^", "\\u005E"); + s = s.replace("|", "\\u007C"); + s = s.replace("<", "\\u003C"); + s = s.replace(">", "\\u003E"); + s = s.replace(" ", "\\u0020"); return s; } diff --git a/core/sail/api/src/main/java/org/eclipse/rdf4j/common/concurrent/locks/LockingIteration.java b/core/sail/api/src/main/java/org/eclipse/rdf4j/common/concurrent/locks/LockingIteration.java index c247c611e92..7e2153faae1 100644 --- a/core/sail/api/src/main/java/org/eclipse/rdf4j/common/concurrent/locks/LockingIteration.java +++ b/core/sail/api/src/main/java/org/eclipse/rdf4j/common/concurrent/locks/LockingIteration.java @@ -21,7 +21,6 @@ * An Iteration that holds on to a lock until the Iteration is closed. Upon closing, the underlying Iteration is closed * before the lock is released. This iterator closes itself as soon as all elements have been read. */ -@Deprecated(since = "4.1.0") public class LockingIteration extends IterationWrapper { /** @@ -35,8 +34,7 @@ public class LockingIteration extends IterationWrapper { * @param lock The lock to release when the itererator is closed, must not be null. * @param iter The underlying Iteration, must not be null. */ - @Deprecated(since = "4.1.0", forRemoval = true) - public LockingIteration(Lock lock, CloseableIteration iter) { + private LockingIteration(Lock lock, CloseableIteration iter) { super(iter); if (iter instanceof EmptyIteration) { lock.release(); 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 8fa0a25df88..a5f428f4714 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 @@ -407,17 +407,6 @@ void removeStatement(UpdateContext op, Resource subj, IRI pred, Value obj, Resou */ void clearNamespaces() throws SailException; - /** - * Indicates if the Sail has any statement removal operations pending (not yet {@link #flush() flushed}) for the - * current transaction. - * - * @return true if any statement removal operations have not yet been flushed, false otherwise. - * @see #flush() - * @deprecated - */ - @Deprecated - boolean pendingRemovals(); - /** *

* Explain how the TupleExpr will be (or has been) executed/evaluated by returning a TupleExpr (which may or may not 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 edd7507e123..b0067d0292e 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 @@ -546,7 +546,7 @@ public final void rollback() throws SailException { @Override public final void addStatement(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException { - if (pendingRemovals()) { + if (statementsRemoved) { flushPendingUpdates(); } addStatement(null, subj, pred, obj, contexts); @@ -797,11 +797,6 @@ public final void clearNamespaces() throws SailException { } } - @Override - public boolean pendingRemovals() { - return statementsRemoved; - } - protected boolean pendingAdds() { return statementsAdded; } diff --git a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/NotifyingSailConnectionBase.java b/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/NotifyingSailConnectionBase.java deleted file mode 100644 index 98abf0becea..00000000000 --- a/core/sail/api/src/main/java/org/eclipse/rdf4j/sail/helpers/NotifyingSailConnectionBase.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2021 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.helpers; - -/** - * @author Jeen Broekstra - * @deprecated since RDF4J 4.0. Use {@link AbstractNotifyingSailConnection} instead. - */ -@Deprecated(forRemoval = true) -public abstract class NotifyingSailConnectionBase extends AbstractNotifyingSailConnection { - - public NotifyingSailConnectionBase(AbstractSail sailBase) { - super(sailBase); - } - -} 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 0ca7b23c735..3d4e64c180c 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 @@ -214,11 +214,6 @@ public void clearNamespaces() throws SailException { wrappedCon.clearNamespaces(); } - @Override - public boolean pendingRemovals() { - return false; - } - @Override public Explanation explain(Explanation.Level level, TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred, int timeoutSeconds) { diff --git a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/DistinctModelReducingUnionIteration.java b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/DistinctModelReducingUnionIteration.java index 2095c4e71e2..8d9331adb3f 100644 --- a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/DistinctModelReducingUnionIteration.java +++ b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/DistinctModelReducingUnionIteration.java @@ -84,11 +84,7 @@ protected Statement getNextElement() throws SailException { @Override protected void handleClose() throws SailException { - try { - iterator.close(); - } finally { - super.handleClose(); - } + iterator.close(); } } diff --git a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailClosingIteration.java b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailClosingIteration.java index 8e032cf717f..59dd811555d 100644 --- a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailClosingIteration.java +++ b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailClosingIteration.java @@ -26,7 +26,7 @@ * * @author James Leigh */ -abstract class SailClosingIteration extends IterationWrapper { +abstract class SailClosingIteration extends IterationWrapper { /** * Creates a new {@link CloseableIteration} that automatically closes the given {@link SailClosable}s. @@ -35,7 +35,7 @@ abstract class SailClosingIteration extends Itera * @param closes The {@link SailClosable}s to {@link SailClosable#close()} when the itererator is closed. * @return a {@link CloseableIteration} that closes the given {@link SailClosable} */ - public static SailClosingIteration makeClosable( + public static SailClosingIteration makeClosable( CloseableIteration iter, SailClosable... closes) { return new SailClosingIteration<>(iter, closes) { @@ -146,8 +146,6 @@ protected void handleClose() { * This method is called after all of the {@link SailClosable} objects have had close called on them. * * @param e The {@link SailException} to handle. - * @throws X Instances of this generic-typed exception in response to the given {@link SailException} if the handler - * decides to propagate the exception. */ - protected abstract void handleSailException(SailException e) throws X; + protected abstract void handleSailException(SailException e); } diff --git a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDatasetImpl.java b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDatasetImpl.java index 809aaad7793..a32407ef461 100644 --- a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDatasetImpl.java +++ b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDatasetImpl.java @@ -168,11 +168,7 @@ public void remove() { @Override public void handleClose() throws SailException { - try { - super.handleClose(); - } finally { - namespaces.close(); - } + namespaces.close(); } }; } @@ -250,11 +246,7 @@ public void remove() throws SailException { @Override public void handleClose() throws SailException { - try { - super.handleClose(); - } finally { - contextIDs.close(); - } + contextIDs.close(); } }; } @@ -341,6 +333,11 @@ private CloseableIteration difference( protected boolean accept(Statement stmt) { return !excluded.apply(stmt); } + + @Override + protected void handleClose() { + + } }; } @@ -352,6 +349,11 @@ private CloseableIteration triplesDifference( protected boolean accept(Triple stmt) { return !excluded.apply(stmt); } + + @Override + protected void handleClose() { + + } }; } diff --git a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDatasetTripleSource.java b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDatasetTripleSource.java index d1b7f48354b..91911934b0c 100644 --- a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDatasetTripleSource.java +++ b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailDatasetTripleSource.java @@ -13,6 +13,7 @@ import org.eclipse.rdf4j.common.annotation.InternalUseOnly; import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.common.iteration.DistinctIteration; +import org.eclipse.rdf4j.common.iteration.EmptyIteration; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; @@ -50,6 +51,9 @@ public CloseableIteration getStatements(Resource subj, IRI CloseableIteration statements = null; try { statements = dataset.getStatements(subj, pred, obj, contexts); + if (statements instanceof EmptyIteration) { + return statements; + } return new TripleSourceIterationWrapper<>(statements); } catch (Throwable t) { if (statements != null) { @@ -76,6 +80,9 @@ public CloseableIteration getRdfStarTriples(Resource subj, IRI // In contrast to statement retrieval (which gets de-duplicated later on when handling things like // projections and conversions) we need to make sure we de-duplicate the RDF-star triples here. triples = dataset.getTriples(subj, pred, obj); + if (triples instanceof EmptyIteration) { + return triples; + } iterationWrapper = new TripleSourceIterationWrapper<>(triples); return new DistinctIteration<>(iterationWrapper); } catch (Throwable t) { 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 6926cedd854..c10842897e8 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 @@ -141,10 +141,6 @@ default void approve(Statement statement) throws SailException { * @param ctx The context from which to remove the statement * @throws SailException If the statement could not be removed, for example because no transaction is active. */ - @Deprecated(since = "3.1.0") - default void deprecate(Resource subj, IRI pred, Value obj, Resource ctx) throws SailException { - deprecate(SimpleValueFactory.getInstance().createStatement(subj, pred, obj, ctx)); - } /** * Removes a statement. diff --git a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailSourceConnection.java b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailSourceConnection.java index b414b14969a..f4048b26aa9 100644 --- a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailSourceConnection.java +++ b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SailSourceConnection.java @@ -986,9 +986,9 @@ private SailSource branch(IncludeInferred includeinferred) throws SailException } } - private CloseableIteration interlock( + private CloseableIteration interlock( CloseableIteration iter, SailClosable... closes) { - return new SailClosingIteration(iter, closes) { + return new SailClosingIteration<>(iter, closes) { @Override protected void handleSailException(SailException e) throws QueryEvaluationException { diff --git a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/evaluation/SailTripleSource.java b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/evaluation/SailTripleSource.java index d473224676f..17a64272ae9 100644 --- a/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/evaluation/SailTripleSource.java +++ b/core/sail/base/src/main/java/org/eclipse/rdf4j/sail/evaluation/SailTripleSource.java @@ -11,6 +11,7 @@ package org.eclipse.rdf4j.sail.evaluation; import org.eclipse.rdf4j.common.iteration.CloseableIteration; +import org.eclipse.rdf4j.common.iteration.EmptyIteration; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.Resource; import org.eclipse.rdf4j.model.Statement; @@ -42,7 +43,10 @@ public CloseableIteration getStatements(Resource subj, IRI CloseableIteration iter = null; try { iter = conn.getStatements(subj, pred, obj, includeInferred, contexts); - return new TripleSourceIterationWrapper(iter); + if (iter instanceof EmptyIteration) { + return iter; + } + return new TripleSourceIterationWrapper<>(iter); } catch (Throwable t) { if (iter != null) { iter.close(); 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 583d4091f0b..f4dff97822e 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 @@ -204,16 +204,8 @@ protected ExtensibleStatement getNextElement() throws SailException { return next; } - @Override - public void remove() throws SailException { - - throw new IllegalStateException("Does not support removing from iterator"); - - } - @Override protected void handleClose() throws SailException { - super.handleClose(); iterator.close(); } diff --git a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/EagerReadCache.java b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/EagerReadCache.java index bc6247d1360..29da5bdd610 100644 --- a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/EagerReadCache.java +++ b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/EagerReadCache.java @@ -93,6 +93,12 @@ protected ExtensibleStatement getNextElement() throws SailException { } return null; } + + @Override + protected void handleClose() { + + } + }, subject, predicate, object, inferred, context); } diff --git a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleSailSource.java b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleSailSource.java index 0be1e79521d..a49e9aced28 100644 --- a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleSailSource.java +++ b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ExtensibleSailSource.java @@ -106,15 +106,9 @@ public void approve(Resource subj, IRI pred, Value obj, Resource ctx) throws Sai @Override public void approve(Statement statement) throws SailException { - dataStructure.addStatement(extensibleStatementHelper.fromStatement(statement, inferred)); } - @Override - public void deprecate(Resource subj, IRI pred, Value obj, Resource ctx) throws SailException { - throw new IllegalStateException("Unsupported operation. Use deprecate(Statement statement) instead!"); - } - @Override public void deprecate(Statement statement) throws SailException { dataStructure.removeStatement(extensibleStatementHelper.fromStatement(statement, inferred)); diff --git a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/FilteringIteration.java b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/FilteringIteration.java index 741cc8e1cfd..d98d932ad39 100644 --- a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/FilteringIteration.java +++ b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/FilteringIteration.java @@ -76,12 +76,7 @@ protected E getNextElement() { @Override protected void handleClose() { - try { - super.handleClose(); - } finally { - wrappedIteration.close(); - } - + wrappedIteration.close(); } private static boolean containsContext(Resource[] haystack, Resource needle) { diff --git a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/LazyReadCache.java b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/LazyReadCache.java index e2da5a3ece4..c0cf2ffd99f 100644 --- a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/LazyReadCache.java +++ b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/LazyReadCache.java @@ -129,6 +129,7 @@ synchronized private CloseableIteration getCached if (statements != null) { return new LookAheadIteration<>() { + final Iterator iterator = statements.iterator(); @Override @@ -138,6 +139,11 @@ protected ExtensibleStatement getNextElement() throws SailException { } return null; } + + @Override + protected void handleClose() { + + } }; } diff --git a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ReadCommittedWrapper.java b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ReadCommittedWrapper.java index 3fe7d747ba0..f67b8046414 100644 --- a/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ReadCommittedWrapper.java +++ b/core/sail/extensible-store/src/main/java/org/eclipse/rdf4j/sail/extensiblestore/ReadCommittedWrapper.java @@ -122,7 +122,6 @@ public CloseableIteration getStatements(Resource @Override protected void handleClose() throws SailException { - super.handleClose(); right.close(); } diff --git a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/ForwardChainingRDFSInferencer.java b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/ForwardChainingRDFSInferencer.java deleted file mode 100644 index 44bf6d9a701..00000000000 --- a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/ForwardChainingRDFSInferencer.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.inferencer.fc; - -import org.eclipse.rdf4j.sail.NotifyingSail; -import org.eclipse.rdf4j.sail.Sail; -import org.eclipse.rdf4j.sail.SailException; -import org.eclipse.rdf4j.sail.inferencer.InferencerConnection; - -/** - * Forward-chaining RDF Schema inferencer, using the rules from the - * RDF Semantics Recommendation (10 February 2004). This - * inferencer can be used to add RDF Schema semantics to any Sail that returns {@link InferencerConnection}s from their - * {@link Sail#getConnection()} method. - * - * @deprecated This inferencer implementation will be phased out. Consider switching to the - * {@link SchemaCachingRDFSInferencer} instead. - */ -@Deprecated(since = "2.5") -public class ForwardChainingRDFSInferencer extends AbstractForwardChainingInferencer { - /*--------------* - * Constructors * - *--------------*/ - - public ForwardChainingRDFSInferencer() { - super(); - } - - public ForwardChainingRDFSInferencer(NotifyingSail baseSail) { - super(baseSail); - } - - /*---------* - * Methods * - *---------*/ - - @Override - public ForwardChainingRDFSInferencerConnection getConnection() throws SailException { - try { - InferencerConnection con = (InferencerConnection) super.getConnection(); - return new ForwardChainingRDFSInferencerConnection(this, con); - } catch (ClassCastException e) { - throw new SailException(e.getMessage(), e); - } - } - - /** - * Adds axiom statements to the underlying Sail. - */ - @Override - public void init() throws SailException { - super.init(); - - try (ForwardChainingRDFSInferencerConnection con = getConnection()) { - con.begin(); - con.addAxiomStatements(); - con.commit(); - } - } -} 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 deleted file mode 100644 index 3f393a10d7e..00000000000 --- a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/ForwardChainingRDFSInferencerConnection.java +++ /dev/null @@ -1,883 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.inferencer.fc; - -import org.eclipse.rdf4j.common.iteration.CloseableIteration; -import org.eclipse.rdf4j.common.text.ASCIIUtil; -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Model; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.Statement; -import org.eclipse.rdf4j.model.Value; -import org.eclipse.rdf4j.model.impl.DynamicModelFactory; -import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.RDFS; -import org.eclipse.rdf4j.sail.Sail; -import org.eclipse.rdf4j.sail.SailException; -import org.eclipse.rdf4j.sail.inferencer.InferencerConnection; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Forward-chaining RDF Schema inferencer, using the rules from the - * RDF Semantics Recommendation (10 February 2004). This - * inferencer can be used to add RDF Schema semantics to any Sail that returns {@link InferencerConnection}s from their - * {@link Sail#getConnection()} method. - * - * @deprecated This inferencer implementation will be phased out. Consider switching to the - * {@link SchemaCachingRDFSInferencer} instead. - */ -@Deprecated(since = "2.5") -class ForwardChainingRDFSInferencerConnection extends AbstractForwardChainingInferencerConnection { - - static private final Logger logger = LoggerFactory.getLogger(ForwardChainingRDFSInferencerConnection.class); - - /*-----------* - * Variables * - *-----------*/ - - private Model newThisIteration; - - /** - * Flags indicating which rules should be evaluated. - */ - private final boolean[] checkRule = new boolean[RDFSRules.RULECOUNT]; - - /** - * Flags indicating which rules should be evaluated next iteration. - */ - private final boolean[] checkRuleNextIter = new boolean[RDFSRules.RULECOUNT]; - - /** - * The number of inferred statements per rule. - */ - private final int[] ruleCount = new int[RDFSRules.RULECOUNT]; - - /*--------------* - * Constructors * - *--------------*/ - - public ForwardChainingRDFSInferencerConnection(Sail sail, InferencerConnection con) { - super(sail, con); - } - - /*---------* - * Methods * - *---------*/ - - // Called by base sail - @Override - protected Model createModel() { - return new DynamicModelFactory().createEmptyModel(); - } - - /** - * Adds all basic set of axiom statements from which the complete set can be inferred to the underlying Sail. - */ - @Override - protected void addAxiomStatements() throws SailException { - logger.debug("Inserting axiom statements"); - - // RDF axiomatic triples (from RDF Semantics, section 3.1): - - addInferredStatement(RDF.TYPE, RDF.TYPE, RDF.PROPERTY); - addInferredStatement(RDF.SUBJECT, RDF.TYPE, RDF.PROPERTY); - addInferredStatement(RDF.PREDICATE, RDF.TYPE, RDF.PROPERTY); - addInferredStatement(RDF.OBJECT, RDF.TYPE, RDF.PROPERTY); - - addInferredStatement(RDF.FIRST, RDF.TYPE, RDF.PROPERTY); - addInferredStatement(RDF.REST, RDF.TYPE, RDF.PROPERTY); - addInferredStatement(RDF.VALUE, RDF.TYPE, RDF.PROPERTY); - - addInferredStatement(RDF.NIL, RDF.TYPE, RDF.LIST); - - // RDFS axiomatic triples (from RDF Semantics, section 4.1): - - addInferredStatement(RDF.TYPE, RDFS.DOMAIN, RDFS.RESOURCE); - addInferredStatement(RDFS.DOMAIN, RDFS.DOMAIN, RDF.PROPERTY); - addInferredStatement(RDFS.RANGE, RDFS.DOMAIN, RDF.PROPERTY); - addInferredStatement(RDFS.SUBPROPERTYOF, RDFS.DOMAIN, RDF.PROPERTY); - addInferredStatement(RDFS.SUBCLASSOF, RDFS.DOMAIN, RDFS.CLASS); - addInferredStatement(RDF.SUBJECT, RDFS.DOMAIN, RDF.STATEMENT); - addInferredStatement(RDF.PREDICATE, RDFS.DOMAIN, RDF.STATEMENT); - addInferredStatement(RDF.OBJECT, RDFS.DOMAIN, RDF.STATEMENT); - addInferredStatement(RDFS.MEMBER, RDFS.DOMAIN, RDFS.RESOURCE); - addInferredStatement(RDF.FIRST, RDFS.DOMAIN, RDF.LIST); - addInferredStatement(RDF.REST, RDFS.DOMAIN, RDF.LIST); - addInferredStatement(RDFS.SEEALSO, RDFS.DOMAIN, RDFS.RESOURCE); - addInferredStatement(RDFS.ISDEFINEDBY, RDFS.DOMAIN, RDFS.RESOURCE); - addInferredStatement(RDFS.COMMENT, RDFS.DOMAIN, RDFS.RESOURCE); - addInferredStatement(RDFS.LABEL, RDFS.DOMAIN, RDFS.RESOURCE); - addInferredStatement(RDF.VALUE, RDFS.DOMAIN, RDFS.RESOURCE); - - addInferredStatement(RDF.TYPE, RDFS.RANGE, RDFS.CLASS); - addInferredStatement(RDFS.DOMAIN, RDFS.RANGE, RDFS.CLASS); - addInferredStatement(RDFS.RANGE, RDFS.RANGE, RDFS.CLASS); - addInferredStatement(RDFS.SUBPROPERTYOF, RDFS.RANGE, RDF.PROPERTY); - addInferredStatement(RDFS.SUBCLASSOF, RDFS.RANGE, RDFS.CLASS); - addInferredStatement(RDF.SUBJECT, RDFS.RANGE, RDFS.RESOURCE); - addInferredStatement(RDF.PREDICATE, RDFS.RANGE, RDFS.RESOURCE); - addInferredStatement(RDF.OBJECT, RDFS.RANGE, RDFS.RESOURCE); - addInferredStatement(RDFS.MEMBER, RDFS.RANGE, RDFS.RESOURCE); - addInferredStatement(RDF.FIRST, RDFS.RANGE, RDFS.RESOURCE); - addInferredStatement(RDF.REST, RDFS.RANGE, RDF.LIST); - addInferredStatement(RDFS.SEEALSO, RDFS.RANGE, RDFS.RESOURCE); - addInferredStatement(RDFS.ISDEFINEDBY, RDFS.RANGE, RDFS.RESOURCE); - addInferredStatement(RDFS.COMMENT, RDFS.RANGE, RDFS.LITERAL); - addInferredStatement(RDFS.LABEL, RDFS.RANGE, RDFS.LITERAL); - addInferredStatement(RDF.VALUE, RDFS.RANGE, RDFS.RESOURCE); - - addInferredStatement(RDF.ALT, RDFS.SUBCLASSOF, RDFS.CONTAINER); - addInferredStatement(RDF.BAG, RDFS.SUBCLASSOF, RDFS.CONTAINER); - addInferredStatement(RDF.SEQ, RDFS.SUBCLASSOF, RDFS.CONTAINER); - addInferredStatement(RDFS.CONTAINERMEMBERSHIPPROPERTY, RDFS.SUBCLASSOF, RDF.PROPERTY); - - addInferredStatement(RDFS.ISDEFINEDBY, RDFS.SUBPROPERTYOF, RDFS.SEEALSO); - - addInferredStatement(RDF.XMLLITERAL, RDF.TYPE, RDFS.DATATYPE); - addInferredStatement(RDF.XMLLITERAL, RDFS.SUBCLASSOF, RDFS.LITERAL); - addInferredStatement(RDFS.DATATYPE, RDFS.SUBCLASSOF, RDFS.CLASS); - } - - @Override - protected void doInferencing() throws SailException { - // All rules need to be checked: - for (int i = 0; i < RDFSRules.RULECOUNT; i++) { - ruleCount[i] = 0; - checkRuleNextIter[i] = true; - } - - super.doInferencing(); - - // Print some statistics - logger.debug("---RdfMTInferencer statistics:---"); - logger.debug("total statements inferred = " + totalInferred); - for (int i = 0; i < RDFSRules.RULECOUNT; i++) { - logger.debug("rule " + RDFSRules.RULENAMES[i] + ":\t#inferred=" + ruleCount[i]); - } - logger.debug("---end of statistics:---"); - } - - @Override - protected int applyRules(Model iteration) throws SailException { - newThisIteration = iteration; - int nofInferred = 0; - nofInferred += applyRule(RDFSRules.Rdf1); - nofInferred += applyRule(RDFSRules.Rdfs2_1); - nofInferred += applyRule(RDFSRules.Rdfs2_2); - nofInferred += applyRule(RDFSRules.Rdfs3_1); - nofInferred += applyRule(RDFSRules.Rdfs3_2); - nofInferred += applyRule(RDFSRules.Rdfs4a); - nofInferred += applyRule(RDFSRules.Rdfs4b); - nofInferred += applyRule(RDFSRules.Rdfs5_1); - nofInferred += applyRule(RDFSRules.Rdfs5_2); - nofInferred += applyRule(RDFSRules.Rdfs6); - nofInferred += applyRule(RDFSRules.Rdfs7_1); - nofInferred += applyRule(RDFSRules.Rdfs7_2); - nofInferred += applyRule(RDFSRules.Rdfs8); - nofInferred += applyRule(RDFSRules.Rdfs9_1); - nofInferred += applyRule(RDFSRules.Rdfs9_2); - nofInferred += applyRule(RDFSRules.Rdfs10); - nofInferred += applyRule(RDFSRules.Rdfs11_1); - nofInferred += applyRule(RDFSRules.Rdfs11_2); - nofInferred += applyRule(RDFSRules.Rdfs12); - nofInferred += applyRule(RDFSRules.Rdfs13); - nofInferred += applyRule(RDFSRules.RX1); - newThisIteration = null; - return nofInferred; - } - - @Override - protected Model prepareIteration() { - for (int i = 0; i < RDFSRules.RULECOUNT; i++) { - checkRule[i] = checkRuleNextIter[i]; - - // reset for next iteration: - checkRuleNextIter[i] = false; - } - return super.prepareIteration(); - } - - protected void updateTriggers(int ruleNo, int nofInferred) { - if (nofInferred > 0) { - ruleCount[ruleNo] += nofInferred; - - // Check which rules are triggered by this one. - boolean[] triggers = RDFSRules.TRIGGERS[ruleNo]; - - for (int i = 0; i < RDFSRules.RULECOUNT; i++) { - if (triggers[i] == true) { - checkRuleNextIter[i] = true; - } - } - } - } - - protected int applyRule(int rule) throws SailException { - if (!checkRule[rule]) { - return 0; - } - int nofInferred; - - nofInferred = applyRuleInternal(rule); - - updateTriggers(rule, nofInferred); - - return nofInferred; - } - - protected int applyRuleInternal(int rule) throws SailException { - int result; - - switch (rule) { - case RDFSRules.Rdf1: - result = applyRuleRdf1(); - break; - case RDFSRules.Rdfs2_1: - result = applyRuleRdfs2_1(); - break; - case RDFSRules.Rdfs2_2: - result = applyRuleRdfs2_2(); - break; - case RDFSRules.Rdfs3_1: - result = applyRuleRdfs3_1(); - break; - case RDFSRules.Rdfs3_2: - result = applyRuleRdfs3_2(); - break; - case RDFSRules.Rdfs4a: - result = applyRuleRdfs4a(); - break; - case RDFSRules.Rdfs4b: - result = applyRuleRdfs4b(); - break; - case RDFSRules.Rdfs5_1: - result = applyRuleRdfs5_1(); - break; - case RDFSRules.Rdfs5_2: - result = applyRuleRdfs5_2(); - break; - case RDFSRules.Rdfs6: - result = applyRuleRdfs6(); - break; - case RDFSRules.Rdfs7_1: - result = applyRuleRdfs7_1(); - break; - case RDFSRules.Rdfs7_2: - result = applyRuleRdfs7_2(); - break; - case RDFSRules.Rdfs8: - result = applyRuleRdfs8(); - break; - case RDFSRules.Rdfs9_1: - result = applyRuleRdfs9_1(); - break; - case RDFSRules.Rdfs9_2: - result = applyRuleRdfs9_2(); - break; - case RDFSRules.Rdfs10: - result = applyRuleRdfs10(); - break; - case RDFSRules.Rdfs11_1: - result = applyRuleRdfs11_1(); - break; - case RDFSRules.Rdfs11_2: - result = applyRuleRdfs11_2(); - break; - case RDFSRules.Rdfs12: - result = applyRuleRdfs12(); - break; - case RDFSRules.Rdfs13: - result = applyRuleRdfs13(); - break; - case RDFSRules.RX1: - result = applyRuleX1(); - break; - default: - throw new AssertionError("Unexpected rule: " + rule); - } - // ThreadLog.trace("Rule " + RDFSRules.RULENAMES[rule] + " inferred " + - // result + " new triples."); - return result; - } - - // xxx aaa yyy --> aaa rdf:type rdf:Property - private int applyRuleRdf1() throws SailException { - int nofInferred = 0; - - Iterable iter = newThisIteration.getStatements(null, null, null); - - for (Statement st : iter) { - boolean added = addInferredStatement(st.getPredicate(), RDF.TYPE, RDF.PROPERTY); - - if (added) { - nofInferred++; - } - } - - return nofInferred; - } - - // xxx aaa yyy (nt) && aaa rdfs:domain zzz (t1) --> xxx rdf:type zzz - private int applyRuleRdfs2_1() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, null, null); - - for (Statement nt : ntIter) { - Resource xxx = nt.getSubject(); - IRI aaa = nt.getPredicate(); - - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(aaa, RDFS.DOMAIN, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Value zzz = t1.getObject(); - if (zzz instanceof Resource) { - boolean added = addInferredStatement(xxx, RDF.TYPE, zzz); - if (added) { - nofInferred++; - } - } - } - t1Iter.close(); - } - - return nofInferred; - } - - // aaa rdfs:domain zzz (nt) && xxx aaa yyy (t1) --> xxx rdf:type zzz - private int applyRuleRdfs2_2() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDFS.DOMAIN, null); - - for (Statement nt : ntIter) { - Resource aaa = nt.getSubject(); - Value zzz = nt.getObject(); - - if (aaa instanceof IRI && zzz instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(null, (IRI) aaa, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Resource xxx = t1.getSubject(); - boolean added = addInferredStatement(xxx, RDF.TYPE, zzz); - if (added) { - nofInferred++; - } - } - t1Iter.close(); - } - } - - return nofInferred; - } - - // xxx aaa uuu (nt) && aaa rdfs:range zzz (t1) --> uuu rdf:type zzz - private int applyRuleRdfs3_1() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, null, null); - - for (Statement nt : ntIter) { - IRI aaa = nt.getPredicate(); - Value uuu = nt.getObject(); - - if (uuu instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(aaa, RDFS.RANGE, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Value zzz = t1.getObject(); - if (zzz instanceof Resource) { - boolean added = addInferredStatement((Resource) uuu, RDF.TYPE, zzz); - if (added) { - nofInferred++; - } - } - } - t1Iter.close(); - } - } - return nofInferred; - } - - // aaa rdfs:range zzz (nt) && xxx aaa uuu (t1) --> uuu rdf:type zzz - private int applyRuleRdfs3_2() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDFS.RANGE, null); - - for (Statement nt : ntIter) { - Resource aaa = nt.getSubject(); - Value zzz = nt.getObject(); - - if (aaa instanceof IRI && zzz instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(null, (IRI) aaa, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Value uuu = t1.getObject(); - if (uuu instanceof Resource) { - boolean added = addInferredStatement((Resource) uuu, RDF.TYPE, zzz); - if (added) { - nofInferred++; - } - } - } - t1Iter.close(); - } - } - - return nofInferred; - - } - - // xxx aaa yyy --> xxx rdf:type rdfs:Resource - private int applyRuleRdfs4a() throws SailException { - int nofInferred = 0; - - Iterable iter = newThisIteration.getStatements(null, null, null); - - for (Statement st : iter) { - boolean added = addInferredStatement(st.getSubject(), RDF.TYPE, RDFS.RESOURCE); - if (added) { - nofInferred++; - } - } - - return nofInferred; - } - - // xxx aaa uuu --> uuu rdf:type rdfs:Resource - private int applyRuleRdfs4b() throws SailException { - int nofInferred = 0; - - Iterable iter = newThisIteration.getStatements(null, null, null); - - for (Statement st : iter) { - Value uuu = st.getObject(); - if (uuu instanceof Resource) { - boolean added = addInferredStatement((Resource) uuu, RDF.TYPE, RDFS.RESOURCE); - if (added) { - nofInferred++; - } - } - } - - return nofInferred; - } - - // aaa rdfs:subPropertyOf bbb (nt) && bbb rdfs:subPropertyOf ccc (t1) - // --> aaa rdfs:subPropertyOf ccc - private int applyRuleRdfs5_1() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDFS.SUBPROPERTYOF, null); - - for (Statement nt : ntIter) { - Resource aaa = nt.getSubject(); - Value bbb = nt.getObject(); - - if (bbb instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements((Resource) bbb, RDFS.SUBPROPERTYOF, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Value ccc = t1.getObject(); - if (ccc instanceof Resource) { - boolean added = addInferredStatement(aaa, RDFS.SUBPROPERTYOF, ccc); - if (added) { - nofInferred++; - } - } - } - t1Iter.close(); - - } - } - - return nofInferred; - } - - // bbb rdfs:subPropertyOf ccc (nt) && aaa rdfs:subPropertyOf bbb (t1) - // --> aaa rdfs:subPropertyOf ccc - private int applyRuleRdfs5_2() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDFS.SUBPROPERTYOF, null); - - for (Statement nt : ntIter) { - Resource bbb = nt.getSubject(); - Value ccc = nt.getObject(); - - if (ccc instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(null, RDFS.SUBPROPERTYOF, bbb, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Resource aaa = t1.getSubject(); - boolean added = addInferredStatement(aaa, RDFS.SUBPROPERTYOF, ccc); - if (added) { - nofInferred++; - } - } - t1Iter.close(); - } - } - - return nofInferred; - } - - // xxx rdf:type rdf:Property --> xxx rdfs:subPropertyOf xxx - private int applyRuleRdfs6() throws SailException { - int nofInferred = 0; - - Iterable iter = newThisIteration.getStatements(null, RDF.TYPE, RDF.PROPERTY); - - for (Statement st : iter) { - Resource xxx = st.getSubject(); - boolean added = addInferredStatement(xxx, RDFS.SUBPROPERTYOF, xxx); - if (added) { - nofInferred++; - } - } - - return nofInferred; - } - - // xxx aaa yyy (nt) && aaa rdfs:subPropertyOf bbb (t1) --> xxx bbb yyy - private int applyRuleRdfs7_1() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, null, null); - - for (Statement nt : ntIter) { - Resource xxx = nt.getSubject(); - IRI aaa = nt.getPredicate(); - Value yyy = nt.getObject(); - - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(aaa, RDFS.SUBPROPERTYOF, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Value bbb = t1.getObject(); - if (bbb instanceof IRI) { - boolean added = addInferredStatement(xxx, (IRI) bbb, yyy); - if (added) { - nofInferred++; - } - } - } - t1Iter.close(); - } - - return nofInferred; - } - - // aaa rdfs:subPropertyOf bbb (nt) && xxx aaa yyy (t1) --> xxx bbb yyy - private int applyRuleRdfs7_2() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDFS.SUBPROPERTYOF, null); - - for (Statement nt : ntIter) { - Resource aaa = nt.getSubject(); - Value bbb = nt.getObject(); - - if (aaa instanceof IRI && bbb instanceof IRI) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(null, (IRI) aaa, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Resource xxx = t1.getSubject(); - Value yyy = t1.getObject(); - - boolean added = addInferredStatement(xxx, (IRI) bbb, yyy); - if (added) { - nofInferred++; - } - } - t1Iter.close(); - } - } - - return nofInferred; - } - - // xxx rdf:type rdfs:Class --> xxx rdfs:subClassOf rdfs:Resource - private int applyRuleRdfs8() throws SailException { - int nofInferred = 0; - - Iterable iter = newThisIteration.getStatements(null, RDF.TYPE, RDFS.CLASS); - - for (Statement st : iter) { - Resource xxx = st.getSubject(); - - boolean added = addInferredStatement(xxx, RDFS.SUBCLASSOF, RDFS.RESOURCE); - if (added) { - nofInferred++; - } - } - - return nofInferred; - } - - // xxx rdfs:subClassOf yyy (nt) && aaa rdf:type xxx (t1) --> aaa rdf:type yyy - private int applyRuleRdfs9_1() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDFS.SUBCLASSOF, null); - - for (Statement nt : ntIter) { - Resource xxx = nt.getSubject(); - Value yyy = nt.getObject(); - - if (yyy instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(null, RDF.TYPE, xxx, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Resource aaa = t1.getSubject(); - - boolean added = addInferredStatement(aaa, RDF.TYPE, yyy); - if (added) { - nofInferred++; - } - } - t1Iter.close(); - } - } - - return nofInferred; - } - - // aaa rdf:type xxx (nt) && xxx rdfs:subClassOf yyy (t1) --> aaa rdf:type yyy - private int applyRuleRdfs9_2() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDF.TYPE, null); - - for (Statement nt : ntIter) { - Resource aaa = nt.getSubject(); - Value xxx = nt.getObject(); - - if (xxx instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements((Resource) xxx, RDFS.SUBCLASSOF, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Value yyy = t1.getObject(); - - if (yyy instanceof Resource) { - boolean added = addInferredStatement(aaa, RDF.TYPE, yyy); - if (added) { - nofInferred++; - } - } - } - t1Iter.close(); - } - } - - return nofInferred; - } - - // xxx rdf:type rdfs:Class --> xxx rdfs:subClassOf xxx - private int applyRuleRdfs10() throws SailException { - int nofInferred = 0; - - Iterable iter = newThisIteration.getStatements(null, RDF.TYPE, RDFS.CLASS); - - for (Statement st : iter) { - Resource xxx = st.getSubject(); - - boolean added = addInferredStatement(xxx, RDFS.SUBCLASSOF, xxx); - if (added) { - nofInferred++; - } - } - - return nofInferred; - } - - // xxx rdfs:subClassOf yyy (nt) && yyy rdfs:subClassOf zzz (t1) - // --> xxx rdfs:subClassOf zzz - private int applyRuleRdfs11_1() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDFS.SUBCLASSOF, null); - - for (Statement nt : ntIter) { - Resource xxx = nt.getSubject(); - Value yyy = nt.getObject(); - - if (yyy instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements((Resource) yyy, RDFS.SUBCLASSOF, null, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Value zzz = t1.getObject(); - - if (zzz instanceof Resource) { - boolean added = addInferredStatement(xxx, RDFS.SUBCLASSOF, zzz); - if (added) { - nofInferred++; - } - } - } - t1Iter.close(); - } - } - - return nofInferred; - } - - // yyy rdfs:subClassOf zzz (nt) && xxx rdfs:subClassOf yyy (t1) - // --> xxx rdfs:subClassOf zzz - private int applyRuleRdfs11_2() throws SailException { - int nofInferred = 0; - - Iterable ntIter = newThisIteration.getStatements(null, RDFS.SUBCLASSOF, null); - - for (Statement nt : ntIter) { - Resource yyy = nt.getSubject(); - Value zzz = nt.getObject(); - - if (zzz instanceof Resource) { - CloseableIteration t1Iter; - t1Iter = getWrappedConnection().getStatements(null, RDFS.SUBCLASSOF, yyy, true); - - while (t1Iter.hasNext()) { - Statement t1 = t1Iter.next(); - - Resource xxx = t1.getSubject(); - - boolean added = addInferredStatement(xxx, RDFS.SUBCLASSOF, zzz); - if (added) { - nofInferred++; - } - } - t1Iter.close(); - } - } - - return nofInferred; - } - - // xxx rdf:type rdfs:ContainerMembershipProperty - // --> xxx rdfs:subPropertyOf rdfs:member - private int applyRuleRdfs12() throws SailException { - int nofInferred = 0; - - Iterable iter = newThisIteration.getStatements(null, RDF.TYPE, RDFS.CONTAINERMEMBERSHIPPROPERTY); - - for (Statement st : iter) { - Resource xxx = st.getSubject(); - - boolean added = addInferredStatement(xxx, RDFS.SUBPROPERTYOF, RDFS.MEMBER); - if (added) { - nofInferred++; - } - } - - return nofInferred; - } - - // xxx rdf:type rdfs:Datatype --> xxx rdfs:subClassOf rdfs:Literal - private int applyRuleRdfs13() throws SailException { - int nofInferred = 0; - - Iterable iter = newThisIteration.getStatements(null, RDF.TYPE, RDFS.DATATYPE); - - for (Statement st : iter) { - Resource xxx = st.getSubject(); - - boolean added = addInferredStatement(xxx, RDFS.SUBCLASSOF, RDFS.LITERAL); - if (added) { - nofInferred++; - } - } - - return nofInferred; - } - - // xxx rdf:_* yyy --> rdf:_* rdf:type rdfs:ContainerMembershipProperty - // This is an extra rule for list membership properties (_1, _2, _3, ...). - // The RDF MT does not specificy a production for this. - private int applyRuleX1() throws SailException { - int nofInferred = 0; - - String prefix = RDF.NAMESPACE + "_"; - Iterable iter = newThisIteration.getStatements(null, null, null); - - for (Statement st : iter) { - IRI predNode = st.getPredicate(); - String predURI = predNode.toString(); - - if (predURI.startsWith(prefix) && isValidPredicateNumber(predURI.substring(prefix.length()))) { - boolean added = addInferredStatement(predNode, RDF.TYPE, RDFS.CONTAINERMEMBERSHIPPROPERTY); - if (added) { - nofInferred++; - } - } - } - - return nofInferred; - } - - /** - * Util method for {@link #applyRuleX1}. - */ - private boolean isValidPredicateNumber(String str) { - int strLength = str.length(); - - if (strLength == 0) { - return false; - } - - for (int i = 0; i < strLength; i++) { - if (!ASCIIUtil.isNumber(str.charAt(i))) { - return false; - } - } - - // No leading zeros - if (str.charAt(0) == '0') { - return false; - } - - return true; - } -} diff --git a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/config/ForwardChainingRDFSInferencerConfig.java b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/config/ForwardChainingRDFSInferencerConfig.java deleted file mode 100644 index 57774d61933..00000000000 --- a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/config/ForwardChainingRDFSInferencerConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.inferencer.fc.config; - -import org.eclipse.rdf4j.sail.config.AbstractDelegatingSailImplConfig; -import org.eclipse.rdf4j.sail.config.SailImplConfig; - -/** - * @author Arjohn Kampman - */ -@Deprecated -public class ForwardChainingRDFSInferencerConfig extends AbstractDelegatingSailImplConfig { - - public ForwardChainingRDFSInferencerConfig() { - super(ForwardChainingRDFSInferencerFactory.SAIL_TYPE); - } - - public ForwardChainingRDFSInferencerConfig(SailImplConfig delegate) { - super(ForwardChainingRDFSInferencerFactory.SAIL_TYPE, delegate); - } -} diff --git a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/config/ForwardChainingRDFSInferencerFactory.java b/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/config/ForwardChainingRDFSInferencerFactory.java deleted file mode 100644 index c264b871e7a..00000000000 --- a/core/sail/inferencer/src/main/java/org/eclipse/rdf4j/sail/inferencer/fc/config/ForwardChainingRDFSInferencerFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.inferencer.fc.config; - -import org.eclipse.rdf4j.sail.Sail; -import org.eclipse.rdf4j.sail.config.SailConfigException; -import org.eclipse.rdf4j.sail.config.SailFactory; -import org.eclipse.rdf4j.sail.config.SailImplConfig; -import org.eclipse.rdf4j.sail.inferencer.fc.ForwardChainingRDFSInferencer; - -/** - * A {@link SailFactory} that creates {@link ForwardChainingRDFSInferencer}s based on RDF configuration data. - * - * @author Arjohn Kampman - */ -@Deprecated -public class ForwardChainingRDFSInferencerFactory implements SailFactory { - - /** - * The type of repositories that are created by this factory. - * - * @see SailFactory#getSailType() - */ - public static final String SAIL_TYPE = "openrdf:ForwardChainingRDFSInferencer"; - - /** - * Returns the Sail's type: openrdf:ForwardChainingRDFSInferencer. - */ - @Override - public String getSailType() { - return SAIL_TYPE; - } - - @Override - public SailImplConfig getConfig() { - return new ForwardChainingRDFSInferencerConfig(); - } - - @Override - public Sail getSail(SailImplConfig config) throws SailConfigException { - if (!SAIL_TYPE.equals(config.getType())) { - throw new SailConfigException("Invalid Sail type: " + config.getType()); - } - - return new ForwardChainingRDFSInferencer(); - } -} diff --git a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/RDFSchemaMemoryRepositoryConnectionTest.java b/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/RDFSchemaMemoryRepositoryConnectionTest.java deleted file mode 100644 index e0533bb67ee..00000000000 --- a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/RDFSchemaMemoryRepositoryConnectionTest.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.inferencer.fc; - -import java.io.File; - -import org.eclipse.rdf4j.repository.Repository; -import org.eclipse.rdf4j.repository.sail.SailRepository; -import org.eclipse.rdf4j.sail.memory.MemoryStore; -import org.eclipse.rdf4j.testsuite.repository.RDFSchemaRepositoryConnectionTest; - -public class RDFSchemaMemoryRepositoryConnectionTest extends RDFSchemaRepositoryConnectionTest { - - @Override - protected Repository createRepository(File dataDir) { - return new SailRepository(new ForwardChainingRDFSInferencer(new MemoryStore())); - } -} diff --git a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/RDFSchemaNativeRepositoryConnectionTest.java b/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/RDFSchemaNativeRepositoryConnectionTest.java deleted file mode 100644 index 25af8feb882..00000000000 --- a/core/sail/inferencer/src/test/java/org/eclipse/rdf4j/sail/inferencer/fc/RDFSchemaNativeRepositoryConnectionTest.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.sail.inferencer.fc; - -import java.io.File; - -import org.eclipse.rdf4j.repository.Repository; -import org.eclipse.rdf4j.repository.sail.SailRepository; -import org.eclipse.rdf4j.sail.nativerdf.NativeStore; -import org.eclipse.rdf4j.testsuite.repository.RDFSchemaRepositoryConnectionTest; - -public class RDFSchemaNativeRepositoryConnectionTest extends RDFSchemaRepositoryConnectionTest { - @Override - protected Repository createRepository(File dataDir) { - return new SailRepository(new ForwardChainingRDFSInferencer(new NativeStore(dataDir, "spoc"))); - } -} diff --git a/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbSailStore.java b/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbSailStore.java index a6dc372ff7f..7255e0faaa2 100644 --- a/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbSailStore.java +++ b/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbSailStore.java @@ -324,6 +324,11 @@ CloseableIteration getContexts() throws IOException { protected boolean accept(Statement st) { return st.getContext() != null; } + + @Override + protected void handleClose() { + + } }; return new ConvertingIteration<>(stIter2) { @@ -887,4 +892,4 @@ public CloseableIteration getStatements(Resource subj, IRI } } } -} \ No newline at end of file +} diff --git a/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbStatementIterator.java b/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbStatementIterator.java index dd49c90d5a6..53a40e5543b 100644 --- a/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbStatementIterator.java +++ b/core/sail/lmdb/src/main/java/org/eclipse/rdf4j/sail/lmdb/LmdbStatementIterator.java @@ -80,11 +80,7 @@ public Statement getNextElement() throws SailException { @Override protected void handleClose() throws SailException { - try { - super.handleClose(); - } finally { - recordIt.close(); - } + recordIt.close(); } protected SailException causeIOException(IOException e) { diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/MemorySailStore.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/MemorySailStore.java index abea50b07d6..327378f5bd9 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/MemorySailStore.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/MemorySailStore.java @@ -40,7 +40,9 @@ import org.eclipse.rdf4j.model.impl.LinkedHashModel; import org.eclipse.rdf4j.query.algebra.StatementPattern; import org.eclipse.rdf4j.query.algebra.Var; +import org.eclipse.rdf4j.query.algebra.evaluation.QueryEvaluationStep; import org.eclipse.rdf4j.query.algebra.evaluation.impl.EvaluationStatistics; +import org.eclipse.rdf4j.query.algebra.evaluation.impl.evaluationsteps.StatementPatternQueryEvaluationStep; import org.eclipse.rdf4j.sail.SailConflictException; import org.eclipse.rdf4j.sail.SailException; import org.eclipse.rdf4j.sail.base.BackingSailSource; @@ -87,7 +89,7 @@ class MemorySailStore implements SailStore { // we prioritise cleanup if there is less than 128 MB of free memory. private static final double CLEANUP_MINIMUM_FREE_MEMORY_RATIO = 1.0 / 8; - public static final EmptyIteration EMPTY_ITERATION = new EmptyIteration<>(); + public static final EmptyIteration EMPTY_ITERATION = (EmptyIteration) StatementPatternQueryEvaluationStep.EMPTY_ITERATION; public static final EmptyIteration EMPTY_TRIPLE_ITERATION = new EmptyIteration<>(); public static final MemResource[] EMPTY_CONTEXT = {}; public static final MemResource[] NULL_CONTEXT = { null }; diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemStatementIteratorCache.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemStatementIteratorCache.java index 52376e81726..3ac3ed33b4a 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemStatementIteratorCache.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemStatementIteratorCache.java @@ -121,7 +121,7 @@ public boolean hasNext() throws SailException { boolean result = iter.hasNext(); if (!result) { - close(); + iter = null; } return result; } diff --git a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemTripleIterator.java b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemTripleIterator.java index 76b3dbbaf08..a36a957a0c4 100644 --- a/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemTripleIterator.java +++ b/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/model/MemTripleIterator.java @@ -123,4 +123,9 @@ protected MemTriple getNextElement() { private boolean isInSnapshot(MemStatement st) { return snapshot < 0 || st.isInSnapshot(snapshot); } + + @Override + protected void handleClose() { + + } } diff --git a/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/benchmark/QueryBenchmark.java b/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/benchmark/QueryBenchmark.java index 82d90ab8eb8..39d0890ed12 100644 --- a/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/benchmark/QueryBenchmark.java +++ b/core/sail/memory/src/test/java/org/eclipse/rdf4j/sail/memory/benchmark/QueryBenchmark.java @@ -15,9 +15,12 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; import org.apache.commons.io.IOUtils; import org.eclipse.rdf4j.common.transaction.IsolationLevels; +import org.eclipse.rdf4j.query.BindingSet; +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; @@ -107,20 +110,97 @@ public static void main(String[] args) throws IOException { // // new Runner(opt).run(); + long k = 0; + QueryBenchmark queryBenchmark = new QueryBenchmark(); queryBenchmark.beforeClass(); for (int i = 0; i < 100; i++) { System.out.println(i); - queryBenchmark.pathExpressionQuery1(); - queryBenchmark.groupByQuery(); - queryBenchmark.different_datasets_with_similar_distributions(); - queryBenchmark.long_chain(); - queryBenchmark.simple_filter_not(); - queryBenchmark.complexQuery(); - queryBenchmark.lots_of_optional(); - queryBenchmark.nested_optionals(); + long result; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result = count(connection + .prepareTupleQuery(query1) + .evaluate()); + + } + k += result; + long result1; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result1 = count(connection + .prepareTupleQuery(query4) + .evaluate()); + + } + k += result1; + long result2; + + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result2 = count(connection + .prepareTupleQuery(query7_pathexpression1) + .evaluate()); + + } + k += result2; + long result3; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result3 = count(connection + .prepareTupleQuery(query8_pathexpression2) + .evaluate()); + + } + k += result3; + long result4; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result4 = count(connection + .prepareTupleQuery(different_datasets_with_similar_distributions) + .evaluate()); + + } + k += result4; + long result5; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result5 = count(connection + .prepareTupleQuery(long_chain) + .evaluate()); + + } + k += result5; + long result6; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result6 = count(connection + .prepareTupleQuery(lots_of_optional) + .evaluate()); + + } + k += result6; +// k += queryBenchmark.minus(); + long result7; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result7 = count(connection + .prepareTupleQuery(nested_optionals) + .evaluate()); + + } + k += result7; + long result8; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result8 = count(connection + .prepareTupleQuery(query_distinct_predicates) + .evaluate()); + + } + k += result8; + long result9; + try (SailRepositoryConnection connection = queryBenchmark.repository.getConnection()) { + result9 = count(connection + .prepareTupleQuery(simple_filter_not) + .evaluate()); + + } + k += result9; } queryBenchmark.afterClass(); + System.out.println(k); } @@ -145,22 +225,25 @@ public void afterClass() { @Benchmark public long groupByQuery() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(query1) - .evaluate() - .stream() - .count(); + .evaluate()); + } + } + + private static long count(TupleQueryResult evaluate) { + try (Stream stream = evaluate.stream()) { + return stream.count(); } } @Benchmark public long complexQuery() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(query4) .evaluate() - .stream() - .count(); + ); } } @@ -168,11 +251,9 @@ public long complexQuery() { public long pathExpressionQuery1() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(query7_pathexpression1) - .evaluate() - .stream() - .count(); + .evaluate()); } } @@ -180,11 +261,9 @@ public long pathExpressionQuery1() { @Benchmark public long pathExpressionQuery2() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(query8_pathexpression2) - .evaluate() - .stream() - .count(); + .evaluate()); } } @@ -202,55 +281,45 @@ public long pathExpressionQuery2() { @Benchmark public long different_datasets_with_similar_distributions() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(different_datasets_with_similar_distributions) - .evaluate() - .stream() - .count(); + .evaluate()); } } @Benchmark public long long_chain() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(long_chain) - .evaluate() - .stream() - .count(); + .evaluate()); } } @Benchmark public long lots_of_optional() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(lots_of_optional) - .evaluate() - .stream() - .count(); + .evaluate()); } } @Benchmark public long minus() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(minus) - .evaluate() - .stream() - .count(); + .evaluate()); } } @Benchmark public long nested_optionals() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(nested_optionals) - .evaluate() - .stream() - .count(); + .evaluate()); } } @@ -268,22 +337,18 @@ public long nested_optionals() { @Benchmark public long query_distinct_predicates() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(query_distinct_predicates) - .evaluate() - .stream() - .count(); + .evaluate()); } } @Benchmark public long simple_filter_not() { try (SailRepositoryConnection connection = repository.getConnection()) { - return connection + return count(connection .prepareTupleQuery(simple_filter_not) - .evaluate() - .stream() - .count(); + .evaluate()); } } @@ -301,4 +366,5 @@ public long simple_filter_not() { private static InputStream getResourceAsStream(String filename) { return QueryBenchmark.class.getClassLoader().getResourceAsStream(filename); } + } diff --git a/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/NativeSailStore.java b/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/NativeSailStore.java index 77b9fada2db..da790e890ac 100644 --- a/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/NativeSailStore.java +++ b/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/NativeSailStore.java @@ -190,15 +190,20 @@ CloseableIteration getContexts() throws IOException { stIter1 = new NativeStatementIterator(btreeIter, valueStore); } - FilterIteration stIter2 = new FilterIteration( + FilterIteration stIter2 = new FilterIteration<>( stIter1) { @Override protected boolean accept(Statement st) { return st.getContext() != null; } + + @Override + protected void handleClose() { + + } }; - return new ConvertingIteration(stIter2) { + return new ConvertingIteration<>(stIter2) { @Override protected Resource convert(Statement sourceObject) throws SailException { return sourceObject.getContext(); diff --git a/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/NativeStatementIterator.java b/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/NativeStatementIterator.java index f3f0e3eb204..6d8c84cfa9c 100644 --- a/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/NativeStatementIterator.java +++ b/core/sail/nativerdf/src/main/java/org/eclipse/rdf4j/sail/nativerdf/NativeStatementIterator.java @@ -84,13 +84,9 @@ public Statement getNextElement() throws SailException { @Override protected void handleClose() throws SailException { try { - super.handleClose(); - } finally { - try { - btreeIter.close(); - } catch (IOException e) { - throw causeIOException(e); - } + btreeIter.close(); + } catch (IOException e) { + throw causeIOException(e); } } diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/wrapper/data/VerySimpleRdfsBackwardsChainingConnection.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/wrapper/data/VerySimpleRdfsBackwardsChainingConnection.java index 3e08175edaa..2371154f092 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/wrapper/data/VerySimpleRdfsBackwardsChainingConnection.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/wrapper/data/VerySimpleRdfsBackwardsChainingConnection.java @@ -133,18 +133,9 @@ protected Statement getNextElement() throws SailException { return next; } - @Override - public void remove() throws SailException { - throw new IllegalStateException("Not implemented"); - } - @Override protected void handleClose() throws SailException { - try { - unionIteration.close(); - } finally { - super.handleClose(); - } + unionIteration.close(); } }; diff --git a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/ConstructTupleFunction.java b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/ConstructTupleFunction.java index cd0fdd25ca0..5ced39bb20e 100644 --- a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/ConstructTupleFunction.java +++ b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/ConstructTupleFunction.java @@ -129,11 +129,7 @@ public void remove() throws QueryEvaluationException { @Override public void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - queryResult.close(); - } + queryResult.close(); } } } diff --git a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/SelectTupleFunction.java b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/SelectTupleFunction.java index 1fa62734831..bd34737b995 100644 --- a/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/SelectTupleFunction.java +++ b/core/spin/src/main/java/org/eclipse/rdf4j/spin/function/SelectTupleFunction.java @@ -148,11 +148,7 @@ public void remove() throws QueryEvaluationException { @Override public void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - queryResult.close(); - } + queryResult.close(); } } } diff --git a/testsuites/benchmark/src/main/java/org/eclipse/rdf4j/benchmark/ForwardChainingRDFSInferencerBenchmark.java b/testsuites/benchmark/src/main/java/org/eclipse/rdf4j/benchmark/ForwardChainingRDFSInferencerBenchmark.java deleted file mode 100644 index 1f657705f68..00000000000 --- a/testsuites/benchmark/src/main/java/org/eclipse/rdf4j/benchmark/ForwardChainingRDFSInferencerBenchmark.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2016 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ - -package org.eclipse.rdf4j.benchmark; - -import org.eclipse.rdf4j.repository.sail.SailRepository; -import org.eclipse.rdf4j.sail.inferencer.fc.ForwardChainingRDFSInferencer; -import org.eclipse.rdf4j.sail.memory.MemoryStore; - -/** - * @author HÃ¥vard Mikkelsen Ottestad - */ -public class ForwardChainingRDFSInferencerBenchmark extends InitializationBenchmark { - - @Override - SailRepository getSail(SailRepository schema) { - return new SailRepository(new ForwardChainingRDFSInferencer(new MemoryStore())); - } - - @Override - Class getSailClass() { - return ForwardChainingRDFSInferencer.class; - } -} diff --git a/testsuites/model/src/main/java/org/eclipse/rdf4j/testsuite/model/AbstractModelTest.java b/testsuites/model/src/main/java/org/eclipse/rdf4j/testsuite/model/AbstractModelTest.java deleted file mode 100644 index 437c7e16515..00000000000 --- a/testsuites/model/src/main/java/org/eclipse/rdf4j/testsuite/model/AbstractModelTest.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.testsuite.model; - -/** - * @deprecated Use {@link ModelTest} instead. - */ -@Deprecated(since = "3.5.0") -public abstract class AbstractModelTest extends ModelTest { - -} diff --git a/testsuites/pom.xml b/testsuites/pom.xml index 746cc063cff..ceb1534de51 100644 --- a/testsuites/pom.xml +++ b/testsuites/pom.xml @@ -17,7 +17,6 @@ sparql repository sail - shacl lucene geosparql benchmark diff --git a/testsuites/shacl/pom.xml b/testsuites/shacl/pom.xml deleted file mode 100644 index 6152bf31b7b..00000000000 --- a/testsuites/shacl/pom.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - 4.0.0 - - org.eclipse.rdf4j - rdf4j-testsuites - 5.0.0-SNAPSHOT - - rdf4j-shacl-testsuite - RDF4J: SHACL compliance test suite - Test suite for the SHACL Shapes Constraint Language - - - ${project.groupId} - rdf4j-shacl - ${project.version} - - - - org.junit.vintage - junit-vintage-engine - compile - - - diff --git a/testsuites/shacl/src/main/java/org/eclipse/rdf4j/testsuite/shacl/manifest/AbstractSHACLTest.java b/testsuites/shacl/src/main/java/org/eclipse/rdf4j/testsuite/shacl/manifest/AbstractSHACLTest.java deleted file mode 100644 index 145b988385c..00000000000 --- a/testsuites/shacl/src/main/java/org/eclipse/rdf4j/testsuite/shacl/manifest/AbstractSHACLTest.java +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.testsuite.shacl.manifest; - -import org.eclipse.rdf4j.model.Model; -import org.eclipse.rdf4j.model.vocabulary.RDF4J; -import org.eclipse.rdf4j.repository.Repository; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.eclipse.rdf4j.repository.RepositoryException; -import org.eclipse.rdf4j.repository.sail.SailRepository; -import org.eclipse.rdf4j.sail.Sail; -import org.eclipse.rdf4j.sail.SailException; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import junit.framework.TestCase; - -/** - * A SHACL constraint test suite, created by reading in a W3C working-group style manifest. - * - * @deprecated This test suite is not maintained. Use {@see org.eclipse.rdf4j.sail.shacl.W3cComplianceTest} instead. We - * may un-deprecate this suite in the future. - * - * @author James Leigh - */ -@Deprecated -public abstract class AbstractSHACLTest extends TestCase { - - /*-----------* - * Constants * - *-----------*/ - - // Logger for non-static tests, so these results can be isolated based on - // where they are run - protected final Logger logger = LoggerFactory.getLogger(this.getClass()); - - protected final String testURI; - - protected final Model shapesGraph; - - protected final Model dataGraph; - - protected final boolean failure; - - protected final boolean conforms; - - /*-----------* - * Variables * - *-----------*/ - - protected Repository dataRep; - - /*--------------* - * Constructors * - *--------------*/ - - public AbstractSHACLTest(String testURI, String label, Model shapesGraph, Model dataGraph, boolean failure, - boolean conforms) { - super(label.replaceAll("\\(", " ").replaceAll("\\)", " ")); - - this.testURI = testURI; - this.shapesGraph = shapesGraph; - this.dataGraph = dataGraph; - this.failure = failure; - this.conforms = conforms; - } - - /*---------* - * Methods * - *---------*/ - - @Override - public void setUp() { - dataRep = createRepository(shapesGraph); - } - - protected Repository createRepository(Model shapesGraph) { - Repository repo = new SailRepository(newSail()); - try (RepositoryConnection conn = repo.getConnection()) { - conn.clear(); - conn.clearNamespaces(); - conn.add(shapesGraph, RDF4J.SHACL_SHAPE_GRAPH); - } - return repo; - } - - /** - * Creates a new un-initialized Sail stack - * - * @return a new un-initialized Sail stack - */ - protected abstract Sail newSail(); - - @Override - public void tearDown() { - if (dataRep != null) { - dataRep.shutDown(); - dataRep = null; - } - } - - @Override - public void runTest() { - try { - upload(dataRep, dataGraph); - assertTrue(conforms); - } catch (RepositoryException exc) { - if (conforms || !(exc.getCause() instanceof SailException)) { - throw exc; - } - } - } - - protected void upload(Repository rep, Model dataGraph) { - RepositoryConnection con = rep.getConnection(); - - try { - con.begin(); - con.add(dataGraph); - con.commit(); - } catch (Exception e) { - if (con.isActive()) { - con.rollback(); - } - throw e; - } finally { - con.close(); - } - } -} diff --git a/testsuites/shacl/src/main/java/org/eclipse/rdf4j/testsuite/shacl/manifest/SHACLManifestTestSuiteFactory.java b/testsuites/shacl/src/main/java/org/eclipse/rdf4j/testsuite/shacl/manifest/SHACLManifestTestSuiteFactory.java deleted file mode 100644 index 815143cc5ec..00000000000 --- a/testsuites/shacl/src/main/java/org/eclipse/rdf4j/testsuite/shacl/manifest/SHACLManifestTestSuiteFactory.java +++ /dev/null @@ -1,320 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.testsuite.shacl.manifest; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.JarURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.jar.JarFile; - -import org.eclipse.rdf4j.common.io.FileUtil; -import org.eclipse.rdf4j.common.io.ZipUtil; -import org.eclipse.rdf4j.common.net.ParsedIRI; -import org.eclipse.rdf4j.model.IRI; -import org.eclipse.rdf4j.model.Literal; -import org.eclipse.rdf4j.model.Model; -import org.eclipse.rdf4j.model.Resource; -import org.eclipse.rdf4j.model.Value; -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.util.Models; -import org.eclipse.rdf4j.model.vocabulary.RDF; -import org.eclipse.rdf4j.model.vocabulary.RDFS; -import org.eclipse.rdf4j.query.MalformedQueryException; -import org.eclipse.rdf4j.query.QueryEvaluationException; -import org.eclipse.rdf4j.repository.RepositoryException; -import org.eclipse.rdf4j.rio.RDFParseException; -import org.eclipse.rdf4j.rio.RDFParser; -import org.eclipse.rdf4j.rio.helpers.ContextStatementCollector; -import org.eclipse.rdf4j.rio.turtle.TurtleParser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import junit.framework.Test; -import junit.framework.TestResult; -import junit.framework.TestSuite; - -/** - * Functionality for creating a JUnit test suite out of a W3C Working Group-style manifest for SHACL shape constraints - * testsuite - * - * @author James Leigh - */ -public class SHACLManifestTestSuiteFactory { - - private static final String MF_INCLUDE = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#include"; - private static final String MF_ENTRIES = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#entries"; - private static final String MF_ACTION = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#action"; - private static final String MF_RESULT = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#result"; - private static final String MF_STATUS = "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#status"; - private static final String SHT_SHAPESGRAPH = "http://www.w3.org/ns/shacl-test#shapesGraph"; - private static final String SHT_DATAGRAPH = "http://www.w3.org/ns/shacl-test#dataGraph"; - private static final String SHT_PROPOSED = "http://www.w3.org/ns/shacl-test#proposed"; - private static final String SHT_APPROVED = "http://www.w3.org/ns/shacl-test#approved"; - private static final String SHT_FAILURE = "http://www.w3.org/ns/shacl-test#Failure"; - private static final String SH_CONFORMS = "http://www.w3.org/ns/shacl#conforms"; - - private final Logger logger = LoggerFactory.getLogger(SHACLManifestTestSuiteFactory.class); - - private File tmpDir; - - public interface TestFactory { - String getName(); - - Test createSHACLTest(String testURI, String label, Model shapesGraph, Model dataGraph, boolean failure, - boolean conforms); - } - - /** - * Creates a new {@link TestSuite} for executiong of {@link AbstractSHACLTest} s. - * - * @param factory a factory class that creates each individual test case. - * @param officialWorkingGroupTests indicates whether to use the official W3C working group tests, or RDF4J's own - * set of tests. - * @param approvedTestsOnly if true, use working group-approved tests only. Has no influence - * when officialWorkingGroup tests is set to false. - * @param useRemoteTests if set to true, use manifests and tests located at - * http://www.w3.org/2009/sparql/docs/tests/data-sparql11/ , instead - * of local copies. - * @param excludedSubdirs an (optionally empty) list of subdirectories to exclude from testing. If - * specified, test cases in one of the supplied subdirs will not be executed. If - * left empty, all tests will be executed. - * @return a TestSuite. - * @throws Exception - */ - public TestSuite createTestSuite(TestFactory factory, boolean officialWorkingGroupTests, boolean approvedTestsOnly, - boolean useRemoteTests, String... excludedSubdirs) throws Exception { - final String manifest = getManifestFile(officialWorkingGroupTests, useRemoteTests); - - TestSuite suite = new TestSuite(factory.getName()) { - - @Override - public void run(TestResult result) { - try { - super.run(result); - } finally { - if (tmpDir != null) { - try { - FileUtil.deleteDir(tmpDir); - } catch (IOException e) { - System.err.println( - "Unable to clean up temporary directory '" + tmpDir + "': " + e.getMessage()); - } - } - } - } - }; - - Map tests = new LinkedHashMap<>(); - ValueFactory vf = SimpleValueFactory.getInstance(); - Model manifests = new LinkedHashModel(); - readTurtle(manifests, new URL(manifest), manifest, excludedSubdirs); - for (Value included : manifests.filter(null, vf.createIRI(MF_INCLUDE), null).objects()) { - String subManifestFile = included.stringValue(); - boolean hasEntries = manifests.contains((IRI) included, vf.createIRI(MF_ENTRIES), null); - if (hasEntries && includeSubManifest(subManifestFile, excludedSubdirs)) { - TestSuite suiteEntry = createSuiteEntry(subManifestFile, factory, approvedTestsOnly); - if (tests.containsKey(suiteEntry.getName())) { - for (int i = 0, n = suiteEntry.testCount(); i < n; i++) { - tests.get(suiteEntry.getName()).addTest(suiteEntry.testAt(i)); - } - } else { - tests.put(suiteEntry.getName(), suiteEntry); - } - } - } - for (TestSuite testSuiets : tests.values()) { - suite.addTest(testSuiets); - } - - logger.info("Created aggregated test suite with " + suite.countTestCases() + " test cases."); - return suite; - } - - private String getManifestFile(boolean officialWorkingGroupTests, boolean useRemote) { - if (useRemote) { - return "https://raw.githubusercontent.com/w3c/data-shapes/gh-pages/data-shapes-test-suite/tests/manifest.ttl"; - } - URL url = SHACLManifestTestSuiteFactory.class.getResource("/data-shapes-test-suite/tests/manifest.ttl"); - if ("jar".equals(url.getProtocol())) { - // Extract manifest files to a temporary directory - try { - tmpDir = Files.createTempDirectory("data-shapes-test-evaluation").toFile(); - - JarURLConnection con = (JarURLConnection) url.openConnection(); - JarFile jar = con.getJarFile(); - - ZipUtil.extract(jar, tmpDir); - - File localFile = new File(tmpDir, con.getEntryName()); - return localFile.toURI().toURL().toString(); - } catch (IOException e) { - throw new AssertionError(e); - } - } else { - return url.toString(); - } - } - - private IRI readTurtle(Model manifests, URL url, String baseURI, String... excludedSubdirs) - throws IOException, RDFParseException { - if (baseURI == null) { - baseURI = url.toExternalForm(); - } - ParsedIRI baseIRI = ParsedIRI.create(baseURI); - SimpleValueFactory vf = SimpleValueFactory.getInstance(); - IRI manifest = vf.createIRI(baseIRI.toString()); - int before = manifests.size(); - - try (InputStream in = url.openStream()) { - RDFParser rdfParser = new TurtleParser(); - - ContextStatementCollector collection = new ContextStatementCollector(manifests, vf, manifest); - rdfParser.setRDFHandler(collection); - - rdfParser.parse(in, baseIRI.toString()); - for (Map.Entry e : collection.getNamespaces().entrySet()) { - manifests.setNamespace(e.getKey(), e.getValue()); - } - } - if (before < manifests.size()) { - for (Value included : new LinkedHashSet<>( - manifests.filter(manifest, vf.createIRI(MF_INCLUDE), null).objects())) { - String subManifestFile = included.stringValue(); - if (includeSubManifest(subManifestFile, excludedSubdirs)) { - readTurtle(manifests, new URL(subManifestFile), subManifestFile, excludedSubdirs); - } - } - } - return manifest; - } - - /** - * Verifies if the selected subManifest occurs in the supplied list of excluded subdirs. - * - * @param subManifestFile the url of a sub-manifest - * @param excludedSubdirs an array of directory names. May be null. - * @return false if the supplied list of excluded subdirs is not empty and contains a match for the - * supplied sub-manifest, true otherwise. - */ - private boolean includeSubManifest(String subManifestFile, String[] excludedSubdirs) { - boolean result = true; - - if (excludedSubdirs != null && excludedSubdirs.length > 0) { - int index = subManifestFile.lastIndexOf('/'); - String path = subManifestFile.substring(0, index); - String sd = path.substring(path.lastIndexOf('/') + 1); - - for (String subdir : excludedSubdirs) { - if (sd.equals(subdir)) { - result = false; - break; - } - } - } - return result; - } - - private TestSuite createSuiteEntry(String manifestFileURL, TestFactory factory, boolean approvedOnly) - throws Exception { - logger.info("Building test suite for {}", manifestFileURL); - - // Read manifest and create declared test cases - Model model = new LinkedHashModel(); - - IRI manifest = readTurtle(model, new URL(manifestFileURL), manifestFileURL); - - TestSuite suite = new TestSuite(getManifestName(model, manifest)); - - // Extract test case information from the manifest file. Note that we only - // select those test cases that are mentioned in the list. - Resource rdfList = getResource(model, manifest, MF_ENTRIES); - for (Resource entry : getListEntries(model, rdfList)) { - String label = getLiteral(model, entry, RDFS.LABEL.stringValue()).stringValue(); - Resource action = getResource(model, entry, MF_ACTION); - Resource result = getResource(model, entry, MF_RESULT); - Resource status = getResource(model, entry, MF_STATUS); - Model shapesGraph = readTurtle(getResource(model, action, SHT_SHAPESGRAPH).stringValue()); - Model dataGraph = readTurtle(getResource(model, action, SHT_DATAGRAPH).stringValue()); - boolean failure = result.stringValue().equals(SHT_FAILURE); - boolean conforms = !failure && getLiteral(model, result, SH_CONFORMS).booleanValue(); - - logger.debug("found test case : {}", label); - - if (status.stringValue().equals(SHT_APPROVED) - || !approvedOnly && status.stringValue().equals(SHT_PROPOSED)) { - Test test = factory.createSHACLTest(entry.stringValue(), label, shapesGraph, dataGraph, failure, - conforms); - if (test != null) { - suite.addTest(test); - } - } - } - - logger.info("Created test suite with " + suite.countTestCases() + " test cases."); - return suite; - } - - private String getManifestName(Model model, IRI manifest) - throws QueryEvaluationException, RepositoryException, MalformedQueryException { - // Try to extract suite name from manifest file - String label = Models.objectString(model.getStatements(manifest, RDFS.LABEL, null)).orElse(null); - if (label != null) { - return label; - } - - // Derive name from manifest URL - String manifestFileURL = manifest.stringValue(); - int lastSlashIdx = manifestFileURL.lastIndexOf('/'); - int secLastSlashIdx = manifestFileURL.lastIndexOf('/', lastSlashIdx - 1); - return manifestFileURL.substring(secLastSlashIdx + 1, lastSlashIdx); - } - - private List getListEntries(Model model, Resource rdfList) { - if (rdfList == null || rdfList.equals(RDF.NIL)) { - return new ArrayList<>(); - } - Resource first = Models.objectResource(model.getStatements(rdfList, RDF.FIRST, null)).orElse(null); - Resource rest = Models.objectResource(model.getStatements(rdfList, RDF.REST, null)).orElse(null); - List list = getListEntries(model, rest); - list.add(0, first); - return list; - } - - private Resource getResource(Model model, Resource subject, String pred) { - ValueFactory vf = SimpleValueFactory.getInstance(); - Optional optional = Models.objectResource(model.getStatements(subject, vf.createIRI(pred), null)); - return optional.orElseThrow(Models.modelException("Missing " + subject + " " + pred)); - } - - private Literal getLiteral(Model model, Resource subject, String pred) { - ValueFactory vf = SimpleValueFactory.getInstance(); - Optional optional = Models.objectLiteral(model.getStatements(subject, vf.createIRI(pred), null)); - return optional.orElseThrow(Models.modelException("Missing " + subject + " " + pred)); - } - - private Model readTurtle(String url) throws RDFParseException, MalformedURLException, IOException { - Model model = new LinkedHashModel(); - readTurtle(model, new URL(url), url); - return model; - } -} diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/manifest.ttl deleted file mode 100644 index 6e921e5658f..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/manifest.ttl +++ /dev/null @@ -1,10 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/complex" ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/personexample.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/personexample.ttl deleted file mode 100644 index 0bd6ba4ca8c..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/personexample.ttl +++ /dev/null @@ -1,103 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Alice - rdf:type ex:Person ; - ex:ssn "987-65-432A" ; -. -ex:Bob - rdf:type ex:Person ; - ex:ssn "123-45-6789" ; - ex:ssn "124-35-6789" ; -. -ex:Calvin - rdf:type ex:Person ; - ex:birthDate "1999-09-09"^^xsd:date ; - ex:worksFor ex:UntypedCompany ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - sh:closed "true"^^xsd:boolean ; - sh:ignoredProperties ( - rdf:type - ) ; - sh:property [ - sh:path ex:ssn ; - sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" ; - ] ; - sh:property [ - sh:path ex:worksFor ; - sh:class ex:Company ; - sh:nodeKind sh:IRI ; - ] ; - sh:property [ - sh:path [ - sh:inversePath ex:worksFor ; - ] ; - sh:name "employee" ; - ] ; - sh:targetClass ex:Person ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of personexample" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Alice ; - sh:resultPath ex:ssn ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape _:b61064 ; - sh:value "987-65-432A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Bob ; - sh:resultPath ex:ssn ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape _:b61064 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Calvin ; - sh:resultPath ex:birthDate ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:sourceShape ex:PersonShape ; - sh:value "1999-09-09"^^xsd:date ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Calvin ; - sh:resultPath ex:worksFor ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape [] ; - sh:value ex:UntypedCompany ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/shacl-shacl-data-shapes.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/shacl-shacl-data-shapes.ttl deleted file mode 100644 index c6b751a771b..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/shacl-shacl-data-shapes.ttl +++ /dev/null @@ -1,410 +0,0 @@ -# baseURI: http://www.w3.org/ns/shacl-shacl# - -# A SHACL shapes graph to validate SHACL shapes graphs -# Draft last edited 2017-04-04 - -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - -@prefix shsh: . - -shsh: - rdfs:label "SHACL for SHACL"@en ; - rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the syntax rules."@en ; - sh:declare [ - sh:prefix "shsh" ; - sh:namespace "http://www.w3.org/ns/shacl-shacl#" ; - ] . - - -shsh:ListShape - a sh:NodeShape ; - rdfs:label "List shape"@en ; - rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath rdf:rest ] ; - rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ; - sh:hasValue rdf:nil ; - sh:node shsh:ListNodeShape ; - ] . - -shsh:ListNodeShape - a sh:NodeShape ; - rdfs:label "List node shape"@en ; - rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ; - sh:or ( [ - sh:hasValue rdf:nil ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 0 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 0 ; - ] ; - ] - [ - sh:not [ sh:hasValue rdf:nil ] ; - sh:property [ - sh:path rdf:first ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path rdf:rest ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - ] ) . - -shsh:ShapeShape - a sh:NodeShape ; - rdfs:label "Shape shape"@en ; - rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ; - - # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape - sh:targetClass sh:NodeShape ; - sh:targetClass sh:PropertyShape ; - sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ; - sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue, - sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive, - sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind, - sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape, - sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:sparql, sh:uniqueLang, sh:xone ; - - sh:targetObjectsOf sh:node ; # node-node - sh:targetObjectsOf sh:not ; # not-node - sh:targetObjectsOf sh:property ; # property-node - sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node - - # Shapes are either node shapes or property shapes - sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ; - - sh:property [ - sh:path sh:targetNode ; - sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind - ] ; - sh:property [ - sh:path sh:targetClass ; - sh:nodeKind sh:IRI ; # targetClass-nodeKind - ] ; - sh:property [ - sh:path sh:targetSubjectsOf ; - sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind - ] ; - sh:property [ - sh:path sh:targetObjectsOf ; - sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind - ] ; - sh:or ( [ sh:not [ - sh:class rdfs:Class ; - sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] ) - ] ] - [ sh:nodeKind sh:IRI ] - ) ; # implicit-targetClass-nodeKind - - sh:property [ - sh:path sh:severity ; - sh:maxCount 1 ; # severity-maxCount - sh:nodeKind sh:IRI ; # severity-nodeKind - ] ; - sh:property [ - sh:path sh:message ; - sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype - ] ; - sh:property [ - sh:path sh:deactivated ; - sh:maxCount 1 ; # deactivated-maxCount - sh:in ( true false ) ; # deactivated-datatype - ] ; - - sh:property [ - sh:path sh:and ; - sh:node shsh:ListShape ; # and-node - ] ; - sh:property [ - sh:path sh:class ; - sh:nodeKind sh:IRI ; # class-nodeKind - ] ; - sh:property [ - sh:path sh:closed ; - sh:datatype xsd:boolean ; # closed-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:ignoredProperties ; - sh:node shsh:ListShape ; # ignoredProperties-node - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind - ] ; - sh:property [ - sh:path sh:datatype ; - sh:nodeKind sh:IRI ; # datatype-nodeKind - sh:maxCount 1 ; # datatype-maxCount - ] ; - sh:property [ - sh:path sh:disjoint ; - sh:nodeKind sh:IRI ; # disjoint-nodeKind - ] ; - sh:property [ - sh:path sh:equals ; - sh:nodeKind sh:IRI ; # equals-nodeKind - ] ; - sh:property [ - sh:path sh:in ; - sh:maxCount 1 ; # in-maxCount - sh:node shsh:ListShape ; # in-node - ] ; - sh:property [ - sh:path sh:languageIn ; - sh:maxCount 1 ; # languageIn-maxCount - sh:node shsh:ListShape ; # languageIn-node - ] ; - sh:property [ - sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:datatype xsd:string ; # languageIn-members-datatype - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:nodeKind sh:IRI ; # lessThan-nodeKind - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:datatype xsd:integer ; # maxCount-datatype - sh:maxCount 1 ; # maxCount-maxCount - ] ; - sh:property [ - sh:path sh:maxExclusive ; - sh:maxCount 1 ; # maxExclusive-maxCount - sh:nodeKind sh:Literal ; # maxExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxInclusive ; - sh:maxCount 1 ; # maxInclusive-maxCount - sh:nodeKind sh:Literal ; # maxInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:maxLength ; - sh:datatype xsd:integer ; # maxLength-datatype - sh:maxCount 1 ; # maxLength-maxCount - ] ; - sh:property [ - sh:path sh:minCount ; - sh:datatype xsd:integer ; # minCount-datatype - sh:maxCount 1 ; # minCount-maxCount - ] ; - sh:property [ - sh:path sh:minExclusive ; - sh:maxCount 1 ; # minExclusive-maxCount - sh:nodeKind sh:Literal ; # minExclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minInclusive ; - sh:maxCount 1 ; # minInclusive-maxCount - sh:nodeKind sh:Literal ; # minInclusive-nodeKind - ] ; - sh:property [ - sh:path sh:minLength ; - sh:datatype xsd:integer ; # minLength-datatype - sh:maxCount 1 ; # minLength-maxCount - ] ; - sh:property [ - sh:path sh:nodeKind ; - sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in - sh:maxCount 1 ; # nodeKind-maxCount - ] ; - sh:property [ - sh:path sh:or ; - sh:node shsh:ListShape ; # or-node - ] ; - sh:property [ - sh:path sh:pattern ; - sh:datatype xsd:string ; # pattern-datatype - sh:maxCount 1 ; # multiple-parameters - # Not implemented: syntax rule pattern-regex - ] ; - sh:property [ - sh:path sh:flags ; - sh:datatype xsd:string ; # flags-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMaxCount ; - sh:datatype xsd:integer ; # qualifiedMaxCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedMinCount ; - sh:datatype xsd:integer ; # qualifiedMinCount-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:qualifiedValueShapesDisjoint ; - sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype - sh:maxCount 1 ; # multiple-parameters - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:datatype xsd:boolean ; # uniqueLang-datatype - sh:maxCount 1 ; # uniqueLang-maxCount - ] ; - sh:property [ - sh:path sh:xone ; - sh:node shsh:ListShape ; # xone-node - ] . - -shsh:NodeShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:node ; # node-node - sh:property [ - sh:path sh:path ; - sh:maxCount 0 ; # NodeShape-path-maxCount - ] ; - sh:property [ - sh:path sh:lessThan ; - sh:maxCount 0 ; # lessThan-scope - ] ; - sh:property [ - sh:path sh:lessThanOrEquals ; - sh:maxCount 0 ; # lessThanOrEquals-scope - ] ; - sh:property [ - sh:path sh:maxCount ; - sh:maxCount 0 ; # maxCount-scope - ] ; - sh:property [ - sh:path sh:minCount ; - sh:maxCount 0 ; # minCount-scope - ] ; - sh:property [ - sh:path sh:qualifiedValueShape ; - sh:maxCount 0 ; # qualifiedValueShape-scope - ] ; - sh:property [ - sh:path sh:uniqueLang ; - sh:maxCount 0 ; # uniqueLang-scope - ] . - -shsh:PropertyShapeShape - a sh:NodeShape ; - sh:targetObjectsOf sh:property ; # property-node - sh:property [ - sh:path sh:path ; - sh:maxCount 1 ; # path-maxCount - sh:minCount 1 ; # PropertyShape-path-minCount - sh:node shsh:PathShape ; # path-node - ] . - -# Values of sh:and, sh:or and sh:xone must be lists of shapes -shsh:ShapesListShape - a sh:NodeShape ; - sh:targetObjectsOf sh:and ; # and-members-node - sh:targetObjectsOf sh:or ; # or-members-node - sh:targetObjectsOf sh:xone ; # xone-members-node - sh:property [ - sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ; - sh:node shsh:ShapeShape ; - ] . - - -# A path of blank node path syntax, used to simulate recursion -_:PathPath - sh:alternativePath ( - ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first ) - sh:inversePath - sh:zeroOrMorePath - sh:oneOrMorePath - sh:zeroOrOnePath - ) . - -shsh:PathShape - a sh:NodeShape ; - rdfs:label "Path shape"@en ; - rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ; - rdfs:seeAlso ; - sh:property [ - sh:path [ sh:zeroOrMorePath _:PathPath ] ; - sh:node shsh:PathNodeShape ; - ] . - -shsh:PathNodeShape - sh:xone ( # path-metarule - [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path - [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path - sh:node shsh:PathListWithAtLeast2Members ; - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path - sh:closed true ; - sh:property [ - sh:path sh:alternativePath ; - sh:node shsh:PathListWithAtLeast2Members ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path - sh:closed true ; - sh:property [ - sh:path sh:inversePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path - sh:closed true ; - sh:property [ - sh:path sh:oneOrMorePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path - sh:closed true ; - sh:property [ - sh:path sh:zeroOrOnePath ; - sh:minCount 1 ; - sh:maxCount 1 ; - ] - ] - ) . - -shsh:PathListWithAtLeast2Members - a sh:NodeShape ; - sh:node shsh:ListShape ; - sh:property [ - sh:path [ sh:oneOrMorePath rdf:rest ] ; - sh:minCount 2 ; # 1 other list node plus rdf:nil - ] . - -shsh:ShapesGraphShape - a sh:NodeShape ; - sh:targetObjectsOf sh:shapesGraph ; - sh:nodeKind sh:IRI . # shapesGraph-nodeKind - -shsh:EntailmentShape - a sh:NodeShape ; - sh:targetObjectsOf sh:entailment ; - sh:nodeKind sh:IRI . # entailment-nodeKind diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/shacl-shacl.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/shacl-shacl.ttl deleted file mode 100644 index 889071471a8..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/complex/shacl-shacl.ttl +++ /dev/null @@ -1,19 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix xsd: . -@prefix sh: . -@prefix sht: . - -<> a mf:Manifest ; - mf:entries ( - - ) . - - a sht:Validate ; - rdfs:label "frozen eat your own ( eat your own frozen dogfood )" ; - mf:action [ - sht:dataGraph ; - sht:shapesGraph ] ; - mf:result [a sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ] ; - mf:status sht:approved . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/manifest.ttl deleted file mode 100644 index ffd61b64024..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/manifest.ttl +++ /dev/null @@ -1,14 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/deactivated-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/deactivated-001.ttl deleted file mode 100644 index 809acde926a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/deactivated-001.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource - rdf:type rdfs:Resource ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:boolean ; - sh:deactivated "true"^^xsd:boolean ; - sh:property ex:TestShape2 ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape2 - rdf:type sh:PropertyShape ; - sh:path ex:property ; - sh:minCount 1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:deactivated 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/deactivated-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/deactivated-002.ttl deleted file mode 100644 index 0498150f2ab..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/deactivated-002.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:boolean ; - sh:deactivated "false"^^xsd:boolean ; - sh:targetNode 32 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:deactivated 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 32 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 32 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/manifest.ttl deleted file mode 100644 index fffc439ce72..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/manifest.ttl +++ /dev/null @@ -1,13 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/misc" ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/message-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/message-001.ttl deleted file mode 100644 index 2d3fb135dd2..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/message-001.ttl +++ /dev/null @@ -1,48 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:integer ; - sh:message "Test message"@en ; - sh:targetNode ex:InvalidNode ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of custom sh:message 001" ; - rdfs:comment """ - Note: This test verifies that the sh:message is copied into sh:resultMessage. - To pass this test, the test harness needs to preserve all sh:resultMessage triples - that are mentioned in the 'expected' results graph.""" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidNode ; - sh:resultMessage "Test message"@en ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidNode ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/severity-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/severity-001.ttl deleted file mode 100644 index 5b3e6b8c9c9..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/severity-001.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:integer ; - sh:severity sh:Warning ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:severity 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Warning ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/severity-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/severity-002.ttl deleted file mode 100644 index 87b2aed772e..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/misc/severity-002.ttl +++ /dev/null @@ -1,60 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property "true"^^xsd:boolean ; -. -ex:TestShape1 - sh:nodeKind sh:BlankNode ; - sh:property ex:TestShape2 ; - sh:severity ex:MySeverity ; - sh:targetNode ex:InvalidResource1 ; -. -ex:TestShape2 - sh:path ex:property ; - sh:datatype xsd:integer ; - sh:severity sh:Info ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:severity 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Info ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape2 ; - sh:value "true"^^xsd:boolean ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity ex:MySeverity ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape ex:TestShape1 ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/and-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/and-001.ttl deleted file mode 100644 index 2a6fb9f04e9..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/and-001.ttl +++ /dev/null @@ -1,77 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidRectangle1 - rdf:type ex:Rectangle ; - ex:height 3 ; -. -ex:InvalidRectangle2 - rdf:type ex:Rectangle ; - ex:width 2 ; -. -ex:Rectangle - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:subClassOf rdfs:Resource ; - sh:and ( - [ - sh:property [ - sh:path ex:width ; - sh:minCount 1 ; - ] ; - ] - [ - sh:property [ - sh:path ex:height ; - sh:minCount 1 ; - ] ; - ] - ) ; -. -ex:ValidRectangle1 - rdf:type ex:Rectangle ; - ex:height 3 ; - ex:width 2 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:and at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidRectangle1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:Rectangle ; - sh:value ex:InvalidRectangle1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidRectangle2 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:Rectangle ; - sh:value ex:InvalidRectangle2 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/and-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/and-002.ttl deleted file mode 100644 index e8303cfd9d9..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/and-002.ttl +++ /dev/null @@ -1,74 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:AndShape - rdf:type sh:NodeShape ; - sh:and ( - ex:SuperShape - [ - sh:property [ - sh:path ex:property ; - sh:maxCount 1 ; - ] ; - ] - ) ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:InvalidInstance2 ; - sh:targetNode ex:ValidInstance1 ; -. -ex:InvalidInstance2 - ex:property "One" ; - ex:property "Two" ; -. -ex:SuperShape - rdf:type sh:NodeShape ; - sh:property [ - sh:path ex:property ; - sh:minCount 1 ; - ] ; -. -ex:ValidInstance1 - ex:property "One" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:and at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AndShape ; - sh:value ex:InvalidInstance1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AndShape ; - sh:value ex:InvalidInstance2 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-001.ttl deleted file mode 100644 index e37ce70129a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-001.ttl +++ /dev/null @@ -1,70 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:John - rdf:type ex:MalePerson ; -. -ex:MalePerson - rdf:type rdfs:Class ; - rdfs:subClassOf ex:Person ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:subClassOf rdfs:Resource ; -. -ex:Quokki - rdf:type ex:Animal ; -. -ex:Someone - rdf:type ex:Person ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:class ex:Person ; - sh:targetNode ex:John ; - sh:targetNode ex:Quokki ; - sh:targetNode ex:Someone ; - sh:targetNode ex:Typeless ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:class at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Quokki ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Quokki ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Typeless ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Typeless ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-002.ttl deleted file mode 100644 index 71ed5e0d546..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-002.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:NamedInstance - rdf:type ex:TestClass ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:class ex:TestClass ; - sh:targetClass ex:BNodeClass ; - sh:targetNode ex:NamedInstance ; - sh:targetNode "String" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:class at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "String" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "String" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b9751 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b9751 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b9751 - rdf:type ex:BNodeClass ; -. -[ - rdf:type ex:BNodeClass ; - rdf:type ex:TestClass ; -]. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-003.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-003.ttl deleted file mode 100644 index 2806b445852..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/class-003.ttl +++ /dev/null @@ -1,105 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:John # not Animal - rdf:type ex:MalePerson ; -. -ex:Joe # OK - rdf:type ex:MalePerson ; - rdf:type ex:Animal ; -. -ex:MalePerson - rdf:type rdfs:Class ; - rdfs:subClassOf ex:Person ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:subClassOf rdfs:Resource ; -. -ex:Quokki # not Person - rdf:type ex:Animal ; -. -ex:Quokkip # not Animal - rdf:type ex:Person ; -. -ex:Someone # OK - rdf:type ex:Person ; - rdf:type ex:Animal ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:class ex:Person ; - sh:class ex:Animal ; - sh:targetClass ex:MalePerson ; - sh:targetNode ex:John ; - sh:targetNode ex:Quokki ; - sh:targetNode ex:Quokkip ; - sh:targetNode ex:Someone ; - sh:targetNode ex:Typeless ; # not Animal, not Person -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:class at node shape 003 multiple classes, overlapping target sets" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Typeless ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Typeless ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Typeless ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Typeless ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Quokki ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Quokki ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Quokkip ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Quokkip ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/closed-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/closed-001.ttl deleted file mode 100644 index 2e7a40e2722..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/closed-001.ttl +++ /dev/null @@ -1,64 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:SomeClass ; - ex:otherProperty 4 ; - ex:someProperty 3 ; -. -ex:MyShape - rdf:type sh:NodeShape ; - sh:closed "true"^^xsd:boolean ; - sh:property [ - sh:path ex:someProperty ; - ] ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:ValidInstance1 ; -. -ex:ValidInstance1 - ex:someProperty 3 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:closed at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath rdf:type ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:sourceShape ex:MyShape ; - sh:value ex:SomeClass ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:otherProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:sourceShape ex:MyShape ; - sh:value 4 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/closed-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/closed-002.ttl deleted file mode 100644 index 7b931afc46d..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/closed-002.ttl +++ /dev/null @@ -1,58 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:otherProperty 4 ; - ex:someProperty 3 ; -. -ex:MyShape - rdf:type sh:NodeShape ; - sh:closed "true"^^xsd:boolean ; - sh:ignoredProperties ( - rdf:type - ) ; - sh:property [ - sh:path ex:someProperty ; - ] ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:ValidInstance1 ; -. -ex:ValidInstance1 - rdf:type ex:SomeClass ; - ex:someProperty 3 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:closed at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:otherProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:sourceShape ex:MyShape ; - sh:value 4 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/datatype-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/datatype-001.ttl deleted file mode 100644 index a6ac937f4d0..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/datatype-001.ttl +++ /dev/null @@ -1,64 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:integer ; - sh:targetClass ex:TestClass ; - sh:targetNode xsd:integer ; - sh:targetNode 42 ; - sh:targetNode "aldi"^^xsd:integer ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode xsd:integer ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value xsd:integer ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "aldi"^^xsd:integer ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "aldi"^^xsd:integer ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b30507 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b30507 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b30507 - rdf:type ex:TestClass ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/datatype-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/datatype-002.ttl deleted file mode 100644 index 6e9e0121fc1..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/datatype-002.ttl +++ /dev/null @@ -1,53 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype rdf:langString ; - sh:targetNode "Hello"^^rdf:HTML ; - sh:targetNode "G'day"@en-AU ; - sh:targetNode "Hallo"@de ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello"^^rdf:HTML ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello"^^rdf:HTML ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/disjoint-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/disjoint-001.ttl deleted file mode 100644 index eddadd79a43..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/disjoint-001.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property ex:InvalidResource1 ; - ex:property ex:ValidResource1 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:disjoint ex:property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - ex:property ex:InvalidResource1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:disjoint at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DisjointConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/equals-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/equals-001.ttl deleted file mode 100644 index 21ed522f003..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/equals-001.ttl +++ /dev/null @@ -1,59 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property ex:InvalidResource1 ; - ex:property ex:SomeValue ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:equals ex:property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - ex:property ex:ValidResource1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:equals at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:SomeValue ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource2 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/hasValue-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/hasValue-001.ttl deleted file mode 100644 index 0c401fcff8d..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/hasValue-001.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:hasValue "Test" ; - sh:targetNode "Invalid String" ; - sh:targetNode "Test" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:hasValue at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Invalid String" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:HasValueConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Invalid String" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/in-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/in-001.ttl deleted file mode 100644 index d79083c19e8..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/in-001.ttl +++ /dev/null @@ -1,63 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Green - rdf:type ex:TestShape ; - rdfs:label "Green" ; -. -ex:InvalidInstance - rdf:type ex:TestShape ; - rdfs:label "Invalid instance" ; -. -ex:Red - rdf:type ex:TestShape ; - rdfs:label "Red" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:in ( - ex:Green - ex:Red - ex:Yellow - ) ; -. -ex:Yellow - rdf:type ex:TestShape ; - rdfs:label "Yellow" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:in at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:InConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidInstance ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/languageIn-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/languageIn-001.ttl deleted file mode 100644 index 49f70bccd4c..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/languageIn-001.ttl +++ /dev/null @@ -1,66 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:languageIn ( - "en" - "fr" - ) ; - sh:targetNode rdfs:Resource ; - sh:targetNode "Deutsch"@de ; - sh:targetNode "English"@en ; - sh:targetNode "Francais"@fr ; - sh:targetNode "Plain String" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:languageIn at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode rdfs:Resource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value rdfs:Resource ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Deutsch"@de ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Deutsch"@de ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Plain String" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Plain String" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/manifest.ttl deleted file mode 100644 index 50fd3167777..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/manifest.ttl +++ /dev/null @@ -1,40 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/node" ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxExclusive-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxExclusive-001.ttl deleted file mode 100644 index c001c0995a7..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxExclusive-001.ttl +++ /dev/null @@ -1,91 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxExclusive 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxExclusive at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4.0 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4.0 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4.1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4.1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b11982 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b11982 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b11982 - rdf:type ex:TestClass ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxInclusive-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxInclusive-001.ttl deleted file mode 100644 index a1bea30445a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxInclusive-001.ttl +++ /dev/null @@ -1,75 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxInclusive 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxInclusive at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4.1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4.1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b22005 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b22005 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b22005 - rdf:type ex:TestClass ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxLength-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxLength-001.ttl deleted file mode 100644 index 8eeebb5370d..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/maxLength-001.ttl +++ /dev/null @@ -1,87 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxLength 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ; - sh:targetNode ex:John ; - sh:targetNode 123 ; - sh:targetNode 1234 ; - sh:targetNode 12345 ; - sh:targetNode "2017-03-29"^^xsd:date ; - sh:targetNode "Hel" ; - sh:targetNode "Hell" ; - sh:targetNode "Hell"@en ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxLength at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 12345 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 12345 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2017-03-29"^^xsd:date ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "2017-03-29"^^xsd:date ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b34236 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b34236 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b34236 - rdf:type ex:TestClass ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minExclusive-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minExclusive-001.ttl deleted file mode 100644 index 511629de902..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minExclusive-001.ttl +++ /dev/null @@ -1,91 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:minExclusive 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minExclusive at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:John ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:John ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 3.9 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 3.9 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 4.0 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 4.0 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hello" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hello" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b33079 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b33079 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b33079 - rdf:type ex:TestClass ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-001.ttl deleted file mode 100644 index 4b6cb4ac31e..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-001.ttl +++ /dev/null @@ -1,44 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:minInclusive 8 ; - sh:targetNode 7 ; - sh:targetNode 8 ; - sh:targetNode 9 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minInclusive at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 7 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 7 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-002.ttl deleted file mode 100644 index 15b5feab955..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-002.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape a sh:NodeShape ; - sh:minInclusive "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:targetNode ex:TestShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minInclusive at node shape 002 - dateTime with timezone" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:value "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:TestShape ; - sh:value ex:TestShape ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-003.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-003.ttl deleted file mode 100644 index 99c56f63d24..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minInclusive-003.ttl +++ /dev/null @@ -1,70 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:minInclusive "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:targetNode "2002-10-10T12:00:00"^^xsd:dateTime ; - sh:targetNode ex:TestShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minInclusive at node shape 003 - dateTime without timezone" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "2002-10-10T12:00:00-05:00"^^xsd:dateTime ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "2002-10-10T12:00:01-05:00"^^xsd:dateTime ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "2002-10-09T12:00:00-05:00"^^xsd:dateTime ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:TestShape ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minLength-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minLength-001.ttl deleted file mode 100644 index 2dd5e4018ed..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/minLength-001.ttl +++ /dev/null @@ -1,79 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:minLength 4 ; - sh:targetClass ex:TestClass ; - sh:targetNode ; - sh:targetNode ex:John ; - sh:targetNode 123 ; - sh:targetNode 1234 ; - sh:targetNode 12345 ; - sh:targetNode "2017-03-29"^^xsd:date ; - sh:targetNode "Hel" ; - sh:targetNode "Hell" ; - sh:targetNode "Hell"@en ; - sh:targetNode "Hello" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minLength at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 123 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 123 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hel" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hel" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b19019 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b19019 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b19019 - rdf:type ex:TestClass ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/node-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/node-001.ttl deleted file mode 100644 index 692d85eea70..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/node-001.ttl +++ /dev/null @@ -1,55 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance - rdf:type ex:TestClass ; - rdfs:label "Invalid instance" ; -. -ex:TestClass - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test class" ; - rdfs:subClassOf rdfs:Resource ; - sh:node [ - sh:class ex:OtherClass ; - ] ; -. -ex:ValidInstance - rdf:type ex:OtherClass ; - rdf:type ex:TestClass ; - rdfs:label "Valid instance" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:node at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeConstraintComponent ; - sh:sourceShape ex:TestClass ; - sh:value ex:InvalidInstance ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/nodeKind-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/nodeKind-001.ttl deleted file mode 100644 index 4ec603e6c77..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/nodeKind-001.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:IRITestShape - rdf:type sh:NodeShape ; - sh:nodeKind sh:IRI ; - sh:targetNode ex:John ; - sh:targetNode "true"^^xsd:boolean ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:nodeKind at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "true"^^xsd:boolean ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape ex:IRITestShape ; - sh:value "true"^^xsd:boolean ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/not-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/not-001.ttl deleted file mode 100644 index 4bb81376234..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/not-001.ttl +++ /dev/null @@ -1,59 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:property "some value" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - rdfs:subClassOf rdfs:Resource ; - sh:not [ - rdf:type sh:NodeShape ; - sh:property [ - sh:path ex:property ; - sh:minCount 1 ; - ] ; - ] ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:not at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NotConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/not-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/not-002.ttl deleted file mode 100644 index 1303738e978..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/not-002.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:property "Some value" ; -. -ex:NotExampleShape - rdf:type sh:NodeShape ; - sh:not [ - rdf:type sh:NodeShape ; - sh:property [ - sh:path ex:property ; - sh:minCount 1 ; - ] ; - ] ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:ValidInstance1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:not at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NotConstraintComponent ; - sh:sourceShape ex:NotExampleShape ; - sh:value ex:InvalidInstance1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/or-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/or-001.ttl deleted file mode 100644 index ca5a9ab68cd..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/or-001.ttl +++ /dev/null @@ -1,91 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidRectangle1 - rdf:type ex:RectangleWithArea ; - ex:height 3 ; -. -ex:InvalidRectangle2 - rdf:type ex:RectangleWithArea ; -. -ex:RectangleWithArea - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:subClassOf rdfs:Resource ; - sh:or ( - [ - sh:property [ - sh:path ex:height ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path ex:width ; - sh:minCount 1 ; - ] ; - ] - [ - sh:property [ - sh:path ex:area ; - sh:minCount 1 ; - ] ; - ] - ) ; -. -ex:ValidRectangle1 - rdf:type ex:RectangleWithArea ; - ex:height 3 ; - ex:width 2 ; -. -ex:ValidRectangle2 - rdf:type ex:RectangleWithArea ; - ex:area 6 ; - ex:height 3 ; - ex:width 2 ; -. -ex:ValidRectangle3 - rdf:type ex:RectangleWithArea ; - ex:area 6 ; - ex:height 3 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:or at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidRectangle1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:RectangleWithArea ; - sh:value ex:InvalidRectangle1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidRectangle2 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:RectangleWithArea ; - sh:value ex:InvalidRectangle2 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/pattern-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/pattern-001.ttl deleted file mode 100644 index 5a0cab2eced..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/pattern-001.ttl +++ /dev/null @@ -1,76 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:pattern "^[2-8][0-9]*$" ; - sh:targetClass ex:TestClass ; - sh:targetNode ex:Test ; - sh:targetNode 20000123 ; - sh:targetNode "3456" ; - sh:targetNode 39 ; - sh:targetNode "777777"@mi ; - sh:targetNode 9 ; - sh:targetNode "John" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:pattern at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Test ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:Test ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode 9 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value 9 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "John" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "John" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode _:b22415 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b22415 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b22415 - rdf:type ex:TestClass ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/pattern-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/pattern-002.ttl deleted file mode 100644 index a0c9c147643..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/pattern-002.ttl +++ /dev/null @@ -1,45 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:flags "i" ; - sh:pattern "Aldi" ; - sh:targetNode "Aldi" ; - sh:targetNode "Alti" ; - sh:targetNode "aLdI" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:pattern at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Alti" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Alti" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001-data.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001-data.ttl deleted file mode 100644 index e495305daab..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001-data.ttl +++ /dev/null @@ -1,4 +0,0 @@ -@prefix ex: . - -ex:i a ex:C1 . -ex:j a ex:C1 , ex:C2 . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001-shapes.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001-shapes.ttl deleted file mode 100644 index f430a7e0204..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001-shapes.ttl +++ /dev/null @@ -1,10 +0,0 @@ -@prefix xsd: . -@prefix sh: . -@prefix ex: . - -ex:s1 a sh:NodeShape ; - sh:targetClass ex:C1 ; - sh:class ex:C2 ; - sh:qualifiedValueShapesDisjoint "1"^^xsd:boolean ; - sh:qualifiedMinCount 5 ; - sh:qualifiedMaxCount 2 . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001.ttl deleted file mode 100644 index 6a89c0999d2..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/qualified-001.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -@prefix ex: . - -<> a mf:Manifest ; - mf:entries ( - - ) . - - a sht:Validate; - rdfs:label "Test of qualified parameters allowed in node shapes" ; - mf:action [ sht:dataGraph ; - sht:shapesGraph ] ; - mf:result [ rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ rdf:type sh:ValidationResult ; - sh:resultSeverity sh:Violation ; - sh:focusNode ex:i ; - sh:value ex:i ; - sh:sourceShape ex:s1 ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ] ] ; - mf:status sht:approved . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-001.ttl deleted file mode 100644 index 6ae110d857c..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-001.ttl +++ /dev/null @@ -1,74 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Bob - rdf:type ex:Person ; - ex:firstName "Robert" ; - ex:lastName "Coin" ; -. -ex:Carla - rdf:type ex:Person ; - ex:fullName "Carla Miller" ; -. -ex:Dory - rdf:type ex:Person ; - ex:firstName "Dory" ; - ex:fullName "Dory Dunce" ; - ex:lastName "Dunce" ; -. -ex:XoneConstraintExampleShape - rdf:type sh:NodeShape ; - sh:targetClass ex:Person ; - sh:xone ( - [ - sh:property [ - sh:path ex:fullName ; - sh:minCount 1 ; - ] ; - ] - [ - sh:property [ - sh:path ex:firstName ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path ex:lastName ; - sh:minCount 1 ; - ] ; - ] - ) ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:xone at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Dory ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:XoneConstraintComponent ; - sh:sourceShape ex:XoneConstraintExampleShape ; - sh:value ex:Dory ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate-data.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate-data.ttl deleted file mode 100644 index e495305daab..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate-data.ttl +++ /dev/null @@ -1,4 +0,0 @@ -@prefix ex: . - -ex:i a ex:C1 . -ex:j a ex:C1 , ex:C2 . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate-shapes.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate-shapes.ttl deleted file mode 100644 index eecb657d656..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate-shapes.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix sh: . -@prefix ex: . - -ex:s1 a sh:NodeShape ; - sh:targetClass ex:C1 ; - sh:xone ( ex:s2 ex:s2 ) . -ex:s2 sh:class ex:C2 . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate.ttl deleted file mode 100644 index 0999905f103..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/node/xone-duplicate.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -@prefix ex: . - -<> a mf:Manifest ; - mf:entries ( - - ) . - - a sht:Validate; - rdfs:label "Test of validation report for shape xone-duplicate by property constraints" ; - mf:action [ sht:dataGraph ; - sht:shapesGraph ] ; - mf:result [ rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ rdf:type sh:ValidationResult ; - sh:resultSeverity sh:Violation ; - sh:focusNode ex:i ; - sh:value ex:i ; - sh:sourceShape ex:s1 ; - sh:sourceConstraintComponent sh:XoneConstraintComponent ] ; - sh:result [ rdf:type sh:ValidationResult ; - sh:resultSeverity sh:Violation ; - sh:focusNode ex:j ; - sh:value ex:j ; - sh:sourceShape ex:s1 ; - sh:sourceConstraintComponent sh:XoneConstraintComponent ] ] ; - mf:status sht:approved . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/manifest.ttl deleted file mode 100644 index 3c355e87ed8..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/manifest.ttl +++ /dev/null @@ -1,21 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/path" ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-alternative-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-alternative-001.ttl deleted file mode 100644 index ea2676478e0..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-alternative-001.ttl +++ /dev/null @@ -1,86 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 "One" ; - ex:property3 "Three" ; -. -ex:TestShape - rdf:type sh:PropertyShape ; - sh:path [ - sh:alternativePath ( - ex:property1 - ex:property2 - ) ; - ] ; - sh:minCount 2 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; - sh:targetNode ex:ValidResource3 ; -. -ex:ValidResource1 - ex:property1 "One" ; - ex:property1 "Two" ; -. -ex:ValidResource2 - ex:property1 "One" ; - ex:property2 "Two" ; -. -ex:ValidResource3 - ex:property2 "One" ; - ex:property2 "Two" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sh:alternativePath 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath [ - sh:alternativePath ( - ex:property1 - ex:property2 - ) ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath [ - sh:alternativePath ( - ex:property1 - ex:property2 - ) ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-001.ttl deleted file mode 100644 index c5e20737bc0..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-001.ttl +++ /dev/null @@ -1,91 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource - rdf:type ex:Animal ; - rdfs:label "Invalid" ; -. -ex:MalePerson - rdf:type rdfs:Class ; - rdfs:subClassOf ex:Person ; -. -ex:Person - rdf:type rdfs:Class ; -. -ex:TestShape - rdf:type sh:PropertyShape ; - sh:path ( - rdf:type - [ - sh:zeroOrMorePath rdfs:subClassOf ; - ] - ) ; - sh:hasValue ex:Person ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; - sh:targetNode ex:ValidResource3 ; -. -ex:ValidResource1 - rdf:type ex:Person ; -. -ex:ValidResource2 - rdf:type ex:MalePerson ; -. -ex:ValidResource3 - rdf:type ex:Animal ; - rdf:type ex:MalePerson ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path complex (rdf:type/rdfs:subClassOf*) 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ( - rdf:type - [ - sh:zeroOrMorePath rdfs:subClassOf ; - ] - ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:HasValueConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ( - rdf:type - [ - sh:zeroOrMorePath rdfs:subClassOf ; - ] - ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:HasValueConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002-data.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002-data.ttl deleted file mode 100644 index fdec8c78e14..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002-data.ttl +++ /dev/null @@ -1,7 +0,0 @@ -@prefix ex: . - -ex:j ex:p ex:i . - -ex:k ex:p ex:j . - -ex:l ex:p ex:j . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002-shapes.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002-shapes.ttl deleted file mode 100644 index f9e8a73bd99..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002-shapes.ttl +++ /dev/null @@ -1,14 +0,0 @@ -@prefix sh: . -@prefix ex: . - -ex:s1 a sh:PropertyShape ; - sh:targetNode ex:i ; - sh:path ( _:pinv _:pinv ) ; - sh:class ex:C . - -_:pinv sh:inversePath ex:p . - -ex:s2 a sh:PropertyShape ; - sh:targetNode ex:i ; - sh:path ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; - sh:class ex:C . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002.ttl deleted file mode 100644 index fdfcfe5c0e4..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-complex-002.ttl +++ /dev/null @@ -1,51 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -<> a mf:Manifest ; - mf:entries ( - - ) . - - a sht:Validate ; - rdfs:label "Test of complex path validation results" ; - mf:action [ - sht:dataGraph ; - sht:shapesGraph ] ; - mf:result [ a sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ex:i ; - sh:value ex:k ; - sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:s1 ] ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ex:i ; - sh:value ex:l ; - sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:s1 ] ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ex:i ; - sh:value ex:l ; - sh:resultPath ( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:s2 ] ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ex:i ; - sh:value ex:k ; - sh:resultPath( [ sh:inversePath ex:p ] [ sh:inversePath ex:p ] ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:s2 ] ] ; - mf:status sht:approved . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-inverse-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-inverse-001.ttl deleted file mode 100644 index f19b8707f82..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-inverse-001.ttl +++ /dev/null @@ -1,90 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type ex:Person ; -. -ex:InvalidResource2 - rdf:type ex:Person ; -. -ex:Parent1 - ex:child ex:InvalidResource1 ; - ex:child ex:InvalidResource2 ; - ex:child ex:ValidResource1 ; -. -ex:Parent2 - ex:child ex:InvalidResource2 ; - ex:child ex:ValidResource1 ; -. -ex:Parent3 - ex:child ex:InvalidResource2 ; -. -ex:Person - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-P ; - sh:targetClass ex:Person ; -. -ex:TestShape-P - rdf:type sh:PropertyShape ; - sh:path [ - sh:inversePath ex:child ; - ] ; - sh:maxCount 2 ; - sh:minCount 2 ; -. -ex:ValidResource1 - rdf:type ex:Person ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sh:inversePath 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath [ - sh:inversePath ex:child ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape-P ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath [ - sh:inversePath ex:child ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-P ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-oneOrMore-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-oneOrMore-001.ttl deleted file mode 100644 index 97d4e030147..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-oneOrMore-001.ttl +++ /dev/null @@ -1,71 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; -. -ex:InvalidResource2 - ex:child ex:Person2 ; -. -ex:Person1 - ex:child ex:Person2 ; -. -ex:TestShape - rdf:type sh:PropertyShape ; - sh:path [ - sh:oneOrMorePath ex:child ; - ] ; - sh:minCount 2 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - ex:child ex:Person1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sh:oneOrMorePath 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath [ - sh:oneOrMorePath ex:child ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath [ - sh:oneOrMorePath ex:child ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-001.ttl deleted file mode 100644 index 65ec5292201..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-001.ttl +++ /dev/null @@ -1,80 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 ex:Node3 ; - ex:property2 ex:Node4 ; -. -ex:Node1 - ex:property2 "One" ; -. -ex:Node2 - ex:property2 "Two" ; -. -ex:TestShape - rdf:type sh:PropertyShape ; - sh:path ( - ex:property1 - ex:property2 - ) ; - sh:minCount 1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:ValidResource1 - ex:property1 ex:Node1 ; -. -ex:ValidResource2 - ex:property1 ex:Node1 ; - ex:property1 ex:Node2 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sequence 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ( - ex:property1 - ex:property2 - ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ( - ex:property1 - ex:property2 - ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-002.ttl deleted file mode 100644 index 4ae6698bdce..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-002.ttl +++ /dev/null @@ -1,83 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 ex:Node3 ; - ex:property2 ex:Node4 ; -. -ex:Node1 - ex:property2 ex:Node2 ; -. -ex:Node2 - ex:property3 "Value" ; -. -ex:TestShape - rdf:type sh:PropertyShape ; - sh:path ( - ex:property1 - ex:property2 - ex:property3 - ) ; - sh:minCount 1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:ValidResource1 - ex:property1 ex:Node1 ; -. -ex:ValidResource2 - ex:property1 ex:Node1 ; - ex:property1 ex:Node2 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sequence 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ( - ex:property1 - ex:property2 - ex:property3 - ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ( - ex:property1 - ex:property2 - ex:property3 - ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-duplicate-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-duplicate-001.ttl deleted file mode 100644 index 81264c57cf5..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-sequence-duplicate-001.ttl +++ /dev/null @@ -1,63 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:A - ex:p1 [ - ex:p2 "value" ; - ] ; - ex:p1 [ - ex:p2 "value" ; - ] ; -. -ex:S - rdf:type sh:NodeShape ; - sh:property ex:SP ; - sh:targetNode ex:A ; -. -ex:SP - rdf:type sh:PropertyShape ; - sh:path ( - ex:p1 - ex:p2 - ) ; - sh:maxCount 1 ; - sh:nodeKind sh:IRI ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sequence with duplicate 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:A ; - sh:resultPath ( - ex:p1 - ex:p2 - ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape ex:SP ; - sh:value "value" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-strange-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-strange-001.ttl deleted file mode 100644 index 2409cb407b3..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-strange-001.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix ex: . -@prefix mf: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:i a ex:C ; - ex:p ex:ip . -ex:ip ex:q ex:ipq . -ex:ipq a ex:C . -ex:pi ex:p ex:i . - -ex:j a ex:C ; - ex:p ex:jp . -ex:jp ex:q ex:jpq . - -ex:s1 a sh:PropertyShape ; - sh:targetClass ex:C ; - sh:path [ rdf:first ex:p ; rdf:rest [ rdf:first ex:q ; rdf:rest rdf:nil ] ; - sh:inversePath ex:p ] ; - sh:class ex:C . - -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - - rdf:type sht:Validate ; - rdfs:label "Test of strange path 001 two valid paths together" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ex:j ; - sh:value ex:jpq ; - sh:resultPath ( ex:p ex:q ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:s1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-strange-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-strange-002.ttl deleted file mode 100644 index 4290f9f1a71..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-strange-002.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix ex: . -@prefix mf: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:i a ex:C ; - ex:p ex:ip . -ex:ip ex:q ex:ipq . -ex:ipq a ex:C . -ex:pi ex:p ex:i . - -ex:j a ex:C ; - ex:p ex:jp . -ex:jp ex:q ex:jpq . - -ex:s1 a sh:PropertyShape ; - sh:targetClass ex:C ; - sh:path [ rdf:first ex:p ; rdf:rest [ rdf:first ex:q ; rdf:rest rdf:nil ] ; - sh:inversePath ( ex:p ) ] ; - sh:class ex:C . - -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - - rdf:type sht:Validate ; - rdfs:label "Test of strange path 002 valid and invalid paths together" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ex:j ; - sh:value ex:jpq ; - sh:resultPath ( ex:p ex:q ) ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:s1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001-data.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001-data.ttl deleted file mode 100644 index ea38c1bbdec..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001-data.ttl +++ /dev/null @@ -1,5 +0,0 @@ -@prefix ex: . - -ex:i a ex:C . - -ex:j a ex:D . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001-shapes.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001-shapes.ttl deleted file mode 100644 index 06838876f3a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001-shapes.ttl +++ /dev/null @@ -1,18 +0,0 @@ -@prefix sh: . -@prefix ex: . -@prefix rdf: . -@prefix rdfs: . - -ex:s1 a sh:NodeShape ; - sh:targetNode ex:j, ex:i ; - sh:class ex:C . - -_:p1 sh:inversePath _:p2 . - -_:p2 sh:zeroOrMorePath ( _:p2 ) . - -_:p2 sh:zeroOrOnePath [ rdf:rest rdf:nil ] . - -_:p3 sh:alternativePath ( ex:p ) ; - rdfs:comment "invalid path" . - diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001.ttl deleted file mode 100644 index 4ae2909139e..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-unused-001.ttl +++ /dev/null @@ -1,29 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -<> a mf:Manifest ; - mf:entries ( - - ) . - - a sht:Validate ; - rdfs:label "Test with unused ill-formed path" ; - mf:action [ - sht:dataGraph ; - sht:shapesGraph ] ; - mf:result [ a sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ a sh:ValidationResult ; - sh:focusNode ex:j ; - sh:value ex:j ; - sh:resultSeverity sh:Violation ; - sh:sourceShape ex:s1 ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ] ] ; - mf:status sht:approved . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-zeroOrMore-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-zeroOrMore-001.ttl deleted file mode 100644 index 834ab9f13de..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-zeroOrMore-001.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; -. -ex:Person2 - ex:child ex:Person3 ; -. -ex:TestShape - rdf:type sh:PropertyShape ; - sh:path [ - sh:zeroOrMorePath ex:child ; - ] ; - sh:minCount 2 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:ValidResource1 - ex:child ex:Person1 ; -. -ex:ValidResource2 - ex:child ex:Person2 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sh:zeroOrMorePath 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath [ - sh:zeroOrMorePath ex:child ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-zeroOrOne-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-zeroOrOne-001.ttl deleted file mode 100644 index 2e4e34f51ae..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/path/path-zeroOrOne-001.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; -. -ex:Person2 - ex:child ex:Person3 ; -. -ex:TestShape - rdf:type sh:PropertyShape ; - sh:path [ - sh:zeroOrOnePath ex:child ; - ] ; - sh:minCount 2 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:ValidResource1 - ex:child ex:Person1 ; -. -ex:ValidResource2 - ex:child ex:Person2 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of path sh:zeroOrOnePath 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath [ - sh:zeroOrOnePath ex:child ; - ] ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:TestShape ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/and-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/and-001.ttl deleted file mode 100644 index c011bdf483e..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/and-001.ttl +++ /dev/null @@ -1,107 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:AddressShape - rdf:type sh:NodeShape ; - rdfs:label "Address shape" ; - sh:property ex:AddressShape-address ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:InvalidResource3 ; - sh:targetNode ex:ValidResource1 ; -. -ex:AddressShape-address - sh:path ex:address ; - sh:and ( - [ - sh:property [ - sh:path ex:suburb ; - sh:minCount 1 ; - ] ; - ] - [ - sh:property [ - sh:path ex:postalCode ; - sh:minCount 1 ; - ] ; - ] - ) ; -. -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:address _:b61065 ; -. -ex:InvalidResource2 - rdf:type rdfs:Resource ; - ex:address _:b31477 ; -. -ex:InvalidResource3 - rdf:type rdfs:Resource ; - ex:address _:b94057 ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - ex:address [ - ex:postalCode 4879 ; - ex:suburb ex:KewarraBeach ; - ] ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:and at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AddressShape-address ; - sh:value _:b61065 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AddressShape-address ; - sh:value _:b31477 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource3 ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:AndConstraintComponent ; - sh:sourceShape ex:AddressShape-address ; - sh:value _:b94057 ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b31477 - ex:suburb ex:KewarraBeach ; -. -_:b61065 - ex:postalCode 4879 ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/class-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/class-001.ttl deleted file mode 100644 index b1a2d66a154..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/class-001.ttl +++ /dev/null @@ -1,91 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:testProperty ex:InvalidResource1 ; - ex:testProperty "A string" ; -. -ex:SubClass - rdf:type rdfs:Class ; - rdfs:subClassOf ex:SuperClass ; -. -ex:SubClassInstance - rdf:type ex:SubClass ; -. -ex:SuperClass - rdf:type rdfs:Class ; -. -ex:SuperClassInstance - rdf:type ex:SuperClass ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-testProperty ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - rdfs:label "test property" ; - sh:class ex:SuperClass ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - ex:testProperty ex:SubClassInstance ; - ex:testProperty ex:SuperClassInstance ; -. -ex:ValidResource2 - rdf:type rdfs:Resource ; - ex:testProperty [ - rdf:type ex:SubClass ; - ] ; - ex:testProperty [ - rdf:type ex:SuperClass ; - ] ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:class at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value ex:InvalidResource1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value "A string" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-001.ttl deleted file mode 100644 index 9d9e8293ac9..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-001.ttl +++ /dev/null @@ -1,76 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type ex:TestShape ; - ex:dateProperty "2011-01-01"^^xsd:dateTime ; - ex:integerProperty 11.1 ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-dateProperty ; - sh:property ex:TestShape-integerProperty ; -. -ex:TestShape-dateProperty - sh:path ex:dateProperty ; - rdfs:label "date property" ; - sh:datatype xsd:date ; -. -ex:TestShape-integerProperty - sh:path ex:integerProperty ; - rdfs:label "integer property" ; - sh:datatype xsd:integer ; -. -ex:ValidResource - rdf:type ex:TestShape ; - ex:dateProperty "2014-09-01"^^xsd:date ; - ex:integerProperty 0 ; - ex:integerProperty 1234 ; - rdfs:label "Valid resource" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:dateProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape-dateProperty ; - sh:value "2011-01-01"^^xsd:dateTime ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:integerProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape-integerProperty ; - sh:value 11.1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-002.ttl deleted file mode 100644 index 8e9b8eb73aa..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-002.ttl +++ /dev/null @@ -1,71 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:value "A"@en ; -. -ex:InvalidInstance2 - ex:value 42 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-value ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:InvalidInstance2 ; - sh:targetNode ex:ValidInstance1 ; - sh:targetNode ex:ValidInstance2 ; -. -ex:TestShape-value - sh:path ex:value ; - sh:datatype xsd:string ; -. -ex:ValidInstance1 - ex:value "A" ; -. -ex:ValidInstance2 - ex:value "A" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:value ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape-value ; - sh:value "A"@en ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:value ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape-value ; - sh:value 42 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-003.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-003.ttl deleted file mode 100644 index ddac579d4a0..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-003.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:value 42 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-value ; - sh:targetNode ex:InvalidInstance1 ; - sh:targetNode ex:ValidInstance1 ; - sh:targetNode ex:ValidInstance2 ; - sh:targetNode ex:ValidInstance3 ; -. -ex:TestShape-value - sh:path ex:value ; - sh:or ( - [ - sh:datatype xsd:string ; - ] - [ - sh:datatype rdf:langString ; - ] - ) ; -. -ex:ValidInstance1 - ex:value "A" ; -. -ex:ValidInstance2 - ex:value "A" ; -. -ex:ValidInstance3 - ex:value "A"@en ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:datatype at property shape 003" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:value ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:TestShape-value ; - sh:value 42 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed-data.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed-data.ttl deleted file mode 100644 index e5338afa8b6..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed-data.ttl +++ /dev/null @@ -1,6 +0,0 @@ -@prefix xsd: . -@prefix ex: . - -ex:i ex:p "300"^^xsd:byte . -ex:i ex:p "55"^^xsd:integer . -ex:i ex:p "c"^^xsd:byte . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed-shapes.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed-shapes.ttl deleted file mode 100644 index 20366326465..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed-shapes.ttl +++ /dev/null @@ -1,8 +0,0 @@ -@prefix sh: . -@prefix xsd: . -@prefix ex: . - -ex:s a sh:PropertyShape ; - sh:targetNode ex:i ; - sh:path ex:p ; - sh:datatype xsd:byte . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed.ttl deleted file mode 100644 index 08611e49896..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/datatype-ill-formed.ttl +++ /dev/null @@ -1,43 +0,0 @@ -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -@prefix ex: . - -<> rdf:type mf:Manifest ; - mf:entries ( - - ) . - - rdf:type sht:Validate; - rdfs:label "Test of validation report for ill-formed literals" ; - mf:action [ sht:dataGraph ; - sht:shapesGraph ] ; - mf:result [ rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ rdf:type sh:ValidationResult ; - sh:resultSeverity sh:Violation ; - sh:focusNode ex:i ; - sh:value "300"^^xsd:byte ; - sh:resultPath ex:p ; - sh:sourceShape ex:s ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ; - sh:result [ rdf:type sh:ValidationResult ; - sh:resultSeverity sh:Violation ; - sh:focusNode ex:i ; - sh:value "c"^^xsd:byte ; - sh:resultPath ex:p ; - sh:sourceShape ex:s ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ; - sh:result [ rdf:type sh:ValidationResult ; - sh:resultSeverity sh:Violation ; - sh:focusNode ex:i ; - sh:value "55"^^xsd:integer ; - sh:resultPath ex:p ; - sh:sourceShape ex:s ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ] ] ; - mf:status sht:approved . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/disjoint-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/disjoint-001.ttl deleted file mode 100644 index 6aa4ce7a34d..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/disjoint-001.ttl +++ /dev/null @@ -1,84 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 "A" ; - ex:property2 "A" ; -. -ex:InvalidResource2 - ex:property1 "A" ; - ex:property1 "B" ; - ex:property2 "A" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property1 - sh:path ex:property1 ; - sh:disjoint ex:property2 ; -. -ex:ValidResource1 - ex:property1 "A" ; - ex:property2 "B" ; -. -ex:ValidResource2 - ex:property1 "A" ; - ex:property1 "B" ; - ex:property2 "C" ; - ex:property2 "D" ; -. -ex:property1 - rdf:type rdf:Property ; -. -ex:property2 - rdf:type rdf:Property ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:disjoint at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DisjointConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DisjointConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/equals-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/equals-001.ttl deleted file mode 100644 index 625ec369c1f..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/equals-001.ttl +++ /dev/null @@ -1,119 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 "A" ; - ex:property2 "B" ; -. -ex:InvalidResource2 - ex:property1 "A" ; -. -ex:InvalidResource3 - ex:property2 "A" ; -. -ex:InvalidResource4 - ex:property1 "A" ; - ex:property1 "B" ; - ex:property2 "A" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:InvalidResource3 ; - sh:targetNode ex:InvalidResource4 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property1 - sh:path ex:property1 ; - sh:equals ex:property2 ; -. -ex:ValidResource1 - ex:property1 "A" ; - ex:property2 "A" ; -. -ex:ValidResource2 - ex:property1 "A" ; - ex:property1 "B" ; - ex:property2 "A" ; - ex:property2 "B" ; -. -ex:property1 - rdf:type rdf:Property ; -. -ex:property2 - rdf:type rdf:Property ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:equals at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "B" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource3 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "A" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource4 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:EqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value "B" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/hasValue-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/hasValue-001.ttl deleted file mode 100644 index 54860894360..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/hasValue-001.ttl +++ /dev/null @@ -1,68 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidMalePerson - rdf:type ex:MalePerson ; - ex:gender "female" ; - rdfs:label "Invalid male person" ; -. -ex:MalePerson - rdf:type rdfs:Class ; - rdfs:label "Male person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - rdfs:label "Person shape" ; - sh:property ex:PersonShape-gender ; - sh:targetClass ex:MalePerson ; -. -ex:PersonShape-gender - sh:path ex:gender ; - rdfs:label "gender" ; - sh:datatype xsd:string ; - sh:hasValue "male" ; -. -ex:ValidMalePerson1 - rdf:type ex:MalePerson ; - ex:gender "male" ; -. -ex:ValidMalePerson2 - rdf:type ex:MalePerson ; - ex:gender "female" ; - ex:gender "male" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:hasValue at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidMalePerson ; - sh:resultPath ex:gender ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:HasValueConstraintComponent ; - sh:sourceShape ex:PersonShape-gender ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/in-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/in-001.ttl deleted file mode 100644 index 6a6a3594a91..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/in-001.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:ShapeClass ; - ex:property "D" ; - rdfs:label "Invalid instance1" ; -. -ex:ShapeClass - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - sh:property ex:ShapeClass-property ; -. -ex:ShapeClass-property - sh:path ex:property ; - sh:datatype xsd:string ; - sh:in ( - "A" - "B" - "C" - ) ; -. -ex:ValidInstance1 - rdf:type ex:ShapeClass ; - ex:property "A" ; - rdfs:label "Valid instance1" ; -. -ex:ValidInstance2 - rdf:type ex:ShapeClass ; - ex:property "A" ; - ex:property "B" ; - ex:property "C" ; - rdfs:label "Valid instance2" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:in at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:InConstraintComponent ; - sh:sourceShape ex:ShapeClass-property ; - sh:value "D" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/languageIn-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/languageIn-001.ttl deleted file mode 100644 index a67085f2b7b..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/languageIn-001.ttl +++ /dev/null @@ -1,79 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Berg - ex:prefLabel ex:BergLabel ; - ex:prefLabel "Berg" ; - ex:prefLabel "Berg"@de ; -. -ex:Mountain - ex:prefLabel "Hill"@en-NZ ; - ex:prefLabel "Maunga"@mi ; - ex:prefLabel "Mountain"@en ; -. -ex:NewZealandLanguagesShape - rdf:type sh:NodeShape ; - sh:property ex:NewZealandLanguagesShape-prefLabel ; - sh:targetNode ex:Berg ; - sh:targetNode ex:Mountain ; -. -ex:NewZealandLanguagesShape-prefLabel - sh:path ex:prefLabel ; - sh:languageIn ( - "en" - "mi" - ) ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:languageIn at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Berg ; - sh:resultPath ex:prefLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; - sh:value ex:BergLabel ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Berg ; - sh:resultPath ex:prefLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; - sh:value "Berg" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Berg ; - sh:resultPath ex:prefLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LanguageInConstraintComponent ; - sh:sourceShape ex:NewZealandLanguagesShape-prefLabel ; - sh:value "Berg"@de ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThan-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThan-001.ttl deleted file mode 100644 index 76198fba3ea..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThan-001.ttl +++ /dev/null @@ -1,96 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 4 ; - ex:property2 4 ; -. -ex:InvalidResource2 - ex:property1 4 ; - ex:property1 6 ; - ex:property2 5 ; -. -ex:InvalidResource3 - ex:property1 5 ; - ex:property2 4 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:InvalidResource3 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property1 - sh:path ex:property1 ; - sh:lessThan ex:property2 ; -. -ex:ValidResource1 - ex:property1 4 ; - ex:property2 6 ; -. -ex:ValidResource2 - ex:property1 3.1 ; - ex:property1 3.2 ; -. -ex:property1 - rdf:type rdf:Property ; -. -ex:property2 - rdf:type rdf:Property ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:lessThan at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 4 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 6 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource3 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 5 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThan-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThan-002.ttl deleted file mode 100644 index 8e2b925e64a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThan-002.ttl +++ /dev/null @@ -1,81 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:first 1 ; - ex:first 2 ; - ex:second "a" ; - ex:second "b" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-first ; - sh:targetNode ex:InvalidInstance1 ; -. -ex:TestShape-first - sh:path ex:first ; - sh:lessThan ex:second ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:lessThan at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:first ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-first ; - sh:value 1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:first ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-first ; - sh:value 1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:first ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-first ; - sh:value 2 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:first ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanConstraintComponent ; - sh:sourceShape ex:TestShape-first ; - sh:value 2 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThanOrEquals-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThanOrEquals-001.ttl deleted file mode 100644 index a1afdebc034..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/lessThanOrEquals-001.ttl +++ /dev/null @@ -1,87 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 5 ; - ex:property2 4 ; -. -ex:InvalidResource2 - ex:property1 4 ; - ex:property1 6 ; - ex:property2 5 ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property1 ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; - sh:targetNode ex:ValidResource3 ; -. -ex:TestShape-property1 - sh:path ex:property1 ; - sh:lessThanOrEquals ex:property2 ; -. -ex:ValidResource1 - ex:property1 4 ; - ex:property2 6 ; -. -ex:ValidResource2 - ex:property1 3.1 ; - ex:property1 3.2 ; -. -ex:ValidResource3 - ex:property1 5 ; - ex:property2 5 ; -. -ex:property1 - rdf:type rdf:Property ; -. -ex:property2 - rdf:type rdf:Property ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:lessThanOrEquals at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 5 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:LessThanOrEqualsConstraintComponent ; - sh:sourceShape ex:TestShape-property1 ; - sh:value 6 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/manifest.ttl deleted file mode 100644 index 034d2537915..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/manifest.ttl +++ /dev/null @@ -1,46 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/property" ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxCount-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxCount-001.ttl deleted file mode 100644 index f665300ebf3..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxCount-001.ttl +++ /dev/null @@ -1,64 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidPerson - rdf:type ex:Person ; - ex:firstName "George" ; - ex:firstName "John" ; - rdfs:label "Invalid person" ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - sh:property ex:PersonShape-firstName ; - sh:targetClass ex:Person ; - sh:targetNode ex:ValidResource ; -. -ex:PersonShape-firstName - sh:path ex:firstName ; - sh:datatype xsd:string ; - sh:maxCount 1 ; -. -ex:ValidResource - rdf:type ex:Person ; - ex:firstName "John" ; - rdfs:label "Valid resource" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxCount at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidPerson ; - sh:resultPath ex:firstName ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:PersonShape-firstName ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxCount-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxCount-002.ttl deleted file mode 100644 index 88246afa14f..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxCount-002.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource - rdf:type rdfs:Resource ; - rdfs:label "Invalid resource" ; - owl:versionInfo "1.0" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-versionInfo ; - sh:targetNode ex:InvalidResource ; - sh:targetNode ex:ValidResource ; -. -ex:TestShape-versionInfo - sh:path owl:versionInfo ; - sh:maxCount 0 ; -. -ex:ValidResource - rdf:type rdfs:Resource ; - rdfs:label "Valid resource" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxCount at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultPath owl:versionInfo ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-versionInfo ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxExclusive-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxExclusive-001.ttl deleted file mode 100644 index e75d64e08b8..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxExclusive-001.ttl +++ /dev/null @@ -1,84 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property 1 ; -. -ex:InvalidResource2 - ex:property 2 ; -. -ex:InvalidResource3 - ex:property "a" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:InvalidResource3 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property - sh:path ex:property ; - sh:maxExclusive 1 ; -. -ex:ValidResource1 - ex:property 0 ; -. -ex:ValidResource2 - ex:property -1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxExclusive at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value 1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value 2 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource3 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "a" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxInclusive-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxInclusive-001.ttl deleted file mode 100644 index 5ee7ace6160..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxInclusive-001.ttl +++ /dev/null @@ -1,71 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property 2 ; -. -ex:InvalidResource2 - ex:property "a" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property - sh:path ex:property ; - sh:maxInclusive 1 ; -. -ex:ValidResource1 - ex:property 0 ; -. -ex:ValidResource2 - ex:property 1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxInclusive at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value 2 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "a" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxLength-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxLength-001.ttl deleted file mode 100644 index b01ec96b816..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/maxLength-001.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "ABC" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - sh:datatype xsd:string ; - sh:maxLength 2 ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "A" ; - ex:testProperty "AB" ; -. -ex:ValidInstance2 - rdf:type ex:TestShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:maxLength at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value "ABC" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minCount-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minCount-001.ttl deleted file mode 100644 index c15fa15d729..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minCount-001.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidPerson - rdf:type ex:Person ; - rdfs:label "Invalid person" ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - sh:property ex:PersonShape-firstName ; - sh:targetClass ex:Person ; - sh:targetNode ex:ValidResource ; -. -ex:PersonShape-firstName - sh:path ex:firstName ; - sh:datatype xsd:string ; - sh:minCount 1 ; -. -ex:ValidResource - rdf:type ex:Person ; - ex:firstName "John" ; - rdfs:label "Valid resource" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minCount at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidPerson ; - sh:resultPath ex:firstName ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinCountConstraintComponent ; - sh:sourceShape ex:PersonShape-firstName ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minCount-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minCount-002.ttl deleted file mode 100644 index 95b4253983f..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minCount-002.ttl +++ /dev/null @@ -1,41 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:TestShape - rdf:type sh:NodeShape ; - sh:property [ - sh:path ex:property ; - sh:minCount 0 ; - sh:name "property" ; - ] ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minCount at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minExclusive-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minExclusive-001.ttl deleted file mode 100644 index c3acd2ef1c8..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minExclusive-001.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty 40 ; -. -ex:InvalidInstance2 - rdf:type ex:TestShape ; - ex:testProperty 39 ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - sh:minExclusive 40 ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty 42 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minExclusive at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value 40 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value 39 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minExclusive-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minExclusive-002.ttl deleted file mode 100644 index 3bc00618221..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minExclusive-002.ttl +++ /dev/null @@ -1,65 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "A string" ; -. -ex:InvalidInstance2 - rdf:type ex:TestShape ; - ex:testProperty rdfs:Resource ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - sh:minExclusive 40 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minExclusive at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value "A string" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value rdfs:Resource ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minLength-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minLength-001.ttl deleted file mode 100644 index fe70e490f87..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/minLength-001.ttl +++ /dev/null @@ -1,61 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "A" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - sh:datatype xsd:string ; - sh:minLength 2 ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "AB" ; - ex:testProperty "ABC" ; -. -ex:ValidInstance2 - rdf:type ex:TestShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:minLength at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - sh:value "A" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/node-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/node-001.ttl deleted file mode 100644 index e82dc91f790..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/node-001.ttl +++ /dev/null @@ -1,113 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Anon - rdf:type ex:Person ; - ex:firstName "Anon" ; -. -ex:Issue - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Issue" ; - rdfs:subClassOf rdfs:Resource ; - sh:property ex:Issue-assignedTo ; - sh:property ex:Issue-submittedBy ; -. -ex:Issue-assignedTo - sh:path ex:assignedTo ; - sh:class ex:Person ; - sh:node [ - rdfs:comment "All assignees must have an email and a last name." ; - sh:property [ - sh:path ex:email ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path ex:lastName ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - ] ; -. -ex:Issue-submittedBy - sh:path ex:submittedBy ; - sh:class ex:Person ; - sh:minCount 1 ; -. -ex:Issue_1 - rdf:type ex:Issue ; - ex:assignedTo ex:Anon ; - ex:submittedBy ex:Anon ; - rdfs:label "Issue 1" ; -. -ex:Issue_2 - rdf:type ex:Issue ; - ex:assignedTo ex:JohnDoeWithEmail ; - ex:submittedBy ex:Anon ; - rdfs:label "Issue 2" ; -. -ex:JohnDoeWithEmail - rdf:type ex:Person ; - ex:email "john@doe.com" ; - ex:firstName "John" ; - ex:lastName "Doe" ; -. -ex:Person - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; - sh:property [ - sh:path ex:email ; - ex:datatype xsd:string ; - rdfs:label "email" ; - ] ; - sh:property [ - sh:path ex:firstName ; - rdfs:label "first name" ; - sh:datatype xsd:string ; - sh:maxCount 1 ; - sh:minCount 1 ; - ] ; - sh:property [ - sh:path ex:lastName ; - rdfs:label "last name" ; - sh:datatype xsd:string ; - ] ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:node at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Issue_1 ; - sh:resultPath ex:assignedTo ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeConstraintComponent ; - sh:sourceShape ex:Issue-assignedTo ; - sh:value ex:Anon ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/node-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/node-002.ttl deleted file mode 100644 index cc01a834ac7..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/node-002.ttl +++ /dev/null @@ -1,75 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:AddressShape - rdf:type sh:NodeShape ; - sh:property ex:AddressShape-postalCode ; -. -ex:AddressShape-postalCode - sh:path ex:postalCode ; - sh:datatype xsd:string ; - sh:maxCount 1 ; -. -ex:Bob - rdf:type ex:Person ; - ex:address ex:BobsAddress ; -. -ex:BobsAddress - ex:postalCode "1234" ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:label "Person" ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - sh:property ex:PersonShape-address ; - sh:targetClass ex:Person ; -. -ex:PersonShape-address - sh:path ex:address ; - sh:minCount 1 ; - sh:node ex:AddressShape ; -. -ex:Reto - rdf:type ex:Person ; - ex:address ex:RetosAddress ; -. -ex:RetosAddress - ex:postalCode 5678 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:node at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Reto ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeConstraintComponent ; - sh:sourceShape ex:PersonShape-address ; - sh:value ex:RetosAddress ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/nodeKind-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/nodeKind-001.ttl deleted file mode 100644 index 137530d8e70..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/nodeKind-001.ttl +++ /dev/null @@ -1,371 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InstanceWithBlankNode - rdf:type ex:MyClass ; - ex:myProperty _:b55454 ; -. -ex:InstanceWithBlankNodeAndIRI - rdf:type ex:MyClass ; - ex:myProperty rdfs:Class ; - ex:myProperty _:b67098 ; -. -ex:InstanceWithBlankNodeAndLiteral - rdf:type ex:MyClass ; - ex:myProperty "Literal" ; - ex:myProperty _:b99026 ; -. -ex:InstanceWithIRI - rdf:type ex:MyClass ; - ex:myProperty rdfs:Class ; -. -ex:InstanceWithIRIAndLiteral - rdf:type ex:MyClass ; - ex:myProperty rdfs:Class ; - ex:myProperty "Literal" ; -. -ex:InstanceWithLiteral - rdf:type ex:MyClass ; - ex:myProperty "Literal" ; -. -ex:MyClass - rdf:type rdfs:Class ; - rdfs:label "My class" ; -. -ex:ShapeWithBlankNode - rdf:type sh:NodeShape ; - sh:property _:b38619 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithBlankNodeOrIRI - rdf:type sh:NodeShape ; - sh:property _:b3078 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithBlankNodeOrLiteral - rdf:type sh:NodeShape ; - sh:property _:b14975 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithIRI - rdf:type sh:NodeShape ; - sh:property _:b97614 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithIRIOrLiteral - rdf:type sh:NodeShape ; - sh:property _:b97860 ; - sh:targetClass ex:MyClass ; -. -ex:ShapeWithLiteral - rdf:type sh:NodeShape ; - sh:property _:b79526 ; - sh:targetClass ex:MyClass ; -. -ex:myProperty - rdf:type rdf:Property ; - rdfs:domain ex:MyClass ; - rdfs:label "my property" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:nodeKind at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNode ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value _:b55454 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNode ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value _:b55454 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNode ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97860 ; - sh:value _:b55454 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b14975 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value _:b67098 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value _:b67098 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97860 ; - sh:value _:b67098 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b3078 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value _:b99026 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value _:b99026 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithBlankNodeAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97860 ; - sh:value _:b99026 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b14975 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRI ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b3078 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b14975 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b79526 ; - sh:value rdfs:Class ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithIRIAndLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b3078 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b38619 ; - sh:value "Literal" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InstanceWithLiteral ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NodeKindConstraintComponent ; - sh:sourceShape _:b97614 ; - sh:value "Literal" ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b3078 - sh:path ex:myProperty ; - sh:nodeKind sh:BlankNodeOrIRI ; -. -_:b14975 - sh:path ex:myProperty ; - sh:nodeKind sh:BlankNodeOrLiteral ; -. -_:b38619 - sh:path ex:myProperty ; - sh:nodeKind sh:BlankNode ; -. -_:b55454 - rdf:type rdfs:Resource ; -. -_:b67098 - rdf:type rdfs:Resource ; -. -_:b79526 - sh:path ex:myProperty ; - sh:nodeKind sh:Literal ; -. -_:b97614 - sh:path ex:myProperty ; - sh:nodeKind sh:IRI ; -. -_:b97860 - sh:path ex:myProperty ; - sh:nodeKind sh:IRIOrLiteral ; -. -_:b99026 - rdf:type rdfs:Resource ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/not-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/not-001.ttl deleted file mode 100644 index 8cbb7ba8dd6..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/not-001.ttl +++ /dev/null @@ -1,68 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:property 42 ; - ex:property "Test Valid" ; - rdfs:label "Invalid resource1" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-property ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:TestShape-property - sh:path ex:property ; - sh:not [ - sh:datatype xsd:integer ; - ] ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - rdfs:label "Valid resource1" ; -. -ex:ValidResource2 - rdf:type rdfs:Resource ; - ex:property 1.5 ; - ex:property "String" ; - rdfs:label "Valid resource2" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:not at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:NotConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value 42 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/or-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/or-001.ttl deleted file mode 100644 index 1040662b92e..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/or-001.ttl +++ /dev/null @@ -1,76 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Address - rdf:type rdfs:Class ; - rdfs:label "Address" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:AddressShape - rdf:type sh:NodeShape ; - rdfs:label "Address shape" ; - sh:property ex:AddressShape-address ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; - sh:targetNode ex:ValidResource2 ; -. -ex:AddressShape-address - sh:path ex:address ; - sh:or ( - [ - sh:datatype xsd:string ; - ] - [ - sh:class ex:Address ; - ] - ) ; -. -ex:InvalidResource1 - rdf:type rdfs:Resource ; - ex:address "true"^^xsd:boolean ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - ex:address "Home" ; -. -ex:ValidResource2 - rdf:type rdfs:Resource ; - ex:address [ - rdf:type ex:Address ; - ] ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:or at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath ex:address ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:AddressShape-address ; - sh:value "true"^^xsd:boolean ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/or-datatypes-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/or-datatypes-001.ttl deleted file mode 100644 index 8f85b20a575..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/or-datatypes-001.ttl +++ /dev/null @@ -1,95 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - rdfs:comment owl:Thing ; - rdfs:comment 42 ; - rdfs:comment "A string" ; - rdfs:comment "none"^^xsd:boolean ; - rdfs:label "Invalid resource1" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-comment ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:TestShape-comment - sh:path rdfs:comment ; - sh:or ( - [ - sh:datatype xsd:string ; - ] - [ - sh:datatype rdf:HTML ; - ] - [ - sh:datatype rdf:langString ; - ] - [ - sh:datatype xsd:boolean ; - ] - ) ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; - rdfs:comment "

HTML
"^^rdf:HTML ; - rdfs:comment "A language string"@en ; - rdfs:comment "A string" ; - rdfs:label "Valid resource1" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:or of sh:datatypes at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:comment ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:TestShape-comment ; - sh:value owl:Thing ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:comment ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:TestShape-comment ; - sh:value 42 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:comment ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:OrConstraintComponent ; - sh:sourceShape ex:TestShape-comment ; - sh:value "none"^^xsd:boolean ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/pattern-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/pattern-001.ttl deleted file mode 100644 index fa863999eb2..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/pattern-001.ttl +++ /dev/null @@ -1,74 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:property "Maria" ; - rdfs:label "Invalid instance1" ; -. -ex:InvalidInstance2 - rdf:type ex:TestShape ; - ex:property "john" ; - rdfs:label "Invalid instance2" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-property ; -. -ex:TestShape-property - sh:path ex:property ; - sh:datatype xsd:string ; - sh:pattern "Joh" ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:property "Hi Joh" ; - ex:property "John" ; - rdfs:label "Valid instance1" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:pattern at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "Maria" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "john" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/pattern-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/pattern-002.ttl deleted file mode 100644 index 79ee3b27ea4..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/pattern-002.ttl +++ /dev/null @@ -1,66 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:property "Maria" ; - rdfs:label "Invalid instance1" ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-property ; -. -ex:TestShape-property - sh:path ex:property ; - rdfs:label "property" ; - sh:datatype xsd:string ; - sh:flags "i" ; - sh:pattern "joh" ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:property "Hi Joh" ; - ex:property "John" ; - rdfs:label "Valid instance1" ; -. -ex:ValidInstance2 - rdf:type ex:TestShape ; - ex:property "john" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:pattern at property shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:property ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape-property ; - sh:value "Maria" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/property-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/property-001.ttl deleted file mode 100644 index 8b00d9af7bd..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/property-001.ttl +++ /dev/null @@ -1,100 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Address - rdf:type rdfs:Class ; - rdfs:label "Address" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:City - rdf:type rdfs:Class ; - rdfs:label "City" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:InvalidAddress - rdf:type ex:Address ; - ex:city ex:InvalidCity ; -. -ex:InvalidPerson1 - rdf:type ex:Person ; - ex:address ex:InvalidAddress ; -. -ex:InvalidPerson2 - rdf:type ex:Person ; - ex:address ex:InvalidAddress ; - ex:address ex:ValidAddress ; -. -ex:Person - rdf:type rdfs:Class ; - rdfs:label "Person" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:PersonShape - rdf:type sh:NodeShape ; - rdfs:label "Person shape" ; - sh:property [ - sh:path ex:address ; - sh:property ex:PersonShape-address-city ; - ] ; - sh:targetClass ex:Person ; -. -ex:PersonShape-address-city - sh:path ex:city ; - sh:class ex:City ; -. -ex:ProperCity - rdf:type ex:City ; - rdfs:label "Proper city" ; -. -ex:ValidAddress - rdf:type ex:Address ; - ex:city ex:ProperCity ; -. -ex:ValidPerson1 - rdf:type ex:Person ; - ex:address ex:ValidAddress ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:property at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidAddress ; - sh:resultPath ex:city ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:PersonShape-address-city ; - sh:value ex:InvalidCity ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidAddress ; - sh:resultPath ex:city ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClassConstraintComponent ; - sh:sourceShape ex:PersonShape-address-city ; - sh:value ex:InvalidCity ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedMinCountDisjoint-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedMinCountDisjoint-001.ttl deleted file mode 100644 index 90f2ccf2063..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedMinCountDisjoint-001.ttl +++ /dev/null @@ -1,116 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Digit - rdf:type rdfs:Class ; - rdfs:label "Digit" ; -. -ex:Finger - rdf:type rdfs:Class ; - rdfs:label "Finger" ; - rdfs:subClassOf ex:Digit ; -. -ex:FingerAndThumb - rdf:type ex:Finger ; - rdf:type ex:Thumb ; - rdfs:label "Finger and thumb" ; -. -ex:FingerShape - rdf:type sh:NodeShape ; - rdfs:label "Finger shape" ; - sh:class ex:Finger ; -. -ex:Finger_1 - rdf:type ex:Finger ; - rdfs:label "Finger 1" ; -. -ex:Hand - rdf:type rdfs:Class ; - rdfs:label "Hand" ; -. -ex:HandShape - rdf:type sh:NodeShape ; - rdfs:label "Hand shape" ; - sh:property ex:HandShape-digit-maxCount4 ; - sh:property ex:HandShape-digit-minCount1 ; - sh:targetClass ex:Hand ; -. -ex:HandShape-digit-maxCount4 - rdf:type sh:PropertyShape ; - sh:path ex:digit ; - sh:qualifiedMaxCount 4 ; - sh:qualifiedValueShape ex:FingerShape ; - sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; -. -ex:HandShape-digit-minCount1 - rdf:type sh:PropertyShape ; - sh:path ex:digit ; - sh:qualifiedMinCount 1 ; - sh:qualifiedValueShape ex:ThumbShape ; - sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; -. -ex:InvalidHand1 - rdf:type ex:Hand ; - ex:digit ex:FingerAndThumb ; - rdfs:label "Invalid hand1" ; -. -ex:Thumb - rdf:type rdfs:Class ; - rdfs:label "Thumb" ; - rdfs:subClassOf ex:Digit ; -. -ex:ThumbShape - rdf:type sh:NodeShape ; - rdfs:label "Thumb shape" ; - sh:class ex:Thumb ; -. -ex:Thumb_1 - rdf:type ex:Thumb ; - rdfs:label "Thumb 1" ; -. -ex:ValidHand1 - rdf:type ex:Hand ; - ex:digit ex:Finger_1 ; - ex:digit ex:Thumb_1 ; - rdfs:label "Valid hand1" ; -. -ex:digit - rdf:type rdf:Property ; - rdfs:domain ex:Hand ; - rdfs:label "digit" ; - rdfs:range ex:Digit ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:qualifiedMinCount with disjoint shapes at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidHand1 ; - sh:resultPath ex:digit ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; - sh:sourceShape ex:HandShape-digit-minCount1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedValueShape-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedValueShape-001.ttl deleted file mode 100644 index 2ca5959e9f2..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedValueShape-001.ttl +++ /dev/null @@ -1,80 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:APGARObservationShape - rdf:type sh:NodeShape ; - sh:property ex:APGARObservationShape-related ; - sh:targetNode ex:Observation1 ; -. -ex:APGARObservationShape-related - sh:path ex:related ; - sh:qualifiedMaxCount 3 ; - sh:qualifiedMinCount 3 ; - sh:qualifiedValueShape [ - sh:property [ - sh:path ex:related_target ; - sh:node [ - sh:property [ - sh:path ex:reference ; - sh:hasValue ex:something ; - ] ; - ] ; - ] ; - ] ; -. -ex:Observation1 - rdf:type ex:Observation ; - ex:related [ - ex:related_target [ - ex:reference ex:something ; - ] ; - ex:related_type "has-component"^^ex:code ; - ] ; - ex:related [ - ex:related_target [ - ex:reference ex:something ; - ] ; - ex:related_type "has-component"^^ex:code ; - ] ; - ex:related [ - ex:related_target [ - ex:reference ex:unrelated ; - ] ; - ex:related_type "has-component"^^ex:code ; - ] ; - sh:nodeShape ex:APGARObservationShape ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:qualifiedValueShape at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Observation1 ; - sh:resultPath ex:related ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; - sh:sourceShape ex:APGARObservationShape-related ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedValueShapesDisjoint-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedValueShapesDisjoint-001.ttl deleted file mode 100644 index 7aa02ea6a45..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/qualifiedValueShapesDisjoint-001.ttl +++ /dev/null @@ -1,128 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Finger - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Finger" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:Finger1 - rdf:type ex:Finger ; - rdfs:label "Finger1" ; -. -ex:Finger2 - rdf:type ex:Finger ; - rdfs:label "Finger2" ; -. -ex:Finger3 - rdf:type ex:Finger ; - rdfs:label "Finger3" ; -. -ex:Finger4 - rdf:type ex:Finger ; - rdfs:label "Finger4" ; -. -ex:FingerAndThumb - rdf:type ex:Finger ; - rdf:type ex:Thumb ; - rdfs:label "Finger and thumb" ; -. -ex:Hand - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Hand" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:HandShape - rdf:type sh:NodeShape ; - sh:property ex:HandShape-digit1 ; - sh:property ex:HandShape-digit4 ; - sh:targetClass ex:Hand ; -. -ex:HandShape-digit1 - sh:path ex:digit ; - sh:qualifiedMaxCount 1 ; - sh:qualifiedMinCount 1 ; - sh:qualifiedValueShape [ - sh:class ex:Thumb ; - ] ; - sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; -. -ex:HandShape-digit4 - sh:path ex:digit ; - sh:qualifiedMaxCount 4 ; - sh:qualifiedMinCount 4 ; - sh:qualifiedValueShape [ - sh:class ex:Finger ; - ] ; - sh:qualifiedValueShapesDisjoint "true"^^xsd:boolean ; -. -ex:InvalidHand1 - rdf:type ex:Hand ; - ex:digit ex:Finger1 ; - ex:digit ex:Finger2 ; - ex:digit ex:Finger3 ; - ex:digit ex:FingerAndThumb ; -. -ex:Thumb - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Thumb" ; - rdfs:subClassOf rdfs:Resource ; -. -ex:Thumb1 - rdf:type ex:Thumb ; - rdfs:label "Thumb1" ; -. -ex:ValidHand - rdf:type ex:Hand ; - ex:digit ex:Finger1 ; - ex:digit ex:Finger2 ; - ex:digit ex:Finger3 ; - ex:digit ex:Finger4 ; - ex:digit ex:Thumb1 ; - rdfs:label "Valid hand" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:qualifiedValueShapesDisjoint at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidHand1 ; - sh:resultPath ex:digit ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; - sh:sourceShape ex:HandShape-digit1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidHand1 ; - sh:resultPath ex:digit ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:QualifiedMinCountConstraintComponent ; - sh:sourceShape ex:HandShape-digit4 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-001.ttl deleted file mode 100644 index 9014c7fa110..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-001.ttl +++ /dev/null @@ -1,86 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "Me" ; - ex:testProperty "Me"@en ; - ex:testProperty "Moi"@fr ; - ex:testProperty "Myself"@en ; -. -ex:InvalidInstance2 - rdf:type ex:TestShape ; - ex:testProperty "I"@en ; - ex:testProperty "Ich"@de ; - ex:testProperty "Me"@en ; - ex:testProperty "Mich"@de ; - ex:testProperty "Myself"@en ; -. -ex:TestShape - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-testProperty ; -. -ex:TestShape-testProperty - sh:path ex:testProperty ; - rdfs:label "test property" ; - sh:uniqueLang "true"^^xsd:boolean ; -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "Me" ; - ex:testProperty "Me"@en ; - ex:testProperty "Moi"@fr ; - ex:testProperty "Myself" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:uniqueLang at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:testProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:UniqueLangConstraintComponent ; - sh:sourceShape ex:TestShape-testProperty ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002-data.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002-data.ttl deleted file mode 100644 index 4db2738ec5c..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002-data.ttl +++ /dev/null @@ -1,3 +0,0 @@ -@prefix ex: . - -ex:i ex:message "HI"@en, "Hi"@en . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002-shapes.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002-shapes.ttl deleted file mode 100644 index 648d4821c94..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002-shapes.ttl +++ /dev/null @@ -1,12 +0,0 @@ -@prefix sh: . -@prefix ex: . -@prefix xsd: . - -ex:s1 a sh:PropertyShape ; - sh:targetNode ex:i ; - sh:path ex:message ; - sh:uniqueLang "1"^^xsd:boolean . - -# Note that the value above is "1"^^xsd:boolean, which is distinct from "true"^^xsd:boolean. -# Only true is mentioned in the spec, meaning that "1" will not activate the constraint -# and the constraint is being ignored. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002.ttl deleted file mode 100644 index c1b1f3bb2ef..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/property/uniqueLang-002.ttl +++ /dev/null @@ -1,23 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -<> a mf:Manifest ; - mf:entries ( - - ) . - - a sht:Validate ; - rdfs:label "Test uniqueLang with other boolean literal for true" ; - mf:action [ - sht:dataGraph ; - sht:shapesGraph ] ; - mf:result [ a sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ] ; - mf:status sht:approved . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/manifest.ttl deleted file mode 100644 index ee7699b7797..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/manifest.ttl +++ /dev/null @@ -1,15 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/targets" ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/multipleTargets-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/multipleTargets-001.ttl deleted file mode 100644 index 02318492a35..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/multipleTargets-001.ttl +++ /dev/null @@ -1,56 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:property1 "Also a value" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:in ( - ex:ValidResource1 - ex:ValidResource2 - ) ; - sh:targetSubjectsOf ex:property1 ; - sh:targetSubjectsOf ex:property2 ; -. -ex:ValidResource1 - ex:property1 "Some value" ; -. -ex:ValidResource2 - ex:property2 "Other value" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of multiple targets 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:InConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetClass-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetClass-001.ttl deleted file mode 100644 index 99ccc3002fb..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetClass-001.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:MyClass ; - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:MyClass - rdf:type rdfs:Class ; -. -ex:MyShape - rdf:type sh:NodeShape ; - sh:property ex:MyShape-myProperty ; - sh:targetClass ex:MyClass ; -. -ex:MyShape-myProperty - sh:path ex:myProperty ; - sh:maxCount 1 ; -. -ex:ValidInstance1 - rdf:type ex:MyClass ; - ex:myProperty "A" ; -. -ex:ValidInstance2 - ex:myProperty "A" ; - ex:myProperty "B" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetClass 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:MyShape-myProperty ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetClassImplicit-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetClassImplicit-001.ttl deleted file mode 100644 index 05cafccbb8a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetClassImplicit-001.ttl +++ /dev/null @@ -1,58 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance - rdf:type ex:SubClass ; - rdfs:label "Invalid instance" ; -. -ex:SubClass - rdf:type rdfs:Class ; - rdfs:label "Sub class" ; - rdfs:subClassOf ex:SuperClass ; -. -ex:SuperClass - rdf:type rdfs:Class ; - rdf:type sh:NodeShape ; - rdfs:label "Super class" ; - sh:in ( - ex:ValidInstance - ) ; -. -ex:ValidInstance - rdf:type ex:SubClass ; - rdfs:label "Valid instance" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of implicit sh:targetClass 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:InConstraintComponent ; - sh:sourceShape ex:SuperClass ; - sh:value ex:InvalidInstance ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetNode-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetNode-001.ttl deleted file mode 100644 index 0cb1e22a7f8..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetNode-001.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - rdfs:label "Invalid resource 1" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:property ex:TestShape-label ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:TestShape-label - sh:path rdfs:label ; - rdfs:label "label" ; - sh:datatype xsd:string ; - sh:maxCount 0 ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetNode 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:label ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-label ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetObjectsOf-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetObjectsOf-001.ttl deleted file mode 100644 index 4cd3d7080b1..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetObjectsOf-001.ttl +++ /dev/null @@ -1,65 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - ex:testProperty "String" ; -. -ex:InvalidResource2 - ex:testProperty rdfs:Resource ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:datatype xsd:integer ; - sh:targetObjectsOf ex:testProperty ; -. -ex:ValidResource1 - ex:testProperty 100 ; - ex:testProperty 42 ; -. -ex:testProperty - rdf:type rdf:Property ; - rdfs:label "test property" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetObjectsOf 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode rdfs:Resource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value rdfs:Resource ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "String" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "String" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetSubjectsOf-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetSubjectsOf-001.ttl deleted file mode 100644 index 1f4637b2236..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetSubjectsOf-001.ttl +++ /dev/null @@ -1,57 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:MyClass - rdf:type rdfs:Class ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-myProperty ; - sh:targetSubjectsOf ex:myProperty ; -. -ex:TestShape-myProperty - rdf:type sh:PropertyShape ; - sh:path ex:myProperty ; - sh:maxCount 1 ; -. -ex:ValidInstance1 - ex:myProperty "A" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetSubjectsOf 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-myProperty ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetSubjectsOf-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetSubjectsOf-002.ttl deleted file mode 100644 index 896dd99700d..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/targets/targetSubjectsOf-002.ttl +++ /dev/null @@ -1,74 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidInstance1 - rdf:type ex:MyClass ; - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:InvalidInstance2 - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:MyClass - rdf:type rdfs:Class ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-myProperty ; - sh:targetClass ex:MyClass ; - sh:targetSubjectsOf ex:myProperty ; -. -ex:TestShape-myProperty - sh:path ex:myProperty ; - sh:maxCount 1 ; -. -ex:ValidInstance1 - rdf:type ex:MyClass ; - ex:myProperty "A" ; -. -ex:ValidInstance2 - ex:myProperty "A" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:targetSubjectsOf 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance1 ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-myProperty ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidInstance2 ; - sh:resultPath ex:myProperty ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxCountConstraintComponent ; - sh:sourceShape ex:TestShape-myProperty ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/manifest.ttl deleted file mode 100644 index b200ca17b8b..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests for validation reports" ; - mf:include ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared-data.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared-data.ttl deleted file mode 100644 index 5263a71ccf4..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared-data.ttl +++ /dev/null @@ -1,4 +0,0 @@ -@prefix ex: . -ex:i ex:p ex:j . -ex:i ex:q ex:j . -ex:j ex:r ex:k . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared-shapes.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared-shapes.ttl deleted file mode 100644 index 26f4b73142e..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared-shapes.ttl +++ /dev/null @@ -1,16 +0,0 @@ -@prefix sh: . -@prefix ex: . - -ex:s1 a sh:NodeShape ; - sh:targetNode ex:i ; - sh:property ex:s2 ; - sh:property ex:s3 . - -ex:s2 sh:path ex:p ; - sh:property ex:s4 . - -ex:s3 sh:path ex:q ; - sh:property ex:s4 . - -ex:s4 sh:path ex:r ; - sh:class ex:C . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared.ttl deleted file mode 100644 index ae4b01ca1cf..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/core/validation-reports/shared.ttl +++ /dev/null @@ -1,52 +0,0 @@ -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -@prefix ex: . - -# This test case is under discussion, as there are different interpretations -# on whether the nested sh:property constraint that is reached twice should -# also be reported twice. - -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - - rdf:type sht:Validate; - rdfs:label "Test of validation report for shape shared by property constraints" ; - mf:action [ - sht:dataGraph ; - sht:shapesGraph - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:resultSeverity sh:Violation ; - sh:focusNode ex:j ; - sh:value ex:k ; - sh:resultPath ex:r ; - sh:sourceShape ex:s4 ; - sh:sourceConstraintComponent sh:ClassConstraintComponent - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:resultSeverity sh:Violation ; - sh:focusNode ex:j ; - sh:value ex:k ; - sh:resultPath ex:r ; - sh:sourceShape ex:s4 ; - sh:sourceConstraintComponent sh:ClassConstraintComponent - ] - ] ; - mf:status sht:approved . - \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/manifest.ttl deleted file mode 100644 index 08a5a1b9c50..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/manifest.ttl deleted file mode 100644 index 631566a2f0c..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/manifest.ttl +++ /dev/null @@ -1,11 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/component" ; - mf:include ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/nodeValidator-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/nodeValidator-001.ttl deleted file mode 100644 index 62d0fbf8386..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/nodeValidator-001.ttl +++ /dev/null @@ -1,83 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - - - sh:declare [ - rdf:type sh:PrefixDeclaration ; - sh:namespace "http://datashapes.org/sh/tests/sparql/component/nodeValidator-001.test#"^^xsd:anyURI ; - sh:prefix "ex" ; - ] ; -. -ex:InvalidResource1 - ex:property "Other" ; -. -ex:TestConstraintComponent - rdf:type sh:ConstraintComponent ; - rdfs:label "Test constraint component" ; - sh:nodeValidator [ - rdf:type sh:SPARQLSelectValidator ; - sh:select """ - SELECT DISTINCT $this - WHERE { - $this ?p ?o . - FILTER NOT EXISTS { - $this ex:property ?requiredParam . - }}""" ; - sh:prefixes ; - ] ; - sh:parameter [ - sh:path ex:optionalParam ; - sh:datatype xsd:integer ; - sh:name "optional param" ; - sh:optional "true"^^xsd:boolean ; - ] ; - sh:parameter [ - sh:path ex:requiredParam ; - sh:datatype xsd:string ; - sh:name "required param" ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - ex:requiredParam "Value" ; - rdfs:label "Test shape" ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -ex:ValidResource1 - ex:property "Value" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:nodeValidator 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:TestConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource1 ; - ] ; - ] ; - mf:status sht:proposed ; -. \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/optional-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/optional-001.ttl deleted file mode 100644 index 0f3ba1f8960..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/optional-001.ttl +++ /dev/null @@ -1,113 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - - - sh:declare [ - rdf:type sh:PrefixDeclaration ; - sh:namespace "http://datashapes.org/sh/tests/sparql/component/optional-001.test#"^^xsd:anyURI ; - sh:prefix "ex" ; - ] ; -. -ex:IncompleteShape - rdf:type sh:NodeShape ; - ex:optionalParam "Some" ; - rdfs:label "Incomplete shape" ; - sh:targetNode "One" ; - sh:targetNode "Three" ; - sh:targetNode "Two" ; -. -ex:TestConstraintComponent - rdf:type sh:ConstraintComponent ; - rdfs:label "Test constraint component" ; - sh:parameter [ - sh:path ex:optionalParam ; - sh:name "optional param" ; - sh:optional "true"^^xsd:boolean ; - ] ; - sh:parameter [ - sh:path ex:requiredParam ; - sh:name "required param" ; - ] ; - sh:validator [ - rdf:type sh:SPARQLAskValidator ; - sh:ask """ASK { - FILTER ($value != $requiredParam && $value != COALESCE(?optionalParam, \"Three\")) . -}""" ; - sh:prefixes ; - ] ; -. -ex:TestShape1 - rdf:type sh:NodeShape ; - ex:requiredParam "One" ; - rdfs:label "Test shape 1" ; - sh:targetNode "One" ; - sh:targetNode "Three" ; - sh:targetNode "Two" ; -. -ex:TestShape2 - rdf:type sh:NodeShape ; - ex:optionalParam "Two" ; - ex:requiredParam "One" ; - rdfs:label "Test shape 1" ; - sh:targetNode "One" ; - sh:targetNode "Three" ; - sh:targetNode "Two" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:optional 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "One" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:TestConstraintComponent ; - sh:sourceShape ex:TestShape1 ; - sh:value "One" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "One" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:TestConstraintComponent ; - sh:sourceShape ex:TestShape2 ; - sh:value "One" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Three" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:TestConstraintComponent ; - sh:sourceShape ex:TestShape1 ; - sh:value "Three" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Two" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:TestConstraintComponent ; - sh:sourceShape ex:TestShape2 ; - sh:value "Two" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/propertyValidator-select-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/propertyValidator-select-001.ttl deleted file mode 100644 index a501c542f9a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/propertyValidator-select-001.ttl +++ /dev/null @@ -1,107 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Country - rdf:type rdfs:Class ; - rdfs:label "Country" ; -. -ex:InvalidCountry1 - rdf:type ex:Country ; - ex:englishLabel "Munich" ; - ex:germanLabel "Muenchen" ; - rdfs:label "Invalid country1" ; -. -ex:LanguageConstraintComponentUsingSELECT - rdf:type sh:ConstraintComponent ; - rdfs:label "Language constraint component" ; - sh:labelTemplate "Values are literals with language \"{$lang}\"" ; - sh:parameter [ - sh:path ex:lang ; - sh:datatype xsd:string ; - sh:description "The language tag, e.g. \"de\"." ; - sh:minLength 2 ; - sh:name "language" ; - ] ; - sh:propertyValidator [ - rdf:type sh:SPARQLSelectValidator ; - sh:message "Values are literals with language \"{?lang}\"" ; - sh:prefixes ; - sh:select """ - SELECT DISTINCT $this ?value - WHERE { - $this $PATH ?value . - FILTER (!isLiteral(?value) || !langMatches(lang(?value), $lang)) - } - """ ; - ] ; -. -ex:LanguageExampleShape - rdf:type sh:NodeShape ; - sh:property _:b56647 ; - sh:property _:b71712 ; - sh:targetClass ex:Country ; -. -ex:ValidCountry1 - rdf:type ex:Country ; - ex:englishLabel "Beijing"@en ; - ex:germanLabel "Peking"@de ; - rdfs:label "Valid country1" ; -. -ex:englishLabel - rdfs:domain ex:Country ; -. -ex:germanLabel - rdfs:domain ex:Country ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:propertyValidator with SELECT 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidCountry1 ; - sh:resultPath ex:englishLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:LanguageConstraintComponentUsingSELECT ; - sh:sourceShape _:b56647 ; - sh:value "Munich" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidCountry1 ; - sh:resultPath ex:germanLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:LanguageConstraintComponentUsingSELECT ; - sh:sourceShape _:b71712 ; - sh:value "Muenchen" ; - ] ; - ] ; - mf:status sht:approved ; -. -_:b56647 - sh:path ex:englishLabel ; - ex:lang "en" ; -. -_:b71712 - sh:path ex:germanLabel ; - ex:lang "de" ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/validator-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/validator-001.ttl deleted file mode 100644 index 67b9d94ac30..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/component/validator-001.ttl +++ /dev/null @@ -1,81 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - - - owl:imports ; -. -ex:ConstraintComponent - rdf:type rdfs:Class ; - rdfs:label "Constraint component" ; - rdfs:subClassOf sh:ConstraintComponent ; -. -ex:SPARQLAskValidator - rdfs:subClassOf sh:SPARQLAskValidator ; -. -ex:TestConstraintComponent - rdf:type ex:ConstraintComponent ; - rdfs:comment """A simple test component with two parameters, which flags all values as invalid unless they are the concatenation of the two parameters. - -Part of this test is to also use various subclasses of the system classes.""" ; - rdfs:label "Test constraint component" ; - sh:parameter ex:TestParameter1 ; - sh:parameter ex:TestParameter2 ; - sh:validator [ - rdf:type ex:SPARQLAskValidator ; - sh:ask """ -ASK { FILTER (?value = CONCAT($test1, $test2)) } - """ ; - ] ; -. -ex:TestParameter1 - rdf:type sh:Parameter ; - sh:path ex:test1 ; - sh:datatype xsd:string ; -. -ex:TestParameter2 - rdf:type sh:Parameter ; - sh:path ex:test2 ; - sh:datatype xsd:string ; -. -ex:TestShape - rdf:type sh:NodeShape ; - ex:test1 "Hello " ; - ex:test2 "World" ; - rdfs:label "Test shape" ; - sh:targetNode "Hallo Welt" ; - sh:targetNode "Hello World" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:validator 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode "Hallo Welt" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent ex:TestConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Hallo Welt" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/manifest.ttl deleted file mode 100644 index d823c551a7a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/manifest.ttl +++ /dev/null @@ -1,11 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/manifest.ttl deleted file mode 100644 index c5f4b86e49b..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/manifest.ttl +++ /dev/null @@ -1,12 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/node" ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/prefixes-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/prefixes-001.ttl deleted file mode 100644 index de29d1f6a9a..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/prefixes-001.ttl +++ /dev/null @@ -1,70 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - - - sh:declare [ - rdf:type sh:PrefixDeclaration ; - sh:namespace "http://datashapes.org/sh/tests/sparql/node/prefixes-001.test#"^^xsd:anyURI ; - sh:prefix "ex" ; - ] ; -. -ex:InvalidResource1 - ex:property ; -. -ex:TestPrefixes - owl:imports ; - sh:declare [ - sh:namespace "http://test.com/ns#"^^xsd:anyURI ; - sh:prefix "test" ; - ] ; -. -ex:TestSPARQL - sh:prefixes ex:TestPrefixes ; - sh:select """ - SELECT $this ?value - WHERE { - $this ex:property ?value . - FILTER (?value = test:Value) . - } """ ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:sparql ex:TestSPARQL ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:ValidResource1 ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:prefixes 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestSPARQL ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-001.ttl deleted file mode 100644 index 1c2b7f2376f..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-001.ttl +++ /dev/null @@ -1,89 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:InvalidResource1 - rdf:type rdfs:Resource ; - rdfs:label "Invalid resource 1" ; -. -ex:InvalidResource2 - rdf:type rdfs:Resource ; - rdfs:label "Invalid label 1" ; - rdfs:label "Invalid label 2" ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource1 ; - sh:targetNode ex:InvalidResource2 ; - sh:targetNode ex:ValidResource1 ; -. -ex:TestShape-sparql - sh:message "Cannot have a label" ; - sh:prefixes ; - sh:select """ - SELECT $this ?path ?value - WHERE { - $this ?path ?value . - FILTER (?path = ) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:sparql at node shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource1 ; - sh:resultPath rdfs:label ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Invalid resource 1" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath rdfs:label ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Invalid label 1" ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource2 ; - sh:resultPath rdfs:label ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value "Invalid label 2" ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-002.ttl deleted file mode 100644 index e6dd7c11bb5..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-002.ttl +++ /dev/null @@ -1,69 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - - - sh:declare [ - rdf:type sh:PrefixDeclaration ; - sh:namespace "http://datashapes.org/sh/tests/sparql/node/sparql-002.test#"^^xsd:anyURI ; - sh:prefix "ex" ; - ] ; -. -ex:InvalidCountry - rdf:type ex:Country ; - ex:germanLabel "Spain"@en ; -. -ex:LanguageExampleShape - rdf:type sh:NodeShape ; - rdf:type sh:SPARQLConstraint ; - sh:message "Values are literals with German language tag." ; - sh:prefixes ; - sh:select """ - SELECT $this (ex:germanLabel AS ?path) ?value - WHERE { - $this ex:germanLabel ?value . - FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\")) - } - """ ; - sh:sparql ex:LanguageExampleShape ; - sh:targetClass ex:Country ; -. -ex:ValidCountry - rdf:type ex:Country ; - ex:germanLabel "Spanien"@de ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:sparql at node shape 002" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidCountry ; - sh:resultPath ex:germanLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:LanguageExampleShape ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:LanguageExampleShape ; - sh:value "Spain"@en ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-003.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-003.ttl deleted file mode 100644 index 4dffc91323d..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/node/sparql-003.ttl +++ /dev/null @@ -1,70 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - - - sh:declare [ - rdf:type sh:PrefixDeclaration ; - sh:namespace "http://datashapes.org/sh/tests/sparql/node/sparql-003.test#"^^xsd:anyURI ; - sh:prefix "ex" ; - ] ; -. -ex:InvalidCountry - rdf:type ex:Country ; - ex:germanLabel "Spain"@en ; -. -ex:LanguageExampleShape - rdf:type sh:NodeShape ; - rdf:type sh:SPARQLConstraint ; - sh:message "Values are literals with German language tag." ; - sh:prefixes ; - sh:select """ - SELECT $this (ex:germanLabel AS ?path) - WHERE { - $this ex:germanLabel ?value . - FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\")) - } - """ ; - sh:severity sh:Warning ; - sh:sparql ex:LanguageExampleShape ; - sh:targetClass ex:Country ; -. -ex:ValidCountry - rdf:type ex:Country ; - ex:germanLabel "Spanien"@de ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:sparql at node shape 003" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidCountry ; - sh:resultPath ex:germanLabel ; - sh:resultSeverity sh:Warning ; - sh:sourceConstraint ex:LanguageExampleShape ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:LanguageExampleShape ; - sh:value ex:InvalidCountry ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/manifest.ttl deleted file mode 100644 index 187159a61e5..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/manifest.ttl +++ /dev/null @@ -1,22 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests for pre-binding" ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; - mf:include ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-001.ttl deleted file mode 100644 index 2babf66f11d..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-001.ttl +++ /dev/null @@ -1,63 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-001.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:message "Test message" ; - sh:prefixes ex: ; - sh:select """ - SELECT $this - WHERE { - FILTER ($this = ex:InvalidResource) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in FILTER" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultMessage "Test message" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-002.ttl deleted file mode 100644 index 5b40e2c1125..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-002.ttl +++ /dev/null @@ -1,67 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-002.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; - sh:select """ - SELECT $this - WHERE { - { - FILTER (false) . - } - UNION - { - FILTER ($this = ex:InvalidResource) . - } - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in UNION" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-003.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-003.ttl deleted file mode 100644 index 3dcf2e9e02b..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-003.ttl +++ /dev/null @@ -1,67 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-003.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; - sh:select """ - SELECT $this - WHERE { - { - { - FILTER ($this = ex:InvalidResource) . - } - FILTER bound($this) . - } - FILTER (true) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in inner {...} blocks" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-004.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-004.ttl deleted file mode 100644 index 7250de036c1..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-004.ttl +++ /dev/null @@ -1,62 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-004.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; - sh:select """ - SELECT $this - WHERE { - BIND ($this AS ?that) . - FILTER (?that = ex:InvalidResource) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in BIND expressions" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-005.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-005.ttl deleted file mode 100644 index 140367447d1..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-005.ttl +++ /dev/null @@ -1,68 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-005.test#"^^xsd:anyURI ; - ] . - -ex:InvalidResource - ex:property "Label" . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; - sh:select """ - SELECT $this - WHERE { - { - FILTER (bound($this)) - } - $this ex:property "Label" . - FILTER (bound($this)) . - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in BGP and FILTER" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-006.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-006.ttl deleted file mode 100644 index b86cf00f771..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-006.ttl +++ /dev/null @@ -1,54 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-006.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; - sh:select """ - SELECT $this - WHERE { - { - SELECT * - WHERE { - FILTER ($this = ex:InvalidResource) . - } - } - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in nested SELECT" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result sht:Failure ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-007.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-007.ttl deleted file mode 100644 index bba550e674b..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/pre-binding-007.ttl +++ /dev/null @@ -1,66 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/pre-binding-007.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; -. -ex:TestShape-sparql - sh:prefixes ex: ; - sh:select """ - SELECT $this - WHERE { - { - SELECT $this - WHERE { - FILTER ($this = ex:InvalidResource) . - } - } - }""" ; -. -ex:ValidResource1 - rdf:type rdfs:Resource ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of pre-binding in nested SELECT" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/shapesGraph-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/shapesGraph-001.ttl deleted file mode 100644 index f15b91e8fb5..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/shapesGraph-001.ttl +++ /dev/null @@ -1,64 +0,0 @@ -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex: - sh:declare [ - sh:prefix "ex" ; - sh:namespace "http://datashapes.org/sh/tests/sparql/pre-binding/shapesGraph-001.test#"^^xsd:anyURI ; - ] . - -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:sparql ex:TestShape-sparql ; - sh:targetNode ex:InvalidResource ; - ex:property 42 ; -. -ex:TestShape-sparql - sh:message "Test message" ; - sh:prefixes ex: ; - sh:select """ - SELECT $this - WHERE { - FILTER bound($shapesGraph) . - GRAPH $shapesGraph { - FILTER bound($currentShape) . - $currentShape ex:property 42 . - } - }""" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of $shapesGraph and $currentShape" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidResource ; - sh:resultMessage "Test message" ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:TestShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value ex:InvalidResource ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-001.ttl deleted file mode 100644 index ddc007aaedc..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-001.ttl +++ /dev/null @@ -1,34 +0,0 @@ -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -<> - rdf:type mf:Manifest ; - mf:entries ( ) . - - - rdf:type sht:Validate ; - rdfs:label "Test of unsupported MINUS" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result sht:Failure ; - mf:status sht:approved . - -ex:TestShape - a sh:NodeShape ; - sh:targetNode ex:InvalidResource ; - sh:sparql [ - sh:select """ - SELECT $this - WHERE { - $this ?x ?any . - MINUS { $this ?x "Value" } - }""" ; - ] . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-002.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-002.ttl deleted file mode 100644 index 529ef9a01ce..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-002.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -<> - rdf:type mf:Manifest ; - mf:entries ( ) . - - - rdf:type sht:Validate ; - rdfs:label "Test of unsupported VALUES" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result sht:Failure ; - mf:status sht:approved . - -ex:TestShape - a sh:NodeShape ; - sh:targetNode ex:InvalidResource ; - sh:sparql [ - sh:select """ - SELECT $this - WHERE { - VALUES ?any { true } - }""" ; - ] . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-003.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-003.ttl deleted file mode 100644 index 02c191ec8b4..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-003.ttl +++ /dev/null @@ -1,36 +0,0 @@ -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -<> - rdf:type mf:Manifest ; - mf:entries ( ) . - - - rdf:type sht:Validate ; - rdfs:label "Test of unsupported SERVICE" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result sht:Failure ; - mf:status sht:approved . - -ex:TestShape - a sh:NodeShape ; - sh:targetNode ex:InvalidResource ; - sh:sparql [ - sh:select """ - SELECT $this - WHERE { - $this ?x ?any . - SERVICE { - ?a ?b ?c . - } - }""" ; - ] . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-004.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-004.ttl deleted file mode 100644 index 7ebf22fa264..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-004.ttl +++ /dev/null @@ -1,39 +0,0 @@ -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -<> - rdf:type mf:Manifest ; - mf:entries ( ) . - - - rdf:type sht:Validate ; - rdfs:label "Test of unsupported SELECT" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result sht:Failure ; - mf:status sht:approved . - -ex:TestShape - a sh:NodeShape ; - sh:targetNode ex:InvalidResource ; - sh:sparql [ - sh:select """ - SELECT $this - WHERE { - $this ?x ?any . - { - SELECT ?other ?b - WHERE { - ?other ?b ?c . - } - } - }""" ; - ] . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-005.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-005.ttl deleted file mode 100644 index 3d47bce5882..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-005.ttl +++ /dev/null @@ -1,33 +0,0 @@ -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -<> - rdf:type mf:Manifest ; - mf:entries ( ) . - - - rdf:type sht:Validate ; - rdfs:label "Test of unsupported AS ?prebound" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result sht:Failure ; - mf:status sht:approved . - -ex:TestShape - a sh:NodeShape ; - sh:targetNode ex:InvalidResource ; - sh:sparql [ - sh:select """ - SELECT $this - WHERE { - BIND (true AS $this) . - }""" ; - ] . diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-006.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-006.ttl deleted file mode 100644 index 83a99204a96..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/pre-binding/unsupported-sparql-006.ttl +++ /dev/null @@ -1,85 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Country - rdf:type rdfs:Class ; - rdfs:label "Country" ; -. -ex:InvalidCountry1 - rdf:type ex:Country ; - ex:englishLabel "Munich" ; - ex:germanLabel "Muenchen" ; - rdfs:label "Invalid country1" ; -. -ex:LanguageConstraintComponentUsingASK - rdf:type sh:ConstraintComponent ; - rdfs:label "Language constraint component" ; - sh:labelTemplate "Values are literals with language \"{$lang}\"" ; - sh:parameter [ - sh:path ex:lang ; - sh:datatype xsd:string ; - sh:description "The language tag, e.g. \"de\"." ; - sh:minLength 2 ; - sh:name "language" ; - ] ; - sh:propertyValidator ex:hasLang ; -. -ex:LanguageExampleShape - rdf:type sh:NodeShape ; - sh:property _:b41651 ; - sh:property _:b75747 ; - sh:targetClass ex:Country ; -. -ex:ValidCountry1 - rdf:type ex:Country ; - ex:englishLabel "Beijing"@en ; - ex:germanLabel "Peking"@de ; - rdfs:label "Valid country1" ; -. -ex:englishLabel - rdfs:domain ex:Country ; -. -ex:germanLabel - rdfs:domain ex:Country ; -. -ex:hasLang - rdf:type sh:SPARQLAskValidator ; - sh:ask """ - ASK { - BIND (true AS ?value) . - FILTER (isLiteral(?value) && langMatches(lang(?value), $lang)) - } - """ ; - sh:message "Values are literals with language \"{?lang}\"" ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of ASK trying to reassign ?value" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result sht:Failure ; - mf:status sht:approved ; -. -_:b41651 - sh:path ex:englishLabel ; - ex:lang "en" ; -. -_:b75747 - sh:path ex:germanLabel ; - ex:lang "de" ; -. diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/property/manifest.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/property/manifest.ttl deleted file mode 100644 index bb76f42b966..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/property/manifest.ttl +++ /dev/null @@ -1,9 +0,0 @@ -@prefix mf: . -@prefix rdfs: . -@prefix sht: . - -<> - a mf:Manifest ; - rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/property" ; - mf:include ; - . \ No newline at end of file diff --git a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/property/sparql-001.ttl b/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/property/sparql-001.ttl deleted file mode 100644 index d7aae032099..00000000000 --- a/testsuites/shacl/src/main/resources/data-shapes-test-suite/tests/sparql/property/sparql-001.ttl +++ /dev/null @@ -1,68 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix mf: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix sht: . -@prefix xsd: . - -ex:Country - rdf:type rdfs:Class ; -. -ex:InvalidCountry - rdf:type ex:Country ; - ex:germanLabel "Spain"@en ; -. -ex:LanguageExamplePropertyShape - rdf:type sh:PropertyShape ; - sh:path ex:germanLabel ; - sh:sparql ex:LanguageExamplePropertyShape-sparql ; - sh:targetClass ex:Country ; -. -ex:LanguageExamplePropertyShape-sparql - rdf:type sh:SPARQLConstraint ; - sh:message "Values are literals with German language tag." ; - sh:prefixes ex: ; - sh:select """ - SELECT $this ?value - WHERE { - $this $PATH ?value . - FILTER (!isLiteral(?value) || !langMatches(lang(?value), \"de\")) - } - """ ; -. -ex:ValidCountry - rdf:type ex:Country ; - ex:germanLabel "Spanien"@de ; -. -<> - rdf:type mf:Manifest ; - mf:entries ( - - ) ; -. - - rdf:type sht:Validate ; - rdfs:label "Test of sh:sparql at property shape 001" ; - mf:action [ - sht:dataGraph <> ; - sht:shapesGraph <> ; - ] ; - mf:result [ - rdf:type sh:ValidationReport ; - sh:conforms "false"^^xsd:boolean ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:InvalidCountry ; - sh:resultPath ex:germanLabel ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraint ex:LanguageExamplePropertyShape-sparql ; - sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; - sh:sourceShape ex:LanguageExamplePropertyShape ; - sh:value "Spain"@en ; - ] ; - ] ; - mf:status sht:approved ; -. diff --git a/tools/config/src/main/java/org/eclipse/rdf4j/common/app/logging/base/LogConfigurationBase.java b/tools/config/src/main/java/org/eclipse/rdf4j/common/app/logging/base/LogConfigurationBase.java deleted file mode 100644 index d9b30d10790..00000000000 --- a/tools/config/src/main/java/org/eclipse/rdf4j/common/app/logging/base/LogConfigurationBase.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.common.app.logging.base; - -import java.io.IOException; - -/** - * @deprecated Use {@link AbstractLogConfiguration} instead. - * @author Jeen Broekstra - */ -@Deprecated(since = "4.0") -public abstract class LogConfigurationBase extends AbstractLogConfiguration { - - /** - * Constructor - * - * @throws IOException - */ - protected LogConfigurationBase() throws IOException { - super(); - } - -} diff --git a/tools/config/src/main/java/org/eclipse/rdf4j/common/logging/base/LogReaderBase.java b/tools/config/src/main/java/org/eclipse/rdf4j/common/logging/base/LogReaderBase.java deleted file mode 100644 index 7e6a51db3d9..00000000000 --- a/tools/config/src/main/java/org/eclipse/rdf4j/common/logging/base/LogReaderBase.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.common.logging.base; - -/** - * @deprecated Use {@link AbstractLogReader} instead. - * @author Jeen Broekstra - */ -@Deprecated(since = "4.0") -public abstract class LogReaderBase extends AbstractLogReader { - -} diff --git a/tools/config/src/main/java/org/eclipse/rdf4j/common/logging/base/LogRecordBase.java b/tools/config/src/main/java/org/eclipse/rdf4j/common/logging/base/LogRecordBase.java deleted file mode 100644 index b9dbfa2b5dc..00000000000 --- a/tools/config/src/main/java/org/eclipse/rdf4j/common/logging/base/LogRecordBase.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.common.logging.base; - -/** - * @deprecated Use {@link SimpleLogRecord} instead. - * @author Jeen Broekstra - */ -@Deprecated(since = "4.0") -public class LogRecordBase extends SimpleLogRecord { - -} diff --git a/tools/console/src/main/java/org/eclipse/rdf4j/console/Util.java b/tools/console/src/main/java/org/eclipse/rdf4j/console/Util.java index 92f0a7a7d04..44b82fce62b 100644 --- a/tools/console/src/main/java/org/eclipse/rdf4j/console/Util.java +++ b/tools/console/src/main/java/org/eclipse/rdf4j/console/Util.java @@ -70,27 +70,6 @@ public static Resource[] getContexts(String[] tokens, int pos, Repository reposi return contexts; } - /** - * Get path from file or URI - * - * @param file file name - * @return path or null - */ - @Deprecated - public static Path getPath(String file) { - Path path = null; - try { - path = Paths.get(file); - } catch (InvalidPathException ipe) { - try { - path = Paths.get(new URI(file)); - } catch (URISyntaxException ex) { - // - } - } - return path; - } - /** * Check if a string looks like a HTTP, HTTPS or file URI. * 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 8a719cf05ce..1622d2bbd76 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 @@ -487,11 +487,6 @@ protected void connectionClosed(SailConnection connection) { } } - @Override - public boolean pendingRemovals() { - return false; - } - @Override public Explanation explain(Explanation.Level level, TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred, int timeoutSeconds) { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ParallelExecutorBase.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ParallelExecutorBase.java index 514fc2e0c08..9152d654a78 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ParallelExecutorBase.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ParallelExecutorBase.java @@ -178,25 +178,20 @@ protected void checkTimeout() throws QueryInterruptedException { @Override public void handleClose() throws QueryEvaluationException { try { - try { - rightQueue.close(); - } finally { - if (rightIter != null) { - try { - rightIter.close(); - rightIter = null; - } catch (Throwable ignore) { - if (ignore instanceof InterruptedException) { - Thread.currentThread().interrupt(); - } - log.trace("Failed to send interrupt signal:", ignore); + rightQueue.close(); + } finally { + if (rightIter != null) { + try { + rightIter.close(); + rightIter = null; + } catch (Throwable ignore) { + if (ignore instanceof InterruptedException) { + Thread.currentThread().interrupt(); } + log.trace("Failed to send interrupt signal:", ignore); } } - } finally { - super.handleClose(); } - } /** diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ParallelServiceExecutor.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ParallelServiceExecutor.java index 50c868a0398..be32db36d46 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ParallelServiceExecutor.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/ParallelServiceExecutor.java @@ -152,6 +152,11 @@ protected BindingSet getNextElement() throws QueryEvaluationException { return null; } + @Override + protected void handleClose() { + + } + /** * Task for evaluating service requests * diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/BoundJoinConversionIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/BoundJoinConversionIteration.java index 3158df973bd..60645baa310 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/BoundJoinConversionIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/BoundJoinConversionIteration.java @@ -25,9 +25,7 @@ * * @author Andreas Schwarte */ -@Deprecated(since = "4.1.0") -public class BoundJoinConversionIteration - extends ConvertingIteration { +public class BoundJoinConversionIteration extends ConvertingIteration { protected final List bindings; diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/BoundJoinVALUESConversionIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/BoundJoinVALUESConversionIteration.java index fee3433a7f3..c734fe6fea9 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/BoundJoinVALUESConversionIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/BoundJoinVALUESConversionIteration.java @@ -34,7 +34,6 @@ * @see SparqlFederationEvalStrategy * @since 3.0 */ -@Deprecated(since = "4.1.0") public class BoundJoinVALUESConversionIteration extends ConvertingIteration { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/FilteringInsertBindingsIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/FilteringInsertBindingsIteration.java index 0316226eeff..15935bfd4b6 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/FilteringInsertBindingsIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/FilteringInsertBindingsIteration.java @@ -10,39 +10,173 @@ *******************************************************************************/ package org.eclipse.rdf4j.federated.evaluation.iterator; +import java.util.NoSuchElementException; + import org.eclipse.rdf4j.common.iteration.CloseableIteration; import org.eclipse.rdf4j.federated.algebra.FilterValueExpr; import org.eclipse.rdf4j.federated.evaluation.FederationEvalStrategy; import org.eclipse.rdf4j.query.BindingSet; import org.eclipse.rdf4j.query.QueryEvaluationException; import org.eclipse.rdf4j.query.algebra.evaluation.QueryBindingSet; +import org.eclipse.rdf4j.query.algebra.evaluation.ValueExprEvaluationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Filters iteration according to specified filterExpr and inserts original bindings into filtered results. * * @author Andreas Schwarte */ -@Deprecated(since = "4.1.0") -public class FilteringInsertBindingsIteration extends FilteringIteration { +public class FilteringInsertBindingsIteration implements CloseableIteration { - protected final BindingSet bindings; + private static final Logger log = LoggerFactory.getLogger(FilteringInsertBindingsIteration.class); + private final BindingSet bindings; + private final FilterValueExpr filterExpr; + private final FederationEvalStrategy strategy; + private final CloseableIteration wrappedIter; + private BindingSet nextElement; + /** + * Flag indicating whether this iteration has been closed. + */ + private boolean closed = false; public FilteringInsertBindingsIteration(FilterValueExpr filterExpr, BindingSet bindings, CloseableIteration iter, FederationEvalStrategy strategy) throws QueryEvaluationException { - super(filterExpr, iter, strategy); + assert iter != null; + this.wrappedIter = iter; + this.filterExpr = filterExpr; + this.strategy = strategy; this.bindings = bindings; } @Override public BindingSet next() throws QueryEvaluationException { - BindingSet next = super.next(); - if (next == null) { - return null; + BindingSet res1; + if (isClosed()) { + throw new NoSuchElementException("The iteration has been closed."); + } + findNextElement(); + + BindingSet result = nextElement; + + if (result != null) { + nextElement = null; + res1 = result; + } else { + close(); + throw new NoSuchElementException("The iteration has been closed."); } + BindingSet next = res1; QueryBindingSet res = new QueryBindingSet(bindings.size() + next.size()); res.addAll(bindings); res.addAll(next); return res; } + + protected boolean accept(BindingSet bindings) throws QueryEvaluationException { + try { + return strategy.isTrue(filterExpr, bindings); + } catch (ValueExprEvaluationException e) { + log.warn("Failed to evaluate filter expr: " + e.getMessage()); + // failed to evaluate condition + return false; + } + } + + @Override + public boolean hasNext() { + if (isClosed()) { + return false; + } + findNextElement(); + + boolean result = nextElement != null; + if (!result) { + close(); + } + return result; + } + + private void findNextElement() { + if (nextElement != null) { + return; + } + + try { + if (!isClosed()) { + if (Thread.currentThread().isInterrupted()) { + close(); + return; + } else { + boolean result = wrappedIter.hasNext(); + if (!result) { + close(); + return; + } + } + } + while (nextElement == null && wrappedIter.hasNext()) { + BindingSet result; + if (Thread.currentThread().isInterrupted()) { + close(); + return; + } + try { + result = wrappedIter.next(); + } catch (NoSuchElementException e) { + close(); + throw e; + } + BindingSet candidate = result; + + if (accept(candidate)) { + nextElement = candidate; + } + } + } finally { + if (isClosed()) { + nextElement = null; + } + } + } + + /** + * Removes the last element that has been returned from the wrapped Iteration. + * + * @throws UnsupportedOperationException If the wrapped Iteration does not support the remove operation. + * @throws IllegalStateException if the Iteration has been closed, or if {@link #next} has not yet been + * called, or {@link #remove} has already been called after the last call to + * {@link #next}. + */ + @Override + public void remove() { + if (isClosed()) { + throw new IllegalStateException("The iteration has been closed."); + } else if (Thread.currentThread().isInterrupted()) { + close(); + throw new IllegalStateException("The iteration has been interrupted."); + } + try { + wrappedIter.remove(); + } catch (IllegalStateException e) { + close(); + throw e; + } + } + + private boolean isClosed() { + return closed; + } + + /** + * Calls {@link #handleClose()} upon first call and makes sure the resource closures are only executed once. + */ + @Override + public final void close() { + if (!closed) { + closed = true; + wrappedIter.close(); + } + } } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/FilteringIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/FilteringIteration.java index ec8d73e7024..adcaefa0698 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/FilteringIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/FilteringIteration.java @@ -25,7 +25,6 @@ * * @author Andreas Schwarte */ -@Deprecated(since = "4.1.0") public class FilteringIteration extends FilterIteration { private static final Logger log = LoggerFactory.getLogger(FilteringIteration.class); @@ -51,4 +50,9 @@ protected boolean accept(BindingSet bindings) throws QueryEvaluationException { return false; } } + + @Override + protected final void handleClose() { + + } } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/GroupedCheckConversionIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/GroupedCheckConversionIteration.java index 2a91afa9bc3..98ef9b6a733 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/GroupedCheckConversionIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/GroupedCheckConversionIteration.java @@ -23,7 +23,6 @@ * * @author Andreas Schwarte */ -@Deprecated(since = "4.1.0") public class GroupedCheckConversionIteration extends ConvertingIteration { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration.java index d7cce0b4693..ba57c275d54 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration.java @@ -98,10 +98,6 @@ protected ArrayList computeResult() throws QueryEvaluationException @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - iter.close(); - } + iter.close(); } } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration2.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration2.java index f059522c5de..d1078cf0edf 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration2.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration2.java @@ -124,14 +124,10 @@ protected ArrayList computeResult() throws QueryEvaluationException @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - iter.close(); - } + iter.close(); } - protected class BindingInfo { + protected static class BindingInfo { public final String name; public final int bindingsIdx; public final Value value; diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration3.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration3.java index 081b3a2bee6..b9130504f1c 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration3.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/IndependentJoingroupBindingsIteration3.java @@ -135,14 +135,10 @@ protected ArrayList computeResult() throws QueryEvaluationException @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - iter.close(); - } + iter.close(); } - protected class BindingInfo { + protected static class BindingInfo { public final String name; public final int bindingsIdx; public final Value value; diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/InsertBindingsIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/InsertBindingsIteration.java index 5b566992c65..f621dc1ce0b 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/InsertBindingsIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/InsertBindingsIteration.java @@ -21,7 +21,6 @@ * * @author Andreas Schwarte */ -@Deprecated(since = "4.1.0") public class InsertBindingsIteration extends ConvertingIteration { protected final BindingSet bindings; diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/StatementConversionIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/StatementConversionIteration.java index ce2cb42f668..c1f1410ac33 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/StatementConversionIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/StatementConversionIteration.java @@ -90,11 +90,7 @@ public void remove() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - repoResult.close(); - } + repoResult.close(); } protected BindingSet convert(Statement st) { diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/StopRemainingExecutionsOnCloseIteration.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/StopRemainingExecutionsOnCloseIteration.java index 264f408323d..8d97e35fd31 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/StopRemainingExecutionsOnCloseIteration.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/iterator/StopRemainingExecutionsOnCloseIteration.java @@ -60,16 +60,11 @@ public void remove() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { try { - super.handleClose(); + inner.close(); } finally { - try { - inner.close(); - } finally { - // make sure to close all scheduled / running parallel executions - // (e.g. if the query result is not fully consumed) - queryInfo.close(); - } - + // make sure to close all scheduled / running parallel executions + // (e.g. if the query result is not fully consumed) + queryInfo.close(); } } diff --git a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ParallelLeftJoinTask.java b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ParallelLeftJoinTask.java index 0d34e72187d..895b139d8db 100644 --- a/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ParallelLeftJoinTask.java +++ b/tools/federation/src/main/java/org/eclipse/rdf4j/federated/evaluation/join/ParallelLeftJoinTask.java @@ -136,12 +136,8 @@ protected BindingSet getNextElement() throws QueryEvaluationException { @Override protected void handleClose() throws QueryEvaluationException { - try { - super.handleClose(); - } finally { - if (rightIter != null) { - rightIter.close(); - } + if (rightIter != null) { + rightIter.close(); } } diff --git a/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/navigation/NavigationNodeBase.java b/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/navigation/NavigationNodeBase.java deleted file mode 100644 index a321785b3c1..00000000000 --- a/tools/server-spring/src/main/java/org/eclipse/rdf4j/common/webapp/navigation/NavigationNodeBase.java +++ /dev/null @@ -1,24 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.common.webapp.navigation; - -/** - * @deprecated Use {@link AbstractNavigationNode} instead. - * @author Jeen Broekstra - */ -@Deprecated(since = "4.0") -public abstract class NavigationNodeBase extends AbstractNavigationNode { - - public NavigationNodeBase(String id) { - super(id); - } - -} diff --git a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/BaseRepositoryServlet.java b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/BaseRepositoryServlet.java deleted file mode 100644 index dbc0c01d747..00000000000 --- a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/BaseRepositoryServlet.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.workbench.base; - -/** - * @deprecated Use {@link AbstractRepositoryServlet} instead. - * @author Jeen Broekstra - */ -@Deprecated(since = "4.0") -public abstract class BaseRepositoryServlet extends AbstractRepositoryServlet { - -} diff --git a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/BaseServlet.java b/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/BaseServlet.java deleted file mode 100644 index 65c43cc56b9..00000000000 --- a/tools/workbench/src/main/java/org/eclipse/rdf4j/workbench/base/BaseServlet.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015 Eclipse RDF4J contributors, Aduna, and others. - * - * 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. - * - * SPDX-License-Identifier: BSD-3-Clause - *******************************************************************************/ -package org.eclipse.rdf4j.workbench.base; - -/** - * @deprecated Use {@link AbstractServlet} instead. - * @author Jeen Broekstra - */ -@Deprecated(since = "4.0") -public abstract class BaseServlet extends AbstractServlet { - -}