shexSpec / spec

ShEx specification
https://shexspec.github.io/spec/
Other
16 stars 9 forks source link

Unexplained need for `.` when specifying cardinality in ShExC #57

Closed tombaker closed 1 year ago

tombaker commented 1 year ago

In the Primer, negative triple constraints are illustrated with:

my:SolitaryIssueShape {
  ex:state [ex:unassigned ex:assigned];
  ex:component . {0} ;
 ^ex:component . {0}
}

Why the dot?

Omitting the dot throws an error, even though the ShExJ translation (nota bene, marked as "TODO" when ShExJ is selected in the Primer), as per rdfshape.weso.es/shexConvert:

PREFIX ex: <http://example.org/>

ex:SolitaryIssueShape {
  ex:component . {0} ;
}

translates to:

{
  "type" : "Schema",
  "@context" : "http://www.w3.org/ns/shex.jsonld",
  "shapes" : [
    {
      "type" : "Shape",
      "id" : "http://example.org/SolitaryIssueShape",
      "expression" : {
        "type" : "TripleConstraint",
        "predicate" : "http://example.org/component",
        "min" : 0,
        "max" : 0
      }
    }
  ]
}

with nothing obvious requiring . as a placeholder.

tombaker commented 1 year ago

I am closing this as an issue here because it is not an issue with the spec, where the "." stands for an inline triple expression.

How I can handle this in my application, which uses Jinja templates to generate ShExC from tabular application profiles (DCTAP), is a different problem, not related to how ShExC is defined.