pkiraly/metadata-qa-api

Pattern

Opened this issue · 0 comments

Pattern := pat:RDFLiteral, flagstr:RDFLiteral

A Pattern parameter is evaluated against the SPARQL regex function with the lexical form of value node as the text parameter, pat as the pattern parameter and flagstr as the flags parameter. (sh:pattern, sh:flags)

<IssueShape1> sh:property [ sh:predicate ex:submittedBy; sh:pattern "^HtTp://" ; sh:flags "i" ] .
<IssueShape2> sh:property [ sh:predicate ex:submittedBy; sh:pattern " +" ; sh:flags "@" ] .
<issue1> ex:submittedBy <http://a.example/bob> .     # matches <IssueShape1>'s case-insensitive pattern
<issue2> ex:submittedBy "http://hahaha!" .           # also matches <IssueShape1>'s pattern
<issue3> ex:submittedBy <mailto:bob@example.com> .
<IssueShape1>  <issue1>  pass
<IssueShape1>  <issue2>  pass
<IssueShape1>  <issue3>  fail  mailto:bob@example.com does not match the pattern /^HtTp:\/\//i
<IssueShape2>  <issue1>  fail  @ is not a valid flag string.
<IssueShape2>  <issue2>  fail  @ is not a valid flag string.