Skip to content
Snippets Groups Projects
Commit 7d0750d3 authored by Cornelia Michlits's avatar Cornelia Michlits
Browse files

update readme, flasgger

parent b3a3e20b
No related branches found
No related tags found
3 merge requests!129New module for citation as they occur multiple,!121Modified logging, modified logging level, modified flasgger endpoint,!102240 onto incl
# Units Service
# Units and Ontology Service
Suggest and validates units of measurements defined in Ontology of units of Measure (OM) [1] is used.
Suggest and validates units of measurements defined in Ontology of Units of Measure (OM) [1]. Moreover, it stores ontologies in DB-Repo, list them and finds suitable concepts over all ontologies within the Repository. Note: In Flasgger switch between "/api-units.json" and "/api-ontologies.json".
[1] https://github.com/HajoRijgersberg/OM
......@@ -98,9 +98,13 @@ Content-Length: 97
}
```
The response is a postgres status message, e.g.,
The response is a status message and a JSON with the URI of the created concept
"\"INSERT 0 1\""
```JSON
{
"uri": "http://www.ontology-of-units-of-measure.org/resource/om-2/centimetre"
}
```
## `POST /api/units/savecolumnsconcept'
Saves values in the entity 'mdb\_columns\_concepts', which realizes the relation between 'mdb\_columns' and 'mdb\_concepts'. Make sure the concept is contained in 'mdb\_concepts'.
......@@ -120,6 +124,68 @@ Content-Length: 122
}
```
The response is a postgres status message, e.g.,
The response is a postgres status message:
* 201: created
* 409: conflict
## `GET /api/ontologies/listontologies'
List the name of all ontologies stored in DB-Repo.
Example http request:
GET /api/ontologies/listontologies HTTP/1.1
Host: localhost:5010
## `GET /api/ontologies/getconcept/<cname>'
Lists concepts contained in all stored ontologies in DB-Repo ('string matching')
"\"INSERT 0 1\""
Example http request:
GET /api/ontologies/getconcept/Curve HTTP/1.1
Host: localhost:5010
The response is a JSON:
```JSON
[
{
"O": "Multicourbe",
"P": "http://www.w3.org/2000/01/rdf-schema#label",
"S-URI": "http://data.ign.fr/def/geometrie#MultiCurve"
},
{
"O": "http://www.opengis.net/ont/sf#Curve",
"P": "http://www.w3.org/2000/01/rdf-schema#subClassOf",
"S-URI": "http://data.ign.fr/def/geometrie#Curve"
}
]
```
## `POST /api/ontologies/upload'
In order to upload new ontologies (.ttl, .nt files) to DB-Repo.
Example http request:
POST /api/ontologies/upload HTTP/1.1
Content-Type: multipart/form-data; boundary=---011000010111000001101001
Host: localhost:5010
Content-Length: 166
-----011000010111000001101001
Content-Disposition: form-data; name="file"; filename="geometrie.ttl"
Content-Type: text/turtle
-----011000010111000001101001--
The response is
* 201: created
* 400: no file selected
* 409: conflict
* 500: internal server error
## `GET /api/ontologies/<o_name>'
Is an endpoint for downloading an ontology contained in DB-Repo.
Example http request:
GET /api/ontologies/VOCAB_QUDT-UNITS-ALL-v2.1 HTTP/1.1
Host: localhost:5010
......@@ -6,10 +6,11 @@ produces:
- "application/json"
parameters:
- in: "path"
type: "string"
name: "cname"
description: "Enter a concept name."
required: true
schema:
type: "string"
responses:
200:
description: "OK"
......
......@@ -6,10 +6,11 @@ produces:
- "application/json"
parameters:
- in: "path"
type: "string"
name: "uname"
description: "Name of a unit in OM"
required: true
schema:
type: "string"
responses:
200:
description: "OK"
......
......@@ -5,10 +5,10 @@ consumes:
produces:
- "application/json"
parameters:
- name: file
- in: "formData"
name: "file"
required: false
in: formData
type: file
type: "file"
responses:
200:
description: "OK"
......
......@@ -5,11 +5,12 @@ consumes:
produces:
- "application/json"
parameters:
- name: o_name
in: path
- in: "path"
name: "o_name"
required: true
type: string
default: "VOCAB_QUDT-UNITS-ALL-v2.1"
schema:
type: "string"
example: "VOCAB_QUDT-UNITS-ALL-v2.1"
responses:
200:
description: "OK"
......
......@@ -6,10 +6,12 @@ produces:
- "application/json"
parameters:
- in: "path"
type: "string"
name: "unit"
description: "Validates unit against om-2."
required: true
schema:
type: "string"
example: "metre"
responses:
200:
description: "OK"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment