gbv / cocoda

A web-based tool for creating mappings between knowledge organization systems.
https://coli-conc.gbv.de/cocoda/
MIT License
39 stars 5 forks source link

Create Skosmos-API wrapper #142

Closed nichtich closed 5 years ago

nichtich commented 6 years ago

Or add JSKOS support to Skosmos. This is important to support a much larger number of terminologies, see https://bartoc-skosmos.unibas.ch/en/ and http://zbw.eu/beta/skosmos/stw/ among others. See also https://bartoc-fast.ub.unibas.ch/bartocfast/about for a list of public Skosmos instances (and a federated search on them). API documentation is available at http://api.finto.fi/doc/

nichtich commented 5 years ago

We could start with STW (via http://zbw.eu/beta/skosmos) to support our colleagues at ZBW.

Access to individual vocabularies vis Skosmos should be configured in Cocoda, e.g.

{
  "provider": "SkosmosApi",
  "api": "http://zbw.eu/beta/skosmos/rest/v1/",
  "schemes": [ {
    "uri": "http://bartoc.org/en/node/313",
    "VOCID": "stw"
  } ]
}

So Cocoda could build queries such as {api}{VOCID}?lang={lang} to get information about a vocabulary and {api}{VOCID}/data?uri={uri}&format=application/json to get all information about a concep. Examples:

There are other concept related queries but /data is enough to start with.

Top concepts and concept types do not need to be supported from the beginning but we need search via Skosmos. The search URL pattern is '{api}{VOCID}/search?query={query}*&unique=1. Example:

stefandesu commented 5 years ago

Too bad you can only request concept scheme labels in one language at the same time. For concepts on the other hand, all labels are returned in one /data request.

nichtich commented 5 years ago

Too bad you can only request concept scheme labels in one language at the same time.

For popular vocabularies we may don't need the information anyway as it should be included in kos-registry via Wikidata, BARTOC or kos.yaml. kos-registry.json could be linked as static file to Cocoda config

stefandesu commented 5 years ago

For popular vocabularies we may don't need the information anyway as it should be included in kos-registry via Wikidata, BARTOC or kos.yaml. kos-registry.json could be linked as static file to Cocoda config

Good point.

stefandesu commented 5 years ago

I added a first implementation of the Skosmos wrapper with STW as an example. Note that their API seems to have some issues currently, but in general it should work (no top concepts, but loading concepts and suggest work).

Some caveats/further tasks:

stefandesu commented 5 years ago

Right now, it doesn't seem to work in dev at all, although it still works fine locally. I'll investigate.

stefandesu commented 5 years ago

Such an obvious error. It works now, so feel free to test.

stefandesu commented 5 years ago

Create new specific issues for missing functionality if necessary.