metadata-qa-api icon indicating copy to clipboard operation
metadata-qa-api copied to clipboard

Pattern

Open pkiraly opened this issue 9 years ago • 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:[email protected]> .
<IssueShape1>  <issue1>  pass
<IssueShape1>  <issue2>  pass
<IssueShape1>  <issue3>  fail  mailto:[email protected] 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.

pkiraly avatar Sep 29 '16 06:09 pkiraly