-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bf052c
commit acc80f4
Showing
6 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@prefix ex: <https://example.org/> . | ||
|
||
ex:person1 a ex:Person ; ex:address ex:address1 . | ||
|
||
ex:address1 ex:city "London" . | ||
|
||
ex:tv ex:size ex:big . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix ex: <https://example.org/> . | ||
|
||
ex:personShape a sh:NodeShape ; | ||
sh:targetClass ex:Person ; | ||
sh:property [ | ||
sh:path ex:address ; | ||
sh:message "ex:city should be sh:IRI" ; | ||
sh:node ex:cityShape | ||
] . | ||
|
||
ex:cityShape | ||
sh:property [ | ||
sh:path ex:city ; | ||
sh:nodeKind sh:IRI | ||
] . | ||
|
||
ex:sizeShape | ||
sh:targetObjectsOf ex:size ; | ||
sh:or ( | ||
[ sh:hasValue ex:small ] | ||
[ sh:hasValue ex:big ] | ||
) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-env mocha */ | ||
import path from 'path' | ||
import assert from 'assert' | ||
import * as url from 'url' | ||
import SHACLValidator from '../index.js' | ||
import { loadDataset } from './utils.js' | ||
|
||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) | ||
const rootPath = path.join(__dirname, '/data/validation-repro') | ||
|
||
describe('validation repro', () => { | ||
it('repro #125', async () => { | ||
const data = await loadDataset(path.join(rootPath, 'repro125-data.ttl')) | ||
const shapes = await loadDataset(path.join(rootPath, 'repro125-shapes.ttl')) | ||
|
||
const validator = new SHACLValidator(shapes) | ||
const report = validator.validate(data) | ||
|
||
assert.equal(1, report.results.length) | ||
assert.equal(1, report.results[0].detail.length) | ||
}) | ||
}) |