Contrib
sssom_pydantic.contrib.ontoportal Module
Get mappings from an OntoPortal instance.
import bioregistry
from sssom_pydantic.contrib.ontoportal import from_bioportal
converter = bioregistry.get_converter()
mappings = from_bioportal("SNOMEDCT", "AERO", converter=converter)
Functions
|
Get mappings from BioPortal. |
|
Get mappings from an OntoPortal instance. |
|
Iterate over mappings from OntoPortal. |
sssom_pydantic.contrib.wikidata Module
Implements between semantic mappings in SSSOM and Wikidata.
Wikidata encodes semantic mappings in two ways:
Using the exact match (P2888) property with a URI as the object. For example, cell wall (Q128700) maps to the Gene Ontology (GO) term for cell wall by its URI
http://purl.obolibrary.org/obo/GO_0005618.Using semantic space-specific properties (e.g. P683 for ChEBI) with local unique identifiers as the object. For example, acetic acid (Q47512) maps to the ChEBI term for acetic acid using the P683 property for ChEBI and local unique identifier for acetic acid (within ChEBI)
15366.
Wikidata has a data structure that enables annotating qualifiers onto triples. Therefore, other parts of semantic mappings modeled in SSSOM can be ported:
Authors and reviewers can be mapped from ORCiD identifiers to Wikidata identifiers, then encoded using the S50 and S4032 properties, respectively
A SKOS-flavored mapping predicate (i.e., exact, narrow, broad, close, related) can be encoded using the S4390 property
The publication date can be encoded using the S577 property
The license can be mapped from text to a Wikidata identifier, then encoded using the S275 property
Note that properties that normally start with a P when used in triples are changed
to start with an S when used as qualifiers. Other fields in SSSOM could potentially
be mapped to Wikidata later.
This module implements the following interactive workflows:
Read an SSSOM file, convert mappings to Wikidata schema, then open a QuickStatements tab in the web browser using
read_and_open_quickstatements()Convert in-memory semantic mappings to the Wikidata schema, then open a QuickStatements tab in the web browser using
open_quickstatements()
It also implements the following non-interactive workflows, which should be used with caution since they write directly to Wikidata:
Read an SSSOM file, convert mappings to Wikidata schema, then post non-interactively to Wikidata via QuickStatements using
read_and_post()Convert in-memory semantic mappings to the Wikidata schema, then post non-interactively to Wikidata via QuickStatements using
post()
Functions
|
Get lines for QuickStatements that can be used to upload SSSOM to Wikidata. |
|
Create a QuickStatements tab from mappings. |
|
Post QuickStatements non-interactively, use with caution. |
|
Read an SSSOM file and open the Quickstatements v2 uploader with the web browser. |
|
|
|
Read an SSSOM file and get QuickStatements v2 lines. |