Skip to content

Compact @id's to relative IRIs #204

@lanthaler

Description

@lanthaler

Currently @ids are transformed to absolute IRIs during expansion. It might make sense to re-compact them automatically to relative IRIs in compaction.

Example (assuming http://www.example.com/document.jsonld as base IRI):

{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name"
  },
  "@id": "markus",
  "name": "Markus Lanthaler"
}

Expands to

[
  {
    "@id": "http://www.example.com/markus",
    "http://xmlns.com/foaf/0.1/name": [
      { "@value": "Markus Lanthaler" }
    ]
  }
]

and re-compacts to

{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name"
  },
  "@id": "http://www.example.com/markus",
  "name": "Markus Lanthaler"
}

Instead I think it should compact to

{
  "@context": {
    "name": "http://xmlns.com/foaf/0.1/name"
  },
  "@id": "markus",
  "name": "Markus Lanthaler"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions