-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
References: * #619 Signed-off-by: Alex Nelson <[email protected]>
- Loading branch information
1 parent
5a80146
commit c205205
Showing
1 changed file
with
139 additions
and
0 deletions.
There are no files selected for viewing
139 changes: 139 additions & 0 deletions
139
tests/examples/information_resource_PASS_validation.ttl
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,139 @@ | ||
@prefix core: <https://ontology.unifiedcyberontology.org/uco/core/> . | ||
@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 xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
[] | ||
a sh:ValidationReport ; | ||
sh:conforms "true"^^xsd:boolean ; | ||
sh:result | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/~bob> ; | ||
sh:resultMessage "UcoThings are suggested to end with a UUID." ; | ||
sh:resultSeverity sh:Info ; | ||
sh:sourceConstraint [ | ||
a sh:SPARQLConstraint ; | ||
rdfs:seeAlso <https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.3> ; | ||
sh:message "UcoThings are suggested to end with a UUID."@en ; | ||
sh:select ''' | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX core: <https://ontology.unifiedcyberontology.org/uco/core/> | ||
SELECT $this | ||
WHERE { | ||
$this a/rdfs:subClassOf* core:UcoThing . | ||
FILTER ( | ||
! REGEX ( | ||
STR($this), | ||
"[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$", | ||
"i" | ||
) | ||
) | ||
} | ||
''' ; | ||
] ; | ||
sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; | ||
sh:sourceShape core:UcoThing-identifier-regex-shape ; | ||
sh:value <http://example.org/~bob> ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/~bob> ; | ||
sh:resultMessage "core:InformationResource and core:NeverInformationResource are disjoint classes. Assigning both types to a single node will be an error as of UCO 2.0.0."@en ; | ||
sh:resultSeverity sh:Warning ; | ||
sh:sourceConstraintComponent sh:NotConstraintComponent ; | ||
sh:sourceShape core:InformationResource-disjointWith-NeverInformationResource-shape ; | ||
sh:value <http://example.org/~bob> ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/~chris> ; | ||
sh:resultMessage "UcoThings are suggested to end with a UUID." ; | ||
sh:resultSeverity sh:Info ; | ||
sh:sourceConstraint [ | ||
a sh:SPARQLConstraint ; | ||
rdfs:seeAlso <https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.3> ; | ||
sh:message "UcoThings are suggested to end with a UUID."@en ; | ||
sh:select ''' | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX core: <https://ontology.unifiedcyberontology.org/uco/core/> | ||
SELECT $this | ||
WHERE { | ||
$this a/rdfs:subClassOf* core:UcoThing . | ||
FILTER ( | ||
! REGEX ( | ||
STR($this), | ||
"[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$", | ||
"i" | ||
) | ||
) | ||
} | ||
''' ; | ||
] ; | ||
sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; | ||
sh:sourceShape core:UcoThing-identifier-regex-shape ; | ||
sh:value <http://example.org/~chris> ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <https://mc.example.co.jp/> ; | ||
sh:resultMessage "UcoThings are suggested to end with a UUID." ; | ||
sh:resultSeverity sh:Info ; | ||
sh:sourceConstraint [ | ||
a sh:SPARQLConstraint ; | ||
rdfs:seeAlso <https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.3> ; | ||
sh:message "UcoThings are suggested to end with a UUID."@en ; | ||
sh:select ''' | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX core: <https://ontology.unifiedcyberontology.org/uco/core/> | ||
SELECT $this | ||
WHERE { | ||
$this a/rdfs:subClassOf* core:UcoThing . | ||
FILTER ( | ||
! REGEX ( | ||
STR($this), | ||
"[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$", | ||
"i" | ||
) | ||
) | ||
} | ||
''' ; | ||
] ; | ||
sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; | ||
sh:sourceShape core:UcoThing-identifier-regex-shape ; | ||
sh:value <https://mc.example.co.jp/> ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <https://mc.example.co.jp/lang-fr/> ; | ||
sh:resultMessage "UcoThings are suggested to end with a UUID." ; | ||
sh:resultSeverity sh:Info ; | ||
sh:sourceConstraint [ | ||
a sh:SPARQLConstraint ; | ||
rdfs:seeAlso <https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.3> ; | ||
sh:message "UcoThings are suggested to end with a UUID."@en ; | ||
sh:select ''' | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX core: <https://ontology.unifiedcyberontology.org/uco/core/> | ||
SELECT $this | ||
WHERE { | ||
$this a/rdfs:subClassOf* core:UcoThing . | ||
FILTER ( | ||
! REGEX ( | ||
STR($this), | ||
"[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$", | ||
"i" | ||
) | ||
) | ||
} | ||
''' ; | ||
] ; | ||
sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; | ||
sh:sourceShape core:UcoThing-identifier-regex-shape ; | ||
sh:value <https://mc.example.co.jp/lang-fr/> ; | ||
] | ||
; | ||
. | ||
|