linked-data-dotnet/json-ld.net

Compaction algorithm doesn't compact properties with { "@type": "@id" } specified in context

Closed this issue · 8 comments

Given

{
  "@context": {
    "@vocab": "http://test.com/",
    "stuff": { "@type": "@id" }
  }
}

when I compact the document:

{
   "http://test.com/stuff": { "@id": "some/stuff" }
}

I believe I should get:

{
  "stuff": "some/stuff"
}

This matches the playground output on the JSON-LD site: https://json-ld.org/playground/#/gist/c01a7b032f191afc9034c307caf17a61

The value compaction algorithm: (6.5.2 Algorithm, 4.1: https://json-ld.org/spec/latest/json-ld-api/#algorithm-8, retrieved 2018-01-10) says:

If number members is 1 and the type mapping of active property is set to @id, return the result of using the IRI compaction algorithm, passing active context, inverse context, and the value of the @id member for iri.

However, json-ld.net instead returns:

{
  "stuff": {
    "@id": "/some/stuff"
  }
}

Are you accepting pull requests for this? Do you need new maintainers?

A PR for this would be great. This project hasn't had a lot of attention lately, but I can help you get the changes in.

Sorry to swamp you with issues today @emgarten but I would like to help resolve at least the ones I've created. I have put a PR in and have another one or two which I can send in whatever form/schedule is easiest for you to receive.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

Reopening this as part of #60

stale commented

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

dependent on pending issues

stale commented

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.