Skip to content

Latest commit

 

History

History
769 lines (513 loc) · 24.1 KB

File metadata and controls

769 lines (513 loc) · 24.1 KB

opensilexClientToolsPython.FactorsApi

All URIs are relative to https://localhost

Method HTTP request Description
count_factors GET /core/experiments/factors/count Count factors
create_factor POST /core/experiments/factors Create a factor
delete_factor DELETE /core/experiments/factors/{uri} Delete a factor
delete_factor_level DELETE /core/experiments/factors/levels/{uri} Delete a factor level
get_factor_associated_experiments GET /core/experiments/factors/{uri}/experiments Get factor associated experiments
get_factor_by_uri GET /core/experiments/factors/{uri} Get a factor
get_factor_level GET /core/experiments/factors/levels/{uri} Get a factor level
get_factor_level_detail GET /core/experiments/factors/levels/{uri}/details Get a factor level
get_factor_levels GET /core/experiments/factors/{uri}/levels Get factor levels
get_factors_by_uris GET /core/experiments/factors/by_uris Get a list of factors by their URIs
search_categories GET /core/experiments/factors/categories Search categories
search_factor_levels GET /core/experiments/factors/factor_levels Search factors levels
search_factors GET /core/experiments/factors Search factors
update_factor PUT /core/experiments/factors Update a factor

count_factors

int count_factors(authorization, experiment=experiment, accept_language=accept_language)

Count factors

Example

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.FactorsApi(pythonClient)
experiment = 'http://www.opensilex.org/demo/2018/o18000076' # str | Experiment URI (optional)


try:
    # Count factors
    api_response = api_instance.count_factors(experiment=experiment, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->count_factors: %s\n" % e)

Parameters

Name Type Description Notes
experiment str Experiment URI [optional]

Return type

int

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_factor

create_factor(authorization, body=body, accept_language=accept_language)

Create a factor

Example

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.FactorsApi(pythonClient)
body = opensilexClientToolsPython.FactorCreationDTO() # FactorCreationDTO | Factor description (optional)


try:
    # Create a factor
    api_instance.create_factor(body=body, )
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->create_factor: %s\n" % e)

Parameters

Name Type Description Notes
body FactorCreationDTO Factor description [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_factor

str delete_factor(uri, authorization, accept_language=accept_language)

Delete a factor

Example

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.FactorsApi(pythonClient)
uri = 'platform-factor:irrigation' # str | Factor URI


try:
    # Delete a factor
    api_response = api_instance.delete_factor(uri, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->delete_factor: %s\n" % e)

Parameters

Name Type Description Notes
uri str Factor URI

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_factor_level

str delete_factor_level(uri, authorization, accept_language=accept_language)

Delete a factor level

Example

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.FactorsApi(pythonClient)
uri = 'platform-factor:irrigation' # str | Factor level URI


try:
    # Delete a factor level
    api_response = api_instance.delete_factor_level(uri, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->delete_factor_level: %s\n" % e)

Parameters

Name Type Description Notes
uri str Factor level URI

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_factor_associated_experiments

list[ExperimentGetListDTO] get_factor_associated_experiments(uri, authorization, accept_language=accept_language)

Get factor associated experiments

Example

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.FactorsApi(pythonClient)
uri = 'platform-factor:irrigation' # str | Factor URI


try:
    # Get factor associated experiments
    api_response = api_instance.get_factor_associated_experiments(uri, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->get_factor_associated_experiments: %s\n" % e)

Parameters

Name Type Description Notes
uri str Factor URI

Return type

list[ExperimentGetListDTO]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_factor_by_uri

FactorDetailsGetDTO get_factor_by_uri(uri, authorization, accept_language=accept_language)

Get a factor

Example

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.FactorsApi(pythonClient)
uri = 'platform-factor:irrigation' # str | Factor URI


try:
    # Get a factor
    api_response = api_instance.get_factor_by_uri(uri, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->get_factor_by_uri: %s\n" % e)

Parameters

Name Type Description Notes
uri str Factor URI

Return type

FactorDetailsGetDTO

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_factor_level

FactorLevelGetDTO get_factor_level(uri, authorization, accept_language=accept_language)

Get a factor level

Example

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.FactorsApi(pythonClient)
uri = 'http://opensilex/set/factorLevel/irrigation.ww' # str | Factor Level URI


try:
    # Get a factor level
    api_response = api_instance.get_factor_level(uri, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->get_factor_level: %s\n" % e)

Parameters

Name Type Description Notes
uri str Factor Level URI

Return type

FactorLevelGetDTO

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_factor_level_detail

FactorLevelGetDetailDTO get_factor_level_detail(uri, authorization, accept_language=accept_language)

Get a factor level

Example

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.FactorsApi(pythonClient)
uri = 'http://opensilex/set/factorLevel/irrigation.ww' # str | Factor Level URI


try:
    # Get a factor level
    api_response = api_instance.get_factor_level_detail(uri, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->get_factor_level_detail: %s\n" % e)

Parameters

Name Type Description Notes
uri str Factor Level URI

Return type

FactorLevelGetDetailDTO

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_factor_levels

list[FactorLevelGetDTO] get_factor_levels(uri, authorization, accept_language=accept_language)

Get factor levels

Example

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.FactorsApi(pythonClient)
uri = 'platform-factor:irrigation' # str | Factor URI


try:
    # Get factor levels
    api_response = api_instance.get_factor_levels(uri, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->get_factor_levels: %s\n" % e)

Parameters

Name Type Description Notes
uri str Factor URI

Return type

list[FactorLevelGetDTO]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_factors_by_uris

list[FactorGetDTO] get_factors_by_uris(uris, authorization, accept_language=accept_language)

Get a list of factors by their URIs

Example

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.FactorsApi(pythonClient)
uris = ['uris_example'] # list[str] | Factors URIs


try:
    # Get a list of factors by their URIs
    api_response = api_instance.get_factors_by_uris(uris, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->get_factors_by_uris: %s\n" % e)

Parameters

Name Type Description Notes
uris list[str] Factors URIs

Return type

list[FactorGetDTO]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_categories

list[FactorCategoryGetDTO] search_categories(name=name, order_by=order_by, accept_language=accept_language)

Search categories

Example

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.FactorsApi(pythonClient)
name = 'describing' # str | Category name regex pattern (optional)
order_by = ['name=asc'] # list[str] | List of fields to sort as an array of fieldName=asc|desc (optional)


try:
    # Search categories
    api_response = api_instance.search_categories(name=name, order_by=order_by, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->search_categories: %s\n" % e)

Parameters

Name Type Description Notes
name str Category name regex pattern [optional]
order_by list[str] List of fields to sort as an array of fieldName=asc desc

Return type

list[FactorCategoryGetDTO]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_factor_levels

list[FactorDetailsGetDTO] search_factor_levels(authorization, name=name, order_by=order_by, page=page, page_size=page_size, accept_language=accept_language)

Search factors levels

Example

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.FactorsApi(pythonClient)
name = 'WW' # str | Regex pattern for filtering on name (optional)
order_by = ['name=asc'] # list[str] | List of fields to sort as an array of fieldName=asc|desc (optional)
page = 0 # int | Page number (optional) (default to 0)
page_size = 20 # int | Page size (optional) (default to 20)


try:
    # Search factors levels
    api_response = api_instance.search_factor_levels(name=name, order_by=order_by, page=page, page_size=page_size, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->search_factor_levels: %s\n" % e)

Parameters

Name Type Description Notes
name str Regex pattern for filtering on name [optional]
order_by list[str] List of fields to sort as an array of fieldName=asc desc
page int Page number [optional] [default to 0]
page_size int Page size [optional] [default to 20]

Return type

list[FactorDetailsGetDTO]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_factors

list[FactorGetDTO] search_factors(authorization, name=name, description=description, category=category, experiment=experiment, order_by=order_by, page=page, page_size=page_size, accept_language=accept_language)

Search factors

Example

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.FactorsApi(pythonClient)
name = 'irrigation' # str | Regex pattern for filtering on name (optional)
description = '20ml of water' # str | Regex pattern for filtering on description (optional)
category = 'http://aims.fao.org/aos/agrovoc/c_32668' # str | Filter by category of a factor (optional)
experiment = 'demo-exp:experiment1' # str | Filter by experiment (optional)
order_by = ['uri=asc'] # list[str] | List of fields to sort as an array of fieldName=asc|desc (optional)
page = 0 # int | Page number (optional) (default to 0)
page_size = 20 # int | Page size (optional) (default to 20)


try:
    # Search factors
    api_response = api_instance.search_factors(name=name, description=description, category=category, experiment=experiment, order_by=order_by, page=page, page_size=page_size, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->search_factors: %s\n" % e)

Parameters

Name Type Description Notes
name str Regex pattern for filtering on name [optional]
description str Regex pattern for filtering on description [optional]
category str Filter by category of a factor [optional]
experiment str Filter by experiment [optional]
order_by list[str] List of fields to sort as an array of fieldName=asc desc
page int Page number [optional] [default to 0]
page_size int Page size [optional] [default to 20]

Return type

list[FactorGetDTO]

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_factor

str update_factor(authorization, body=body, accept_language=accept_language)

Update a factor

Example

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.FactorsApi(pythonClient)
body = opensilexClientToolsPython.FactorUpdateDTO() # FactorUpdateDTO | Factor description (optional)


try:
    # Update a factor
    api_response = api_instance.update_factor(body=body, )
    pprint(api_response)
except opensilexClientToolsPython.rest.ApiException as e:
    print("Exception when calling FactorsApi->update_factor: %s\n" % e)

Parameters

Name Type Description Notes
body FactorUpdateDTO Factor description [optional]

Return type

str

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]