dlcs / elucidate-server

A W3C and OA compliant Web Annotation server
https://dlcs.info/features.html
MIT License
51 stars 15 forks source link

Empty annotation page uses incorrect compaction #37

Open tomcrane opened 7 years ago

tomcrane commented 7 years ago

When there's nothing in a container, you get

as:items: {
    @list: [ ]
},

image

As soon as you put something in it, you get the correct items:

image

danielgrant commented 7 years ago

Hi @tomcrane,

I've been aware of this anomaly for some time now and in fact, this is intentional behaviour. You can see the same behaviour being exhibited in this JSON-LD Playground: https://tinyurl.com/ybyewdz6.

As per this issue over on the JSON-LD Public Repositories, this is basically the result of the algorithms inability to select the term for compaction due to the lack of at least one entry in the list that matches the type / language expectations of the term within the @context.

It looks like this has been worked on and merged into master recently, but it's not yet clear whether this is being treated as an erratum to the 1.0 version of the specification, or is being carried forward to 1.1. Either way, it'll need to find it's way into the jsonld-java library that Elucidate uses, or we'll have to do some serious manual hacking of the JSON-LD payload to detect and modify when this scenario occurs.

Cheers, Daniel.

tomcrane commented 7 years ago

Eek... I can work round it for now.

danielgrant commented 7 years ago

I'll leave this open so we can track it but I'll label it as wontfix as it (currently) doesn't fall under the remit of the this project to resolve.