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:
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
Built Distribution
Hashes for namespacelib-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2ca03ef7fd9e1b0d1575bb230e95865941157c556d3b494f5a23c856433206b |
|
MD5 | 93d849e5eabf5932be937a30189d4fd1 |
|
BLAKE2b-256 | 6d72adf0e4f0e286620d2cbe50327d9e777edbef4b64641acdce93ae16f3c169 |