[WIP] Make store return JSON-LD when preferred#90
[WIP] Make store return JSON-LD when preferred#90Treora wants to merge 17 commits intoopenannotation:masterfrom
Conversation
Annotations can now be serialised into JSON-LD formatted RDF, following the data model spec: http://www.openannotation.org/spec/core/
Because JSON-LD spec recommends keeping @context at the top.
Let's keep the default very generic, for example we don't even know if users are Persons. Implementors can subclass Annotation to add more user info (as with any of the properties).
Note that render does not return a string or response object, but an object that jsonify can process. This can be changed when we wish to support formats that are not JSON-based. Also the content-negotiation/rendering is still only done on endpoints that are read-only, because to use writable endpoints one needs to understand the annotator-specific format anyway.
|
@nickstenning @tilgovi since @Treora's cycles are diminishing, do you think we could get this merged? I'm happy to pick up where he left of if it needs any more tweaking. Thanks for building this @Treora! |
|
@BigBlueHat: I would like to note that this code never left the experimental phase. We're mostly talking about PR #83 here by the way, as this PR #90 is only adding content negotiation on top of that. |
The follow-up on #83.
Note that render does not return a string or response object, but an
object that jsonify can process. This can be changed when we wish to
support formats that are not JSON-based.
Also the content-negotiation/rendering is still only done on endpoints
that are read-only, because to use writable endpoints one needs to
understand the annotator-specific format anyway.