DS-V1 - Grammar
Last updated
Last updated
The grammar for DS-V1 is given below in BNF. The grammar consists of 7 different node-types, that are used to construct a Domain Specification. A Domain Specification is a tree-shaped JSON-LD, like the annotations it should represent.
The Domain Specification Node is the start node (aka. root-node) for a Domain Specification.
It contains the @context
for the whole document, which includes only schema.org and the (virtual) DS Vocabulary:
dsv:class
holds an array of possible restricted Classes that this DS would allow. If an annotation complies to at least one of these restricted classes, the annotation would be in compliance to the DS.
A Restricted Class Node is used to represent a Class from schema.org (dsv:baseClass
) that has a specific set of further specified properties (dsv:property
).
A Property Node is used to represent a Property from schema.org (dsv:baseProperty
) that has cardinality constraints (dsv:isOptional
and dsv:multipleValuesAllowed
), and a specific set of further specified ranges (dsv:expectedType
).
A Class Node is used to represent a Class from schema.org (@id
). In this case no further constraints are given: the corresponding Class may have any set of properties allowed by schema.org for this class.
A Restricted Enumeration Node is used to represent an Enumeration from schema.org (dsv:baseEnumeration
) that has a specific set of further specified enumeration values = valid instances (dsv:expectedEnumerationValue
).
An Enumeration Value Node is used to represent an Enumeration Value from schema.org (@id
).
A Data Type Node is used to represent a Data Type from schema.org (@id
).