Skip to content

"jsonld compact" adds weird stuff #4

@ksuszka

Description

@ksuszka

Running following commands:

echo '{"_:a":"b"}' > input.json
echo '{}' > context.json
jsonld compact -c context.json input.json

gives following result:

[
  {
    "@context": "context.json",
    "_:a": "b"
  },
  {
    "@base": {
      "fragment": null,
      "query": null,
      "file": "input.json",
      "directory": "/Users/ksuszka/repos/experiments/tutorial/",
      "path": "/Users/ksuszka/repos/experiments/tutorial/input.json",
      "port": null,
      "hostname": "",
      "password": null,
      "user": null,
      "auth": null,
      "authority": "",
      "scheme": "file",
      "protocol": "file:",
      "href": "file:///Users/ksuszka/repos/experiments/tutorial/input.json",
      "normalizedPath": "/Users/ksuszka/repos/experiments/tutorial/input.json"
    },
    "mappings": {},
    "inverse": {},
    "fastCurieMap": {}
  }
]

I would expect to have this instead:

{
  "_:a": "b"
}

as it is generated on official json-ld playground: http://tinyurl.com/jdrltwu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions