Newer
Older
web-services / loterre-resolvers / v1 / transcribe.ini
@Nicolas Thouvenin Nicolas Thouvenin on 14 Apr 2023 1 KB fix: apply objflatten like the previous version
# Necessary plugins
[use]
plugin = basics
plugin = analytics
plugin = storage

# Load concept form URI
[load]
location = env('location')
domain = env('loterreID').prepend('loterre-').append('concepts')
path = value
target = value

# transcribe broaderConcept
[assign]
path = value.skos$broader
value = get('value.skos$broader').castArray().filter(Boolean)

[map]
path = value.skos$broader

[map/load]
location = env('location')
domain = env('loterreID').prepend('loterre-').append('concepts')
path = rdf$resource

[map/exchange]
value = self().pick(['skos$prefLabel', 'rdf$about'])

# transcribe narrowerConcept
[assign]
path = value.skos$narrower
value = get('value.skos$narrower').castArray().filter(Boolean)

[map]
path = value.skos$narrower

[map/load]
location = env('location')
domain = env('loterreID').prepend('loterre-').append('concepts')
path = rdf$resource

[map/exchange]
value = self().pick(['skos$prefLabel', 'rdf$about'])


# trick to apply OBJFlatten only on the value field
[map]
path = value
[map/OBJFlatten]
safe = true

[assign]
path = value
value = get('value').pop()