Skip to main content

Utility library for the work with ontology namespaces.

Project description

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.

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

namespacelib-0.4.0.tar.gz (610.0 kB view hashes)

Uploaded Source

Built Distribution

namespacelib-0.4.0-py3-none-any.whl (640.3 kB view hashes)

Uploaded Python 3

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