Skip to content

@base treats trailing hash ('#') different from slash '/' #809

Open
@simontaurus

Description

@simontaurus
{
  "@context": {
    "@version": 1.1,
    "@base":"http://example.com/vocab/",
    "name": {"@id": "http://example.com/vocab#test", "@type": "@id"}
  },
  "@id": "http://example.org/places#BrewEats",
  "@type": "Restaurant",
  "name": "Restaurant"
}

expands to

[
  {
    "@id": "http://example.org/places#BrewEats",
    "@type": [
      "http://example.com/vocab/Restaurant"
    ],
    "http://example.com/vocab#test": [
      {
        "@id": "http://example.com/vocab/Restaurant"
      }
    ]
  }
]

(playground)
while

{
  "@context": {
    "@version": 1.1,
    "@base":"http://example.com/vocab#",
    "name": {"@id": "http://example.com/vocab#test", "@type": "@id"}
  },
  "@id": "http://example.org/places#BrewEats",
  "@type": "Restaurant",
  "name": "Restaurant"
}

ignores the hash and falls back to the last slash

[
  {
    "@id": "http://example.org/places#BrewEats",
    "@type": [
      "http://example.com/Restaurant"
    ],
    "http://example.com/vocab#test": [
      {
        "@id": "http://example.com/Restaurant"
      }
    ]
  }
]

(playground)

Is this behaviour intended? I did not found any hint in the spec

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions