Newer
Older
web-services / loterre-resolvers / v1 / 2XK / identify.ini
@Nicolas Thouvenin Nicolas Thouvenin on 7 Feb 2023 2 KB doc: add examples
# OpenAPI Documentation - JSON format (dot notation)
mimeType = application/json

post.operationId = post-v1-2XK-identify
post.description = Associer une structure de recherche vocabulaire Loterre correspondant - https://www.loterre.fr/skosmos/2XK/fr/
post.summary = verbalisation à partir d'un tableau d'objets avec à minima un champ value contenant des termes
post.tags.0 = loterre-resolvers
post.requestBody.content.application/json.example.0.id = 1
post.requestBody.content.application/json.example.0.value = GDR3753
post.requestBody.content.application/json.example.1.id = 2
post.requestBody.content.application/json.example.1.value = Inist
post.requestBody.content.application/json.example.2.id = 3
post.requestBody.content.application/json.example.2.value = Centre Marc Bloch
post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream
post.requestBody.required = true
post.responses.default.content.application/json.example.0.id = 1
post.responses.default.content.application/json.example.0.value = {...}
post.responses.default.content.application/json.example.1.id = 2
post.responses.default.content.application/json.example.1.value = {...}
post.responses.default.content.application/json.example.2.id = 3
post.responses.default.content.application/json.example.2.value = {...}
post.responses.default.content.application/json.schema.$ref =  #/components/schemas/JSONStream
post.responses.default.description = Les prefixes DOI en verion textuel
post.parameters.0.description = Indenter le JSON résultant
post.parameters.0.in = query
post.parameters.0.name = indent
post.parameters.0.schema.type = boolean

[env]
path = primer
value = env("TABLE_SERVER_URL", "http://mapping-tables.daf.intra.inist.fr/").concat("loterre-structures-recherche.xml").join("")

path = weekNumber
value = thru(() => new Date()).thru(currentDate => Math.floor((currentDate - (new Date(currentDate.getFullYear(), 0, 1)))/(24 * 60 * 60 * 1000))).thru(days => Math.ceil(days / 7))

path = loterreID
value = fix('2XK')

[delegate]
file = ./v1/process.ini

[swing]
test = get('value').isObject()
[swing/replace]

path = id
value = get('id')

path = value.id
value = get('value.id')

path = value.about
value = get('value.rdf$about')

path = value.prefLabel@fr
value = get('value.skos$prefLabel').castArray().concat({$t:_.get(self, 'value.skos$prefLabel/$t', 'n/a'), xml$lang:_.get(self, 'value.skos$prefLabel/xml$lang', 'n/a')}).filter(Boolean).filter(y => (y.xml$lang === 'fr')).map(x => x.$t).shift()

path = value.prefLabel@en
value = get('value.skos$prefLabel').filter(y => (y.xml$lang === 'en')).map(x => x.$t).shift()

path = value.codeRNSR
value =  get('value.wdt$P3016/$t')

path = value.latitude
value = get('value.geo$lat/$t')

path = value.longitude
value = get('value.geo$long/$t')

[dump]
indent = env('indent', false)