MkRDF
MkDocs plugin to build pages from RDF Graphs.
A use case it to covers the representation of an entire graph with templates to represent instances of each class.
You need to install mkrdf e.g. with pip and configure your mkdocs setup to use it.
The section in your mkdocs.yml file could look as follows:
[…]
plugins:
- mkrdf:
graph_file: simpsons.ttl
base_iri: https://simpsons.example.org/
selection:
preset: subject_relative
class_template_map:
http://xmlns.com/foaf/0.1/Person: person.html
instance_template_map:
https://simpsons.example.org/Marge: marge.html
Selection
The selection is responsible to choose for which IRIs from the provided graph a page should be build.
The configuration key has four sub keys, preset, query, list, and file. If multiple of the keys are set, the union of the selections is build.
presetcan hold the valuessubject_relative(default),subject_all, ornone,subject_relativeselects all subject IRIs that share the configuredbase_iri, i.e.SELECT ?resourceIri { ?resourceIri ?p ?o . FILTER regex(str(?resourceIri), concat("^", str(?base_iri))) },subject_relativeselects all subject IRIs irrespective of thebase_iri, i.e.SELECT ?resourceIri { ?resourceIri ?p ?o }.nonewill skip all other selections and not IRI is selected
queryorqueriesneeds to provide a string (or list of strings) with a valid SPARQL 1.1 query, that binds the variable?resourceIrito all selected IRIs.listan explicit list of IRIsfilea file explicitly listing the IRIs
Related Projects
The implementation of jinja-rdf, kisumu, and mkrdf is a result of the lessons learned from JekyllRDF.
Jinja RDF
The library that provides the filters and data model (the core).
Kisumu
A simple command line tool and library to render a template + an RDF graph -> a static document. It is also build on top of Jinja RDF.
Jekyll RDF
The implementation of jinja-rdf, kisumu, and mkrdf is a result of the lessons learned from JekyllRDF. Currently the three tools don't cover all features, that were implemented in JekyllRDF, if you miss a feature that you need, please provide a pull request to one of the projects. (Read more about the relation.)
Migrate from Jekyll RDF
If you migrate from Jekyll RDF you need to setup a new mkdocs project, adjust your templates and configuration. Many things are named differently with the hope to make it simpler for users of mkrdf without previous knowledge about Jekyll RDF.
Configuration
path is now graph_file
restriction is now selection (note, that the query now binds the variable ?resourceIri instead of ?resourceUri)
baseiri is now base_iri
Filters
Those are the filters provided by JekyllRDF.
rdf_get(not available)rdf_property->property,propertiesResource[]rdf_inverse_property->property_inv,properties_invsparql_query->queryrdf_container(not available, TODO)rdf_collection(not available, TODO)
Versioning
For now, I follow the 0ver scheme.
Metadata
Release files for mkrdf 0.2.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 |
|---|---|---|---|---|
| mkrdf-0.2.4.tar.gz | 8.9 kB | Without provenance | Details for mkrdf-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mkrdf-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for mkrdf-0.2.4-py3-none-any.whl |
Total release size: 18.7 kB
Release files / mkrdf-0.2.4.tar.gz
| Download URL | mkrdf-0.2.4.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5bada67091ed9c0cc0e3810be46a43dc35e878f1055707aa0be4493604051d4
|
|
BLAKE2b-256 checksum How to use checksums |
7f057213d9f5cbaa71ffd29d620333df4dc2426dabba82bc65a4ed81089d1dc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.14.0 Linux/6.17.7-300.fc43.x86_64
|
Release files / mkrdf-0.2.4-py3-none-any.whl
| Download URL | mkrdf-0.2.4-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75d94135238155f9577781c5e0b513bfe17feddcee0cb0c63c4153d3beceeac7
|
|
BLAKE2b-256 checksum How to use checksums |
47ae0990615f73052fe5e8d5179c424eadde490cc085736ba8848601436cedb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.14.0 Linux/6.17.7-300.fc43.x86_64
|
Security for mkrdf 0.2.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.