From c0c01c8b405c4ccd8cf07d90ec9a4099e5d09a10 Mon Sep 17 00:00:00 2001 From: Dylan Van Assche Date: Wed, 3 Jul 2024 12:14:13 +0200 Subject: [PATCH] shapes: relative_path_{source,target}: add RelativePath{Source,Target} shapes --- shapes/relative_path_source.ttl | 55 +++++++++++++++++++++++++++++++++ shapes/relative_path_target.ttl | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 shapes/relative_path_source.ttl create mode 100644 shapes/relative_path_target.ttl diff --git a/shapes/relative_path_source.ttl b/shapes/relative_path_source.ttl new file mode 100644 index 0000000..7f62adf --- /dev/null +++ b/shapes/relative_path_source.ttl @@ -0,0 +1,55 @@ +############################################################################### +# RML Relative Path Source shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2024) # +############################################################################### +@prefix sh: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLRelativePathSourceShape + a sh:NodeShape ; + sh:targetClass rml:RelativePathSource ; # Used as a class + sh:name "RML Relative Path Source" ; + sh:description """ + A RML Relative Path Source provides a source with relative paths which is + not provided by existing vocabularies such as DCAT without a base IRI. + """ ; + sh:message """ + RML Relative Path Source accepts one rml:root, and one rml:path. + rml:root is optional and defaults to rml:CurrentWorkingDirectory. + """ ; + + # rml:root + sh:property [ + sh:path rml:root ; + sh:name "rml:root" ; + sh:description """ + rml:root defines the root directory against which relative paths are + resolved. If not provided, defaults to the current working directory. + """ ; + sh:message """ + rml:root must be either rml:CurrentWorkingDirectory or + rml:MappingDirectory. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:in (rml:CurrentWorkingDirectory rml:MappingDirectory) ; + ] ; + + # rml:path + sh:property [ + sh:path rml:path ; + sh:name "rml:path" ; + sh:description """ + rml:path specifies the relative path to access for the source. + """ ; + sh:message """ + rml:path must be a string Literal. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + ] ; +. diff --git a/shapes/relative_path_target.ttl b/shapes/relative_path_target.ttl new file mode 100644 index 0000000..0b75675 --- /dev/null +++ b/shapes/relative_path_target.ttl @@ -0,0 +1,55 @@ +############################################################################### +# RML Relative Path Target shape # +# Copyright Dylan Van Assche, IDLab - UGent - imec (2024) # +############################################################################### +@prefix sh: . +@prefix : . +@prefix rdf: . +@prefix rml: . +@prefix xsd: . + +:RMLRelativePathTargetShape + a sh:NodeShape ; + sh:targetClass rml:RelativePathTarget ; # Used as a class + sh:name "RML Relative Path Target" ; + sh:description """ + A RML Relative Path Target provides a target with relative paths which is + not provided by existing vocabularies such as DCAT without a base IRI. + """ ; + sh:message """ + RML Relative Path Target accepts one rml:root, and one rml:path. + rml:root is optional and defaults to rml:CurrentWorkingDirectory. + """ ; + + # rml:root + sh:property [ + sh:path rml:root ; + sh:name "rml:root" ; + sh:description """ + rml:root defines the root directory against which relative paths are + resolved. If not provided, defaults to the current working directory. + """ ; + sh:message """ + rml:root must be either rml:CurrentWorkingDirectory or + rml:MappingDirectory. + """ ; + sh:minCount 0 ; + sh:maxCount 1 ; + sh:in (rml:CurrentWorkingDirectory rml:MappingDirectory) ; + ] ; + + # rml:path + sh:property [ + sh:path rml:path ; + sh:name "rml:path" ; + sh:description """ + rml:path specifies the relative path to access for the target. + """ ; + sh:message """ + rml:path must be a string Literal. + """ ; + sh:minCount 1 ; + sh:maxCount 1 ; + sh:nodeKind sh:Literal ; + ] ; +.