DS Specifications
Domain SpecificationsListsVocabularies
main
main
  • DS Specifications Overview
  • Domain Specifications
    • DS-V7
      • DS-V7 - Changelog
      • DS-V7 - Developer Notes
      • DS-V7 - Grammar
        • Domain Specification
          • @Context
          • Domain Specification Node
          • Property Node
          • Class Node
          • DataType Node
          • Enumeration Node
        • Verification Report
          • Verification Report Node
          • Error Entry Node
          • Error List for the domain-specific verification
        • DS-Path
      • DS-V7 - Examples
    • DS-V6
    • DS-V5
      • DS-V5 - Grammar
        • VerificationReport
          • Error List for the basic verification
          • Verification of schema.org annotations
          • Error List for the Meta verification of DS (unfinished)
          • Error List for the DS-based verification
        • Grammar and semantics of Domain Specifications
          • Enumeration Node
          • Property Node
          • Domain Specification Node
          • Class Node
          • Terms used in Domain Specifications
          • @Context
          • DataType Node
      • DS-V5 - Examples
    • DS-V4
    • DS-V3
      • DS-V3 - Examples
      • DS-V3 - Grammar
        • VerificationReport
          • Error List for the basic verification
          • Verification of schema.org annotations
          • Error List for the DS-based verification
          • Error List for the Meta verification of DS
        • Grammar and semantics of Domain Specifications
          • SDO Enumeration
          • SDO Property
          • Domain Specification
          • SDO Class
          • SDO Datatype
          • @Context
    • DS-V2
      • DS-V2 - Grammar
        • Grammar and semantics of Domain Specifications
          • Grammar Documentation for node type "RestrictedEnumeration"
          • Grammar Documentation for node type "CustomEnumerationValue"
          • Grammar Documentation for node type "Enumeration"
          • Grammar Documentation for node type "Property"
          • Grammar Documentation for node type "RestrictedProperty"
          • Grammar Documentation for node type "DomainSpecification"
          • Grammar Documentation for node type "RestrictedClass"
          • Grammar Documentation for node type "EnumerationValue"
          • Grammar Documentation for node type "Class"
          • Grammar Documentation for node type "DataType"
        • Numeric Pattern
        • Grammar Documentation for node type "VerificationReport"
          • Grammar Documentation for node type "Error"
          • Error codes for Verification Reports
        • Rules Grammar
          • Grammar Documentation for node type "ComplexRule"
          • Grammar Documentation for node type "DateRule"
          • Grammar Documentation for node type "TextRule"
          • Grammar Documentation for node type "TimeRule"
          • Grammar Documentation for node type "NumberRule"
          • Grammar Documentation for node type "BooleanRule"
          • Grammar Documentation for node type "DateTimeRule"
      • DS-V2 - Examples
    • DS-V1
      • DS-V1 - Examples
      • DS-V1 - Grammar
  • SDO-Verification
  • Lists
    • List-V1
  • Vocabularies
  • DS-Vocabulary
    • Input
      • Vocabulary for Domain Specifications
      • DS-Vocabulary
    • DS-Vocab-V1
Powered by GitBook
On this page
  • Additions and changes
  • @context for DS-V5
  1. Domain Specifications
  2. DS-V5
  3. DS-V5 - Grammar
  4. Grammar and semantics of Domain Specifications

@Context

DS-V5 uses almost the same @context as the previous version DS-V4 with some additions and changes.

Additions and changes

Additions to the @context are:

  • sh:languageIn

  • sh:equals

  • sh:disjoint

  • sh:lessThan

  • sh:lessThanOrEquals

  • ds (this is a namespace/vocabulary for DS related specifications, which is also part of DS-V5)

  • ds:usedVocabularies

Since we want to use sh:in to constraints the possible values for literals too (we used it only for enumeration values before), we have to remove the corresponding "@type": "@id" from the @context. This means, that enumeration values are now wrapped with @id:

in DS-V4

@context:
...
"sh:in": {
    "@id": "sh:in",
    "@type": "@id",
    "@container": "@list"
}
...
@graph:
...
{
    "sh:class": "schema:DayOfWeek",
    "sh:in": [
        "schema:Wednesday",
        "schema:Saturday",
        "schema:Thursday"
    ]
}
...

in DS-V5

@context:
...
"sh:in": {
    "@id": "sh:in",
    "@container": "@list"
}
...
@graph:
...
{
    "sh:class": "schema:DayOfWeek",
    "sh:in": [
        {
            "@id": "schema:Wednesday"
        },
        {
           "@id": "schema:Saturday"
        },
        {
           "@id": "schema:Thursday"
        }
    ]
}
...
{
    "sh:path": "schema:City",
    "sh:or": [
        {
            "sh:datatype": "xsd:string",
            "sh:in": [
                "Innsbruck",
                "Mayrhofen",
                "Seefeld"
            ]
        }
    ]
}

To enable a listing of allowed language tags without having a wrapping @list, we need to add the following to the context:

"sh:languageIn": {
    "@id": "sh:languageIn",
    "@container":"@list"
}

Value for property pair constraints have always an URI as values, so it wise to add that type in the context:

"sh:equals": {
    "@id": "sh:equals",
    "@type": "@id"
}

@context for DS-V5

{
  "@context": {
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "sh": "http://www.w3.org/ns/shacl#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "schema": "http://schema.org/",
    "sh:targetClass": {
      "@id": "sh:targetClass",
      "@type": "@id"
    },
    "sh:property": {
      "@id": "sh:property"
    },
    "sh:path": {
      "@id": "sh:path",
      "@type": "@id"
    },
    "sh:datatype": {
      "@id": "sh:datatype",
      "@type": "@id"
    },
    "sh:node": {
      "@id": "sh:node"
    },
    "sh:class": {
      "@id": "sh:class",
      "@type": "@id"
    },
    "sh:or": {
      "@id": "sh:or",
      "@container": "@list"
    },
    "sh:in": {
      "@id": "sh:in",
      "@container": "@list"
    },
    "sh:languageIn": {
       "@id": "sh:languageIn",
       "@container":"@list"
    },
    "sh:equals": {
       "@id": "sh:equals",
       "@type": "@id"
    },
    "sh:disjoint": {
       "@id": "sh:disjoint",
       "@type": "@id"
    },
    "sh:lessThan": {
       "@id": "sh:lessThan",
       "@type": "@id"
    },
    "sh:lessThanOrEquals": {
       "@id": "sh:lessThanOrEquals",
       "@type": "@id"
    },
    "ds": "http://vocab.sti2.at/ds/",
    "ds:usedVocabularies": {
      "@id": "ds:usedVocabularies",
      "@type": "@id"
    }
  }
}
PreviousTerms used in Domain SpecificationsNextDataType Node

Last updated 4 years ago