Closed stefandesu closed 4 years ago
Hmm, we have https://github.com/gbv/wikidata-jskos/blob/5311646386821a144c72ac2431f70661d10587ec/lib/queries/get-mappings-from.js#L12 and https://github.com/gbv/wikidata-jskos/blob/5311646386821a144c72ac2431f70661d10587ec/lib/queries/get-mappings-to.js#L8, but still get a result.
(partOf
is also ignored, by the way)
Found it:
This is setting query.fromScheme
to null
, thus making the query as if there was no fromScheme
at all.
@nichtich, would a solution like this be okay?
if (query.fromScheme) {
query.fromScheme = this.detectWikidataConceptScheme(query.fromScheme)
// Return empty list if incompatible scheme is queried
if (!query.fromScheme) {
return Promise.resolve([])
}
}
Same thing for toScheme
. And should we also mitigate the partOf
issue, i.e. returning an empty array if partOf
is present on the query?
fromScheme
basically seems to get ignored. For example, if you query mappings from DDC to BK, you'll get WD to BK mappings. In my opinion, these requests should return no mapping at all.