Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 31 additions & 26 deletions shapes/core.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -676,44 +676,31 @@
Represents a Expression Map.
""" ;
sh:message """
Expression Map requires one rml:template or one rml:constant or one
Expression Map may require one rml:template or one rml:constant or one
rml:reference.
""" ;
sh:property [ rdfs:label "template/constant/reference/returnMap/functionExecution" ;
sh:or ( [ sh:not [ sh:property [ sh:minCount 1 ;
sh:path rml:returnMap ] ] ] [ sh:property [ sh:maxCount 1 ;
sh:minCount 1 ;
sh:path rml:returnMap ],
[ sh:maxCount 1 ;
sh:minCount 1 ;
sh:path rml:functionExecution ] ] ) ;
sh:property [ rdfs:label "template/constant/reference/functionExecution" ;
rdfs:comment """
Exactly one rml:template, one rml:constant, one rml:reference,
one rml:returnMap, or one rml:functionExecution is required.
Only one rml:template, one rml:constant, one rml:reference,
or one rml:functionExecution is allowed. rml:returnMap is only allowed if rml:functionExecution is present.
""" ;
sh:maxCount 1 ;
sh:message """
Exactly one rml:template, one rml:constant, one rml:reference,
one rml:returnMap, or one rml:functionExecution is required.
""" ;
sh:minCount 1 ;
sh:path [ sh:alternativePath ( rml:template rml:constant rml:reference rml:returnMap rml:functionExecution ) ] ;
sh:path [ sh:alternativePath ( rml:template rml:constant rml:reference rml:functionExecution ) ] ;
sh:targetSubjectsOf rml:constant,
rml:functionExecution,
rml:reference,
rml:returnMap,
rml:template ],
[ rdfs:label "reference" ;
rdfs:comment """
A reference rml:reference is used to refer to a column in case of
databases, a record in case of CSV or TSV data source, an element in
case of XML data source, an object in case of a JSON data source, etc.

A reference must be a valid identifier, considering the reference
formulation (rml:referenceFormulation) specified. The reference can be
an absolute path, or a path relative to the iterator specified at the
logical source.
""" ;
sh:datatype xsd:string ;
sh:message """
rml:reference must be a string.
""" ;
sh:nodeKind sh:Literal ;
sh:path rml:reference ;
sh:targetSubjectsOf rml:reference ],
[ rdfs:label "returnMap" ;
rdfs:comment """
A Return Map rml:returnMap is used to define the return values of a FnO
Expand Down Expand Up @@ -761,7 +748,25 @@
rml:constant must be an IRI or Literal.
""" ;
sh:path rml:constant ;
sh:targetSubjectsOf rml:constant ] .
sh:targetSubjectsOf rml:constant ],
[ rdfs:label "reference" ;
rdfs:comment """
A reference rml:reference is used to refer to a column in case of
databases, a record in case of CSV or TSV data source, an element in
case of XML data source, an object in case of a JSON data source, etc.

A reference must be a valid identifier, considering the reference
formulation (rml:referenceFormulation) specified. The reference can be
an absolute path, or a path relative to the iterator specified at the
logical source.
""" ;
sh:datatype xsd:string ;
sh:message """
rml:reference must be a string.
""" ;
sh:nodeKind sh:Literal ;
sh:path rml:reference ;
sh:targetSubjectsOf rml:reference ] .

<http://w3id.org/rml/shapes/RMLLogicalTargetPropertiesShape> a sh:PropertyShape ;
rdfs:label "logicalTarget" ;
Expand Down
36 changes: 29 additions & 7 deletions shapes/expression_map.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Represents a Expression Map.
""" ;
sh:message """
Expression Map requires one rml:template or one rml:constant or one
Expression Map may require one rml:template or one rml:constant or one
rml:reference.
""" ;

Expand All @@ -26,23 +26,20 @@
sh:targetSubjectsOf rml:template ;
sh:targetSubjectsOf rml:constant ;
sh:targetSubjectsOf rml:reference ;
sh:targetSubjectsOf rml:returnMap ;
sh:targetSubjectsOf rml:functionExecution ;
sh:path [sh:alternativePath (rml:template
rml:constant
rml:reference
rml:returnMap
rml:functionExecution)] ;
rdfs:label "template/constant/reference/returnMap/functionExecution" ;
rdfs:label "template/constant/reference/functionExecution" ;
rdfs:comment """
Exactly one rml:template, one rml:constant, one rml:reference,
one rml:returnMap, or one rml:functionExecution is required.
Only one rml:template, one rml:constant, one rml:reference,
or one rml:functionExecution is allowed. rml:returnMap is only allowed if rml:functionExecution is present.
""" ;
sh:message """
Exactly one rml:template, one rml:constant, one rml:reference,
one rml:returnMap, or one rml:functionExecution is required.
""" ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;

Expand Down Expand Up @@ -134,4 +131,29 @@
sh:nodeKind sh:BlankNodeOrIRI ;
# Allow BlankNodes so nested structurces works as well for rml:returnMap
] ;
# If returnMap appears, then functionExecution must also appear
sh:or (

[
sh:not [
sh:property [
sh:path rml:returnMap ;
sh:minCount 1
]
]
]

[
sh:property [
sh:path rml:returnMap ;
sh:minCount 1 ;
sh:maxCount 1
] ;
sh:property [
sh:path rml:functionExecution ;
sh:minCount 1 ;
sh:maxCount 1
]
]
)
.