Skip to content

Commit

Permalink
Merge pull request #37 from schimatos/live-testing
Browse files Browse the repository at this point in the history
Live testing
  • Loading branch information
jeswr authored Apr 6, 2021
2 parents daa1c1f + 7df519e commit 1b0b2cc
Show file tree
Hide file tree
Showing 31 changed files with 40,326 additions and 20,184 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
path.tsx
accessibility.tsx
form-change.tsx
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release --dry-run
run: npx semantic-release
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./webpack.config.js
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"personexample"
]
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export function MyApp() {

This library also exposes the `SHACLFormInternal` component.

Note that this component uses `rdf-object` which has a dependency on the node `stream` package. If you intend to use the component in a browser application you will need to use a wepack polfill. See

## License
©2019–present
[Jesse Wright](https://github.com/jeswr), Commonwealth of Australia,
Expand Down
144 changes: 144 additions & 0 deletions __tests__/data/PersonShape.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"@context":
{},
"@graph": [
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#PersonShape",
"@type": [
"http://www.w3.org/ns/shacl#NodeShape"
],
"http://www.w3.org/ns/shacl#closed": [
{
"@value": "true",
"@type": "http://www.w3.org/2001/XMLSchema#boolean"
}
],
"http://www.w3.org/ns/shacl#ignoredProperties": [
{
"@id": "_:n3-0"
}
]
},
{
"@id": "_:n3-0",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [
{
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [
{
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#first": [
{
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
}
],
"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest": [
{
"@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"
}
]
},
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#PersonShape",
"http://www.w3.org/ns/shacl#property": [
{
"@id": "_:b15_b61064"
}
]
},
{
"@id": "_:b15_b61064",
"http://www.w3.org/ns/shacl#path": [
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#ssn"
}
],
"http://www.w3.org/ns/shacl#datatype": [
{
"@id": "http://www.w3.org/2001/XMLSchema#string"
}
],
"http://www.w3.org/ns/shacl#maxCount": [
{
"@value": "1",
"@type": "http://www.w3.org/2001/XMLSchema#integer"
}
],
"http://www.w3.org/ns/shacl#pattern": [
{
"@value": "^\\d{3}-\\d{2}-\\d{4}$"
}
]
},
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#PersonShape",
"http://www.w3.org/ns/shacl#property": [
{
"@id": "_:b15_b60054"
}
]
},
{
"@id": "_:b15_b60054",
"http://www.w3.org/ns/shacl#path": [
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#worksFor"
}
],
"http://www.w3.org/ns/shacl#class": [
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#Company"
}
],
"http://www.w3.org/ns/shacl#nodeKind": [
{
"@id": "http://www.w3.org/ns/shacl#IRI"
}
]
},
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#PersonShape",
"http://www.w3.org/ns/shacl#property": [
{
"@id": "_:n3-1"
}
]
},
{
"@id": "_:n3-1",
"http://www.w3.org/ns/shacl#path": [
{
"@id": "_:n3-2"
}
]
},
{
"@id": "_:n3-2",
"http://www.w3.org/ns/shacl#inversePath": [
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#worksFor"
}
]
},
{
"@id": "_:n3-1",
"http://www.w3.org/ns/shacl#name": [
{
"@value": "employee"
}
]
},
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#PersonShape",
"http://www.w3.org/ns/shacl#targetClass": [
{
"@id": "http://datashapes.org/sh/tests/core/complex/personexample.test#Person"
}
]
}
]
}
122 changes: 122 additions & 0 deletions __tests__/data/person-shape.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
export default `@prefix dash: <http://datashapes.org/dash#> .
@prefix ex: <http://datashapes.org/sh/tests/core/complex/personexample.test#> .
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix sht: <http://www.w3.org/ns/shacl-test#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
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 (ex:1 ex:2 ex:3) ;
sh:name "random path" ;
] ;
sh:property [
sh:path [ sh:zeroOrMorePath (ex:1 ex:2 ex:3) ] ;
sh:name "employee" ;
] ;
sh:property [
sh:path [
sh:alternativePath (
[sh:zeroOrMorePath (foaf:knows)]
[sh:zeroOrMorePath (foaf:name)]
)
] ;
sh:name "friend" ;
] ;
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
.
_:b60054
sh:path ex:worksFor ;
sh:class ex:Company ;
sh:nodeKind sh:IRI
.
<>
rdf:type mf:Manifest ;
mf:entries (
<personexample>
) ;
.
<personexample>
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 ;
.`;
Loading

0 comments on commit 1b0b2cc

Please sign in to comment.