Closed cubap closed 6 days ago
Note that Linked Data principles state that the @context
property should always be the first property in JSON-LD objects.
"@context" : "http://t-pen.org/3/context.json",
"@type" : "CreativeWork",
These are not needed here. Who's idea was this?
Improve the GET /project/{id} endpoint to return the type of thing expected. Actual connections to the database can be mocked for now.
See #2 for expectations as well as #26 for docs about possible parameters in the request to handle.
Write the failing tests first, then build to suit.
For now, a Project will look like this:
This will be stored in a database that is not set up yet, but you can assume a database controller abstraction with
db.getByID()
anddb.find({property: match})
at a minimum, the return of which will be a JSON that contains the minimum unique Project information.This endpoint should also provide alternate returns for certain parameters:
?text=blob
a complete blob of text of all lines concatenated?text=layers
an Array with each discrete layer as an entry{ "name" : Layer.name, "id" : "#AnnotationCollectionId", "textContent" : "concatenated blob" }
?text=pages
an Array of Pages, each with discrete layer as an entry{ "name" : \
Layer.name, Page.name`, "id" : "#AnnotationPageId", "textContent" : "concatenated blob" }`?text=lines
an Array of Pages, then Layers with "textContent" above as `"lines" : [ { "id" : "#AnnotationId", "textualBody" : "single annotation content" }?image=thumb
the URL of the default resolution of a thumbnail from the Manifest?lookup=manifest
(layers[], annotations[], metadata[], group) find the related document or Array of documents and return that instead, the version allowed without authentication?view=json
is the default, no querystring request and is redundant?view=xml
is a chance to get the document as an XML file?view=html
is a readonly viewer HTML Document presenting the project data?embed=true
instructs methods that would have returned a URI to expand that and dereference the full document in its placeThese parameters are all mutually exclusive except
embed
and passing multiple or a nonsense combo ("?view=html&embed=true") is an error.