UserData#
UserData are a set of API routes to store and recover data.
You can find the documentation of the Userdata routes from the Swagger
interface, available at the path /api/v1/#/userdata
.
Add a Userdata#
The POST route /api/v1/users/data
allows you to add a UserData. This route takes up
A JSON object following:
{
"data_type": "string",
"data_label": "",
"data_comment": "",
"data_group": "",
"data_tool": "",
"data_source": "",
"data_content": {},
"is_shared": false,
"shared_profiles": [],
"shared_users": [],
"readwrite": false
}
clé |
description |
example |
---|---|---|
|
The data type |
|
|
A label describing the data |
|
|
A comment |
|
|
A group, to sort UserData |
|
|
SousLeSens tool concerned by this data |
|
|
The source concerned by this data |
|
|
The data |
|
|
If the data is shared with other users or profiles |
|
|
List of profiles that can read or write the UserData |
|
|
List of users that can read or write the UserData |
|
|
If the UserData can be read or readwrite |
|
Once the userdata has been added, the identifier of the resource is returned by the API.
Read all UserData#
The GET route /api/v1/users/data
allows te get all UserData. The route return a list of objets
with all info exept the data_content
.
The route return only the UserData owned or shared.
The route takes optional query parameters to filter the results. For exemple,
with data_type=sparqlQuery
, only UserData with data_type
SparqlQuery
will be returned.
Get a UserData#
The GET route /api/v1/users/data/{id}
(replace {id}
with a UserData id
)
return the corresponding UserData with the data_content
.
Delete a UserData#
The DELETE route /api/v1/users/data/{id}
(replace {id}
with a UserData
id
) delete the corresponding UserData. Only owned or shared with
readwrite
UserData can be deleted.
Execute a SPARQL query stored in a UserData#
The GET route /api/v1/users/data/{id}/exec
(replace {id}
with a UserData) will execute the
data_content
on the SPARQL server. The UserData data_type
must be SparqlQuery
and the
data_content
must be an object with a query
key containing the query. For example:
{ "query": "SELECT * WHERE { ?s ?p ?o .} LIMIT 10" }