Skip to main content

namespacelib

Utility library for the work with ontology namespaces.

Usage

The namespaces interfaces implemented in this package allow to get the URI as a class property. Implementation similar to rdflib, which has implemented popular ontologies, like prov:

import rdflib

print(rdflib.PROV.Agent)
# rdflib.URIRef('http://www.w3.org/ns/prov#Agent')

Note, that you may access these namespaces also through namespaclib as it just "forwards" to rdflib.

Other namespaces, like M4I can be accessed like this:

import namespacelib

print(namespacelib.M4I.Tool)
# rdflib.URIRef('http://w3id.org/nfdi4ing/metadata4ing#Tool')

Very helpful for scientific data are the unit vocabulary qudt:

import namespacelib

print(namespacelib.QUDT_UNIT.M_PER_SEC)
# rdflib.URIRef('http://qudt.org/vocab/unit/M-PER-SEC')

print(namespacelib.QUDT_KIND.Velocity)
# rdflib.URIRef('http://qudt.org/vocab/quantitykind/Velocity')

An URI, that does not exist will raise an error (Other than rdflib, which can raise an AttributeError but does not by default!:

import namespacelib

# will raise an AttributeError:
print(namespacelib.QUDT_UNIT.METER)

Available namespaces:

Limitations

Some vocabularies are not complete because names start with a digit, include a "#" or are called "yield", "True" or "False" (see schema.org, for example). These are not implemented in this package.

Metadata

Release files for namespacelib 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for namespacelib 0.4.0
File Size Uploaded
namespacelib-0.4.0.tar.gz 610.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for namespacelib 0.4.0
File Interpreter ABI Platform
namespacelib-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / namespacelib-0.4.0.tar.gz

Download URL namespacelib-0.4.0.tar.gz
Size 610.0 kB
Tags Source
SHA-256 checksum
How to use checksums
01be0a6cfe0378bb47e833987bbb8e42164660f3770f632e5a351f10b27adfbb
BLAKE2b-256 checksum
How to use checksums
40c945538f86261cb02db668f2ac1f088b8dea22e03e30b62e8b63182fa31d15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.18

Release files / namespacelib-0.4.0-py3-none-any.whl

Download URL namespacelib-0.4.0-py3-none-any.whl
Size 640.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e382a6cfb1dad4e367dbe5b7dd246c94bd3a8f98d02459a6e8daa986e6ad4209
BLAKE2b-256 checksum
How to use checksums
0c0f14584c9dde640941aeacafa2ba5683ea9e426b15664b4bbe9b433ded7fed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.18

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page