Skip to content

Does @sealed consider order? #153

Closed
Closed
@rubensworks

Description

@rubensworks

Due to the definition of @sealed, the following context will throw an error:

{
  "@context": [
    {
      "@version": 1.1,
      "Person": "http://schema.org/Person",
      "knows": "http://schema.org/knows",
      "name": {
        "@id": "http://schema.org/name",
        "@sealed": true
      }
    },
    {
      "name": "this_attempt_to_override_name_will_fail"
    }
  ]
}

As far as I can see, the spec does not seem to mention what should happen if sealing is done within a context that extends an existing context. Concretely, should the following also error?

{
  "@context": [
    {
      "name": "this_attempt_to_override_name_will_fail"
    },
    {
      "@version": 1.1,
      "Person": "http://schema.org/Person",
      "knows": "http://schema.org/knows",
      "name": {
        "@id": "http://schema.org/name",
        "@sealed": true
      }
    }
  ]
}

Two things are possible here:

  1. No error: The sealed scope only starts from the moment @sealed is used. This would allow modifications of term definitions up to this point, but not later on. (May be useful when combining multiple external contexts, and sealing afterwards)
  2. Error: The sealed scope propagates backwards from the moment @sealed is used. This may be useful for cases where context extensions need to be handled very strictly.

I have a slight preference for option 1. But either way, I think this should be clarified in the spec.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions