Skip to content

Commit

Permalink
Replace use of deprecated concepts endpoints in documentation (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Apr 14, 2023
1 parent 0e10eda commit 6a8254c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ Note about previous additional options for `auth`:
JSKOS Server provides scripts to import JSKOS data into the database or delete data from the database. Right now, mappings, terminologies (concept schemes), concepts, concordances, and annotations, in JSON (object or array of objects) or [NDJSON](http://ndjson.org) format are supported.

#### Import Notes
**About hierarchies within concepts:** Hierarchies are supported. However, only the `broader` field will be used during import. Both `ancestors` and `narrower` will be removed and the respective endpoints ([GET /ancestors](#get-ancestors) and [GET /narrower](#get-narrower)) will dynamically rebuild these properties. That means that when converting your data, please normalize it so that the hierarchy is expressed via the `broader` field in JSKOS.
**About hierarchies within concepts:** Hierarchies are supported. However, only the `broader` field will be used during import. Both `ancestors` and `narrower` will be removed and the respective endpoints ([GET /concepts/ancestors](#get-conceptsancestors) and [GET /concepts/narrower](#get-conceptsnarrower)) will dynamically rebuild these properties. That means that when converting your data, please normalize it so that the hierarchy is expressed via the `broader` field in JSKOS.

Example scheme (as JSON object) with concepts in a hierarchy (as NDJSON):
```json
Expand Down Expand Up @@ -503,7 +503,7 @@ npm run import-batch -- mappings files.txt
# You can, for example, store these batch import files in folder `imports` which is ignored in git.
```

**Note: If you have concepts in your database, make sure to run `npm run import -- --indexes` at least once. This will make sure all necessary indexes are created. Without this step, the `/suggest` and `/search` endpoints will not work.**
**Note: If you have concepts in your database, make sure to run `npm run import -- --indexes` at least once. This will make sure all necessary indexes are created. Without this step, the `/concepts/suggest` and `/concepts/search` endpoints will not work.**

For more information about the import script, run `npm run import -- --help`.

Expand Down Expand Up @@ -647,16 +647,16 @@ Note that certain properties from the actual configuration will not be shown in
"identityProviders": null,
"identities": null
},
"data": "http://localhost:3000/data",
"schemes": "http://localhost:3000/voc",
"top": "http://localhost:3000/voc/top",
"concepts": "http://localhost:3000/voc/concepts",
"voc-suggest": "http://localhost:3000/voc/suggest",
"voc-search": "http://localhost:3000/voc/search",
"data": "http://localhost:3000/data",
"narrower": "http://localhost:3000/narrower",
"ancestors": "http://localhost:3000/ancestors",
"suggest": "http://localhost:3000/suggest",
"search": "http://localhost:3000/search",
"narrower": "http://localhost:3000/concepts/narrower",
"ancestors": "http://localhost:3000/concepts/ancestors",
"suggest": "http://localhost:3000/concepts/suggest",
"search": "http://localhost:3000/concepts/search",
"concordances": "http://localhost:3000/concordances",
"mappings": "http://localhost:3000/mappings",
"annotations": "http://localhost:3000/annotations",
Expand Down Expand Up @@ -1666,7 +1666,7 @@ Returns narrower concepts for a concept.
* **Sample Call**

```bash
curl https://coli-conc.gbv.de/api/narrower?uri=http://dewey.info/class/612.112/e23/
curl https://coli-conc.gbv.de/api/concepts/narrower?uri=http://dewey.info/class/612.112/e23/
```

```json
Expand Down Expand Up @@ -1780,7 +1780,7 @@ Returns ancestor concepts for a concept.
* **Sample Call**

```bash
curl https://coli-conc.gbv.de/api/ancestors?uri=http://dewey.info/class/61/e23/
curl https://coli-conc.gbv.de/api/concepts/ancestors?uri=http://dewey.info/class/61/e23/
```

```json
Expand Down Expand Up @@ -1839,7 +1839,7 @@ Returns concept suggestions.
* **Sample Calls**

```bash
curl https://coli-conc.gbv.de/api/suggest?search=Krebs&limit=5
curl https://coli-conc.gbv.de/api/concepts/suggest?search=Krebs&limit=5
```

```json
Expand Down Expand Up @@ -1870,7 +1870,7 @@ Returns concept suggestions.
```

```bash
curl https://coli-conc.gbv.de/api/suggest?search=Krebs&limit=2&format=jskos
curl https://coli-conc.gbv.de/api/concepts/suggest?search=Krebs&limit=2&format=jskos
```

```json
Expand Down Expand Up @@ -1943,7 +1943,7 @@ Returns concept suggestions.
```

### GET /concepts/search
Currently the same as `/suggest` with parameter `format=jskos`. Additionally, search supports the parameter `properties=[list]` as in the other concept methods.
Currently the same as `/concepts/suggest` with parameter `format=jskos`. Additionally, search supports the parameter `properties=[list]` as in the other concept methods.

**Note:** The old `/search` endpoint is deprecated as of version 2.0 and will be removed in version 3.0.

Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const connect = async () => {
config.status["voc-suggest"] = null
}
if (config.concepts && !(await connection.collection("concepts").indexExists("text"))) {
config.warn("Text index on concepts collection missing. /search and /suggest are disabled. Run `npm run import -- --indexes` or `npm run import -- -i concepts` to created indexes.")
config.warn("Text index on concepts collection missing. /concepts/search and /concepts/suggest are disabled. Run `npm run import -- --indexes` or `npm run import -- -i concepts` to created indexes.")
config.status.search = null
config.status.suggest = null
}
Expand Down

0 comments on commit 6a8254c

Please sign in to comment.