From 74b11a2c34abdca9cadf96fd5439aecafd8e4412 Mon Sep 17 00:00:00 2001 From: Martin Maillard Date: Fri, 3 Apr 2020 11:03:32 +0200 Subject: [PATCH 1/7] Add official data-shapes test suite --- package-lock.json | 621 +----------------- package.json | 2 +- test/configuration_tests.js | 5 +- .../data-shapes/core/complex/manifest.ttl | 10 + .../core/complex/personexample.ttl | 105 +++ .../core/complex/shacl-shacl-data-shapes.ttl | 410 ++++++++++++ .../data-shapes/core/complex/shacl-shacl.ttl | 19 + test/data/data-shapes/core/manifest.ttl | 14 + .../data-shapes/core/misc/deactivated-001.ttl | 44 ++ .../data-shapes/core/misc/deactivated-002.ttl | 43 ++ test/data/data-shapes/core/misc/manifest.ttl | 13 + .../data-shapes/core/misc/message-001.ttl | 48 ++ .../data-shapes/core/misc/severity-001.ttl | 43 ++ .../data-shapes/core/misc/severity-002.ttl | 60 ++ test/data/data-shapes/core/node/and-001.ttl | 77 +++ test/data/data-shapes/core/node/and-002.ttl | 74 +++ test/data/data-shapes/core/node/class-001.ttl | 70 ++ test/data/data-shapes/core/node/class-002.ttl | 62 ++ test/data/data-shapes/core/node/class-003.ttl | 105 +++ .../data/data-shapes/core/node/closed-001.ttl | 64 ++ .../data/data-shapes/core/node/closed-002.ttl | 58 ++ .../data-shapes/core/node/datatype-001.ttl | 64 ++ .../data-shapes/core/node/datatype-002.ttl | 53 ++ .../data-shapes/core/node/disjoint-001.ttl | 51 ++ .../data/data-shapes/core/node/equals-001.ttl | 59 ++ .../data-shapes/core/node/hasValue-001.ttl | 44 ++ test/data/data-shapes/core/node/in-001.ttl | 63 ++ .../data-shapes/core/node/languageIn-001.ttl | 66 ++ test/data/data-shapes/core/node/manifest.ttl | 40 ++ .../core/node/maxExclusive-001.ttl | 91 +++ .../core/node/maxInclusive-001.ttl | 75 +++ .../data-shapes/core/node/maxLength-001.ttl | 87 +++ .../core/node/minExclusive-001.ttl | 91 +++ .../core/node/minInclusive-001.ttl | 44 ++ .../core/node/minInclusive-002.ttl | 61 ++ .../core/node/minInclusive-003.ttl | 70 ++ .../data-shapes/core/node/minLength-001.ttl | 79 +++ test/data/data-shapes/core/node/node-001.ttl | 55 ++ .../data-shapes/core/node/nodeKind-001.ttl | 43 ++ test/data/data-shapes/core/node/not-001.ttl | 59 ++ test/data/data-shapes/core/node/not-002.ttl | 52 ++ test/data/data-shapes/core/node/or-001.ttl | 91 +++ .../data-shapes/core/node/pattern-001.ttl | 76 +++ .../data-shapes/core/node/pattern-002.ttl | 45 ++ .../core/node/qualified-001-data.ttl | 4 + .../core/node/qualified-001-shapes.ttl | 10 + .../data-shapes/core/node/qualified-001.ttl | 28 + test/data/data-shapes/core/node/xone-001.ttl | 74 +++ .../core/node/xone-duplicate-data.ttl | 4 + .../core/node/xone-duplicate-shapes.ttl | 7 + .../data-shapes/core/node/xone-duplicate.ttl | 34 + test/data/data-shapes/core/path/manifest.ttl | 21 + .../core/path/path-alternative-001.ttl | 86 +++ .../core/path/path-complex-001.ttl | 91 +++ .../core/path/path-complex-002-data.ttl | 7 + .../core/path/path-complex-002-shapes.ttl | 14 + .../core/path/path-complex-002.ttl | 51 ++ .../core/path/path-inverse-001.ttl | 90 +++ .../core/path/path-oneOrMore-001.ttl | 71 ++ .../core/path/path-sequence-001.ttl | 80 +++ .../core/path/path-sequence-002.ttl | 83 +++ .../core/path/path-sequence-duplicate-001.ttl | 63 ++ .../core/path/path-strange-001.ttl | 52 ++ .../core/path/path-strange-002.ttl | 52 ++ .../core/path/path-unused-001-data.ttl | 5 + .../core/path/path-unused-001-shapes.ttl | 18 + .../data-shapes/core/path/path-unused-001.ttl | 29 + .../core/path/path-zeroOrMore-001.ttl | 61 ++ .../core/path/path-zeroOrOne-001.ttl | 61 ++ .../data-shapes/core/property/and-001.ttl | 107 +++ .../data-shapes/core/property/class-001.ttl | 91 +++ .../core/property/datatype-001.ttl | 76 +++ .../core/property/datatype-002.ttl | 71 ++ .../core/property/datatype-003.ttl | 69 ++ .../property/datatype-ill-formed-data.ttl | 6 + .../property/datatype-ill-formed-shapes.ttl | 8 + .../core/property/datatype-ill-formed.ttl | 43 ++ .../core/property/disjoint-001.ttl | 84 +++ .../data-shapes/core/property/equals-001.ttl | 119 ++++ .../core/property/hasValue-001.ttl | 68 ++ .../data/data-shapes/core/property/in-001.ttl | 69 ++ .../core/property/languageIn-001.ttl | 79 +++ .../core/property/lessThan-001.ttl | 96 +++ .../core/property/lessThan-002.ttl | 81 +++ .../core/property/lessThanOrEquals-001.ttl | 87 +++ .../data-shapes/core/property/manifest.ttl | 46 ++ .../core/property/maxCount-001.ttl | 64 ++ .../core/property/maxCount-002.ttl | 57 ++ .../core/property/maxExclusive-001.ttl | 84 +++ .../core/property/maxInclusive-001.ttl | 71 ++ .../core/property/maxLength-001.ttl | 61 ++ .../core/property/minCount-001.ttl | 62 ++ .../core/property/minCount-002.ttl | 41 ++ .../core/property/minExclusive-001.ttl | 69 ++ .../core/property/minExclusive-002.ttl | 65 ++ .../core/property/minLength-001.ttl | 61 ++ .../data-shapes/core/property/node-001.ttl | 113 ++++ .../data-shapes/core/property/node-002.ttl | 75 +++ .../core/property/nodeKind-001.ttl | 371 +++++++++++ .../data-shapes/core/property/not-001.ttl | 68 ++ .../data/data-shapes/core/property/or-001.ttl | 76 +++ .../core/property/or-datatypes-001.ttl | 95 +++ .../data-shapes/core/property/pattern-001.ttl | 74 +++ .../data-shapes/core/property/pattern-002.ttl | 66 ++ .../core/property/property-001.ttl | 100 +++ .../qualifiedMinCountDisjoint-001.ttl | 116 ++++ .../core/property/qualifiedValueShape-001.ttl | 80 +++ .../qualifiedValueShapesDisjoint-001.ttl | 128 ++++ .../core/property/uniqueLang-001.ttl | 86 +++ .../core/property/uniqueLang-002-data.ttl | 3 + .../core/property/uniqueLang-002-shapes.ttl | 12 + .../core/property/uniqueLang-002.ttl | 23 + .../data-shapes/core/targets/manifest.ttl | 15 + .../core/targets/multipleTargets-001.ttl | 56 ++ .../core/targets/targetClass-001.ttl | 62 ++ .../core/targets/targetClassImplicit-001.ttl | 58 ++ .../core/targets/targetNode-001.ttl | 57 ++ .../core/targets/targetObjectsOf-001.ttl | 65 ++ .../core/targets/targetSubjectsOf-001.ttl | 57 ++ .../core/targets/targetSubjectsOf-002.ttl | 74 +++ .../core/validation-reports/manifest.ttl | 9 + .../core/validation-reports/shared-data.ttl | 4 + .../core/validation-reports/shared-shapes.ttl | 16 + .../core/validation-reports/shared.ttl | 52 ++ test/data/data-shapes/manifest.ttl | 9 + .../data-shapes/sparql/component/manifest.ttl | 11 + .../sparql/component/nodeValidator-001.ttl | 83 +++ .../sparql/component/optional-001.ttl | 113 ++++ .../propertyValidator-select-001.ttl | 107 +++ .../sparql/component/validator-001.ttl | 81 +++ test/data/data-shapes/sparql/manifest.ttl | 11 + .../data/data-shapes/sparql/node/manifest.ttl | 12 + .../data-shapes/sparql/node/prefixes-001.ttl | 70 ++ .../data-shapes/sparql/node/sparql-001.ttl | 89 +++ .../data-shapes/sparql/node/sparql-002.ttl | 69 ++ .../data-shapes/sparql/node/sparql-003.ttl | 70 ++ .../sparql/pre-binding/manifest.ttl | 22 + .../sparql/pre-binding/pre-binding-001.ttl | 63 ++ .../sparql/pre-binding/pre-binding-002.ttl | 67 ++ .../sparql/pre-binding/pre-binding-003.ttl | 67 ++ .../sparql/pre-binding/pre-binding-004.ttl | 62 ++ .../sparql/pre-binding/pre-binding-005.ttl | 68 ++ .../sparql/pre-binding/pre-binding-006.ttl | 54 ++ .../sparql/pre-binding/pre-binding-007.ttl | 66 ++ .../sparql/pre-binding/shapesGraph-001.ttl | 64 ++ .../pre-binding/unsupported-sparql-001.ttl | 34 + .../pre-binding/unsupported-sparql-002.ttl | 33 + .../pre-binding/unsupported-sparql-003.ttl | 36 + .../pre-binding/unsupported-sparql-004.ttl | 39 ++ .../pre-binding/unsupported-sparql-005.ttl | 33 + .../pre-binding/unsupported-sparql-006.ttl | 85 +++ .../data-shapes/sparql/property/manifest.ttl | 9 + .../sparql/property/sparql-001.ttl | 68 ++ test/integration_tests.js | 5 +- test/official_tests.js | 140 ++++ test/utils.js | 13 + test/validation_message_test.js | 13 +- 157 files changed, 9484 insertions(+), 630 deletions(-) create mode 100644 test/data/data-shapes/core/complex/manifest.ttl create mode 100644 test/data/data-shapes/core/complex/personexample.ttl create mode 100644 test/data/data-shapes/core/complex/shacl-shacl-data-shapes.ttl create mode 100644 test/data/data-shapes/core/complex/shacl-shacl.ttl create mode 100644 test/data/data-shapes/core/manifest.ttl create mode 100644 test/data/data-shapes/core/misc/deactivated-001.ttl create mode 100644 test/data/data-shapes/core/misc/deactivated-002.ttl create mode 100644 test/data/data-shapes/core/misc/manifest.ttl create mode 100644 test/data/data-shapes/core/misc/message-001.ttl create mode 100644 test/data/data-shapes/core/misc/severity-001.ttl create mode 100644 test/data/data-shapes/core/misc/severity-002.ttl create mode 100644 test/data/data-shapes/core/node/and-001.ttl create mode 100644 test/data/data-shapes/core/node/and-002.ttl create mode 100644 test/data/data-shapes/core/node/class-001.ttl create mode 100644 test/data/data-shapes/core/node/class-002.ttl create mode 100644 test/data/data-shapes/core/node/class-003.ttl create mode 100644 test/data/data-shapes/core/node/closed-001.ttl create mode 100644 test/data/data-shapes/core/node/closed-002.ttl create mode 100644 test/data/data-shapes/core/node/datatype-001.ttl create mode 100644 test/data/data-shapes/core/node/datatype-002.ttl create mode 100644 test/data/data-shapes/core/node/disjoint-001.ttl create mode 100644 test/data/data-shapes/core/node/equals-001.ttl create mode 100644 test/data/data-shapes/core/node/hasValue-001.ttl create mode 100644 test/data/data-shapes/core/node/in-001.ttl create mode 100644 test/data/data-shapes/core/node/languageIn-001.ttl create mode 100644 test/data/data-shapes/core/node/manifest.ttl create mode 100644 test/data/data-shapes/core/node/maxExclusive-001.ttl create mode 100644 test/data/data-shapes/core/node/maxInclusive-001.ttl create mode 100644 test/data/data-shapes/core/node/maxLength-001.ttl create mode 100644 test/data/data-shapes/core/node/minExclusive-001.ttl create mode 100644 test/data/data-shapes/core/node/minInclusive-001.ttl create mode 100644 test/data/data-shapes/core/node/minInclusive-002.ttl create mode 100644 test/data/data-shapes/core/node/minInclusive-003.ttl create mode 100644 test/data/data-shapes/core/node/minLength-001.ttl create mode 100644 test/data/data-shapes/core/node/node-001.ttl create mode 100644 test/data/data-shapes/core/node/nodeKind-001.ttl create mode 100644 test/data/data-shapes/core/node/not-001.ttl create mode 100644 test/data/data-shapes/core/node/not-002.ttl create mode 100644 test/data/data-shapes/core/node/or-001.ttl create mode 100644 test/data/data-shapes/core/node/pattern-001.ttl create mode 100644 test/data/data-shapes/core/node/pattern-002.ttl create mode 100644 test/data/data-shapes/core/node/qualified-001-data.ttl create mode 100644 test/data/data-shapes/core/node/qualified-001-shapes.ttl create mode 100644 test/data/data-shapes/core/node/qualified-001.ttl create mode 100644 test/data/data-shapes/core/node/xone-001.ttl create mode 100644 test/data/data-shapes/core/node/xone-duplicate-data.ttl create mode 100644 test/data/data-shapes/core/node/xone-duplicate-shapes.ttl create mode 100644 test/data/data-shapes/core/node/xone-duplicate.ttl create mode 100644 test/data/data-shapes/core/path/manifest.ttl create mode 100644 test/data/data-shapes/core/path/path-alternative-001.ttl create mode 100644 test/data/data-shapes/core/path/path-complex-001.ttl create mode 100644 test/data/data-shapes/core/path/path-complex-002-data.ttl create mode 100644 test/data/data-shapes/core/path/path-complex-002-shapes.ttl create mode 100644 test/data/data-shapes/core/path/path-complex-002.ttl create mode 100644 test/data/data-shapes/core/path/path-inverse-001.ttl create mode 100644 test/data/data-shapes/core/path/path-oneOrMore-001.ttl create mode 100644 test/data/data-shapes/core/path/path-sequence-001.ttl create mode 100644 test/data/data-shapes/core/path/path-sequence-002.ttl create mode 100644 test/data/data-shapes/core/path/path-sequence-duplicate-001.ttl create mode 100644 test/data/data-shapes/core/path/path-strange-001.ttl create mode 100644 test/data/data-shapes/core/path/path-strange-002.ttl create mode 100644 test/data/data-shapes/core/path/path-unused-001-data.ttl create mode 100644 test/data/data-shapes/core/path/path-unused-001-shapes.ttl create mode 100644 test/data/data-shapes/core/path/path-unused-001.ttl create mode 100644 test/data/data-shapes/core/path/path-zeroOrMore-001.ttl create mode 100644 test/data/data-shapes/core/path/path-zeroOrOne-001.ttl create mode 100644 test/data/data-shapes/core/property/and-001.ttl create mode 100644 test/data/data-shapes/core/property/class-001.ttl create mode 100644 test/data/data-shapes/core/property/datatype-001.ttl create mode 100644 test/data/data-shapes/core/property/datatype-002.ttl create mode 100644 test/data/data-shapes/core/property/datatype-003.ttl create mode 100644 test/data/data-shapes/core/property/datatype-ill-formed-data.ttl create mode 100644 test/data/data-shapes/core/property/datatype-ill-formed-shapes.ttl create mode 100644 test/data/data-shapes/core/property/datatype-ill-formed.ttl create mode 100644 test/data/data-shapes/core/property/disjoint-001.ttl create mode 100644 test/data/data-shapes/core/property/equals-001.ttl create mode 100644 test/data/data-shapes/core/property/hasValue-001.ttl create mode 100644 test/data/data-shapes/core/property/in-001.ttl create mode 100644 test/data/data-shapes/core/property/languageIn-001.ttl create mode 100644 test/data/data-shapes/core/property/lessThan-001.ttl create mode 100644 test/data/data-shapes/core/property/lessThan-002.ttl create mode 100644 test/data/data-shapes/core/property/lessThanOrEquals-001.ttl create mode 100644 test/data/data-shapes/core/property/manifest.ttl create mode 100644 test/data/data-shapes/core/property/maxCount-001.ttl create mode 100644 test/data/data-shapes/core/property/maxCount-002.ttl create mode 100644 test/data/data-shapes/core/property/maxExclusive-001.ttl create mode 100644 test/data/data-shapes/core/property/maxInclusive-001.ttl create mode 100644 test/data/data-shapes/core/property/maxLength-001.ttl create mode 100644 test/data/data-shapes/core/property/minCount-001.ttl create mode 100644 test/data/data-shapes/core/property/minCount-002.ttl create mode 100644 test/data/data-shapes/core/property/minExclusive-001.ttl create mode 100644 test/data/data-shapes/core/property/minExclusive-002.ttl create mode 100644 test/data/data-shapes/core/property/minLength-001.ttl create mode 100644 test/data/data-shapes/core/property/node-001.ttl create mode 100644 test/data/data-shapes/core/property/node-002.ttl create mode 100644 test/data/data-shapes/core/property/nodeKind-001.ttl create mode 100644 test/data/data-shapes/core/property/not-001.ttl create mode 100644 test/data/data-shapes/core/property/or-001.ttl create mode 100644 test/data/data-shapes/core/property/or-datatypes-001.ttl create mode 100644 test/data/data-shapes/core/property/pattern-001.ttl create mode 100644 test/data/data-shapes/core/property/pattern-002.ttl create mode 100644 test/data/data-shapes/core/property/property-001.ttl create mode 100644 test/data/data-shapes/core/property/qualifiedMinCountDisjoint-001.ttl create mode 100644 test/data/data-shapes/core/property/qualifiedValueShape-001.ttl create mode 100644 test/data/data-shapes/core/property/qualifiedValueShapesDisjoint-001.ttl create mode 100644 test/data/data-shapes/core/property/uniqueLang-001.ttl create mode 100644 test/data/data-shapes/core/property/uniqueLang-002-data.ttl create mode 100644 test/data/data-shapes/core/property/uniqueLang-002-shapes.ttl create mode 100644 test/data/data-shapes/core/property/uniqueLang-002.ttl create mode 100644 test/data/data-shapes/core/targets/manifest.ttl create mode 100644 test/data/data-shapes/core/targets/multipleTargets-001.ttl create mode 100644 test/data/data-shapes/core/targets/targetClass-001.ttl create mode 100644 test/data/data-shapes/core/targets/targetClassImplicit-001.ttl create mode 100644 test/data/data-shapes/core/targets/targetNode-001.ttl create mode 100644 test/data/data-shapes/core/targets/targetObjectsOf-001.ttl create mode 100644 test/data/data-shapes/core/targets/targetSubjectsOf-001.ttl create mode 100644 test/data/data-shapes/core/targets/targetSubjectsOf-002.ttl create mode 100644 test/data/data-shapes/core/validation-reports/manifest.ttl create mode 100644 test/data/data-shapes/core/validation-reports/shared-data.ttl create mode 100644 test/data/data-shapes/core/validation-reports/shared-shapes.ttl create mode 100644 test/data/data-shapes/core/validation-reports/shared.ttl create mode 100644 test/data/data-shapes/manifest.ttl create mode 100644 test/data/data-shapes/sparql/component/manifest.ttl create mode 100644 test/data/data-shapes/sparql/component/nodeValidator-001.ttl create mode 100644 test/data/data-shapes/sparql/component/optional-001.ttl create mode 100644 test/data/data-shapes/sparql/component/propertyValidator-select-001.ttl create mode 100644 test/data/data-shapes/sparql/component/validator-001.ttl create mode 100644 test/data/data-shapes/sparql/manifest.ttl create mode 100644 test/data/data-shapes/sparql/node/manifest.ttl create mode 100644 test/data/data-shapes/sparql/node/prefixes-001.ttl create mode 100644 test/data/data-shapes/sparql/node/sparql-001.ttl create mode 100644 test/data/data-shapes/sparql/node/sparql-002.ttl create mode 100644 test/data/data-shapes/sparql/node/sparql-003.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/manifest.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/pre-binding-001.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/pre-binding-002.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/pre-binding-003.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/pre-binding-004.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/pre-binding-005.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/pre-binding-006.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/pre-binding-007.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/shapesGraph-001.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/unsupported-sparql-001.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/unsupported-sparql-002.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/unsupported-sparql-003.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/unsupported-sparql-004.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/unsupported-sparql-005.ttl create mode 100644 test/data/data-shapes/sparql/pre-binding/unsupported-sparql-006.ttl create mode 100644 test/data/data-shapes/sparql/property/manifest.ttl create mode 100644 test/data/data-shapes/sparql/property/sparql-001.ttl create mode 100644 test/official_tests.js create mode 100644 test/utils.js diff --git a/package-lock.json b/package-lock.json index d266ae5..794f380 100644 --- a/package-lock.json +++ b/package-lock.json @@ -307,20 +307,6 @@ "@rdfjs/data-model": "^1.1.1" } }, - "@rdfjs/formats-common": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@rdfjs/formats-common/-/formats-common-2.1.0.tgz", - "integrity": "sha512-DVsQsMwSf+bNelIocDe35Wq/POkC+puXYd0BRwP76A3tzYKjIHwBHQFfq7wXMUaBe3jQq80x4DaFpxPaI7sPKA==", - "dev": true, - "requires": { - "@rdfjs/parser-jsonld": "^1.1.1", - "@rdfjs/parser-n3": "^1.1.2", - "@rdfjs/serializer-jsonld": "^1.2.0", - "@rdfjs/serializer-ntriples": "^1.0.1", - "@rdfjs/sink-map": "^1.0.0", - "rdfxml-streaming-parser": "^1.2.0" - } - }, "@rdfjs/namespace": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rdfjs/namespace/-/namespace-1.1.0.tgz", @@ -329,94 +315,6 @@ "@rdfjs/data-model": "^1.1.0" } }, - "@rdfjs/parser-jsonld": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@rdfjs/parser-jsonld/-/parser-jsonld-1.2.0.tgz", - "integrity": "sha512-jn5QWljPdwKhNK4+Y+jjthtBcnt0q0ldB397KmXGR1u8d1Kvn8hYiiRrwypzgQuxaNFPwuOUuBK9xx3N/kWInA==", - "dev": true, - "requires": { - "@rdfjs/data-model": "^1.0.1", - "@rdfjs/sink": "^1.0.2", - "concat-stream": "^1.6.2", - "jsonld": "^1.8.1", - "readable-stream": "^2.3.6" - }, - "dependencies": { - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "jsonld": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/jsonld/-/jsonld-1.8.1.tgz", - "integrity": "sha512-f0rusl5v8aPKS3jApT5fhYsdTC/JpyK1PoJ+ZtYYtZXoyb1J0Z///mJqLwrfL/g4NueFSqPymDYIi1CcSk7b8Q==", - "dev": true, - "requires": { - "canonicalize": "^1.0.1", - "rdf-canonize": "^1.0.2", - "request": "^2.88.0", - "semver": "^5.6.0", - "xmldom": "0.1.19" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "xmldom": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.19.tgz", - "integrity": "sha1-Yx/Ad3bv2EEYvyUXGzftTQdaCrw=", - "dev": true - } - } - }, "@rdfjs/parser-n3": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/@rdfjs/parser-n3/-/parser-n3-1.1.4.tgz", @@ -430,115 +328,12 @@ "readable-to-readable": "^0.1.0" } }, - "@rdfjs/serializer-jsonld": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@rdfjs/serializer-jsonld/-/serializer-jsonld-1.2.1.tgz", - "integrity": "sha512-QGNpSEGNF+MzCqK6nCCfLgdaTFGIZceLPPg5dodJuDK4NeO0N6rpC8YGrrq0j1xR55A4+5IrEbHEu5LMdF5ZWQ==", - "dev": true, - "requires": { - "@rdfjs/sink": "^1.0.2", - "readable-stream": "^2.3.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "@rdfjs/serializer-ntriples": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@rdfjs/serializer-ntriples/-/serializer-ntriples-1.0.2.tgz", - "integrity": "sha512-5pIYhbkz5SIy7B2fkXHGAsC92VP8GPsf7aJ6UNA7OdabggVbOibPWJ9zTetxvxM7bQRez6FsvC7lPnTbZt4I4A==", - "dev": true, - "requires": { - "@rdfjs/sink": "^1.0.2", - "@rdfjs/to-ntriples": "^1.0.0", - "readable-stream": "^2.3.6" - }, - "dependencies": { - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "@rdfjs/sink": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@rdfjs/sink/-/sink-1.0.3.tgz", "integrity": "sha512-2KfYa8mAnptRNeogxhQqkWNXqfYVWO04jQThtXKepySrIwYmz83+WlevQtA4VDLFe+kFd2TwgL29ekPe5XVUfA==", "dev": true }, - "@rdfjs/sink-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@rdfjs/sink-map/-/sink-map-1.0.1.tgz", - "integrity": "sha512-PRp5TjULHe2oRcupR80SClZ/l50wnSuX2Pl+TlkcRazt1w7AT86kLmQYFbDfjqGM7uDwSyD6evLJxXBDf5UuvQ==", - "dev": true - }, "@rdfjs/term-set": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@rdfjs/term-set/-/term-set-1.0.1.tgz", @@ -719,60 +514,18 @@ "is-string": "^1.0.5" } }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", - "dev": true - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, "binary-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", @@ -804,12 +557,6 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, "caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", @@ -834,18 +581,6 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, - "canonicalize": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/canonicalize/-/canonicalize-1.0.1.tgz", - "integrity": "sha512-N3cmB3QLhS5TJ5smKFf1w42rJXWe6C1qP01z4dxJiI5v269buii4fLHWETDyf7yEd0azGLNC63VxNMiPd2u0Cg==", - "dev": true - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -974,15 +709,6 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, "commander": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-5.0.0.tgz", @@ -1024,12 +750,6 @@ } } }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -1043,15 +763,6 @@ "which": "^1.2.9" } }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -1127,12 +838,6 @@ } } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -1148,16 +853,6 @@ "esutils": "^2.0.2" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -1567,12 +1262,6 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -1584,12 +1273,6 @@ "tmp": "^0.0.33" } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, "fast-deep-equal": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", @@ -1785,23 +1468,6 @@ } } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "fromentries": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.0.tgz", @@ -1860,15 +1526,6 @@ "pump": "^3.0.0" } }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -1913,22 +1570,6 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "dev": true, - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1978,17 +1619,6 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -2273,12 +1903,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, "istanbul-lib-coverage": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", @@ -2457,12 +2081,6 @@ "esprima": "^4.0.0" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -2475,12 +2093,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -2493,12 +2105,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, "json5": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", @@ -2508,18 +2114,6 @@ "minimist": "^1.2.5" } }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "jsx-ast-utils": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.2.3.tgz", @@ -2609,21 +2203,6 @@ } } }, - "mime-db": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", - "dev": true - }, - "mime-types": { - "version": "2.1.26", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", - "dev": true, - "requires": { - "mime-db": "1.43.0" - } - }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -2743,12 +2322,6 @@ "semver": "^5.7.0" } }, - "node-forge": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.1.tgz", - "integrity": "sha512-G6RlQt5Sb4GMBzXvhfkeFmbqR6MzhtnT7VTHuLadjkii3rdYHNdw0m8zA4BTxVIh68FicCQ2NSUANpsqkr9jvQ==", - "dev": true - }, "node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", @@ -2989,12 +2562,6 @@ } } }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3205,12 +2772,6 @@ "pify": "^2.0.0" } }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -3341,12 +2902,6 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, "process-on-spawn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", @@ -3373,12 +2928,6 @@ "react-is": "^16.8.1" } }, - "psl": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz", - "integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==", - "dev": true - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -3417,30 +2966,6 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true - }, - "rdf-canonize": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/rdf-canonize/-/rdf-canonize-1.1.0.tgz", - "integrity": "sha512-DV06OnhVfl2zcZJQCt+YvU+hoZVgpyQpNFLeAmghq8RJybUxD3B4LRzlBquYS5k+LLd8/c3g5Gnhkqjw5qRMvg==", - "dev": true, - "requires": { - "node-forge": "^0.9.1", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true - } - } - }, "rdf-dataset-indexed": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/rdf-dataset-indexed/-/rdf-dataset-indexed-0.4.0.tgz", @@ -3469,37 +2994,11 @@ "integrity": "sha1-U0lrrzYszp2fyh8iFsbDAAf5nMo=", "dev": true }, - "rdf-utils-fs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/rdf-utils-fs/-/rdf-utils-fs-2.1.0.tgz", - "integrity": "sha512-833CqAJYYixWe6s5D+bHbiUPxb+lqk+aRmYVND2PVa0b6vKqme/g87xA5n5tZLORNBwrVhmR1sDfxbvFezYnDA==", - "dev": true, - "requires": { - "@rdfjs/formats-common": "^2.0.1", - "readable-stream": "^3.4.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - } - } + "rdf-utils-dataset": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/rdf-utils-dataset/-/rdf-utils-dataset-1.1.0.tgz", + "integrity": "sha512-YvM9n5ltw5DQGVOwCs+ObH3r4dSw5ujLSMgt/igDsIdrIn6cEf82xpuhm1hIljfFlz1x3678zN7pGTDfwm2q6Q==", + "dev": true }, "rdf-validate-datatype": { "version": "0.1.1", @@ -3510,17 +3009,6 @@ "@tpluscode/rdf-ns-builders": "0.1.0" } }, - "rdfxml-streaming-parser": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/rdfxml-streaming-parser/-/rdfxml-streaming-parser-1.3.4.tgz", - "integrity": "sha512-8Y+rXEAB0GEbmm4vMbAeBSfMjd7dmQao0jgT12MH+VOnOrKK+WitvsWB5jf/coQq+NsOOLDmKBm0ODoBq8SK+g==", - "dev": true, - "requires": { - "@rdfjs/data-model": "^1.1.2", - "relative-to-absolute-iri": "^1.0.0", - "sax": "^1.2.4" - } - }, "react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -3628,12 +3116,6 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, - "relative-to-absolute-iri": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/relative-to-absolute-iri/-/relative-to-absolute-iri-1.0.5.tgz", - "integrity": "sha512-sHpUlpF3fRWtTcBa8uBIwQ+Z/YnjDjerocV3q0FrP8T9oZ3z6d61I12ZcGlGr9jW2cQbcCkErCT9XLcN18ZLaQ==", - "dev": true - }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -3643,34 +3125,6 @@ "es6-error": "^4.0.1" } }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3753,12 +3207,6 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -3881,23 +3329,6 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "standard": { "version": "14.3.3", "resolved": "https://registry.npmjs.org/standard/-/standard-14.3.3.tgz", @@ -4108,37 +3539,12 @@ "is-number": "^7.0.0" } }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, "tslib": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", "dev": true }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true - }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -4154,12 +3560,6 @@ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -4212,17 +3612,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/package.json b/package.json index 2910003..3ae3356 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "mocha": "^7.1.1", "nyc": "^15.0.1", "rdf-ext": "^1.3.0", - "rdf-utils-fs": "^2.1.0", + "rdf-utils-dataset": "1.1.0", "standard": "^14.3.3" }, "files": [ diff --git a/test/configuration_tests.js b/test/configuration_tests.js index 7b292f3..94e7ece 100644 --- a/test/configuration_tests.js +++ b/test/configuration_tests.js @@ -1,14 +1,13 @@ /* eslint-env mocha */ const assert = require('assert') const path = require('path') -const rdf = require('rdf-ext') -const rdfFS = require('rdf-utils-fs') const SHACLValidator = require('../index') +const { loadDataset } = require('./utils') describe('configuration', () => { it('stops after `maxErrors` is reached', async () => { const dataFile = path.join(__dirname, '/data/core/property/class-001.test.ttl') - const data = await rdf.dataset().import(rdfFS.fromFile(dataFile)) + const data = await loadDataset(dataFile) const shapes = data const validator1 = new SHACLValidator(shapes) diff --git a/test/data/data-shapes/core/complex/manifest.ttl b/test/data/data-shapes/core/complex/manifest.ttl new file mode 100644 index 0000000..6e921e5 --- /dev/null +++ b/test/data/data-shapes/core/complex/manifest.ttl @@ -0,0 +1,10 @@ +@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/test/data/data-shapes/core/complex/personexample.ttl b/test/data/data-shapes/core/complex/personexample.ttl new file mode 100644 index 0000000..5794d7e --- /dev/null +++ b/test/data/data-shapes/core/complex/personexample.ttl @@ -0,0 +1,105 @@ +@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 _:b61064 ; + sh:property _:b60054 ; + sh:property [ + sh:path [ + sh:inversePath ex:worksFor ; + ] ; + sh:name "employee" ; + ] ; + sh:targetClass ex:Person ; +. +_:b61064 + sh:path ex:ssn ; + sh:datatype xsd:string ; + sh:maxCount 1 ; + sh:pattern "^\\d{3}-\\d{2}-\\d{4}$" +. +_:b60054 + sh:path ex:worksFor ; + sh:class ex:Company ; + sh:nodeKind sh:IRI +. +<> + 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 _:b60054 ; + sh:value ex:UntypedCompany ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/test/data/data-shapes/core/complex/shacl-shacl-data-shapes.ttl b/test/data/data-shapes/core/complex/shacl-shacl-data-shapes.ttl new file mode 100644 index 0000000..c6b751a --- /dev/null +++ b/test/data/data-shapes/core/complex/shacl-shacl-data-shapes.ttl @@ -0,0 +1,410 @@ +# 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/test/data/data-shapes/core/complex/shacl-shacl.ttl b/test/data/data-shapes/core/complex/shacl-shacl.ttl new file mode 100644 index 0000000..8890714 --- /dev/null +++ b/test/data/data-shapes/core/complex/shacl-shacl.ttl @@ -0,0 +1,19 @@ +@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/test/data/data-shapes/core/manifest.ttl b/test/data/data-shapes/core/manifest.ttl new file mode 100644 index 0000000..ffd61b6 --- /dev/null +++ b/test/data/data-shapes/core/manifest.ttl @@ -0,0 +1,14 @@ +@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/test/data/data-shapes/core/misc/deactivated-001.ttl b/test/data/data-shapes/core/misc/deactivated-001.ttl new file mode 100644 index 0000000..809acde --- /dev/null +++ b/test/data/data-shapes/core/misc/deactivated-001.ttl @@ -0,0 +1,44 @@ +@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/test/data/data-shapes/core/misc/deactivated-002.ttl b/test/data/data-shapes/core/misc/deactivated-002.ttl new file mode 100644 index 0000000..0498150 --- /dev/null +++ b/test/data/data-shapes/core/misc/deactivated-002.ttl @@ -0,0 +1,43 @@ +@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/test/data/data-shapes/core/misc/manifest.ttl b/test/data/data-shapes/core/misc/manifest.ttl new file mode 100644 index 0000000..fffc439 --- /dev/null +++ b/test/data/data-shapes/core/misc/manifest.ttl @@ -0,0 +1,13 @@ +@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/test/data/data-shapes/core/misc/message-001.ttl b/test/data/data-shapes/core/misc/message-001.ttl new file mode 100644 index 0000000..2d3fb13 --- /dev/null +++ b/test/data/data-shapes/core/misc/message-001.ttl @@ -0,0 +1,48 @@ +@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/test/data/data-shapes/core/misc/severity-001.ttl b/test/data/data-shapes/core/misc/severity-001.ttl new file mode 100644 index 0000000..5b3e6b8 --- /dev/null +++ b/test/data/data-shapes/core/misc/severity-001.ttl @@ -0,0 +1,43 @@ +@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/test/data/data-shapes/core/misc/severity-002.ttl b/test/data/data-shapes/core/misc/severity-002.ttl new file mode 100644 index 0000000..87b2aed --- /dev/null +++ b/test/data/data-shapes/core/misc/severity-002.ttl @@ -0,0 +1,60 @@ +@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/test/data/data-shapes/core/node/and-001.ttl b/test/data/data-shapes/core/node/and-001.ttl new file mode 100644 index 0000000..d0d8676 --- /dev/null +++ b/test/data/data-shapes/core/node/and-001.ttl @@ -0,0 +1,77 @@ +@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/test/data/data-shapes/core/node/and-002.ttl b/test/data/data-shapes/core/node/and-002.ttl new file mode 100644 index 0000000..f4b018d --- /dev/null +++ b/test/data/data-shapes/core/node/and-002.ttl @@ -0,0 +1,74 @@ +@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/test/data/data-shapes/core/node/class-001.ttl b/test/data/data-shapes/core/node/class-001.ttl new file mode 100644 index 0000000..ab97977 --- /dev/null +++ b/test/data/data-shapes/core/node/class-001.ttl @@ -0,0 +1,70 @@ +@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/test/data/data-shapes/core/node/class-002.ttl b/test/data/data-shapes/core/node/class-002.ttl new file mode 100644 index 0000000..71ed5e0 --- /dev/null +++ b/test/data/data-shapes/core/node/class-002.ttl @@ -0,0 +1,62 @@ +@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/test/data/data-shapes/core/node/class-003.ttl b/test/data/data-shapes/core/node/class-003.ttl new file mode 100644 index 0000000..16b37be --- /dev/null +++ b/test/data/data-shapes/core/node/class-003.ttl @@ -0,0 +1,105 @@ +@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/test/data/data-shapes/core/node/closed-001.ttl b/test/data/data-shapes/core/node/closed-001.ttl new file mode 100644 index 0000000..6bae9de --- /dev/null +++ b/test/data/data-shapes/core/node/closed-001.ttl @@ -0,0 +1,64 @@ +@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/test/data/data-shapes/core/node/closed-002.ttl b/test/data/data-shapes/core/node/closed-002.ttl new file mode 100644 index 0000000..d72eebb --- /dev/null +++ b/test/data/data-shapes/core/node/closed-002.ttl @@ -0,0 +1,58 @@ +@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/test/data/data-shapes/core/node/datatype-001.ttl b/test/data/data-shapes/core/node/datatype-001.ttl new file mode 100644 index 0000000..427572d --- /dev/null +++ b/test/data/data-shapes/core/node/datatype-001.ttl @@ -0,0 +1,64 @@ +@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/test/data/data-shapes/core/node/datatype-002.ttl b/test/data/data-shapes/core/node/datatype-002.ttl new file mode 100644 index 0000000..6e9e012 --- /dev/null +++ b/test/data/data-shapes/core/node/datatype-002.ttl @@ -0,0 +1,53 @@ +@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/test/data/data-shapes/core/node/disjoint-001.ttl b/test/data/data-shapes/core/node/disjoint-001.ttl new file mode 100644 index 0000000..d98158a --- /dev/null +++ b/test/data/data-shapes/core/node/disjoint-001.ttl @@ -0,0 +1,51 @@ +@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/test/data/data-shapes/core/node/equals-001.ttl b/test/data/data-shapes/core/node/equals-001.ttl new file mode 100644 index 0000000..8f23966 --- /dev/null +++ b/test/data/data-shapes/core/node/equals-001.ttl @@ -0,0 +1,59 @@ +@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/test/data/data-shapes/core/node/hasValue-001.ttl b/test/data/data-shapes/core/node/hasValue-001.ttl new file mode 100644 index 0000000..0a9945a --- /dev/null +++ b/test/data/data-shapes/core/node/hasValue-001.ttl @@ -0,0 +1,44 @@ +@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 ; + # See See https://github.com/w3c/data-shapes/issues/111: don't create sh:value "Invalid String" ; + ] ; + ] ; + mf:status sht:approved ; +. diff --git a/test/data/data-shapes/core/node/in-001.ttl b/test/data/data-shapes/core/node/in-001.ttl new file mode 100644 index 0000000..8fb4c08 --- /dev/null +++ b/test/data/data-shapes/core/node/in-001.ttl @@ -0,0 +1,63 @@ +@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/test/data/data-shapes/core/node/languageIn-001.ttl b/test/data/data-shapes/core/node/languageIn-001.ttl new file mode 100644 index 0000000..b8365d2 --- /dev/null +++ b/test/data/data-shapes/core/node/languageIn-001.ttl @@ -0,0 +1,66 @@ +@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/test/data/data-shapes/core/node/manifest.ttl b/test/data/data-shapes/core/node/manifest.ttl new file mode 100644 index 0000000..50fd316 --- /dev/null +++ b/test/data/data-shapes/core/node/manifest.ttl @@ -0,0 +1,40 @@ +@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/test/data/data-shapes/core/node/maxExclusive-001.ttl b/test/data/data-shapes/core/node/maxExclusive-001.ttl new file mode 100644 index 0000000..7c2b177 --- /dev/null +++ b/test/data/data-shapes/core/node/maxExclusive-001.ttl @@ -0,0 +1,91 @@ +@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/test/data/data-shapes/core/node/maxInclusive-001.ttl b/test/data/data-shapes/core/node/maxInclusive-001.ttl new file mode 100644 index 0000000..f30c942 --- /dev/null +++ b/test/data/data-shapes/core/node/maxInclusive-001.ttl @@ -0,0 +1,75 @@ +@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/test/data/data-shapes/core/node/maxLength-001.ttl b/test/data/data-shapes/core/node/maxLength-001.ttl new file mode 100644 index 0000000..bd197e2 --- /dev/null +++ b/test/data/data-shapes/core/node/maxLength-001.ttl @@ -0,0 +1,87 @@ +@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/test/data/data-shapes/core/node/minExclusive-001.ttl b/test/data/data-shapes/core/node/minExclusive-001.ttl new file mode 100644 index 0000000..7219150 --- /dev/null +++ b/test/data/data-shapes/core/node/minExclusive-001.ttl @@ -0,0 +1,91 @@ +@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/test/data/data-shapes/core/node/minInclusive-001.ttl b/test/data/data-shapes/core/node/minInclusive-001.ttl new file mode 100644 index 0000000..e2113bf --- /dev/null +++ b/test/data/data-shapes/core/node/minInclusive-001.ttl @@ -0,0 +1,44 @@ +@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/test/data/data-shapes/core/node/minInclusive-002.ttl b/test/data/data-shapes/core/node/minInclusive-002.ttl new file mode 100644 index 0000000..e9a8d5e --- /dev/null +++ b/test/data/data-shapes/core/node/minInclusive-002.ttl @@ -0,0 +1,61 @@ +@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/test/data/data-shapes/core/node/minInclusive-003.ttl b/test/data/data-shapes/core/node/minInclusive-003.ttl new file mode 100644 index 0000000..306ca78 --- /dev/null +++ b/test/data/data-shapes/core/node/minInclusive-003.ttl @@ -0,0 +1,70 @@ +@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/test/data/data-shapes/core/node/minLength-001.ttl b/test/data/data-shapes/core/node/minLength-001.ttl new file mode 100644 index 0000000..75151fe --- /dev/null +++ b/test/data/data-shapes/core/node/minLength-001.ttl @@ -0,0 +1,79 @@ +@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/test/data/data-shapes/core/node/node-001.ttl b/test/data/data-shapes/core/node/node-001.ttl new file mode 100644 index 0000000..b6d7170 --- /dev/null +++ b/test/data/data-shapes/core/node/node-001.ttl @@ -0,0 +1,55 @@ +@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/test/data/data-shapes/core/node/nodeKind-001.ttl b/test/data/data-shapes/core/node/nodeKind-001.ttl new file mode 100644 index 0000000..004f8fa --- /dev/null +++ b/test/data/data-shapes/core/node/nodeKind-001.ttl @@ -0,0 +1,43 @@ +@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/test/data/data-shapes/core/node/not-001.ttl b/test/data/data-shapes/core/node/not-001.ttl new file mode 100644 index 0000000..588436c --- /dev/null +++ b/test/data/data-shapes/core/node/not-001.ttl @@ -0,0 +1,59 @@ +@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/test/data/data-shapes/core/node/not-002.ttl b/test/data/data-shapes/core/node/not-002.ttl new file mode 100644 index 0000000..cf43632 --- /dev/null +++ b/test/data/data-shapes/core/node/not-002.ttl @@ -0,0 +1,52 @@ +@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/test/data/data-shapes/core/node/or-001.ttl b/test/data/data-shapes/core/node/or-001.ttl new file mode 100644 index 0000000..455c8c6 --- /dev/null +++ b/test/data/data-shapes/core/node/or-001.ttl @@ -0,0 +1,91 @@ +@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/test/data/data-shapes/core/node/pattern-001.ttl b/test/data/data-shapes/core/node/pattern-001.ttl new file mode 100644 index 0000000..31d77ef --- /dev/null +++ b/test/data/data-shapes/core/node/pattern-001.ttl @@ -0,0 +1,76 @@ +@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/test/data/data-shapes/core/node/pattern-002.ttl b/test/data/data-shapes/core/node/pattern-002.ttl new file mode 100644 index 0000000..fadc4d9 --- /dev/null +++ b/test/data/data-shapes/core/node/pattern-002.ttl @@ -0,0 +1,45 @@ +@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/test/data/data-shapes/core/node/qualified-001-data.ttl b/test/data/data-shapes/core/node/qualified-001-data.ttl new file mode 100644 index 0000000..e495305 --- /dev/null +++ b/test/data/data-shapes/core/node/qualified-001-data.ttl @@ -0,0 +1,4 @@ +@prefix ex: . + +ex:i a ex:C1 . +ex:j a ex:C1 , ex:C2 . diff --git a/test/data/data-shapes/core/node/qualified-001-shapes.ttl b/test/data/data-shapes/core/node/qualified-001-shapes.ttl new file mode 100644 index 0000000..f430a7e --- /dev/null +++ b/test/data/data-shapes/core/node/qualified-001-shapes.ttl @@ -0,0 +1,10 @@ +@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/test/data/data-shapes/core/node/qualified-001.ttl b/test/data/data-shapes/core/node/qualified-001.ttl new file mode 100644 index 0000000..6a89c09 --- /dev/null +++ b/test/data/data-shapes/core/node/qualified-001.ttl @@ -0,0 +1,28 @@ +@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/test/data/data-shapes/core/node/xone-001.ttl b/test/data/data-shapes/core/node/xone-001.ttl new file mode 100644 index 0000000..79011d8 --- /dev/null +++ b/test/data/data-shapes/core/node/xone-001.ttl @@ -0,0 +1,74 @@ +@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/test/data/data-shapes/core/node/xone-duplicate-data.ttl b/test/data/data-shapes/core/node/xone-duplicate-data.ttl new file mode 100644 index 0000000..e495305 --- /dev/null +++ b/test/data/data-shapes/core/node/xone-duplicate-data.ttl @@ -0,0 +1,4 @@ +@prefix ex: . + +ex:i a ex:C1 . +ex:j a ex:C1 , ex:C2 . diff --git a/test/data/data-shapes/core/node/xone-duplicate-shapes.ttl b/test/data/data-shapes/core/node/xone-duplicate-shapes.ttl new file mode 100644 index 0000000..eecb657 --- /dev/null +++ b/test/data/data-shapes/core/node/xone-duplicate-shapes.ttl @@ -0,0 +1,7 @@ +@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/test/data/data-shapes/core/node/xone-duplicate.ttl b/test/data/data-shapes/core/node/xone-duplicate.ttl new file mode 100644 index 0000000..0999905 --- /dev/null +++ b/test/data/data-shapes/core/node/xone-duplicate.ttl @@ -0,0 +1,34 @@ +@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/test/data/data-shapes/core/path/manifest.ttl b/test/data/data-shapes/core/path/manifest.ttl new file mode 100644 index 0000000..3c355e8 --- /dev/null +++ b/test/data/data-shapes/core/path/manifest.ttl @@ -0,0 +1,21 @@ +@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/test/data/data-shapes/core/path/path-alternative-001.ttl b/test/data/data-shapes/core/path/path-alternative-001.ttl new file mode 100644 index 0000000..ea26764 --- /dev/null +++ b/test/data/data-shapes/core/path/path-alternative-001.ttl @@ -0,0 +1,86 @@ +@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/test/data/data-shapes/core/path/path-complex-001.ttl b/test/data/data-shapes/core/path/path-complex-001.ttl new file mode 100644 index 0000000..c5e2073 --- /dev/null +++ b/test/data/data-shapes/core/path/path-complex-001.ttl @@ -0,0 +1,91 @@ +@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/test/data/data-shapes/core/path/path-complex-002-data.ttl b/test/data/data-shapes/core/path/path-complex-002-data.ttl new file mode 100644 index 0000000..fdec8c7 --- /dev/null +++ b/test/data/data-shapes/core/path/path-complex-002-data.ttl @@ -0,0 +1,7 @@ +@prefix ex: . + +ex:j ex:p ex:i . + +ex:k ex:p ex:j . + +ex:l ex:p ex:j . diff --git a/test/data/data-shapes/core/path/path-complex-002-shapes.ttl b/test/data/data-shapes/core/path/path-complex-002-shapes.ttl new file mode 100644 index 0000000..f9e8a73 --- /dev/null +++ b/test/data/data-shapes/core/path/path-complex-002-shapes.ttl @@ -0,0 +1,14 @@ +@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/test/data/data-shapes/core/path/path-complex-002.ttl b/test/data/data-shapes/core/path/path-complex-002.ttl new file mode 100644 index 0000000..fdfcfe5 --- /dev/null +++ b/test/data/data-shapes/core/path/path-complex-002.ttl @@ -0,0 +1,51 @@ +@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/test/data/data-shapes/core/path/path-inverse-001.ttl b/test/data/data-shapes/core/path/path-inverse-001.ttl new file mode 100644 index 0000000..a4c4ac4 --- /dev/null +++ b/test/data/data-shapes/core/path/path-inverse-001.ttl @@ -0,0 +1,90 @@ +@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/test/data/data-shapes/core/path/path-oneOrMore-001.ttl b/test/data/data-shapes/core/path/path-oneOrMore-001.ttl new file mode 100644 index 0000000..97d4e03 --- /dev/null +++ b/test/data/data-shapes/core/path/path-oneOrMore-001.ttl @@ -0,0 +1,71 @@ +@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/test/data/data-shapes/core/path/path-sequence-001.ttl b/test/data/data-shapes/core/path/path-sequence-001.ttl new file mode 100644 index 0000000..65ec529 --- /dev/null +++ b/test/data/data-shapes/core/path/path-sequence-001.ttl @@ -0,0 +1,80 @@ +@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/test/data/data-shapes/core/path/path-sequence-002.ttl b/test/data/data-shapes/core/path/path-sequence-002.ttl new file mode 100644 index 0000000..4ae6698 --- /dev/null +++ b/test/data/data-shapes/core/path/path-sequence-002.ttl @@ -0,0 +1,83 @@ +@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/test/data/data-shapes/core/path/path-sequence-duplicate-001.ttl b/test/data/data-shapes/core/path/path-sequence-duplicate-001.ttl new file mode 100644 index 0000000..81264c5 --- /dev/null +++ b/test/data/data-shapes/core/path/path-sequence-duplicate-001.ttl @@ -0,0 +1,63 @@ +@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/test/data/data-shapes/core/path/path-strange-001.ttl b/test/data/data-shapes/core/path/path-strange-001.ttl new file mode 100644 index 0000000..2409cb4 --- /dev/null +++ b/test/data/data-shapes/core/path/path-strange-001.ttl @@ -0,0 +1,52 @@ +@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/test/data/data-shapes/core/path/path-strange-002.ttl b/test/data/data-shapes/core/path/path-strange-002.ttl new file mode 100644 index 0000000..4290f9f --- /dev/null +++ b/test/data/data-shapes/core/path/path-strange-002.ttl @@ -0,0 +1,52 @@ +@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/test/data/data-shapes/core/path/path-unused-001-data.ttl b/test/data/data-shapes/core/path/path-unused-001-data.ttl new file mode 100644 index 0000000..ea38c1b --- /dev/null +++ b/test/data/data-shapes/core/path/path-unused-001-data.ttl @@ -0,0 +1,5 @@ +@prefix ex: . + +ex:i a ex:C . + +ex:j a ex:D . diff --git a/test/data/data-shapes/core/path/path-unused-001-shapes.ttl b/test/data/data-shapes/core/path/path-unused-001-shapes.ttl new file mode 100644 index 0000000..0683887 --- /dev/null +++ b/test/data/data-shapes/core/path/path-unused-001-shapes.ttl @@ -0,0 +1,18 @@ +@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/test/data/data-shapes/core/path/path-unused-001.ttl b/test/data/data-shapes/core/path/path-unused-001.ttl new file mode 100644 index 0000000..4ae2909 --- /dev/null +++ b/test/data/data-shapes/core/path/path-unused-001.ttl @@ -0,0 +1,29 @@ +@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/test/data/data-shapes/core/path/path-zeroOrMore-001.ttl b/test/data/data-shapes/core/path/path-zeroOrMore-001.ttl new file mode 100644 index 0000000..834ab9f --- /dev/null +++ b/test/data/data-shapes/core/path/path-zeroOrMore-001.ttl @@ -0,0 +1,61 @@ +@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/test/data/data-shapes/core/path/path-zeroOrOne-001.ttl b/test/data/data-shapes/core/path/path-zeroOrOne-001.ttl new file mode 100644 index 0000000..2e4e34f --- /dev/null +++ b/test/data/data-shapes/core/path/path-zeroOrOne-001.ttl @@ -0,0 +1,61 @@ +@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/test/data/data-shapes/core/property/and-001.ttl b/test/data/data-shapes/core/property/and-001.ttl new file mode 100644 index 0000000..57eeaf4 --- /dev/null +++ b/test/data/data-shapes/core/property/and-001.ttl @@ -0,0 +1,107 @@ +@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/test/data/data-shapes/core/property/class-001.ttl b/test/data/data-shapes/core/property/class-001.ttl new file mode 100644 index 0000000..2b97bf8 --- /dev/null +++ b/test/data/data-shapes/core/property/class-001.ttl @@ -0,0 +1,91 @@ +@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/test/data/data-shapes/core/property/datatype-001.ttl b/test/data/data-shapes/core/property/datatype-001.ttl new file mode 100644 index 0000000..f1b1b81 --- /dev/null +++ b/test/data/data-shapes/core/property/datatype-001.ttl @@ -0,0 +1,76 @@ +@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/test/data/data-shapes/core/property/datatype-002.ttl b/test/data/data-shapes/core/property/datatype-002.ttl new file mode 100644 index 0000000..fc56377 --- /dev/null +++ b/test/data/data-shapes/core/property/datatype-002.ttl @@ -0,0 +1,71 @@ +@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/test/data/data-shapes/core/property/datatype-003.ttl b/test/data/data-shapes/core/property/datatype-003.ttl new file mode 100644 index 0000000..5296850 --- /dev/null +++ b/test/data/data-shapes/core/property/datatype-003.ttl @@ -0,0 +1,69 @@ +@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/test/data/data-shapes/core/property/datatype-ill-formed-data.ttl b/test/data/data-shapes/core/property/datatype-ill-formed-data.ttl new file mode 100644 index 0000000..e5338af --- /dev/null +++ b/test/data/data-shapes/core/property/datatype-ill-formed-data.ttl @@ -0,0 +1,6 @@ +@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/test/data/data-shapes/core/property/datatype-ill-formed-shapes.ttl b/test/data/data-shapes/core/property/datatype-ill-formed-shapes.ttl new file mode 100644 index 0000000..2036632 --- /dev/null +++ b/test/data/data-shapes/core/property/datatype-ill-formed-shapes.ttl @@ -0,0 +1,8 @@ +@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/test/data/data-shapes/core/property/datatype-ill-formed.ttl b/test/data/data-shapes/core/property/datatype-ill-formed.ttl new file mode 100644 index 0000000..08611e4 --- /dev/null +++ b/test/data/data-shapes/core/property/datatype-ill-formed.ttl @@ -0,0 +1,43 @@ +@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/test/data/data-shapes/core/property/disjoint-001.ttl b/test/data/data-shapes/core/property/disjoint-001.ttl new file mode 100644 index 0000000..8bfc685 --- /dev/null +++ b/test/data/data-shapes/core/property/disjoint-001.ttl @@ -0,0 +1,84 @@ +@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/test/data/data-shapes/core/property/equals-001.ttl b/test/data/data-shapes/core/property/equals-001.ttl new file mode 100644 index 0000000..64024cd --- /dev/null +++ b/test/data/data-shapes/core/property/equals-001.ttl @@ -0,0 +1,119 @@ +@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/test/data/data-shapes/core/property/hasValue-001.ttl b/test/data/data-shapes/core/property/hasValue-001.ttl new file mode 100644 index 0000000..ffaa0eb --- /dev/null +++ b/test/data/data-shapes/core/property/hasValue-001.ttl @@ -0,0 +1,68 @@ +@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/test/data/data-shapes/core/property/in-001.ttl b/test/data/data-shapes/core/property/in-001.ttl new file mode 100644 index 0000000..cfd37cf --- /dev/null +++ b/test/data/data-shapes/core/property/in-001.ttl @@ -0,0 +1,69 @@ +@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/test/data/data-shapes/core/property/languageIn-001.ttl b/test/data/data-shapes/core/property/languageIn-001.ttl new file mode 100644 index 0000000..00e9d98 --- /dev/null +++ b/test/data/data-shapes/core/property/languageIn-001.ttl @@ -0,0 +1,79 @@ +@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/test/data/data-shapes/core/property/lessThan-001.ttl b/test/data/data-shapes/core/property/lessThan-001.ttl new file mode 100644 index 0000000..d76b37d --- /dev/null +++ b/test/data/data-shapes/core/property/lessThan-001.ttl @@ -0,0 +1,96 @@ +@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/test/data/data-shapes/core/property/lessThan-002.ttl b/test/data/data-shapes/core/property/lessThan-002.ttl new file mode 100644 index 0000000..9f352ef --- /dev/null +++ b/test/data/data-shapes/core/property/lessThan-002.ttl @@ -0,0 +1,81 @@ +@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/test/data/data-shapes/core/property/lessThanOrEquals-001.ttl b/test/data/data-shapes/core/property/lessThanOrEquals-001.ttl new file mode 100644 index 0000000..c1ac111 --- /dev/null +++ b/test/data/data-shapes/core/property/lessThanOrEquals-001.ttl @@ -0,0 +1,87 @@ +@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/test/data/data-shapes/core/property/manifest.ttl b/test/data/data-shapes/core/property/manifest.ttl new file mode 100644 index 0000000..034d253 --- /dev/null +++ b/test/data/data-shapes/core/property/manifest.ttl @@ -0,0 +1,46 @@ +@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/test/data/data-shapes/core/property/maxCount-001.ttl b/test/data/data-shapes/core/property/maxCount-001.ttl new file mode 100644 index 0000000..52653de --- /dev/null +++ b/test/data/data-shapes/core/property/maxCount-001.ttl @@ -0,0 +1,64 @@ +@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/test/data/data-shapes/core/property/maxCount-002.ttl b/test/data/data-shapes/core/property/maxCount-002.ttl new file mode 100644 index 0000000..23d82a0 --- /dev/null +++ b/test/data/data-shapes/core/property/maxCount-002.ttl @@ -0,0 +1,57 @@ +@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/test/data/data-shapes/core/property/maxExclusive-001.ttl b/test/data/data-shapes/core/property/maxExclusive-001.ttl new file mode 100644 index 0000000..47566a8 --- /dev/null +++ b/test/data/data-shapes/core/property/maxExclusive-001.ttl @@ -0,0 +1,84 @@ +@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/test/data/data-shapes/core/property/maxInclusive-001.ttl b/test/data/data-shapes/core/property/maxInclusive-001.ttl new file mode 100644 index 0000000..2c5077f --- /dev/null +++ b/test/data/data-shapes/core/property/maxInclusive-001.ttl @@ -0,0 +1,71 @@ +@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/test/data/data-shapes/core/property/maxLength-001.ttl b/test/data/data-shapes/core/property/maxLength-001.ttl new file mode 100644 index 0000000..b6d4b48 --- /dev/null +++ b/test/data/data-shapes/core/property/maxLength-001.ttl @@ -0,0 +1,61 @@ +@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/test/data/data-shapes/core/property/minCount-001.ttl b/test/data/data-shapes/core/property/minCount-001.ttl new file mode 100644 index 0000000..680f9c4 --- /dev/null +++ b/test/data/data-shapes/core/property/minCount-001.ttl @@ -0,0 +1,62 @@ +@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/test/data/data-shapes/core/property/minCount-002.ttl b/test/data/data-shapes/core/property/minCount-002.ttl new file mode 100644 index 0000000..d4b4f13 --- /dev/null +++ b/test/data/data-shapes/core/property/minCount-002.ttl @@ -0,0 +1,41 @@ +@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/test/data/data-shapes/core/property/minExclusive-001.ttl b/test/data/data-shapes/core/property/minExclusive-001.ttl new file mode 100644 index 0000000..8c99b43 --- /dev/null +++ b/test/data/data-shapes/core/property/minExclusive-001.ttl @@ -0,0 +1,69 @@ +@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/test/data/data-shapes/core/property/minExclusive-002.ttl b/test/data/data-shapes/core/property/minExclusive-002.ttl new file mode 100644 index 0000000..2612e16 --- /dev/null +++ b/test/data/data-shapes/core/property/minExclusive-002.ttl @@ -0,0 +1,65 @@ +@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/test/data/data-shapes/core/property/minLength-001.ttl b/test/data/data-shapes/core/property/minLength-001.ttl new file mode 100644 index 0000000..06f286e --- /dev/null +++ b/test/data/data-shapes/core/property/minLength-001.ttl @@ -0,0 +1,61 @@ +@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/test/data/data-shapes/core/property/node-001.ttl b/test/data/data-shapes/core/property/node-001.ttl new file mode 100644 index 0000000..2245930 --- /dev/null +++ b/test/data/data-shapes/core/property/node-001.ttl @@ -0,0 +1,113 @@ +@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/test/data/data-shapes/core/property/node-002.ttl b/test/data/data-shapes/core/property/node-002.ttl new file mode 100644 index 0000000..f028f57 --- /dev/null +++ b/test/data/data-shapes/core/property/node-002.ttl @@ -0,0 +1,75 @@ +@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/test/data/data-shapes/core/property/nodeKind-001.ttl b/test/data/data-shapes/core/property/nodeKind-001.ttl new file mode 100644 index 0000000..d40515d --- /dev/null +++ b/test/data/data-shapes/core/property/nodeKind-001.ttl @@ -0,0 +1,371 @@ +@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/test/data/data-shapes/core/property/not-001.ttl b/test/data/data-shapes/core/property/not-001.ttl new file mode 100644 index 0000000..bad0e6f --- /dev/null +++ b/test/data/data-shapes/core/property/not-001.ttl @@ -0,0 +1,68 @@ +@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/test/data/data-shapes/core/property/or-001.ttl b/test/data/data-shapes/core/property/or-001.ttl new file mode 100644 index 0000000..323ed0f --- /dev/null +++ b/test/data/data-shapes/core/property/or-001.ttl @@ -0,0 +1,76 @@ +@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/test/data/data-shapes/core/property/or-datatypes-001.ttl b/test/data/data-shapes/core/property/or-datatypes-001.ttl new file mode 100644 index 0000000..dc59b42 --- /dev/null +++ b/test/data/data-shapes/core/property/or-datatypes-001.ttl @@ -0,0 +1,95 @@ +@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/test/data/data-shapes/core/property/pattern-001.ttl b/test/data/data-shapes/core/property/pattern-001.ttl new file mode 100644 index 0000000..2c63ad8 --- /dev/null +++ b/test/data/data-shapes/core/property/pattern-001.ttl @@ -0,0 +1,74 @@ +@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/test/data/data-shapes/core/property/pattern-002.ttl b/test/data/data-shapes/core/property/pattern-002.ttl new file mode 100644 index 0000000..498c2a3 --- /dev/null +++ b/test/data/data-shapes/core/property/pattern-002.ttl @@ -0,0 +1,66 @@ +@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/test/data/data-shapes/core/property/property-001.ttl b/test/data/data-shapes/core/property/property-001.ttl new file mode 100644 index 0000000..cd7bfd4 --- /dev/null +++ b/test/data/data-shapes/core/property/property-001.ttl @@ -0,0 +1,100 @@ +@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/test/data/data-shapes/core/property/qualifiedMinCountDisjoint-001.ttl b/test/data/data-shapes/core/property/qualifiedMinCountDisjoint-001.ttl new file mode 100644 index 0000000..00d91c2 --- /dev/null +++ b/test/data/data-shapes/core/property/qualifiedMinCountDisjoint-001.ttl @@ -0,0 +1,116 @@ +@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/test/data/data-shapes/core/property/qualifiedValueShape-001.ttl b/test/data/data-shapes/core/property/qualifiedValueShape-001.ttl new file mode 100644 index 0000000..ead8f71 --- /dev/null +++ b/test/data/data-shapes/core/property/qualifiedValueShape-001.ttl @@ -0,0 +1,80 @@ +@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/test/data/data-shapes/core/property/qualifiedValueShapesDisjoint-001.ttl b/test/data/data-shapes/core/property/qualifiedValueShapesDisjoint-001.ttl new file mode 100644 index 0000000..1cc8cbc --- /dev/null +++ b/test/data/data-shapes/core/property/qualifiedValueShapesDisjoint-001.ttl @@ -0,0 +1,128 @@ +@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/test/data/data-shapes/core/property/uniqueLang-001.ttl b/test/data/data-shapes/core/property/uniqueLang-001.ttl new file mode 100644 index 0000000..ffec0ff --- /dev/null +++ b/test/data/data-shapes/core/property/uniqueLang-001.ttl @@ -0,0 +1,86 @@ +@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/test/data/data-shapes/core/property/uniqueLang-002-data.ttl b/test/data/data-shapes/core/property/uniqueLang-002-data.ttl new file mode 100644 index 0000000..4db2738 --- /dev/null +++ b/test/data/data-shapes/core/property/uniqueLang-002-data.ttl @@ -0,0 +1,3 @@ +@prefix ex: . + +ex:i ex:message "HI"@en, "Hi"@en . diff --git a/test/data/data-shapes/core/property/uniqueLang-002-shapes.ttl b/test/data/data-shapes/core/property/uniqueLang-002-shapes.ttl new file mode 100644 index 0000000..648d482 --- /dev/null +++ b/test/data/data-shapes/core/property/uniqueLang-002-shapes.ttl @@ -0,0 +1,12 @@ +@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/test/data/data-shapes/core/property/uniqueLang-002.ttl b/test/data/data-shapes/core/property/uniqueLang-002.ttl new file mode 100644 index 0000000..c1b1f3b --- /dev/null +++ b/test/data/data-shapes/core/property/uniqueLang-002.ttl @@ -0,0 +1,23 @@ +@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/test/data/data-shapes/core/targets/manifest.ttl b/test/data/data-shapes/core/targets/manifest.ttl new file mode 100644 index 0000000..ee7699b --- /dev/null +++ b/test/data/data-shapes/core/targets/manifest.ttl @@ -0,0 +1,15 @@ +@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/test/data/data-shapes/core/targets/multipleTargets-001.ttl b/test/data/data-shapes/core/targets/multipleTargets-001.ttl new file mode 100644 index 0000000..81a99e8 --- /dev/null +++ b/test/data/data-shapes/core/targets/multipleTargets-001.ttl @@ -0,0 +1,56 @@ +@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/test/data/data-shapes/core/targets/targetClass-001.ttl b/test/data/data-shapes/core/targets/targetClass-001.ttl new file mode 100644 index 0000000..e1d5a55 --- /dev/null +++ b/test/data/data-shapes/core/targets/targetClass-001.ttl @@ -0,0 +1,62 @@ +@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/test/data/data-shapes/core/targets/targetClassImplicit-001.ttl b/test/data/data-shapes/core/targets/targetClassImplicit-001.ttl new file mode 100644 index 0000000..05cafcc --- /dev/null +++ b/test/data/data-shapes/core/targets/targetClassImplicit-001.ttl @@ -0,0 +1,58 @@ +@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/test/data/data-shapes/core/targets/targetNode-001.ttl b/test/data/data-shapes/core/targets/targetNode-001.ttl new file mode 100644 index 0000000..195e3ff --- /dev/null +++ b/test/data/data-shapes/core/targets/targetNode-001.ttl @@ -0,0 +1,57 @@ +@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/test/data/data-shapes/core/targets/targetObjectsOf-001.ttl b/test/data/data-shapes/core/targets/targetObjectsOf-001.ttl new file mode 100644 index 0000000..09eeea6 --- /dev/null +++ b/test/data/data-shapes/core/targets/targetObjectsOf-001.ttl @@ -0,0 +1,65 @@ +@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/test/data/data-shapes/core/targets/targetSubjectsOf-001.ttl b/test/data/data-shapes/core/targets/targetSubjectsOf-001.ttl new file mode 100644 index 0000000..9069f17 --- /dev/null +++ b/test/data/data-shapes/core/targets/targetSubjectsOf-001.ttl @@ -0,0 +1,57 @@ +@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/test/data/data-shapes/core/targets/targetSubjectsOf-002.ttl b/test/data/data-shapes/core/targets/targetSubjectsOf-002.ttl new file mode 100644 index 0000000..e4adacd --- /dev/null +++ b/test/data/data-shapes/core/targets/targetSubjectsOf-002.ttl @@ -0,0 +1,74 @@ +@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/test/data/data-shapes/core/validation-reports/manifest.ttl b/test/data/data-shapes/core/validation-reports/manifest.ttl new file mode 100644 index 0000000..b200ca1 --- /dev/null +++ b/test/data/data-shapes/core/validation-reports/manifest.ttl @@ -0,0 +1,9 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Tests for validation reports" ; + mf:include ; +. diff --git a/test/data/data-shapes/core/validation-reports/shared-data.ttl b/test/data/data-shapes/core/validation-reports/shared-data.ttl new file mode 100644 index 0000000..5263a71 --- /dev/null +++ b/test/data/data-shapes/core/validation-reports/shared-data.ttl @@ -0,0 +1,4 @@ +@prefix ex: . +ex:i ex:p ex:j . +ex:i ex:q ex:j . +ex:j ex:r ex:k . diff --git a/test/data/data-shapes/core/validation-reports/shared-shapes.ttl b/test/data/data-shapes/core/validation-reports/shared-shapes.ttl new file mode 100644 index 0000000..26f4b73 --- /dev/null +++ b/test/data/data-shapes/core/validation-reports/shared-shapes.ttl @@ -0,0 +1,16 @@ +@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/test/data/data-shapes/core/validation-reports/shared.ttl b/test/data/data-shapes/core/validation-reports/shared.ttl new file mode 100644 index 0000000..ae4b01c --- /dev/null +++ b/test/data/data-shapes/core/validation-reports/shared.ttl @@ -0,0 +1,52 @@ +@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/test/data/data-shapes/manifest.ttl b/test/data/data-shapes/manifest.ttl new file mode 100644 index 0000000..b44bb0c --- /dev/null +++ b/test/data/data-shapes/manifest.ttl @@ -0,0 +1,9 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + mf:include ; + # mf:include ; + . diff --git a/test/data/data-shapes/sparql/component/manifest.ttl b/test/data/data-shapes/sparql/component/manifest.ttl new file mode 100644 index 0000000..631566a --- /dev/null +++ b/test/data/data-shapes/sparql/component/manifest.ttl @@ -0,0 +1,11 @@ +@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/test/data/data-shapes/sparql/component/nodeValidator-001.ttl b/test/data/data-shapes/sparql/component/nodeValidator-001.ttl new file mode 100644 index 0000000..1bcabc4 --- /dev/null +++ b/test/data/data-shapes/sparql/component/nodeValidator-001.ttl @@ -0,0 +1,83 @@ +@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/test/data/data-shapes/sparql/component/optional-001.ttl b/test/data/data-shapes/sparql/component/optional-001.ttl new file mode 100644 index 0000000..0f3ba1f --- /dev/null +++ b/test/data/data-shapes/sparql/component/optional-001.ttl @@ -0,0 +1,113 @@ +@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/test/data/data-shapes/sparql/component/propertyValidator-select-001.ttl b/test/data/data-shapes/sparql/component/propertyValidator-select-001.ttl new file mode 100644 index 0000000..a501c54 --- /dev/null +++ b/test/data/data-shapes/sparql/component/propertyValidator-select-001.ttl @@ -0,0 +1,107 @@ +@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/test/data/data-shapes/sparql/component/validator-001.ttl b/test/data/data-shapes/sparql/component/validator-001.ttl new file mode 100644 index 0000000..67b9d94 --- /dev/null +++ b/test/data/data-shapes/sparql/component/validator-001.ttl @@ -0,0 +1,81 @@ +@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/test/data/data-shapes/sparql/manifest.ttl b/test/data/data-shapes/sparql/manifest.ttl new file mode 100644 index 0000000..d823c55 --- /dev/null +++ b/test/data/data-shapes/sparql/manifest.ttl @@ -0,0 +1,11 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + mf:include ; + mf:include ; + mf:include ; + mf:include ; + . diff --git a/test/data/data-shapes/sparql/node/manifest.ttl b/test/data/data-shapes/sparql/node/manifest.ttl new file mode 100644 index 0000000..c5f4b86 --- /dev/null +++ b/test/data/data-shapes/sparql/node/manifest.ttl @@ -0,0 +1,12 @@ +@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/test/data/data-shapes/sparql/node/prefixes-001.ttl b/test/data/data-shapes/sparql/node/prefixes-001.ttl new file mode 100644 index 0000000..de29d1f --- /dev/null +++ b/test/data/data-shapes/sparql/node/prefixes-001.ttl @@ -0,0 +1,70 @@ +@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/test/data/data-shapes/sparql/node/sparql-001.ttl b/test/data/data-shapes/sparql/node/sparql-001.ttl new file mode 100644 index 0000000..eae95eb --- /dev/null +++ b/test/data/data-shapes/sparql/node/sparql-001.ttl @@ -0,0 +1,89 @@ +@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/test/data/data-shapes/sparql/node/sparql-002.ttl b/test/data/data-shapes/sparql/node/sparql-002.ttl new file mode 100644 index 0000000..e6dd7c1 --- /dev/null +++ b/test/data/data-shapes/sparql/node/sparql-002.ttl @@ -0,0 +1,69 @@ +@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/test/data/data-shapes/sparql/node/sparql-003.ttl b/test/data/data-shapes/sparql/node/sparql-003.ttl new file mode 100644 index 0000000..2c603e1 --- /dev/null +++ b/test/data/data-shapes/sparql/node/sparql-003.ttl @@ -0,0 +1,70 @@ +@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/test/data/data-shapes/sparql/pre-binding/manifest.ttl b/test/data/data-shapes/sparql/pre-binding/manifest.ttl new file mode 100644 index 0000000..187159a --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/manifest.ttl @@ -0,0 +1,22 @@ +@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/test/data/data-shapes/sparql/pre-binding/pre-binding-001.ttl b/test/data/data-shapes/sparql/pre-binding/pre-binding-001.ttl new file mode 100644 index 0000000..cf90275 --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/pre-binding-001.ttl @@ -0,0 +1,63 @@ +@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/test/data/data-shapes/sparql/pre-binding/pre-binding-002.ttl b/test/data/data-shapes/sparql/pre-binding/pre-binding-002.ttl new file mode 100644 index 0000000..819b681 --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/pre-binding-002.ttl @@ -0,0 +1,67 @@ +@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/test/data/data-shapes/sparql/pre-binding/pre-binding-003.ttl b/test/data/data-shapes/sparql/pre-binding/pre-binding-003.ttl new file mode 100644 index 0000000..2cc510c --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/pre-binding-003.ttl @@ -0,0 +1,67 @@ +@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/test/data/data-shapes/sparql/pre-binding/pre-binding-004.ttl b/test/data/data-shapes/sparql/pre-binding/pre-binding-004.ttl new file mode 100644 index 0000000..e19c2e0 --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/pre-binding-004.ttl @@ -0,0 +1,62 @@ +@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/test/data/data-shapes/sparql/pre-binding/pre-binding-005.ttl b/test/data/data-shapes/sparql/pre-binding/pre-binding-005.ttl new file mode 100644 index 0000000..83790bb --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/pre-binding-005.ttl @@ -0,0 +1,68 @@ +@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/test/data/data-shapes/sparql/pre-binding/pre-binding-006.ttl b/test/data/data-shapes/sparql/pre-binding/pre-binding-006.ttl new file mode 100644 index 0000000..5e8062b --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/pre-binding-006.ttl @@ -0,0 +1,54 @@ +@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/test/data/data-shapes/sparql/pre-binding/pre-binding-007.ttl b/test/data/data-shapes/sparql/pre-binding/pre-binding-007.ttl new file mode 100644 index 0000000..bba550e --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/pre-binding-007.ttl @@ -0,0 +1,66 @@ +@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/test/data/data-shapes/sparql/pre-binding/shapesGraph-001.ttl b/test/data/data-shapes/sparql/pre-binding/shapesGraph-001.ttl new file mode 100644 index 0000000..c805851 --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/shapesGraph-001.ttl @@ -0,0 +1,64 @@ +@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/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-001.ttl b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-001.ttl new file mode 100644 index 0000000..ddc007a --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-001.ttl @@ -0,0 +1,34 @@ +@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/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-002.ttl b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-002.ttl new file mode 100644 index 0000000..529ef9a --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-002.ttl @@ -0,0 +1,33 @@ +@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/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-003.ttl b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-003.ttl new file mode 100644 index 0000000..02c191e --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-003.ttl @@ -0,0 +1,36 @@ +@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/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-004.ttl b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-004.ttl new file mode 100644 index 0000000..7ebf22f --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-004.ttl @@ -0,0 +1,39 @@ +@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/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-005.ttl b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-005.ttl new file mode 100644 index 0000000..3d47bce --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-005.ttl @@ -0,0 +1,33 @@ +@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/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-006.ttl b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-006.ttl new file mode 100644 index 0000000..89f4374 --- /dev/null +++ b/test/data/data-shapes/sparql/pre-binding/unsupported-sparql-006.ttl @@ -0,0 +1,85 @@ +@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:validator ex:hasLang ; # This was changed by HK on 2018-09-21, see https://github.com/w3c/data-shapes/issues/101 +. +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/test/data/data-shapes/sparql/property/manifest.ttl b/test/data/data-shapes/sparql/property/manifest.ttl new file mode 100644 index 0000000..bb76f42 --- /dev/null +++ b/test/data/data-shapes/sparql/property/manifest.ttl @@ -0,0 +1,9 @@ +@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/test/data/data-shapes/sparql/property/sparql-001.ttl b/test/data/data-shapes/sparql/property/sparql-001.ttl new file mode 100644 index 0000000..d7aae03 --- /dev/null +++ b/test/data/data-shapes/sparql/property/sparql-001.ttl @@ -0,0 +1,68 @@ +@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/test/integration_tests.js b/test/integration_tests.js index 16cbbf1..071e8bf 100644 --- a/test/integration_tests.js +++ b/test/integration_tests.js @@ -3,10 +3,9 @@ const assert = require('assert') const path = require('path') const SHACLValidator = require('../index') const fs = require('fs') -const rdf = require('rdf-ext') -const rdfFS = require('rdf-utils-fs') const clownface = require('clownface') const { sh, rdf: rdfNS } = require('../src/namespaces') +const { loadDataset } = require('./utils') class ExpectedValidationReport { constructor (dataset) { @@ -42,7 +41,7 @@ const isBlank = function (s) { } const validateReports = async function (input) { - const data = await rdf.dataset().import(rdfFS.fromFile(input)) + const data = await loadDataset(input) const shapes = data const expectedReport = new ExpectedValidationReport(data) diff --git a/test/official_tests.js b/test/official_tests.js new file mode 100644 index 0000000..d917ecc --- /dev/null +++ b/test/official_tests.js @@ -0,0 +1,140 @@ +/* eslint-env mocha */ +const assert = require('assert') +const path = require('path') +const $rdf = require('rdf-ext') +const clownface = require('clownface') +const namespace = require('@rdfjs/namespace') +const resource = require('rdf-utils-dataset/resource') +const SHACLValidator = require('../index') +const { rdf, rdfs, sh } = require('../src/namespaces') +const { loadDataset } = require('./utils') + +const testDir = path.join(__dirname, 'data', 'data-shapes') +const mf = namespace('http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#') +const sht = namespace('http://www.w3.org/ns/shacl-test#') + +// The following tests fail with the current implementation and are skipped until fixed +const SKIPPED = [ + // https://github.com/w3c/data-shapes/issues/124 + 'path-strange-001', + 'path-strange-002', + + // TODO: Support non-numeric types in comparison constraints + 'minInclusive-002', + 'minInclusive-003', + + // TODO: This failure is not technically a bug. It is due to the fact that + // the test suite expects `sh:resultPath`'s blank node structure to never + // reuse blank nodes. We need to improve the report normlization before + // comparison with the expected report. + 'path-complex-002' +] + +before(async () => { + const testCases = await loadTestCases(testDir) + + describe('Official data-shapes test suite', () => { + testCases.forEach((testCase) => it(testCase.label, async function () { + if (SKIPPED.includes(testCase.node.value)) { + this.skip() + } else { + await testCase.execute() + } + })) + }) +}) + +it.skip('Dummy test to fetch test configurations', () => {}) + +async function loadTestCases (dir) { + const rootManifestPath = path.join(dir, 'manifest.ttl') + return walkManifests(rootManifestPath) +} + +async function walkManifests (manifestPath) { + const dir = path.dirname(manifestPath) + const dataset = await loadDataset(manifestPath) + const cf = clownface({ dataset, factory: $rdf }) + const manifest = cf.node(mf.Manifest).in(rdf.type) + + if (!manifest.term) { + throw new Error(`No manifest found at ${manifestPath}`) + } + + const childrenTestCases = await Promise.all( + manifest + .out(mf.include) + .values + .map((childRelativePath) => { + const childManifestPath = path.join(dir, childRelativePath) + return walkManifests(childManifestPath) + }) + ) + + const testCases = rdfListToArray(manifest.out(mf.entries)) + .map((testCaseNode) => new TestCase(testCaseNode, dir)) + + return testCases.concat(...childrenTestCases) +} + +function rdfListToArray (node) { + if (!node.term || node.term.equals(rdf.nil)) { + return [] + } + + const first = node.out(rdf.first) + const rest = node.out(rdf.rest) + return [first].concat(rdfListToArray(rest)) +} + +class TestCase { + constructor (node, dir) { + this.node = node + this.dir = dir + this.label = node.out(rdfs.label).value + } + + async getShapes () { + const relativePath = this.node.out(mf.action).out(sht.shapesGraph).value + return this._loadDataset(relativePath) + } + + async getData () { + const relativePath = this.node.out(mf.action).out(sht.dataGraph).value + return this._loadDataset(relativePath) + } + + async _loadDataset (relativePath) { + if (relativePath === '') { + return this.node.dataset + } else { + const filePath = path.join(this.dir, relativePath) + return loadDataset(filePath) + } + } + + async execute () { + const data = await this.getData() + const shapes = await this.getShapes() + const validator = new SHACLValidator(shapes, { factory: $rdf }) + const expectedReport = this.node.out(mf.result) + + const report = clownface({ dataset: validator.validate(data).dataset, factory: $rdf }) + .node(sh.ValidationReport) + .in(rdf.type) + + const expectedDataset = resource(this.node.dataset, expectedReport.term) + + normalizeReport(report, expectedReport) + + assert.strictEqual(report.dataset.toCanonical(), expectedDataset.toCanonical()) + } +} + +// As specified in https://w3c.github.io/data-shapes/data-shapes-test-suite/#Validate +function normalizeReport (report, expectedReport) { + // Delete messages if expected report doesn't have any + if (expectedReport.out(sh.result).out(sh.resultMessage).values.length === 0) { + report.out(sh.result).deleteOut(sh.resultMessage) + } +} diff --git a/test/utils.js b/test/utils.js new file mode 100644 index 0000000..6d3f1fe --- /dev/null +++ b/test/utils.js @@ -0,0 +1,13 @@ +const fs = require('fs') +const ParserN3 = require('@rdfjs/parser-n3') +const $rdf = require('rdf-ext') + +async function loadDataset (filePath) { + const stream = fs.createReadStream(filePath) + const parser = new ParserN3({ factory: $rdf }) + return $rdf.dataset().import(parser.import(stream)) +} + +module.exports = { + loadDataset +} diff --git a/test/validation_message_test.js b/test/validation_message_test.js index 8e5d858..1cb6b55 100644 --- a/test/validation_message_test.js +++ b/test/validation_message_test.js @@ -1,8 +1,7 @@ /* eslint-env mocha */ const path = require('path') const assert = require('assert') -const $rdf = require('rdf-ext') -const rdfFS = require('rdf-utils-fs') +const { loadDataset } = require('./utils') const SHACLValidator = require('../index') const rootPath = path.join(__dirname, '/data/validation-message') @@ -10,7 +9,7 @@ const rootPath = path.join(__dirname, '/data/validation-message') describe('validation messages', () => { it('Returns message from shape property if provided', async () => { const dataPath = path.join(rootPath, 'message-from-shape-property.ttl') - const data = await $rdf.dataset().import(rdfFS.fromFile(dataPath)) + const data = await loadDataset(dataPath) const shapes = data const validator = new SHACLValidator(shapes) @@ -22,7 +21,7 @@ describe('validation messages', () => { it('Returns message from validator if provided (and no message on shape)', async () => { const dataPath = path.join(rootPath, 'message-from-validator.ttl') - const data = await $rdf.dataset().import(rdfFS.fromFile(dataPath)) + const data = await loadDataset(dataPath) const shapes = data const validator = new SHACLValidator(shapes) @@ -34,7 +33,7 @@ describe('validation messages', () => { it('Returns message from constraint component if provided (and no message on shape or validator)', async () => { const dataPath = path.join(rootPath, 'message-from-constraint-component.ttl') - const data = await $rdf.dataset().import(rdfFS.fromFile(dataPath)) + const data = await loadDataset(dataPath) const shapes = data const validator = new SHACLValidator(shapes) @@ -46,7 +45,7 @@ describe('validation messages', () => { it('Returns null if no message is defined anywhere', async () => { const dataPath = path.join(rootPath, 'message-empty.ttl') - const data = await $rdf.dataset().import(rdfFS.fromFile(dataPath)) + const data = await loadDataset(dataPath) const shapes = data const validator = new SHACLValidator(shapes) @@ -58,7 +57,7 @@ describe('validation messages', () => { it('Substitutes variables in message', async () => { const dataPath = path.join(rootPath, 'message-with-variable.ttl') - const data = await $rdf.dataset().import(rdfFS.fromFile(dataPath)) + const data = await loadDataset(dataPath) const shapes = data const validator = new SHACLValidator(shapes) From e559c22fa19ac7100d2f6b722abe61b2d62c3524 Mon Sep 17 00:00:00 2001 From: Martin Maillard Date: Fri, 3 Apr 2020 11:04:34 +0200 Subject: [PATCH 2/7] Deep-copy blank nodes structure in validation report --- src/dataset-utils.js | 25 +++++++++++++++++++++++++ src/validation-engine.js | 28 +++++++++++++++++++--------- 2 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 src/dataset-utils.js diff --git a/src/dataset-utils.js b/src/dataset-utils.js new file mode 100644 index 0000000..e1190c0 --- /dev/null +++ b/src/dataset-utils.js @@ -0,0 +1,25 @@ + +/** + * Extracts all the quads forming the structure under a blank node. Stops at + * non-blank nodes. + * + * @param {DatasetCore} dataset + * @param {Term} startNode + */ +function extractStructure (dataset, startNode) { + if (startNode.termType !== 'BlankNode') { + return [] + } + + const quads = [...dataset.match(startNode, null, null)] + + const children = quads.map((quad) => { + return extractStructure(dataset, quad.object) + }) + + return quads.concat(...children) +} + +module.exports = { + extractStructure +} diff --git a/src/validation-engine.js b/src/validation-engine.js index 2109ebe..a98a808 100644 --- a/src/validation-engine.js +++ b/src/validation-engine.js @@ -1,4 +1,5 @@ const ValidationReport = require('./validation-report') +const { extractStructure } = require('./dataset-utils') const error = require('debug')('validation-enging::error') class ValidationEngine { @@ -29,14 +30,23 @@ class ValidationEngine { this.addResultProperty(result, rdf.type, sh.ValidationResult) this.addResultProperty(result, sh.resultSeverity, severity) this.addResultProperty(result, sh.sourceConstraintComponent, sourceConstraintComponent) - this.addResultProperty(result, sh.sourceShape, sourceShape) - this.addResultProperty(result, sh.focusNode, focusNode) + this.addResultPropertyDeep(result, sh.sourceShape, sourceShape) + this.addResultPropertyDeep(result, sh.focusNode, focusNode) if (valueNode) { - this.addResultProperty(result, sh.value, valueNode) + this.addResultPropertyDeep(result, sh.value, valueNode) } return result } + addResultPropertyDeep (result, predicate, node) { + this.addResultProperty(result, predicate, node) + + const structureQuads = extractStructure(this.context.$shapes.dataset, node) + for (const quad of structureQuads) { + this.results.push(quad) + } + } + /** * Creates all the validation result nodes and messages for the result of applying the validation logic * of a constraints against a node. @@ -53,7 +63,7 @@ class ValidationEngine { const result = this.createResult(constraint, focusNode, valueNode) if (constraint.shape.isPropertyShape()) { - this.addResultProperty(result, sh.resultPath, constraint.shape.path) // TODO: Make deep copy + this.addResultPropertyDeep(result, sh.resultPath, constraint.shape.path, true) } this.createResultMessages(result, constraint) return true @@ -63,7 +73,7 @@ class ValidationEngine { } const result = this.createResult(constraint, focusNode, valueNode) if (constraint.shape.isPropertyShape()) { - this.addResultProperty(result, sh.resultPath, constraint.shape.path) // TODO: Make deep copy + this.addResultPropertyDeep(result, sh.resultPath, constraint.shape.path, true) } this.addResultProperty(result, sh.resultMessage, this.factory.literal(obj, xsd.string)) this.createResultMessages(result, constraint) @@ -74,14 +84,14 @@ class ValidationEngine { } const result = this.createResult(constraint, focusNode) if (obj.path) { - this.addResultProperty(result, sh.resultPath, obj.path) // TODO: Make deep copy + this.addResultPropertyDeep(result, sh.resultPath, obj.path, true) } else if (constraint.shape.isPropertyShape()) { - this.addResultProperty(result, sh.resultPath, constraint.shape.path) // TODO: Make deep copy + this.addResultPropertyDeep(result, sh.resultPath, constraint.shape.path, true) } if (obj.value) { - this.addResultProperty(result, sh.value, obj.value) + this.addResultPropertyDeep(result, sh.value, obj.value) } else if (valueNode) { - this.addResultProperty(result, sh.value, valueNode) + this.addResultPropertyDeep(result, sh.value, valueNode) } if (obj.message) { this.addResultProperty(result, sh.resultMessage, this.factory.literal(obj.message, xsd.string)) From d2bf1aba1b6d7704ba2c23acdbece6cfd77e100b Mon Sep 17 00:00:00 2001 From: Martin Maillard Date: Tue, 14 Apr 2020 16:52:25 +0200 Subject: [PATCH 3/7] Normalize blank node structures before assertion --- test/official_tests.js | 57 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/test/official_tests.js b/test/official_tests.js index d917ecc..97d1076 100644 --- a/test/official_tests.js +++ b/test/official_tests.js @@ -21,13 +21,7 @@ const SKIPPED = [ // TODO: Support non-numeric types in comparison constraints 'minInclusive-002', - 'minInclusive-003', - - // TODO: This failure is not technically a bug. It is due to the fact that - // the test suite expects `sh:resultPath`'s blank node structure to never - // reuse blank nodes. We need to improve the report normlization before - // comparison with the expected report. - 'path-complex-002' + 'minInclusive-003' ] before(async () => { @@ -137,4 +131,53 @@ function normalizeReport (report, expectedReport) { if (expectedReport.out(sh.result).out(sh.resultMessage).values.length === 0) { report.out(sh.result).deleteOut(sh.resultMessage) } + + // Split shared blank nodes into distinct blank node structures + splitSharedBlankNodes(report.dataset) +} + +function splitSharedBlankNodes (dataset) { + const cf = clownface({ dataset }) + + const predicates = [ + sh.resultPath, + rdf.first, + rdf.rest, + sh.alternativePath, + sh.zeroOrMorePath, + sh.oneOrMorePath, + sh.zeroOrOnePath, + sh.inversePath + ] + + let moreSharedBlanks = true + while (moreSharedBlanks) { + const sharedBlanks = cf + .out(predicates) + .filter((obj) => obj.term.termType === 'BlankNode' && obj.in().terms.length > 1) + .terms + + if (sharedBlanks.length === 0) { + moreSharedBlanks = false + continue + } + + sharedBlanks.forEach((sharedBlank) => { + // Keep the first link to the shared node intact and split the next ones + const quadsToSplit = [...dataset.match(null, null, sharedBlank)].slice(1) + quadsToSplit.forEach((quad) => { + const newBlank = $rdf.blankNode() + + // Replace quad pointing to shared node to new node + dataset.remove(quad) + dataset.add($rdf.quad(quad.subject, quad.predicate, newBlank, quad.graph)) + + // Copy shared node structure to new node + // Nested shared blank nodes will be split in the next iteration + dataset.match(sharedBlank, null, null).forEach((quad) => { + dataset.add($rdf.quad(newBlank, quad.predicate, quad.object, quad.graph)) + }) + }) + }) + } } From 61a22a023fefe2e35454d8ff78b588b998018813 Mon Sep 17 00:00:00 2001 From: Martin Maillard Date: Tue, 14 Apr 2020 17:14:07 +0200 Subject: [PATCH 4/7] Rename data-shapes test suite module --- test/{official_tests.js => data-shapes_tests.js} | 2 ++ 1 file changed, 2 insertions(+) rename test/{official_tests.js => data-shapes_tests.js} (97%) diff --git a/test/official_tests.js b/test/data-shapes_tests.js similarity index 97% rename from test/official_tests.js rename to test/data-shapes_tests.js index 97d1076..9380793 100644 --- a/test/official_tests.js +++ b/test/data-shapes_tests.js @@ -1,4 +1,6 @@ /* eslint-env mocha */ +// This module implements the official SHACL test suite +// https://w3c.github.io/data-shapes/data-shapes-test-suite const assert = require('assert') const path = require('path') const $rdf = require('rdf-ext') From 6170adb38e13bdb76268010b1c7494b9cc095c66 Mon Sep 17 00:00:00 2001 From: Martin Maillard Date: Tue, 14 Apr 2020 17:29:22 +0200 Subject: [PATCH 5/7] Add custom tests --- test/data/data-shapes/custom/closed-false.ttl | 38 +++++++++++++++ test/data/data-shapes/custom/manifest.ttl | 10 ++++ .../data-shapes/custom/uniqueLang-false.ttl | 47 +++++++++++++++++++ test/data/data-shapes/manifest.ttl | 1 + 4 files changed, 96 insertions(+) create mode 100644 test/data/data-shapes/custom/closed-false.ttl create mode 100644 test/data/data-shapes/custom/manifest.ttl create mode 100644 test/data/data-shapes/custom/uniqueLang-false.ttl diff --git a/test/data/data-shapes/custom/closed-false.ttl b/test/data/data-shapes/custom/closed-false.ttl new file mode 100644 index 0000000..f435a2d --- /dev/null +++ b/test/data/data-shapes/custom/closed-false.ttl @@ -0,0 +1,38 @@ +@prefix dash: . +@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 sh:closed set to false" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ; + ] ; + mf:status sht:proposed ; +. +ex:ValidInstance1 + ex:otherProperty 4 ; + ex:someProperty 3 ; +. +ex:MyShape + rdf:type sh:NodeShape ; + sh:closed "false"^^xsd:boolean ; + sh:targetNode ex:ValidInstance1 ; +. diff --git a/test/data/data-shapes/custom/manifest.ttl b/test/data/data-shapes/custom/manifest.ttl new file mode 100644 index 0000000..89364dd --- /dev/null +++ b/test/data/data-shapes/custom/manifest.ttl @@ -0,0 +1,10 @@ +@prefix mf: . +@prefix rdfs: . +@prefix sht: . + +<> + a mf:Manifest ; + rdfs:label "Custom tests to complete the official test suite" ; + mf:include ; + mf:include ; + . diff --git a/test/data/data-shapes/custom/uniqueLang-false.ttl b/test/data/data-shapes/custom/uniqueLang-false.ttl new file mode 100644 index 0000000..07a8a8d --- /dev/null +++ b/test/data/data-shapes/custom/uniqueLang-false.ttl @@ -0,0 +1,47 @@ +@prefix dash: . +@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 sh:uniqueLang set to false" ; + mf:action [ + sht:dataGraph <> ; + sht:shapesGraph <> ; + ] ; + mf:result [ + rdf:type sh:ValidationReport ; + sh:conforms "true"^^xsd:boolean ; + ] ; + mf:status sht:proposed ; +. +ex:ValidInstance1 + rdf:type ex:TestShape ; + ex:testProperty "Me" ; + ex:testProperty "Me"@en ; + ex:testProperty "Moi"@fr ; + 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 "false"^^xsd:boolean ; +. diff --git a/test/data/data-shapes/manifest.ttl b/test/data/data-shapes/manifest.ttl index b44bb0c..b0edc92 100644 --- a/test/data/data-shapes/manifest.ttl +++ b/test/data/data-shapes/manifest.ttl @@ -6,4 +6,5 @@ a mf:Manifest ; mf:include ; # mf:include ; + mf:include ; . From 8555a77e424983c8c29e14f1abcb0a305ecde702 Mon Sep 17 00:00:00 2001 From: Martin Maillard Date: Tue, 14 Apr 2020 17:56:44 +0200 Subject: [PATCH 6/7] Remove redundant integration tests They are replaced by the official SHACL test suite --- test/configuration_tests.js | 2 +- test/data/core/complex/personexample.test.ttl | 99 ----- test/data/core/misc/deactivated-001.test.ttl | 40 -- test/data/core/misc/deactivated-002.test.ttl | 39 -- test/data/core/misc/severity-001.test.ttl | 38 -- test/data/core/misc/severity-002.test.ttl | 55 --- test/data/core/node/and-001.test.ttl | 72 ---- test/data/core/node/and-002.test.ttl | 70 ---- test/data/core/node/class-001.test.ttl | 65 ---- test/data/core/node/class-002.test.ttl | 57 --- test/data/core/node/closed-001.test.ttl | 60 --- test/data/core/node/closed-002.test.ttl | 54 --- test/data/core/node/closed-false.test.ttl | 28 -- test/data/core/node/datatype-001.test.ttl | 59 --- test/data/core/node/datatype-002.test.ttl | 48 --- test/data/core/node/disjoint-001.test.ttl | 47 --- test/data/core/node/equals-001.test.ttl | 55 --- test/data/core/node/hasValue-001.test.ttl | 40 -- test/data/core/node/in-001.test.ttl | 59 --- test/data/core/node/languageIn-001.test.ttl | 61 --- test/data/core/node/maxExclusive-001.test.ttl | 86 ---- test/data/core/node/maxInclusive-001.test.ttl | 70 ---- test/data/core/node/maxLength-001.test.ttl | 82 ---- test/data/core/node/minExclusive-001.test.ttl | 86 ---- test/data/core/node/minInclusive-001.test.ttl | 40 -- test/data/core/node/minLength-001.test.ttl | 74 ---- test/data/core/node/node-001.test.ttl | 50 --- test/data/core/node/nodeKind-001.test.ttl | 39 -- test/data/core/node/not-001.test.ttl | 54 --- test/data/core/node/not-002.test.ttl | 48 --- test/data/core/node/or-001.test.ttl | 87 ----- test/data/core/node/pattern-001.test.ttl | 71 ---- test/data/core/node/pattern-002.test.ttl | 41 -- test/data/core/node/xone-001.test.ttl | 69 ---- .../core/path/path-alternative-001.test.ttl | 81 ---- test/data/core/path/path-complex-001.test.ttl | 86 ---- test/data/core/path/path-inverse-001.test.ttl | 85 ---- .../core/path/path-oneOrMore-001.test.ttl | 66 ---- .../data/core/path/path-sequence-001.test.ttl | 75 ---- .../data/core/path/path-sequence-002.test.ttl | 78 ---- .../path/path-sequence-duplicate-001.test.ttl | 58 --- .../core/path/path-zeroOrMore-001.test.ttl | 56 --- .../core/path/path-zeroOrOne-001.test.ttl | 56 --- test/data/core/property/and-001.test.ttl | 102 ----- test/data/core/property/class-001.test.ttl | 86 ---- test/data/core/property/datatype-001.test.ttl | 72 ---- test/data/core/property/datatype-002.test.ttl | 67 ---- test/data/core/property/datatype-003.test.ttl | 65 ---- test/data/core/property/disjoint-001.test.ttl | 80 ---- test/data/core/property/equals-001.test.ttl | 114 ------ test/data/core/property/hasValue-001.test.ttl | 63 --- test/data/core/property/in-001.test.ttl | 64 --- .../core/property/languageIn-001.test.ttl | 74 ---- test/data/core/property/lessThan-001.test.ttl | 91 ----- test/data/core/property/lessThan-002.test.ttl | 77 ---- .../property/lessThanOrEquals-001.test.ttl | 82 ---- test/data/core/property/maxCount-001.test.ttl | 59 --- test/data/core/property/maxCount-002.test.ttl | 52 --- .../core/property/maxExclusive-001.test.ttl | 79 ---- .../core/property/maxInclusive-001.test.ttl | 66 ---- .../data/core/property/maxLength-001.test.ttl | 57 --- test/data/core/property/minCount-001.test.ttl | 57 --- test/data/core/property/minCount-002.test.ttl | 36 -- .../core/property/minExclusive-001.test.ttl | 64 --- .../core/property/minExclusive-002.test.ttl | 60 --- .../data/core/property/minLength-001.test.ttl | 56 --- test/data/core/property/node-001.test.ttl | 108 ------ test/data/core/property/node-002.test.ttl | 70 ---- test/data/core/property/nodeKind-001.test.ttl | 366 ------------------ test/data/core/property/not-001.test.ttl | 64 --- test/data/core/property/or-001.test.ttl | 71 ---- .../core/property/or-datatypes-001.test.ttl | 90 ----- test/data/core/property/pattern-001.test.ttl | 69 ---- test/data/core/property/pattern-002.test.ttl | 61 --- test/data/core/property/property-001.test.ttl | 95 ----- .../qualifiedMinCountDisjoint-001.test.ttl | 111 ------ .../property/qualifiedValueShape-001.test.ttl | 75 ---- .../qualifiedValueShapesDisjoint-001.test.ttl | 123 ------ .../core/property/uniqueLang-001.test.ttl | 81 ---- .../core/property/uniqueLang-false.test.ttl | 37 -- .../core/targets/multipleTargets-001.test.ttl | 52 --- .../core/targets/targetClass-001.test.ttl | 57 --- .../targets/targetClassImplicit-001.test.ttl | 54 --- .../data/core/targets/targetNode-001.test.ttl | 52 --- .../core/targets/targetObjectsOf-001.test.ttl | 60 --- .../targets/targetSubjectsOf-001.test.ttl | 52 --- .../targets/targetSubjectsOf-002.test.ttl | 69 ---- test/integration_tests.js | 79 ---- 88 files changed, 1 insertion(+), 6104 deletions(-) delete mode 100644 test/data/core/complex/personexample.test.ttl delete mode 100644 test/data/core/misc/deactivated-001.test.ttl delete mode 100644 test/data/core/misc/deactivated-002.test.ttl delete mode 100644 test/data/core/misc/severity-001.test.ttl delete mode 100644 test/data/core/misc/severity-002.test.ttl delete mode 100644 test/data/core/node/and-001.test.ttl delete mode 100644 test/data/core/node/and-002.test.ttl delete mode 100644 test/data/core/node/class-001.test.ttl delete mode 100644 test/data/core/node/class-002.test.ttl delete mode 100644 test/data/core/node/closed-001.test.ttl delete mode 100644 test/data/core/node/closed-002.test.ttl delete mode 100644 test/data/core/node/closed-false.test.ttl delete mode 100644 test/data/core/node/datatype-001.test.ttl delete mode 100644 test/data/core/node/datatype-002.test.ttl delete mode 100644 test/data/core/node/disjoint-001.test.ttl delete mode 100644 test/data/core/node/equals-001.test.ttl delete mode 100644 test/data/core/node/hasValue-001.test.ttl delete mode 100644 test/data/core/node/in-001.test.ttl delete mode 100644 test/data/core/node/languageIn-001.test.ttl delete mode 100644 test/data/core/node/maxExclusive-001.test.ttl delete mode 100644 test/data/core/node/maxInclusive-001.test.ttl delete mode 100644 test/data/core/node/maxLength-001.test.ttl delete mode 100644 test/data/core/node/minExclusive-001.test.ttl delete mode 100644 test/data/core/node/minInclusive-001.test.ttl delete mode 100644 test/data/core/node/minLength-001.test.ttl delete mode 100644 test/data/core/node/node-001.test.ttl delete mode 100644 test/data/core/node/nodeKind-001.test.ttl delete mode 100644 test/data/core/node/not-001.test.ttl delete mode 100644 test/data/core/node/not-002.test.ttl delete mode 100644 test/data/core/node/or-001.test.ttl delete mode 100644 test/data/core/node/pattern-001.test.ttl delete mode 100644 test/data/core/node/pattern-002.test.ttl delete mode 100644 test/data/core/node/xone-001.test.ttl delete mode 100644 test/data/core/path/path-alternative-001.test.ttl delete mode 100644 test/data/core/path/path-complex-001.test.ttl delete mode 100644 test/data/core/path/path-inverse-001.test.ttl delete mode 100644 test/data/core/path/path-oneOrMore-001.test.ttl delete mode 100644 test/data/core/path/path-sequence-001.test.ttl delete mode 100644 test/data/core/path/path-sequence-002.test.ttl delete mode 100644 test/data/core/path/path-sequence-duplicate-001.test.ttl delete mode 100644 test/data/core/path/path-zeroOrMore-001.test.ttl delete mode 100644 test/data/core/path/path-zeroOrOne-001.test.ttl delete mode 100644 test/data/core/property/and-001.test.ttl delete mode 100644 test/data/core/property/class-001.test.ttl delete mode 100644 test/data/core/property/datatype-001.test.ttl delete mode 100644 test/data/core/property/datatype-002.test.ttl delete mode 100644 test/data/core/property/datatype-003.test.ttl delete mode 100644 test/data/core/property/disjoint-001.test.ttl delete mode 100644 test/data/core/property/equals-001.test.ttl delete mode 100644 test/data/core/property/hasValue-001.test.ttl delete mode 100644 test/data/core/property/in-001.test.ttl delete mode 100644 test/data/core/property/languageIn-001.test.ttl delete mode 100644 test/data/core/property/lessThan-001.test.ttl delete mode 100644 test/data/core/property/lessThan-002.test.ttl delete mode 100644 test/data/core/property/lessThanOrEquals-001.test.ttl delete mode 100644 test/data/core/property/maxCount-001.test.ttl delete mode 100644 test/data/core/property/maxCount-002.test.ttl delete mode 100644 test/data/core/property/maxExclusive-001.test.ttl delete mode 100644 test/data/core/property/maxInclusive-001.test.ttl delete mode 100644 test/data/core/property/maxLength-001.test.ttl delete mode 100644 test/data/core/property/minCount-001.test.ttl delete mode 100644 test/data/core/property/minCount-002.test.ttl delete mode 100644 test/data/core/property/minExclusive-001.test.ttl delete mode 100644 test/data/core/property/minExclusive-002.test.ttl delete mode 100644 test/data/core/property/minLength-001.test.ttl delete mode 100644 test/data/core/property/node-001.test.ttl delete mode 100644 test/data/core/property/node-002.test.ttl delete mode 100644 test/data/core/property/nodeKind-001.test.ttl delete mode 100644 test/data/core/property/not-001.test.ttl delete mode 100644 test/data/core/property/or-001.test.ttl delete mode 100644 test/data/core/property/or-datatypes-001.test.ttl delete mode 100644 test/data/core/property/pattern-001.test.ttl delete mode 100644 test/data/core/property/pattern-002.test.ttl delete mode 100644 test/data/core/property/property-001.test.ttl delete mode 100644 test/data/core/property/qualifiedMinCountDisjoint-001.test.ttl delete mode 100644 test/data/core/property/qualifiedValueShape-001.test.ttl delete mode 100644 test/data/core/property/qualifiedValueShapesDisjoint-001.test.ttl delete mode 100644 test/data/core/property/uniqueLang-001.test.ttl delete mode 100644 test/data/core/property/uniqueLang-false.test.ttl delete mode 100644 test/data/core/targets/multipleTargets-001.test.ttl delete mode 100644 test/data/core/targets/targetClass-001.test.ttl delete mode 100644 test/data/core/targets/targetClassImplicit-001.test.ttl delete mode 100644 test/data/core/targets/targetNode-001.test.ttl delete mode 100644 test/data/core/targets/targetObjectsOf-001.test.ttl delete mode 100644 test/data/core/targets/targetSubjectsOf-001.test.ttl delete mode 100644 test/data/core/targets/targetSubjectsOf-002.test.ttl delete mode 100644 test/integration_tests.js diff --git a/test/configuration_tests.js b/test/configuration_tests.js index 94e7ece..21b775f 100644 --- a/test/configuration_tests.js +++ b/test/configuration_tests.js @@ -6,7 +6,7 @@ const { loadDataset } = require('./utils') describe('configuration', () => { it('stops after `maxErrors` is reached', async () => { - const dataFile = path.join(__dirname, '/data/core/property/class-001.test.ttl') + const dataFile = path.join(__dirname, '/data/data-shapes/core/property/class-001.ttl') const data = await loadDataset(dataFile) const shapes = data diff --git a/test/data/core/complex/personexample.test.ttl b/test/data/core/complex/personexample.test.ttl deleted file mode 100644 index 807f79e..0000000 --- a/test/data/core/complex/personexample.test.ttl +++ /dev/null @@ -1,99 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/complex/personexample.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of personexample" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 _:b1 ; - 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 _:b1 ; - ] ; - sh:result [ - rdf:type sh:ValidationResult ; - sh:focusNode ex:Calvin ; - sh:resultPath ex:birthDate ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:ClosedConstraintComponent ; - sh:value "1999-09-09"^^xsd:date ; - sh:sourceShape ex:PersonShape ; - ] ; - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/misc/deactivated-001.test.ttl b/test/data/core/misc/deactivated-001.test.ttl deleted file mode 100644 index 3e0666d..0000000 --- a/test/data/core/misc/deactivated-001.test.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/misc/deactivated-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of deactivated-001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - rdf:type sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ; - ] ; -. -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 ; -. diff --git a/test/data/core/misc/deactivated-002.test.ttl b/test/data/core/misc/deactivated-002.test.ttl deleted file mode 100644 index 27243d2..0000000 --- a/test/data/core/misc/deactivated-002.test.ttl +++ /dev/null @@ -1,39 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/misc/deactivated-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of deactivated-002" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:boolean ; - sh:deactivated "false"^^xsd:boolean ; - sh:targetNode 32 ; -. diff --git a/test/data/core/misc/severity-001.test.ttl b/test/data/core/misc/severity-001.test.ttl deleted file mode 100644 index 12c4104..0000000 --- a/test/data/core/misc/severity-001.test.ttl +++ /dev/null @@ -1,38 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/misc/severity-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:severity 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:integer ; - sh:severity sh:Warning ; - sh:targetNode "Hello" ; -. diff --git a/test/data/core/misc/severity-002.test.ttl b/test/data/core/misc/severity-002.test.ttl deleted file mode 100644 index 69cad23..0000000 --- a/test/data/core/misc/severity-002.test.ttl +++ /dev/null @@ -1,55 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/misc/severity-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:severity 002" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/and-001.test.ttl b/test/data/core/node/and-001.test.ttl deleted file mode 100644 index 069ad95..0000000 --- a/test/data/core/node/and-001.test.ttl +++ /dev/null @@ -1,72 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/and-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:and at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/and-002.test.ttl b/test/data/core/node/and-002.test.ttl deleted file mode 100644 index 2c9dfa8..0000000 --- a/test/data/core/node/and-002.test.ttl +++ /dev/null @@ -1,70 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/and-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:and at node shape 002" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/node/class-001.test.ttl b/test/data/core/node/class-001.test.ttl deleted file mode 100644 index fbc85f9..0000000 --- a/test/data/core/node/class-001.test.ttl +++ /dev/null @@ -1,65 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/class-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:class at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/class-002.test.ttl b/test/data/core/node/class-002.test.ttl deleted file mode 100644 index d9fc3b0..0000000 --- a/test/data/core/node/class-002.test.ttl +++ /dev/null @@ -1,57 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/class-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:class at node shape 002" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. -_:b9751 - rdf:type ex:BNodeClass ; -. -[ - rdf:type ex:BNodeClass ; - rdf:type ex:TestClass ; -]. diff --git a/test/data/core/node/closed-001.test.ttl b/test/data/core/node/closed-001.test.ttl deleted file mode 100644 index c83a4e5..0000000 --- a/test/data/core/node/closed-001.test.ttl +++ /dev/null @@ -1,60 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/closed-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:closed at node shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/closed-002.test.ttl b/test/data/core/node/closed-002.test.ttl deleted file mode 100644 index 10f6439..0000000 --- a/test/data/core/node/closed-002.test.ttl +++ /dev/null @@ -1,54 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/closed-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:closed at node shape 002" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/closed-false.test.ttl b/test/data/core/node/closed-false.test.ttl deleted file mode 100644 index c9eb25e..0000000 --- a/test/data/core/node/closed-false.test.ttl +++ /dev/null @@ -1,28 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:closed set to false" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - rdf:type sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ; - ] ; -. -ex:ValidInstance1 - ex:otherProperty 4 ; - ex:someProperty 3 ; -. -ex:MyShape - rdf:type sh:NodeShape ; - sh:closed "false"^^xsd:boolean ; - sh:targetNode ex:ValidInstance1 ; -. diff --git a/test/data/core/node/datatype-001.test.ttl b/test/data/core/node/datatype-001.test.ttl deleted file mode 100644 index 67d751b..0000000 --- a/test/data/core/node/datatype-001.test.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/datatype-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:datatype at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 _:b9649 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:DatatypeConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b9649 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:datatype xsd:integer ; - sh:targetNode xsd:integer ; - sh:targetNode 42 ; - sh:targetNode "aldi"^^xsd:integer ; - sh:targetClass ex:TestClass ; -. -_:b9649 - rdf:type ex:TestClass ; -. diff --git a/test/data/core/node/datatype-002.test.ttl b/test/data/core/node/datatype-002.test.ttl deleted file mode 100644 index dd5fb3b..0000000 --- a/test/data/core/node/datatype-002.test.ttl +++ /dev/null @@ -1,48 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/datatype-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:datatype at node shape 002" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/node/disjoint-001.test.ttl b/test/data/core/node/disjoint-001.test.ttl deleted file mode 100644 index 36d181e..0000000 --- a/test/data/core/node/disjoint-001.test.ttl +++ /dev/null @@ -1,47 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/disjoint-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:disjoint at node shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/equals-001.test.ttl b/test/data/core/node/equals-001.test.ttl deleted file mode 100644 index 9c05912..0000000 --- a/test/data/core/node/equals-001.test.ttl +++ /dev/null @@ -1,55 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/equals-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:equals at node shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/hasValue-001.test.ttl b/test/data/core/node/hasValue-001.test.ttl deleted file mode 100644 index 8ec51e6..0000000 --- a/test/data/core/node/hasValue-001.test.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/hasValue-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:hasValue at node shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - rdfs:label "Test shape" ; - sh:hasValue "Test" ; - sh:targetNode "Invalid String" ; - sh:targetNode "Test" ; -. diff --git a/test/data/core/node/in-001.test.ttl b/test/data/core/node/in-001.test.ttl deleted file mode 100644 index 8e24716..0000000 --- a/test/data/core/node/in-001.test.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/in-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:in at node shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/node/languageIn-001.test.ttl b/test/data/core/node/languageIn-001.test.ttl deleted file mode 100644 index d081751..0000000 --- a/test/data/core/node/languageIn-001.test.ttl +++ /dev/null @@ -1,61 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/languageIn-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:languageIn at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/node/maxExclusive-001.test.ttl b/test/data/core/node/maxExclusive-001.test.ttl deleted file mode 100644 index e6dd143..0000000 --- a/test/data/core/node/maxExclusive-001.test.ttl +++ /dev/null @@ -1,86 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/maxExclusive-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:maxExclusive at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 _:b9649 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b9649 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxExclusive 4 ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; - sh:targetClass ex:TestClass ; -. -_:b9649 - rdf:type ex:TestClass ; -. diff --git a/test/data/core/node/maxInclusive-001.test.ttl b/test/data/core/node/maxInclusive-001.test.ttl deleted file mode 100644 index bd9c8c0..0000000 --- a/test/data/core/node/maxInclusive-001.test.ttl +++ /dev/null @@ -1,70 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/maxInclusive-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:maxInclusive at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 _:b9649 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxInclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b9649 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxInclusive 4 ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; - sh:targetClass ex:TestClass ; -. -_:b9649 - rdf:type ex:TestClass ; -. diff --git a/test/data/core/node/maxLength-001.test.ttl b/test/data/core/node/maxLength-001.test.ttl deleted file mode 100644 index 4d81698..0000000 --- a/test/data/core/node/maxLength-001.test.ttl +++ /dev/null @@ -1,82 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/maxLength-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:maxLength at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 _:b9649 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MaxLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b9649 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:maxLength 4 ; - 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" ; - sh:targetClass ex:TestClass ; -. -_:b9649 - rdf:type ex:TestClass ; -. diff --git a/test/data/core/node/minExclusive-001.test.ttl b/test/data/core/node/minExclusive-001.test.ttl deleted file mode 100644 index 5dcb537..0000000 --- a/test/data/core/node/minExclusive-001.test.ttl +++ /dev/null @@ -1,86 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/minExclusive-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:minExclusive at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 _:b9649 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinExclusiveConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b9649 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:minExclusive 4 ; - sh:targetNode ex:John ; - sh:targetNode 3.9 ; - sh:targetNode 4 ; - sh:targetNode 4.0 ; - sh:targetNode 4.1 ; - sh:targetNode "Hello" ; - sh:targetClass ex:TestClass ; -. -_:b9649 - rdf:type ex:TestClass ; -. diff --git a/test/data/core/node/minInclusive-001.test.ttl b/test/data/core/node/minInclusive-001.test.ttl deleted file mode 100644 index 560dbc9..0000000 --- a/test/data/core/node/minInclusive-001.test.ttl +++ /dev/null @@ -1,40 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/minInclusive-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:minInclusive at node shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:minInclusive 8 ; - sh:targetNode 7 ; - sh:targetNode 8 ; - sh:targetNode 9 ; -. diff --git a/test/data/core/node/minLength-001.test.ttl b/test/data/core/node/minLength-001.test.ttl deleted file mode 100644 index c908aa8..0000000 --- a/test/data/core/node/minLength-001.test.ttl +++ /dev/null @@ -1,74 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/minLength-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:minLength at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 _:b9649 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b9649 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:minLength 4 ; - 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" ; - sh:targetClass ex:TestClass ; -. -_:b9649 - rdf:type ex:TestClass ; -. diff --git a/test/data/core/node/node-001.test.ttl b/test/data/core/node/node-001.test.ttl deleted file mode 100644 index 05580e8..0000000 --- a/test/data/core/node/node-001.test.ttl +++ /dev/null @@ -1,50 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/node-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:node at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/node/nodeKind-001.test.ttl b/test/data/core/node/nodeKind-001.test.ttl deleted file mode 100644 index 031d134..0000000 --- a/test/data/core/node/nodeKind-001.test.ttl +++ /dev/null @@ -1,39 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/nodeKind-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:nodeKind at node shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -ex:IRITestShape - rdf:type sh:NodeShape ; - sh:nodeKind sh:IRI ; - sh:targetNode ex:John ; - sh:targetNode "true"^^xsd:boolean ; -. diff --git a/test/data/core/node/not-001.test.ttl b/test/data/core/node/not-001.test.ttl deleted file mode 100644 index 7086a8e..0000000 --- a/test/data/core/node/not-001.test.ttl +++ /dev/null @@ -1,54 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/not-001 -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:not at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/not-002.test.ttl b/test/data/core/node/not-002.test.ttl deleted file mode 100644 index 7dc7f53..0000000 --- a/test/data/core/node/not-002.test.ttl +++ /dev/null @@ -1,48 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/not-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:not at node shape 002" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/or-001.test.ttl b/test/data/core/node/or-001.test.ttl deleted file mode 100644 index 82b6f57..0000000 --- a/test/data/core/node/or-001.test.ttl +++ /dev/null @@ -1,87 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/or-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:or at node shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/node/pattern-001.test.ttl b/test/data/core/node/pattern-001.test.ttl deleted file mode 100644 index 3461ce5..0000000 --- a/test/data/core/node/pattern-001.test.ttl +++ /dev/null @@ -1,71 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/pattern-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:pattern at node shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 _:b9649 ; - sh:resultSeverity sh:Violation ; - sh:sourceConstraintComponent sh:PatternConstraintComponent ; - sh:sourceShape ex:TestShape ; - sh:value _:b9649 ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:pattern "^[2-8][0-9]*$" ; - sh:targetNode ex:Test ; - sh:targetNode 20000123 ; - sh:targetNode "3456" ; - sh:targetNode 39 ; - sh:targetNode "777777"@mi ; - sh:targetNode 9 ; - sh:targetNode "John" ; - sh:targetClass ex:TestClass ; -. -_:b9649 - rdf:type ex:TestClass ; -. diff --git a/test/data/core/node/pattern-002.test.ttl b/test/data/core/node/pattern-002.test.ttl deleted file mode 100644 index 5512ce5..0000000 --- a/test/data/core/node/pattern-002.test.ttl +++ /dev/null @@ -1,41 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/pattern-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:pattern at node shape 002" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:flags "i" ; - sh:pattern "Aldi" ; - sh:targetNode "Aldi" ; - sh:targetNode "Alti" ; - sh:targetNode "aLdI" ; -. diff --git a/test/data/core/node/xone-001.test.ttl b/test/data/core/node/xone-001.test.ttl deleted file mode 100644 index 547b22d..0000000 --- a/test/data/core/node/xone-001.test.ttl +++ /dev/null @@ -1,69 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/node/xone-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:xone at node shape 001" ; - owl:imports ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; - ] ; - ] - ) ; -. diff --git a/test/data/core/path/path-alternative-001.test.ttl b/test/data/core/path/path-alternative-001.test.ttl deleted file mode 100644 index d985a07..0000000 --- a/test/data/core/path/path-alternative-001.test.ttl +++ /dev/null @@ -1,81 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-alternative-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path sh:alternativePath 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/path/path-complex-001.test.ttl b/test/data/core/path/path-complex-001.test.ttl deleted file mode 100644 index 569f31f..0000000 --- a/test/data/core/path/path-complex-001.test.ttl +++ /dev/null @@ -1,86 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-complex-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path complex (rdf:type/rdfs:subClassOf*) 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/path/path-inverse-001.test.ttl b/test/data/core/path/path-inverse-001.test.ttl deleted file mode 100644 index d728a2c..0000000 --- a/test/data/core/path/path-inverse-001.test.ttl +++ /dev/null @@ -1,85 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-inverse-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path sh:inversePath 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 - a sh:PropertyShape ; - sh:maxCount 2 ; - sh:minCount 2 ; - sh:path [ - sh:inversePath ex:child ; - ] ; -. -ex:ValidResource1 - rdf:type ex:Person ; -. diff --git a/test/data/core/path/path-oneOrMore-001.test.ttl b/test/data/core/path/path-oneOrMore-001.test.ttl deleted file mode 100644 index 9eb84a4..0000000 --- a/test/data/core/path/path-oneOrMore-001.test.ttl +++ /dev/null @@ -1,66 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-oneOrMore-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path sh:oneOrMorePath 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/path/path-sequence-001.test.ttl b/test/data/core/path/path-sequence-001.test.ttl deleted file mode 100644 index efa3f0b..0000000 --- a/test/data/core/path/path-sequence-001.test.ttl +++ /dev/null @@ -1,75 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-sequence-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path sequence 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/path/path-sequence-002.test.ttl b/test/data/core/path/path-sequence-002.test.ttl deleted file mode 100644 index 3091140..0000000 --- a/test/data/core/path/path-sequence-002.test.ttl +++ /dev/null @@ -1,78 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-sequence-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path sequence 002" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/path/path-sequence-duplicate-001.test.ttl b/test/data/core/path/path-sequence-duplicate-001.test.ttl deleted file mode 100644 index b9ce96a..0000000 --- a/test/data/core/path/path-sequence-duplicate-001.test.ttl +++ /dev/null @@ -1,58 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-sequence-duplicate-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path sequence with duplicate 001" ; - owl:imports ; -. -ex:A - ex:p1 [ - ex:p2 "value" ; - ] ; - ex:p1 [ - ex:p2 "value" ; - ] ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -ex:S - rdf:type sh:NodeShape ; - sh:property ex:SP ; - sh:targetNode ex:A ; -. -ex:SP - a sh:PropertyShape ; - sh:maxCount 1 ; - sh:nodeKind sh:IRI ; - sh:path ( - ex:p1 - ex:p2 - ) ; -. diff --git a/test/data/core/path/path-zeroOrMore-001.test.ttl b/test/data/core/path/path-zeroOrMore-001.test.ttl deleted file mode 100644 index de6bb1d..0000000 --- a/test/data/core/path/path-zeroOrMore-001.test.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-zeroOrMore-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path sh:zeroOrMorePath 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/path/path-zeroOrOne-001.test.ttl b/test/data/core/path/path-zeroOrOne-001.test.ttl deleted file mode 100644 index 421f34b..0000000 --- a/test/data/core/path/path-zeroOrOne-001.test.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/path/path-zeroOrOne-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of path sh:zeroOrOnePath 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/and-001.test.ttl b/test/data/core/property/and-001.test.ttl deleted file mode 100644 index 41d4087..0000000 --- a/test/data/core/property/and-001.test.ttl +++ /dev/null @@ -1,102 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/and-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:and at property shape 001" ; - owl:imports ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; - ] ; -. -_:b31477 - ex:suburb ex:KewarraBeach ; -. -_:b61065 - ex:postalCode 4879 ; -. diff --git a/test/data/core/property/class-001.test.ttl b/test/data/core/property/class-001.test.ttl deleted file mode 100644 index c516da5..0000000 --- a/test/data/core/property/class-001.test.ttl +++ /dev/null @@ -1,86 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/class-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:class at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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 ; - ] ; -. diff --git a/test/data/core/property/datatype-001.test.ttl b/test/data/core/property/datatype-001.test.ttl deleted file mode 100644 index 9c68ce3..0000000 --- a/test/data/core/property/datatype-001.test.ttl +++ /dev/null @@ -1,72 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/datatype-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:datatype at property shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/datatype-002.test.ttl b/test/data/core/property/datatype-002.test.ttl deleted file mode 100644 index d7b709d..0000000 --- a/test/data/core/property/datatype-002.test.ttl +++ /dev/null @@ -1,67 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/datatype-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:datatype at property shape 002" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/datatype-003.test.ttl b/test/data/core/property/datatype-003.test.ttl deleted file mode 100644 index e23dbb5..0000000 --- a/test/data/core/property/datatype-003.test.ttl +++ /dev/null @@ -1,65 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/datatype-003.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:datatype at property shape 003" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/disjoint-001.test.ttl b/test/data/core/property/disjoint-001.test.ttl deleted file mode 100644 index 6c2fc1a..0000000 --- a/test/data/core/property/disjoint-001.test.ttl +++ /dev/null @@ -1,80 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/disjoint-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:disjoint at property shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/equals-001.test.ttl b/test/data/core/property/equals-001.test.ttl deleted file mode 100644 index 299d25a..0000000 --- a/test/data/core/property/equals-001.test.ttl +++ /dev/null @@ -1,114 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/equals-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:equals at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/hasValue-001.test.ttl b/test/data/core/property/hasValue-001.test.ttl deleted file mode 100644 index 410233f..0000000 --- a/test/data/core/property/hasValue-001.test.ttl +++ /dev/null @@ -1,63 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/hasValue-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:hasValue at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/in-001.test.ttl b/test/data/core/property/in-001.test.ttl deleted file mode 100644 index 62f4767..0000000 --- a/test/data/core/property/in-001.test.ttl +++ /dev/null @@ -1,64 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/in-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:in at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/languageIn-001.test.ttl b/test/data/core/property/languageIn-001.test.ttl deleted file mode 100644 index 4f58ca9..0000000 --- a/test/data/core/property/languageIn-001.test.ttl +++ /dev/null @@ -1,74 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/languageIn-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:languageIn at property shape 001" ; - owl:imports ; -. -ex:Berg - ex:prefLabel ex:BergLabel ; - ex:prefLabel "Berg" ; - ex:prefLabel "Berg"@de ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" - ) ; -. diff --git a/test/data/core/property/lessThan-001.test.ttl b/test/data/core/property/lessThan-001.test.ttl deleted file mode 100644 index c251522..0000000 --- a/test/data/core/property/lessThan-001.test.ttl +++ /dev/null @@ -1,91 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/lessThan-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:lessThan at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/lessThan-002.test.ttl b/test/data/core/property/lessThan-002.test.ttl deleted file mode 100644 index 061a559..0000000 --- a/test/data/core/property/lessThan-002.test.ttl +++ /dev/null @@ -1,77 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/lessThan-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:lessThan at property shape 002" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. \ No newline at end of file diff --git a/test/data/core/property/lessThanOrEquals-001.test.ttl b/test/data/core/property/lessThanOrEquals-001.test.ttl deleted file mode 100644 index 30c690e..0000000 --- a/test/data/core/property/lessThanOrEquals-001.test.ttl +++ /dev/null @@ -1,82 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/lessThanOrEquals-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:lessThanOrEquals at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/maxCount-001.test.ttl b/test/data/core/property/maxCount-001.test.ttl deleted file mode 100644 index 108eeaa..0000000 --- a/test/data/core/property/maxCount-001.test.ttl +++ /dev/null @@ -1,59 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/maxCount-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:maxCount at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/maxCount-002.test.ttl b/test/data/core/property/maxCount-002.test.ttl deleted file mode 100644 index 7688a23..0000000 --- a/test/data/core/property/maxCount-002.test.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/maxCount-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:maxCount at property shape 002" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/maxExclusive-001.test.ttl b/test/data/core/property/maxExclusive-001.test.ttl deleted file mode 100644 index 6f97e48..0000000 --- a/test/data/core/property/maxExclusive-001.test.ttl +++ /dev/null @@ -1,79 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/maxExclusive-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:maxExclusive at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/maxInclusive-001.test.ttl b/test/data/core/property/maxInclusive-001.test.ttl deleted file mode 100644 index c2f19b9..0000000 --- a/test/data/core/property/maxInclusive-001.test.ttl +++ /dev/null @@ -1,66 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/maxInclusive-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:maxInclusive at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/maxLength-001.test.ttl b/test/data/core/property/maxLength-001.test.ttl deleted file mode 100644 index ed5a33a..0000000 --- a/test/data/core/property/maxLength-001.test.ttl +++ /dev/null @@ -1,57 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/maxLength-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:maxLength at property shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/minCount-001.test.ttl b/test/data/core/property/minCount-001.test.ttl deleted file mode 100644 index f31dc99..0000000 --- a/test/data/core/property/minCount-001.test.ttl +++ /dev/null @@ -1,57 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/minCount-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:minCount at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/minCount-002.test.ttl b/test/data/core/property/minCount-002.test.ttl deleted file mode 100644 index e57e070..0000000 --- a/test/data/core/property/minCount-002.test.ttl +++ /dev/null @@ -1,36 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/minCount-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:minCount at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - rdf:type sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/minExclusive-001.test.ttl b/test/data/core/property/minExclusive-001.test.ttl deleted file mode 100644 index 8ffe992..0000000 --- a/test/data/core/property/minExclusive-001.test.ttl +++ /dev/null @@ -1,64 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/minExclusive-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:minExclusive at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/minExclusive-002.test.ttl b/test/data/core/property/minExclusive-002.test.ttl deleted file mode 100644 index c2fc611..0000000 --- a/test/data/core/property/minExclusive-002.test.ttl +++ /dev/null @@ -1,60 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/minExclusive-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:minExclusive at property shape 002" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. \ No newline at end of file diff --git a/test/data/core/property/minLength-001.test.ttl b/test/data/core/property/minLength-001.test.ttl deleted file mode 100644 index f822589..0000000 --- a/test/data/core/property/minLength-001.test.ttl +++ /dev/null @@ -1,56 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/minLength-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:minLength at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/node-001.test.ttl b/test/data/core/property/node-001.test.ttl deleted file mode 100644 index cf545ef..0000000 --- a/test/data/core/property/node-001.test.ttl +++ /dev/null @@ -1,108 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/node-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:node at property shape 001" ; - owl:imports ; -. -ex:Anon - rdf:type ex:Person ; - ex:firstName "Anon" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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: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 ; - ] ; - ] ; - sh:class ex:Person ; -. -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 ; - ] ; -. diff --git a/test/data/core/property/node-002.test.ttl b/test/data/core/property/node-002.test.ttl deleted file mode 100644 index 20704fe..0000000 --- a/test/data/core/property/node-002.test.ttl +++ /dev/null @@ -1,70 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/node-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:node at property shape 002" ; - owl:imports ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/nodeKind-001.test.ttl b/test/data/core/property/nodeKind-001.test.ttl deleted file mode 100644 index 3e92aab..0000000 --- a/test/data/core/property/nodeKind-001.test.ttl +++ /dev/null @@ -1,366 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/nodeKind-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:nodeKind at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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" ; -. -_: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/test/data/core/property/not-001.test.ttl b/test/data/core/property/not-001.test.ttl deleted file mode 100644 index a0f7d35..0000000 --- a/test/data/core/property/not-001.test.ttl +++ /dev/null @@ -1,64 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/not-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:not at property shape 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/or-001.test.ttl b/test/data/core/property/or-001.test.ttl deleted file mode 100644 index 97ae57c..0000000 --- a/test/data/core/property/or-001.test.ttl +++ /dev/null @@ -1,71 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/or-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:or at property shape 001" ; - owl:imports ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; - ] ; -. diff --git a/test/data/core/property/or-datatypes-001.test.ttl b/test/data/core/property/or-datatypes-001.test.ttl deleted file mode 100644 index 406263f..0000000 --- a/test/data/core/property/or-datatypes-001.test.ttl +++ /dev/null @@ -1,90 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/or-datatypes-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:or of sh:datatypes at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/pattern-001.test.ttl b/test/data/core/property/pattern-001.test.ttl deleted file mode 100644 index 603e495..0000000 --- a/test/data/core/property/pattern-001.test.ttl +++ /dev/null @@ -1,69 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/pattern-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:pattern at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/pattern-002.test.ttl b/test/data/core/property/pattern-002.test.ttl deleted file mode 100644 index 908c601..0000000 --- a/test/data/core/property/pattern-002.test.ttl +++ /dev/null @@ -1,61 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/pattern-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:pattern at property shape 002" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/property-001.test.ttl b/test/data/core/property/property-001.test.ttl deleted file mode 100644 index 30f73ec..0000000 --- a/test/data/core/property/property-001.test.ttl +++ /dev/null @@ -1,95 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/property-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:property at property shape 001" ; - owl:imports ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/qualifiedMinCountDisjoint-001.test.ttl b/test/data/core/property/qualifiedMinCountDisjoint-001.test.ttl deleted file mode 100644 index 1080e34..0000000 --- a/test/data/core/property/qualifiedMinCountDisjoint-001.test.ttl +++ /dev/null @@ -1,111 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/qualifiedMinCountDisjoint-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:qualifiedMinCount with disjoint shapes at property shape 001" ; - owl:imports ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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:qualifiedValueShapesDisjoint true ; - sh:qualifiedValueShape ex:FingerShape ; -. -ex:HandShape-digit-minCount1 - rdf:type sh:PropertyShape ; - sh:path ex:digit ; - sh:qualifiedMinCount 1 ; - sh:qualifiedValueShapesDisjoint true ; - sh:qualifiedValueShape ex:ThumbShape ; -. -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 ; -. diff --git a/test/data/core/property/qualifiedValueShape-001.test.ttl b/test/data/core/property/qualifiedValueShape-001.test.ttl deleted file mode 100644 index 6deb334..0000000 --- a/test/data/core/property/qualifiedValueShape-001.test.ttl +++ /dev/null @@ -1,75 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/qualifiedValueShape-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:qualifiedValueShape at property shape 001" ; - owl:imports ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/property/qualifiedValueShapesDisjoint-001.test.ttl b/test/data/core/property/qualifiedValueShapesDisjoint-001.test.ttl deleted file mode 100644 index 4f63f0a..0000000 --- a/test/data/core/property/qualifiedValueShapesDisjoint-001.test.ttl +++ /dev/null @@ -1,123 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/qualifiedValueShapesDisjoint-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:qualifiedValueShapesDisjoint at property shape 001" ; - owl:imports ; -. -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:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. -ex:HandShape-digit4 - sh:path ex:digit ; - sh:qualifiedMaxCount 4 ; - sh:qualifiedMinCount 4 ; - sh:qualifiedValueShape [ - sh:class ex:Finger ; - ] ; - sh:qualifiedValueShapesDisjoint true ; -. -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" ; -. diff --git a/test/data/core/property/uniqueLang-001.test.ttl b/test/data/core/property/uniqueLang-001.test.ttl deleted file mode 100644 index b592814..0000000 --- a/test/data/core/property/uniqueLang-001.test.ttl +++ /dev/null @@ -1,81 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/property/uniqueLang-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:uniqueLang at property shape 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/property/uniqueLang-false.test.ttl b/test/data/core/property/uniqueLang-false.test.ttl deleted file mode 100644 index b0da8d9..0000000 --- a/test/data/core/property/uniqueLang-false.test.ttl +++ /dev/null @@ -1,37 +0,0 @@ -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:uniqueLang set to false" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - rdf:type sh:ValidationReport ; - sh:conforms "true"^^xsd:boolean ; - ] -. -ex:ValidInstance1 - rdf:type ex:TestShape ; - ex:testProperty "Me" ; - ex:testProperty "Me"@en ; - ex:testProperty "Moi"@fr ; - 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 "false"^^xsd:boolean ; -. diff --git a/test/data/core/targets/multipleTargets-001.test.ttl b/test/data/core/targets/multipleTargets-001.test.ttl deleted file mode 100644 index 20f80de..0000000 --- a/test/data/core/targets/multipleTargets-001.test.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/targets/multipleTargets-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of multiple targets 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/targets/targetClass-001.test.ttl b/test/data/core/targets/targetClass-001.test.ttl deleted file mode 100644 index 7782706..0000000 --- a/test/data/core/targets/targetClass-001.test.ttl +++ /dev/null @@ -1,57 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/targets/targetClass-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:targetClass 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/targets/targetClassImplicit-001.test.ttl b/test/data/core/targets/targetClassImplicit-001.test.ttl deleted file mode 100644 index 461e775..0000000 --- a/test/data/core/targets/targetClassImplicit-001.test.ttl +++ /dev/null @@ -1,54 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/targets/targetClassImplicit-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of implicit sh:targetClass 001" ; - owl:imports ; - owl:versionInfo "Created with TopBraid Composer" ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/targets/targetNode-001.test.ttl b/test/data/core/targets/targetNode-001.test.ttl deleted file mode 100644 index 81dea6d..0000000 --- a/test/data/core/targets/targetNode-001.test.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/targets/targetNode-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:targetNode 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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 ; -. diff --git a/test/data/core/targets/targetObjectsOf-001.test.ttl b/test/data/core/targets/targetObjectsOf-001.test.ttl deleted file mode 100644 index 34e8835..0000000 --- a/test/data/core/targets/targetObjectsOf-001.test.ttl +++ /dev/null @@ -1,60 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/targets/targetObjectsOf-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:targetObjectsOf 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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" ; - ] ; - ] ; -. -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" ; -. diff --git a/test/data/core/targets/targetSubjectsOf-001.test.ttl b/test/data/core/targets/targetSubjectsOf-001.test.ttl deleted file mode 100644 index ac9bc32..0000000 --- a/test/data/core/targets/targetSubjectsOf-001.test.ttl +++ /dev/null @@ -1,52 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/targets/targetSubjectsOf-001.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - -ex:InvalidInstance1 - ex:myProperty "A" ; - ex:myProperty "B" ; -. -ex:ValidInstance1 - ex:myProperty "A" ; -. - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:targetSubjectsOf 001" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -ex:MyClass - rdf:type rdfs:Class ; -. -ex:TestShape - rdf:type sh:NodeShape ; - sh:property ex:TestShape-myProperty ; - sh:targetSubjectsOf ex:myProperty ; -. -ex:TestShape-myProperty - a sh:PropertyShape ; - sh:path ex:myProperty ; - sh:maxCount 1 ; -. diff --git a/test/data/core/targets/targetSubjectsOf-002.test.ttl b/test/data/core/targets/targetSubjectsOf-002.test.ttl deleted file mode 100644 index 2bf1649..0000000 --- a/test/data/core/targets/targetSubjectsOf-002.test.ttl +++ /dev/null @@ -1,69 +0,0 @@ -# baseURI: http://datashapes.org/sh/tests/core/targets/targetSubjectsOf-002.test -# imports: http://datashapes.org/dash -# prefix: ex - -@prefix dash: . -@prefix ex: . -@prefix owl: . -@prefix rdf: . -@prefix rdfs: . -@prefix sh: . -@prefix xsd: . - - - rdf:type owl:Ontology ; - rdfs:label "Test of sh:targetSubjectsOf 002" ; - owl:imports ; -. -ex:GraphValidationTestCase - rdf:type dash:GraphValidationTestCase ; - dash:expectedResult [ - 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 ; - ] ; - ] ; -. -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" ; -. diff --git a/test/integration_tests.js b/test/integration_tests.js deleted file mode 100644 index 071e8bf..0000000 --- a/test/integration_tests.js +++ /dev/null @@ -1,79 +0,0 @@ -/* eslint-env mocha */ -const assert = require('assert') -const path = require('path') -const SHACLValidator = require('../index') -const fs = require('fs') -const clownface = require('clownface') -const { sh, rdf: rdfNS } = require('../src/namespaces') -const { loadDataset } = require('./utils') - -class ExpectedValidationReport { - constructor (dataset) { - this.cf = clownface({ dataset }) - this.reportNode = this.cf.namedNode(sh.ValidationReport).in(rdfNS.type) - } - - get conforms () { - return this.reportNode.out(sh.conforms).value === 'true' - } - - get results () { - return this.reportNode.out(sh.result).map((node) => new ExpectedValidationResult({ - focusNode: node.out(sh.focusNode).term, - severity: node.out(sh.resultSeverity).term, - constraint: node.out(sh.sourceConstraintComponent).term, - shape: node.out(sh.sourceShape).term - })) - } -} - -class ExpectedValidationResult { - constructor ({ severity, focusNode, constraint, shape }) { - this.focusNode = focusNode.termType === 'BlankNode' ? `_:${focusNode.value}` : focusNode.value - this.severity = severity ? severity.value.split('#')[1] : null - this.sourceConstraintComponent = constraint.value - this.sourceShape = shape.termType === 'BlankNode' ? '_:' + shape.value : shape.value - } -} - -const isBlank = function (s) { - return s != null && (s.indexOf('_:') === 0 || s.indexOf('_g_') > -1) -} - -const validateReports = async function (input) { - const data = await loadDataset(input) - const shapes = data - - const expectedReport = new ExpectedValidationReport(data) - const report = new SHACLValidator(shapes).validate(data) - assert.strictEqual(report.conforms, expectedReport.conforms) - assert.strictEqual(report.results.length, expectedReport.results.length) - - for (const result of report.results) { - let found = false - for (const expectedResult of expectedReport.results) { - if ( - result.focusNode === expectedResult.focusNode && - result.severity === expectedResult.severity && - ( - (isBlank(result.sourceShape) && isBlank(expectedResult.sourceShape)) || - result.sourceShape === expectedResult.sourceShape - ) && - result.sourceConstraintComponent === expectedResult.sourceConstraintComponent - ) { - found = true - } - } - assert.strictEqual(found, true) - } -} - -describe('integration tests', () => { - const rootPath = path.join(__dirname, '/data/core') - fs.readdirSync(rootPath).forEach(function (dir) { - const dirPath = path.join(rootPath, dir) - fs.readdirSync(dirPath).forEach(function (file) { - it(dir + '-test-' + file, async () => validateReports(path.join(dirPath, file))) - }) - }) -}) From d273ecd6353dc350019eeb9d023373b388156740 Mon Sep 17 00:00:00 2001 From: Martin Maillard Date: Tue, 14 Apr 2020 17:57:08 +0200 Subject: [PATCH 7/7] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48c57b6..0ff9837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ## Next version (TBA) +* Include deep blank node structures in validation report +* Add official SHACL test suite * Fix provided factory not being used to create all quads in the validation report * Performance improvements