
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
A Python library for retrieving semantic prefix maps.
A semantic prefix map will map a a prefix (e.g. skos
) to a namespace (e.g http://www.w3.org/2004/02/skos/core#
).
This repository and the corresponding library is designed to satisfy the following requirements:
What this is NOT intended for:
pip install prefixmaps
To use in combination with curies library:
from prefixmaps import load_converter
from curies import Converter
converter: Converter = load_converter(["obo", "bioregistry.upper", "linked_data", "prefixcc"])
>>> converter.expand("CHEBI:1")
'http://purl.obolibrary.org/obo/CHEBI_1'
>>> converter.expand("GEO:1")
'http://purl.obolibrary.org/obo/GEO_1'
>>> converter.expand("owl:Class")
'http://www.w3.org/2002/07/owl#Class'
>>> converter.expand("FlyBase:FBgn123")
'http://identifiers.org/fb/FBgn123'
geo
for geosparql http://www.opengis.net/ont/geosparql#
GEO
for the Geographical Entity Ontology, expanding to http://purl.obolibrary.org/obo/GEO_
geo
for NCBI GEO, and "re-mints" a geogeo
prefix for the OBO ontologyIf we prioritize prefix.cc the OBO prefix is ignored:
converter = load_converter(["prefixcc", "obo"])
>>> converter.expand("GEO:1")
>>> converter.expand("geo:1")
'http://www.opengis.net/ont/geosparql#1'
Even though prefix expansion is case-sensitive, we intentionally block conflicts that differ only in case.
If we push bioregistry
at the start of the list then GEOGEO can be used as the prefix for the OBO ontology:
converter = load_converter(["bioregistry", "prefixcc", "obo"])
>>> converter.expand("geo:1")
'http://identifiers.org/geo/1'
>>> converter.expand("GEO:1")
>>> converter.expand("GEOGEO:1")
'http://purl.obolibrary.org/obo/GEO_1'
Note that from the OBO perspective, GEOGEO is non-canonical.
We get similar results using the upper-normalized variant of bioregistry
:
converter = load_converter(["bioregistry.upper", "prefixcc", "obo"])
>>> converter.expand("GEO:1")
'http://identifiers.org/geo/1'
>>> converter.expand("geo:1")
>>> converter.expand("GEOGEO:1")
'http://purl.obolibrary.org/obo/GEO_1'
Users of OBO ontologies will want to place OBO at the start of the list:
converter = load_converter(["obo", "bioregistry.upper", "prefixcc"])
>>> converter.expand("geo:1")
>>> converter.expand("GEO:1")
'http://purl.obolibrary.org/obo/GEO_1'
>>> converter.expand("GEOGEO:1")
Note under this ordering there is no prefix for NCBI GEO. This is not a major limitation as there is no canonical semantic rendering of NCBI GEO. This could be added in future with a unique OBO prefix.
You can use the ready-made "merged" prefix set, which prioritizes OBO:
converter = load_converter("merged")
>>> converter.expand("GEOGEO:1")
>>> converter.expand("GEO:1")
'http://purl.obolibrary.org/obo/GEO_1'
>>> converter.expand("geo:1")
By default, this will make use of metadata distributed alongside the package. This has certain advantages in terms of reproducibility, but it means if a new ontology or prefix is added to an upstream source you won't see this.
To refresh and use the latest upstream:
converter = load_converter("obo", refresh=True)
This will perform a fetch from http://obofoundry.org/registry/obo_prefixes.ttl
See the description fields
Data files containing pre-build prefix maps using sources like OBO and Bioregistry are distributed alongside the python
Location:
The data can be refreshed in several ways:
Locally, you can use tox
with:
pip install tox tox-poetry
tox -e refresh
Manually running and automatically committing via this GitHub Actions workflow.
Running makefile (warning, this requires some pre-configuration
make etl
TODO: make a github action that auto-releases new versions
Note that PRs should not be made against the individual CSV files. These are generated from upstream sources.
We temporarily house a small number of curated prefixmaps such as linked_data.yaml, with the CSV generated from the YAML.
Our goal is to ultimately cede these to upstream sources.
This repo is NOT a prefix registry. Its job is simply to aggregate different prefix maps. Request changes upstream.
FAQs
A python library for retrieving semantic prefix maps
We found that prefixmaps demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.