-
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: * #602 Signed-off-by: Alex Nelson <[email protected]>
- Loading branch information
1 parent
6827596
commit 1e6d1af
Showing
2 changed files
with
168 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
@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 types: <https://ontology.unifiedcyberontology.org/uco/types/> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
[] | ||
a sh:ValidationReport ; | ||
sh:conforms "false"^^xsd:boolean ; | ||
sh:result | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/kb/Dictionary-34ac0c49-1042-49c0-8fd6-c42a810e58da> ; | ||
sh:resultMessage "A key in a dictionary should appear no more than once. The value literal does. Please consider using the types:ImproperDictionary class and types:repeatsKey property." ; | ||
sh:resultSeverity sh:Warning ; | ||
sh:sourceConstraint [ | ||
a sh:SPARQLConstraint ; | ||
sh:message "A key in a dictionary should appear no more than once. The value literal does. Please consider using the types:ImproperDictionary class and types:repeatsKey property."@en ; | ||
sh:select """ | ||
PREFIX types: <https://ontology.unifiedcyberontology.org/uco/types/> | ||
SELECT $this ?value | ||
WHERE { | ||
$this | ||
types:entry/types:key ?value ; | ||
. | ||
FILTER NOT EXISTS { | ||
$this | ||
a types:ImproperDictionary ; | ||
. | ||
} | ||
FILTER NOT EXISTS { | ||
$this | ||
a types:ProperDictionary ; | ||
. | ||
} | ||
} | ||
GROUP BY ?value | ||
HAVING (COUNT(?value) > 1) | ||
""" ; | ||
] ; | ||
sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; | ||
sh:sourceShape types:Dictionary-keyUniqueness-shape ; | ||
sh:value "x" ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/kb/Dictionary-34ac0c49-1042-49c0-8fd6-c42a810e58da> ; | ||
sh:resultMessage "Value does not have class types:ImproperDictionary" ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:ClassConstraintComponent ; | ||
sh:sourceShape types:repeatsKey-subjects-shape ; | ||
sh:value <http://example.org/kb/Dictionary-34ac0c49-1042-49c0-8fd6-c42a810e58da> ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/kb/Dictionary-5bc55661-4808-48e6-9e02-80a153eee5d3> ; | ||
sh:resultMessage "types:ImproperDictionary and types:ProperDictionary are disjoint classes."@en ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:NotConstraintComponent ; | ||
sh:sourceShape types:ImproperDictionary-disjointWith-ProperDictionary-shape ; | ||
sh:value <http://example.org/kb/Dictionary-5bc55661-4808-48e6-9e02-80a153eee5d3> ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/kb/Dictionary-e6dc9c2e-25bc-422f-8ae8-8457e29f5fde> ; | ||
sh:resultMessage "Value does not have class types:ImproperDictionary" ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:ClassConstraintComponent ; | ||
sh:sourceShape types:repeatsKey-subjects-shape ; | ||
sh:value <http://example.org/kb/Dictionary-e6dc9c2e-25bc-422f-8ae8-8457e29f5fde> ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/kb/ProperDictionary-8114819f-d3c8-4e29-9e31-295d771f9db2> ; | ||
sh:resultMessage "Value does not have class types:ImproperDictionary" ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:ClassConstraintComponent ; | ||
sh:sourceShape types:repeatsKey-subjects-shape ; | ||
sh:value <http://example.org/kb/ProperDictionary-8114819f-d3c8-4e29-9e31-295d771f9db2> ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/kb/ProperDictionary-b2baf8af-3d5d-4c4e-b442-49befefd147e> ; | ||
sh:resultMessage "A key in a proper dictionary can appear no more than once." ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraint [ | ||
a sh:SPARQLConstraint ; | ||
sh:message "A key in a proper dictionary can appear no more than once."@en ; | ||
sh:select """ | ||
PREFIX types: <https://ontology.unifiedcyberontology.org/uco/types/> | ||
SELECT $this ?value | ||
WHERE { | ||
$this | ||
types:entry/types:key ?value ; | ||
. | ||
} | ||
GROUP BY ?value | ||
HAVING (COUNT(?value) > 1) | ||
""" ; | ||
] ; | ||
sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; | ||
sh:sourceShape types:ProperDictionary ; | ||
sh:value "x" ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/kb/ProperDictionary-f5ae2e6a-9b10-46f3-8441-30aada36aa1b> ; | ||
sh:resultMessage "A key in a proper dictionary can appear no more than once." ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraint [ | ||
a sh:SPARQLConstraint ; | ||
sh:message "A key in a proper dictionary can appear no more than once."@en ; | ||
sh:select """ | ||
PREFIX types: <https://ontology.unifiedcyberontology.org/uco/types/> | ||
SELECT $this ?value | ||
WHERE { | ||
$this | ||
types:entry/types:key ?value ; | ||
. | ||
} | ||
GROUP BY ?value | ||
HAVING (COUNT(?value) > 1) | ||
""" ; | ||
] ; | ||
sh:sourceConstraintComponent sh:SPARQLConstraintComponent ; | ||
sh:sourceShape types:ProperDictionary ; | ||
sh:value "x" ; | ||
] , | ||
[ | ||
a sh:ValidationResult ; | ||
sh:focusNode <http://example.org/kb/ProperDictionary-f5ae2e6a-9b10-46f3-8441-30aada36aa1b> ; | ||
sh:resultMessage "Value does not have class types:ImproperDictionary" ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:ClassConstraintComponent ; | ||
sh:sourceShape types:repeatsKey-subjects-shape ; | ||
sh:value <http://example.org/kb/ProperDictionary-f5ae2e6a-9b10-46f3-8441-30aada36aa1b> ; | ||
] | ||
; | ||
. | ||
|