Open labra opened 7 years ago
Why not just use ShapeAnd?:
<OneOf> @<TripleExprComponent> AND {
a [sx:OneOf] ;
}
<EachOf> @<TripleExprComponent> AND {
a [sx:EachOf] ;
}
<TripleExprComponent> CLOSED {
a . ;
sx:min xsd:integer? ;
sx:max xsd:integer OR ["*"]? ;
sx:expressions @<tripleExpressionList2Plus> ;
sx:semActs @<SemActList1Plus>? ;
sx:annotation @<Annotation>*
}
Of course, there may be other cases where parameterization would come in handy. I would think it would be more of a macro-feature in ShExC.
That's a nice solution for that use case that I had not consider. Thanks.
Anyway, as you say, having some kind of macro facility is something that will be useful.
I don't suggest this feature for the next version of ShEx, although I wanted to record it as a feature to consider in the future.
should we have a long-now milestone?
ShEx 3.0 ?
I suggest re-titling this issue to "ShEx functions or macros".
Done
Any language will sooner or later need an abstraction mechanism where one can declare some common parts with some parameters that can be reused.
As an example, this ShEx file contains:
which looks very repetitive.
One possible syntax could be: