[spec] Add the possibility to define top-level shape declarations (#50)

labra has just created a new issue for https://github.com/shexSpec/spec:

== Add the possibility to define top-level shape declarations ==
One feature that will be useful for ShEx is to have top-level shape definitions which refer to other shapes. For example:

```shex
<Human> @<Person>
<Person> { :name . }
```

This change would imply to add more ceremony to the ShExJ. For example:

``json
{ "type": "Schema",
  "shapes": [
    { "type": "ShapeDecl", "id": "Human",
      "shapeExpr": {
        "type": "Shape",
        "expression": {
          "type": "TripleConstraint",
          "predicate": "http://example.org/name" } } },
    { "type": "ShapeDecl", "id": "Person",
      "shapeExpr": "Human" }
  ]
}
```

The changes for the ShExJ would look like:

```json
# 2.1
{
  "type": "Schema",
  "shapes": [
    { "type": "Shape",
      "expression": {
        "type": "TripleConstraint",
        "predicate": "http..."
      } } }
}
# 2.2
{
  "type": "Schema",
  "shapes": [
    { "type": "ShapeDecl",
      "id": "Human",
      "shapeExpr": {
        "type": "Shape",
        "expression": {
          "type": "TripleConstraint",
          "predicate": "http..."
        } } }
  ]
}
```

Please view or discuss this issue at https://github.com/shexSpec/spec/issues/50 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 10 June 2022 08:50:55 UTC