Closed falquaddoomi closed 2 years ago
The API now supports querying two corpora, abstracts and fulltext. By default abstracts are queried, but you can use the corpus= argument to the /neighbors and /neighbors/cached endpoints to specify the fulltexts corpus.
abstracts
fulltext
corpus=
/neighbors
/neighbors/cached
fulltexts
For example, https://api-wl.greenelab.com/neighbors?tok=pandemic&corpus=fulltexts queries the fulltexts corpus for pandemic. You can check if a term is cached via https://api-wl.greenelab.com/neighbors/cached?tok=pandemic&corpus=fulltexts.
pandemic
Querying for a corpus that doesn't exist will produce the following HTTP code 400 response:
{ "detail": "Requested corpus 'bogus' not in corpus set ('abstracts', 'fulltexts')" }
The set of corpora currently supported can be found in the config.CORPORA_SET subkey at the server meta endpoint, i.e. https://api-wl.greenelab.com/.
config.CORPORA_SET
The frontend should support some way to choose the corpus and pass the selected corpus to the relevant endpoints.
What's Done
The API now supports querying two corpora,
abstracts
andfulltext
. By defaultabstracts
are queried, but you can use thecorpus=
argument to the/neighbors
and/neighbors/cached
endpoints to specify thefulltexts
corpus.For example, https://api-wl.greenelab.com/neighbors?tok=pandemic&corpus=fulltexts queries the
fulltexts
corpus forpandemic
. You can check if a term is cached via https://api-wl.greenelab.com/neighbors/cached?tok=pandemic&corpus=fulltexts.Querying for a corpus that doesn't exist will produce the following HTTP code 400 response:
The set of corpora currently supported can be found in the
config.CORPORA_SET
subkey at the server meta endpoint, i.e. https://api-wl.greenelab.com/.What Needs to be Done
The frontend should support some way to choose the corpus and pass the selected corpus to the relevant endpoints.