Skip to main content

Open Translation Environment (OTE) API.

Project description

Open Translation Environment (OTE) API Core

Framework for accessing data resources, mapping data models, describing the data to ontologies and perform data transformations

We highly recommend reading this page in the official documentation.

About OTEAPI Core

OTEAPI Core provides the core functionality of OTEAPI, which stands for the Open Translation Environment API.

It uses the strategy software design pattern to implement a simple and easy to extend access to a large range of data resources. Semantic interoperability is supported via mapping of data models describing the data to ontologies. Transformations, mainly intended to transform data between representations, are also supported, but transformations can also be used for running simulations in a simple workflow.

OTEAPI Core includes:

  • A set of standard strategies;
  • A plugin system for loading the standard strategies, as well as third party strategies;
  • Data models for configuring the strategies;
  • A Python library, through which the data can be accessed; and
  • An efficient data cache module that avoids downloading the same content several times.

Types of strategies

Download strategy

Download strategy patterns use a given protocol to download content into the data cache. They are configured with the ResourceConfig data model, using the scheme of the downloadUrl field for strategy selection. The configuration field can be used to configure how the downloaded content is stored in the cache using the DownloadConfig data model.

Standard downloaded strategies: file, https, http, sftp, ftp

Parse strategy

Parse strategy patterns convert content from the data cache to a Python dict. Like download strategies, they are configured with the ResourceConfig data model, using the mediaType field for strategy selection. Additional strategy-specific configurations can be provided via the configuration field.

Standard parse strategies: text_csv, text_json, image_jpeg, excel_xlsx

Resource strategy

Resource strategy patterns can retrieve/upload data to external data services. They are configured with the ResourceConfig data model, using the scheme of the accessUrl and accessService fields. The scheme of the accessUrl is used for strategy selection.

Mapping strategy

Strategies for mapping fields/properties in data models to ontological concepts.

Filter strategy

Filter strategies can update the configuration of other strategies. They can also update values in the data cache.

Transformation strategy

Transformation strategies are a special form of a filter strategy intended for long-running transformations.

Entry points for plugins

Suggestion: Use setuptools entry points to load plugins.

The entry point groups could be named as something like this:

  • "oteapi.download_strategy", "oteapi.filter_strategy"
  • "oteapi.download", "oteapi.filter"
  • "oteapi.interfaces.download", "oteapi.interfaces.filter"

The value for an entrypoint should then be:

setup(
    # ...,
    entry_points={
        "oteapi.download_strategy": [
            "my_plugin.p2p = my_plugin.strategies.download.peer_2_peer",
            "my_plugin.mongo = my_plugin.strategies.download.mongo_get",
        ],
    },
)

or as part of a YAML/JSON/setup.cfg setup files as such:

entry_points:
  oteapi.download_strategy:
  - "my_plugin.p2p = my_plugin.strategies.download.peer_2_peer"
  - "my_plugin.mongo = my_plugin.strategies.download.mongo_get"
{
  "entry_points": {
    "oteapi.download_strategy": [
      "my_plugin.p2p = my_plugin.strategies.download.peer_2_peer",
      "my_plugin.mongo = my_plugin.strategies.download.mongo_get"
    ]
  }
}
[options.entry_points]
oteapi.download_strategy =
    my_plugin.p2p = my_plugin.strategies.download.peer_2_peer
    my_plugin.mongo = my_plugin.strategies.download.mongo_get

The plugins will then automagically load all installed strategy module plugins, registering the strategies according to the StrategyFactory decorator.

Other OTEAPI-related repositories

Installation

OTEAPI Core can be installed with:

$ pip install oteapi-core

License

OTEAPI Core is released under the MIT license with copyright © SINTEF.

Acknowledgment

OTEAPI Core has been supported by the following projects:

  • OntoTrans (2020-2024) that receives funding from the European Union’s Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 862136.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oteapi-core-0.0.5.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

oteapi_core-0.0.5-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

Details for the file oteapi-core-0.0.5.tar.gz.

File metadata

  • Download URL: oteapi-core-0.0.5.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for oteapi-core-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f6c610f3a33f81755f233e9fee4559d184a4ea0018ccf93aa6edee4b1e0e47d9
MD5 9df45d8415fc843f4a74f320c61e5541
BLAKE2b-256 639bef244f86f9d9a325c55690217d8bfe7cc9d5125015257cd0b54c9cf79e08

See more details on using hashes here.

File details

Details for the file oteapi_core-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: oteapi_core-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for oteapi_core-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4e3628dfa16ddac093b16563bd7d33f7310a31b1514d551cf58a62a655b6deda
MD5 0864c5b099f2fbab78a1f0d6c393bca4
BLAKE2b-256 47c9039c50cfeb3348e81854c6baeea7c9cff968654b21ac071a527d8eb71f84

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page