-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweaks in the registers module to better support the annotation of entities other than places and people #237
base: master
Are you sure you want to change the base?
Conversation
@@ -60,7 +60,10 @@ declare function rapi:save($request as map(*)) { | |||
let $body := $request?body/*[1] | |||
|
|||
let $type := local-name($body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we sure $body is defined always e.g. by api.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request body is used in the definition of the corresponding REST API endpoint:
"requestBody": {
"content": {
"application/xml": {
"schema": {
"type": "string"
}
}
}
},
$request?body
key is empty when the route expects no body; see source code.
…ixed conventions exist
let $numeric-ids := for $id in $all-ids return if ($id castable as xs:integer) then $id else () | ||
let $last := if (count($all-ids)) then sort($numeric-ids)[last()] else 1 | ||
let $next := | ||
try { | ||
xs:integer($last) + 1 | ||
} catch * { | ||
'_error' | ||
1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes here are due to a case in which the register already has entries like: rp-gnd-118536109
(in which rp-
is the prefix) and then we want to generate custom entries with an ID like rp-000001
Note that 786bdfb is only relevant in the context of eeditiones/tei-publisher-components#193