Skip to content

method to require {"id": "uri"} resource compaction result  #6

Closed
@gkellogg

Description

@gkellogg

Issue: The compaction algorithm prefers the most compact format, which for resources without relationships is a string containing the URI. This causes problems in systems that cannot handle arrays of mixed data types (for example ElasticSearch) when there are also resources that have relationships, resulting in both objects and strings in the same array.

For example:

"seeAlso": [
    "http://example.org/reference1",
    {"id": "http://example.org/reference2", "format": "text/html"}
  ]

would raise an error in Elastic.

Proposed solution: Provide a flag to the compaction algorithm to signal that the resulting JSON should always create objects for resources, even if there is only the URI available. This would instead render the example above as an array of objects:

"seeAlso": [
    {"id": "http://example.org/reference1"},
    {"id": "http://example.org/reference2", "format": "text/html"}
  ]

Original issue: JSON-LD 1.1: method to require {"id": "uri"} resource compaction result #507.

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