slanted W3C logo
Cover page images (keys)

SHACL and ShEx

http://www.w3.org/2015/Talks/0909-shex-egp/

TOC

grammar

similarities

CLOSED vs. OPEN properties

Mentioning a predicate once says that other uses of it are errors.

<AuthorShape> {
    pub:authored @<ChapterShape>+
}

 ShEx:

<Author1> pub:authored <Chapter1>,  <Chapter2>, <SomeBlurb>, <#$%@#$%>.

SHACL:

<Author1> pub:authored <Chapter1>,  <Chapter2>, <SomeBlurb>, <#$%@#$%>.

Mentioning it twice (multi-occurance) does the same.

<AuthorShape> {
    pub:authored @<ChapterShape>+,
    pub:authored @<BlurbShape>
}

 ShEx:

<Author1> pub:authored <Chapter1>,  <Chapter2>, <SomeBlurb>, <#$%@#$%>.

SHACL:

<Author1> pub:authored <Chapter1>,  <Chapter2>, <SomeBlurb>, <#$%@#$%>.

A property can be "EXTRA", meaning it's not policed.

<AuthorShape> EXTRA pub:authored {
    pub:authored @<ChapterShape>+,
    pub:authored @<BlurbShape>
}

ShEx

<Author1> pub:authored <Chapter1>,  <Chapter2>, <SomeBlurb>, <#$%@#$%>.

shex minus shacl

shacl minus shex

funny bits

JSON syntax

repo

{
  "type": "schema",
  "prefixes": {},
  "shapes": {
    "http://a.example/IssueShape": {
      "type": "shape",
      "expression": {
        "type": "someOf",
        "expressions": [
          {
            "type": "tripleConstraint",
            "predicate": "http://a.example/p1",
            "value": { "type": "valueClass" }
          },
          {
            "type": "tripleConstraint",
            "predicate": "http://a.example/p2",
            "value": { "type": "valueClass" }
          }
        ]
      }
    }
  }
}

strategy

  1. document ShEx-to-json à la
  2. transmute the tree to eliminate the upper list
  3. ...