Skip to main content

For Converting Metadata Records into Science On Schema.Org Markup

Project description

soso

Project Status: Active – The project has reached a stable, usable state and is being actively developed. CI CD codecov DOI PyPI - Version

For converting dataset metadata into Science On Schema.Org markup.

Quick Start

Installation

Install from PyPI:

$ pip install soso

Metadata Conversion

To perform a conversion, specify the file path of the metadata and the desired conversion strategy. Each metadata standard corresponds to a specific strategy.

>>> from soso.main import convert
>>> r = convert(file='metadata.xml', strategy='EML')
>>> r
'{"@context": ["https://schema.org/", {"prov": "http://www. ..."}]'

For a list of available strategies, please refer to the documentation of the convert function.

Adding Unmappable Properties

Some SOSO properties may not be derived from metadata records alone. In such cases, additional information can be provided via kwargs, where keys match the top level property name, and values are the property value.

For example, the url property representing the landing page URL does not exist in an EML metadata record. But this information is known to the repository hosting the dataset.

>>> kwargs = {'url': 'https://sample-data-repository.org/dataset/472032'}
>>> r = convert(file='metadata.xml', strategy='EML', **kwargs)
>>> r
'{"@context": ["https://schema.org/", {"prov": "http://www. ..."}]'

It's worth noting that this kwargs approach is not limited to supplying unmappable properties; it can be utilized to override any top-level SOSO property.

Unmappable properties are listed in the strategy documentation.

Other Modifications

Any additional modifications can be made to the resulting JSON-LD string before it is used. Simply parse the string into a Python dictionary, make the necessary changes, and then convert it back to a JSON-LD string.

Shared Conversion Scripts

When data repositories use a common metadata standard and adopt shared infrastructure, such as databases containing ancillary information, a shared conversion script can be used. These scripts reliably reference the shared infrastructure to create a richer SOSO record by incorporating this additional information. Below is a list of available scripts and their usage examples:

API Reference and User Guide

The API reference and user guide are available on Read the Docs.

Code of Conduct

In the spirit of collaboration, we emphasize the importance of maintaining a respectful and inclusive environment.

See the Code of Conduct for details.

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

soso-1.1.0.tar.gz (100.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

soso-1.1.0-py3-none-any.whl (105.8 kB view details)

Uploaded Python 3

File details

Details for the file soso-1.1.0.tar.gz.

File metadata

  • Download URL: soso-1.1.0.tar.gz
  • Upload date:
  • Size: 100.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for soso-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b5216dc9eec5d234015aa8e0b8f0e5d82ce79483646fe91241d4edab8944393a
MD5 bf0de1be5759fc3349ce544652cd42ae
BLAKE2b-256 a40f27dab72cf7f11a661d31a46e65eaec970a51036f2df4cb749d30c99a7ffe

See more details on using hashes here.

File details

Details for the file soso-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: soso-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 105.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for soso-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 735830e89e85f1904cf9bfdcf3bbdcf226c7aca72ba525d59e9454fa7d01ccde
MD5 006a756d8dd9a6bb20733b423357f699
BLAKE2b-256 0a641420746596e20eaffeb4b63a955c04b3c58e20c1c73f7cb0f0e4648e9a34

See more details on using hashes here.

Supported by

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