All URIs are relative to https://localhost
| Method | HTTP request | Description |
|---|---|---|
| count_documents | GET /core/documents/count | Count documents |
| create_document | POST /core/documents | Add a document |
| delete_document | DELETE /core/documents/{uri} | Delete a document |
| get_document_file | GET /core/documents/{uri} | Get document |
| get_document_metadata | GET /core/documents/{uri}/description | Get document's description |
| search_documents | GET /core/documents | Search documents |
| update_document | PUT /core/documents | Update document's description |
int count_documents(authorization, target=target, accept_language=accept_language)
Count documents
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.DocumentsApi(pythonClient)
target = 'http://www.opensilex.org/demo/2018/o18000076' # str | Target URI (optional)
try:
# Count documents
api_response = api_instance.count_documents(target=target, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling DocumentsApi->count_documents: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| target | str | Target URI | [optional] |
int
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str create_document(description, authorization, file=file, accept_language=accept_language)
Add a document
{ uri: http://opensilex.dev/set/documents#ProtocolExperimental, identifier: doi:10.1340/309registries, rdf_type: http://www.opensilex.org/vocabulary/oeso#ScientificDocument, title: title, date: 2020-06-01, description: description, targets: http://opensilex.dev/opensilex/id/variables/v001, authors: Author name, language: fr, format: jpg, deprecated: false, keywords: keywords}
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.DocumentsApi(pythonClient)
description = 'description_example' # str | File description with metadata
file = '/path/to/file.txt' # file | file (optional)
try:
# Add a document
api_response = api_instance.create_document(description, file=file, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling DocumentsApi->create_document: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| description | str | File description with metadata | |
| file | file | file | [optional] |
str
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str delete_document(uri, authorization, accept_language=accept_language)
Delete a document
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.DocumentsApi(pythonClient)
uri = 'uri_example' # str | Document URI
try:
# Delete a document
api_response = api_instance.delete_document(uri, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling DocumentsApi->delete_document: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| uri | str | Document URI |
str
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_document_file(uri, authorization, accept_language=accept_language)
Get document
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.DocumentsApi(pythonClient)
uri = 'http://opensilex.dev/set/documents/ZA17' # str | Document URI
try:
# Get document
api_instance.get_document_file(uri, )
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling DocumentsApi->get_document_file: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| uri | str | Document URI |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: application/octet-stream
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DocumentGetDTO get_document_metadata(uri, authorization, accept_language=accept_language)
Get document's description
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.DocumentsApi(pythonClient)
uri = 'http://opensilex.dev/set/documents/ZA17' # str | Document URI
try:
# Get document's description
api_response = api_instance.get_document_metadata(uri, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling DocumentsApi->get_document_metadata: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| uri | str | Document URI |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[DocumentGetDTO] search_documents(authorization, rdf_type=rdf_type, title=title, _date=_date, targets=targets, authors=authors, keyword=keyword, multiple=multiple, deprecated=deprecated, order_by=order_by, page=page, page_size=page_size, accept_language=accept_language)
Search documents
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.DocumentsApi(pythonClient)
rdf_type = 'http://www.opensilex.org/vocabulary/oeso#ScientificDocument' # str | Search by type (optional)
title = 'experimental_protocol_3' # str | Regex pattern for filtering list by title (optional)
_date = '2020' # str | Regex pattern for filtering list by date (optional)
targets = 'dev-expe:za17' # str | Search by targets (optional)
authors = 'Firstname Lastname' # str | Regex pattern for filtering list by author (optional)
keyword = 'keyword' # str | Regex pattern for filtering list by keyword (optional)
multiple = 'keyword or title' # str | Regex pattern for filtering list by keyword or title (optional)
deprecated = 'true' # str | Search deprecated file (optional)
order_by = ['date=asc'] # list[str] | List of fields to sort as an array of fieldTitle=asc|desc (optional)
page = 0 # int | Page number (optional) (default to 0)
page_size = 20 # int | Page size (optional) (default to 20)
try:
# Search documents
api_response = api_instance.search_documents(rdf_type=rdf_type, title=title, _date=_date, targets=targets, authors=authors, keyword=keyword, multiple=multiple, deprecated=deprecated, order_by=order_by, page=page, page_size=page_size, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling DocumentsApi->search_documents: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| rdf_type | str | Search by type | [optional] |
| title | str | Regex pattern for filtering list by title | [optional] |
| _date | str | Regex pattern for filtering list by date | [optional] |
| targets | str | Search by targets | [optional] |
| authors | str | Regex pattern for filtering list by author | [optional] |
| keyword | str | Regex pattern for filtering list by keyword | [optional] |
| multiple | str | Regex pattern for filtering list by keyword or title | [optional] |
| deprecated | str | Search deprecated file | [optional] |
| order_by | list[str] | List of fields to sort as an array of fieldTitle=asc | desc |
| page | int | Page number | [optional] [default to 0] |
| page_size | int | Page size | [optional] [default to 20] |
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
str update_document(description, authorization, accept_language=accept_language)
Update document's description
from __future__ import print_function
import time
import opensilexClientToolsPython
from opensilexClientToolsPython.rest import ApiException
from pprint import pprint
# create an instance of the API class
pythonClient = opensilexClientToolsPython.ApiClient()
pythonClient.connect_to_opensilex_ws(identifier="guest@opensilex.org",password="guest",host="https://localhost")
api_instance = opensilexClientToolsPython.DocumentsApi(pythonClient)
description = 'description_example' # str | description
try:
# Update document's description
api_response = api_instance.update_document(description, )
pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
print("Exception when calling DocumentsApi->update_document: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| description | str | description |
str
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]