diff --git a/loterre-resolvers/examples.http b/loterre-resolvers/examples.http index 8278f2d..88cd217 100644 --- a/loterre-resolvers/examples.http +++ b/loterre-resolvers/examples.http @@ -45,6 +45,7 @@ Content-Type: application/json [ + { "value": "toto"}, { "value": "Nancy sur cluses" }, { "value": "Trémaouézan" }, { "value": "Curan" }, @@ -57,6 +58,7 @@ Content-Type: application/json [ + { "value": "toto"}, { "value": "Amygdala" }, { "value": "Frontal lobe" }, { "value": "metamemory" } @@ -68,8 +70,38 @@ Content-Type: application/json [ + { "value": "toto"}, { "value": "Amygdala" }, { "value": "Frontal lobe" }, { "value": "metamemory" } ] ### + + +# @name 2XK_identify +POST {{baseUrl}}/v1/2XK/identify?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "xvalue": "toto"}, + { "xvalue": "uar76" }, + { "value": "GDR3753"}, + { "xvalue": "Centre Marc Bloch" }, + { "xvalue": "CNRS" }, + { "xvalue": "Ecole de Physique des Houches" } +] +### + +# @name 2XK_expand +POST {{baseUrl}}/v1/2XK/expand?indent=true HTTP/1.1 +Content-Type: application/json + +[ + { "xvalue": "toto"}, + { "xvalue": "uar76" }, + { "value": "GDR3753"}, + { "xvalue": "Centre Marc Bloch" }, + { "xvalue": "CNRS" }, + { "xvalue": "Ecole de Physique des Houches" } +] +### diff --git a/loterre-resolvers/v1/2XK/identify.ini b/loterre-resolvers/v1/2XK/identify.ini index a1a6ea7..3af5a59 100644 --- a/loterre-resolvers/v1/2XK/identify.ini +++ b/loterre-resolvers/v1/2XK/identify.ini @@ -49,26 +49,17 @@ path = value.id value = get('value.id') -path = value.cartographyCode -value = get('value.inist$lodexPlacenameCode/$t') - path = value.about value = get('value.rdf$about') path = value.prefLabel@fr -value = get('value.skos$prefLabel').filter(y => (y.xml$lang === 'fr')).map(x => x.$t).shift() +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.wikidataURI -value = get("value.wdt$P36/rdf$resource") - -path = value.geonameURI -value = get('value.gn$geonamesID/$t').prepend('https://www.geonames.org/') - -path = value.countryCode -value = get('value.gn$countryCode/$t') +path = value.codeRNSR +value = get('value.wdt$P3016/$t') path = value.latitude value = get('value.geo$lat/$t') @@ -76,11 +67,5 @@ path = value.longitude value = get('value.geo$long/$t') -path = value.localization@en -value = get('value.localization').map((x) => x.skos$prefLabel.filter(y => (y.xml$lang === 'en')).map(x => x.$t).shift()) - -path = value.localization@fr -value = get('value.localization').map((x) => x.skos$prefLabel.filter(y => (y.xml$lang === 'fr')).map(x => x.$t).shift()) - [dump] indent = env('indent', false)