CLiSN <📚>✨
A collection of RDFLib namespaces for the Computational Literary Studies Infrastructure project.
Requirements
- Python >=3.11
Installation
pip install clisn
Usage
Namespaces
CLiSN provides rdflib.Namespaces for the CLSInfra project.
from rdflib import Graph
from rdflib.namespace import RDF
from clisn import crm, crmcls, corpus_base
base_ns = corpus_base("SweDraCor")
attrassign_uri = base_ns["attrassign/1"]
triples = [
(
attrassign_uri,
RDF.type,
crm["E13_Attribute_Assignment"]
),
(
attrassign_uri,
crm["P140_assigned_attribute_to"],
base_ns["corpus"]
),
(
attrassign_uri,
crm["P177_assigned_property_of_type"],
crmcls["Z8_corpus_has_corpus_type"]
)
]
graph = Graph()
for triple in triples:
graph.add(triple)
print(graph.serialize())
Output:
@prefix ns1: <http://www.cidoc-crm.org/cidoc-crm/> .
<https://swedracor.clscor.io/entity/attrassign/1> a ns1:E13_Attribute_Assignment ;
ns1:P140_assigned_attribute_to <https://swedracor.clscor.io/entity/corpus> ;
ns1:P177_assigned_property_of_type <https://clscor.io/ontologies/CRMcls/Z8_corpus_has_corpus_type> .
NamespaceManager
clisn features a custom NamespaceManager for CLSInfra namespaces.
This e.g. allows to easily generate a namespaced rdflib.Graph like so:
from rdflib import Graph, URIRef, Literal
from clisn import CLSInfraNamespaceManager, crm
graph = Graph()
CLSInfraNamespaceManager(graph)
graph.add(
(
URIRef("https://subject.xyz/example/"),
crm["p90_has_value"],
Literal("some value")
)
)
print(graph.serialize())
Output:
@prefix crm: <http://www.cidoc-crm.org/cidoc-crm/> .
<https://subject.xyz/example/> crm:p90_has_value "some value" .
Metadata
Release files for clisn 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clisn-0.1.4.tar.gz | 14.6 kB | Without provenance | Details for clisn-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clisn-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for clisn-0.1.4-py3-none-any.whl |
Total release size: 29.9 kB
Release files / clisn-0.1.4.tar.gz
| Download URL | clisn-0.1.4.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0920a21dd1a618e2ee22f65c0186c3e299a2d3067c5b374f6e6b4237448c0e40
|
|
BLAKE2b-256 checksum How to use checksums |
03ae5016e32a9a34caabf19f6f39ce0ab75294612a5abc107641829ff76839c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.8 Linux/6.8.2-arch2-1
|
Release files / clisn-0.1.4-py3-none-any.whl
| Download URL | clisn-0.1.4-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddc3166ccb104a57d996c883a5f5b6756c1c73f3063ec28ef23748c6483f5109
|
|
BLAKE2b-256 checksum How to use checksums |
e2dc39c383e40eb3c04a17b68093dfd6892d208521ff48aeae469fb5f91b3c55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.8 Linux/6.8.2-arch2-1
|
Security for clisn 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.