Skip to content

Commit

Permalink
add official tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomociti committed Oct 3, 2024
1 parent 7f69b00 commit 9d69164
Show file tree
Hide file tree
Showing 124 changed files with 8,132 additions and 8 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main
on: [push, pull_request]

jobs:
build-and-test:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
test/core
test-expected.ttl
test-actual.ttl
test-actual-report.ttl
10 changes: 10 additions & 0 deletions test/core/complex/manifest.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sht: <http://www.w3.org/ns/shacl-test#> .

<>
a mf:Manifest ;
rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/complex" ;
mf:include <personexample.ttl> ; # blank name
# mf:include <shacl-shacl.ttl> ; # timeout
.
105 changes: 105 additions & 0 deletions test/core/complex/personexample.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
@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#> .

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 (
<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 9d69164

Please sign in to comment.