Skip to main content

SOFT7 semantic interoperability framework.

Project description

SOFT7

OTEAPI plugin

The soft7 packages comes with an OTEAPI plugin that allows one to convert any core parser data to a SOFT7 Entity instance.

To use the plugin, call the 'soft7' functionType function strategy.

Test the plugin

At the root of the repository is a Docker Compose file, which, when run, will start an OTEAPI Service that includes the soft7 OTEAPI plugin.

To start the service, run:

docker compose pull
docker compose up -d

To follow along with the installation of the soft7 package and startup of the OTEAPI Service, run:

docker logs -f soft7-oteapi-1

Press Ctrl+C to stop following the logs.

To eventually stop the services, run:

docker compose down

But first, let's test the plugin.

Open a Python shell, an IPython shell, or a Jupyter Notebook, and run:

from s7.factories import create_datasource

# Let us use an OPTIMADE structure from the Materials Project as our "raw" data source.
# The chosen structure is mp-1228448 (Al2O3):
# https://materialsproject.org/materials/mp-1228448/
# For more information about OPTIMADE, see https://www.optimade.org/
# For more information about the Materials Project, see https://materialsproject.org/
dataresource_config = {
    "downloadUrl": (
        "https://optimade.materialsproject.org/v1/structures/mp-1228448?"
        "response_format=json"
    ),
    "mediaType": "application/json",
}

# We need to setup a mapping configuration to tell the plugin how to map the OPTIMADE
# structure to a SOFT7 Entity instance.
# This requires knowledge of the OPTIMADE structure and the SOFT7 Entity.
# In our case the OPTIMADE structure specification is available at
# https://github.com/Materials-Consortia/OPTIMADE/blob/v1.1.0/optimade.rst#structures-entries
# and the SOFT7 Entity of choice is the `OPTIMADEStructure` Entity, which can be found
# at http://onto-ns.com/meta/1.0/OPTIMADEStructure
mapping_config = {
    "mappingType": "triples",
    "prefixes": {
        "optimade": "https://optimade.materialsproject.org/v1/structures/mp-1228448#",
        "soft7": "http://onto-ns.com/meta/1.0/OPTIMADEStructure#",
    },
    "triples": {
        ("optimade:data.id", "", "soft7:properties.id"),
        ("optimade:data.type", "", "soft7:properties.type"),
        ("optimade:data.attributes", "", "soft7:properties."),
    }
}

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

soft7-0.2.0.tar.gz (70.4 kB view details)

Uploaded Source

Built Distribution

soft7-0.2.0-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file soft7-0.2.0.tar.gz.

File metadata

  • Download URL: soft7-0.2.0.tar.gz
  • Upload date:
  • Size: 70.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for soft7-0.2.0.tar.gz
Algorithm Hash digest
SHA256 270f30ae5d08492fda6f6bf473c1edcdbe3e2b14a3643f1078926081d377cb6f
MD5 ab569d3f2b91888b334ef7fb1045c15d
BLAKE2b-256 975600f732fd5a3d3f9560b7f98d104a5cfc9ab9acf36c1361a74c0be010cda3

See more details on using hashes here.

File details

Details for the file soft7-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: soft7-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for soft7-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4607f666394e7f012a3dfd4288898e2a67868f4843c6e0e1a066146ba8287ea
MD5 ea69df32d987ffa3183ef4f48b60ef09
BLAKE2b-256 294b9366c0d0456b17f509b5e54cd0a3b9bc50f2855c8d47a10e088630a54b70

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