Skip to main content

No project description provided

Project description

MkRDF

[!WARNING]

This project is still under development and does not yet covers all use cases of Jekyll RDF. The interface are unstable and might break in future versions.

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.

  • preset can hold the values subject_relative (default), subject_all, or none,
    • subject_relative selects all subject IRIs that share the configured base_iri, i.e. SELECT ?resourceIri { ?resourceIri ?p ?o . FILTER regex(str(?resourceIri), concat("^", str(?base_iri))) },
    • subject_relative selects all subject IRIs irrespective of the base_iri, i.e. SELECT ?resourceIri { ?resourceIri ?p ?o }.
    • none will skip all other selections and not IRI is selected
  • query or queries needs to provide a string (or list of strings) with a valid SPARQL 1.1 query, that binds the variable ?resourceIri to all selected IRIs.
  • list an explicit list of IRIs
  • file a 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

Jinja RDF

The library that provides the filters and data model (the core).

Kisumu

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

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, properties Resource[]
  • rdf_inverse_property -> property_inv, properties_inv
  • sparql_query -> query
  • rdf_container (not available, TODO)
  • rdf_collection (not available, TODO)

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

mkrdf-0.1.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkrdf-0.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file mkrdf-0.1.1.tar.gz.

File metadata

  • Download URL: mkrdf-0.1.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.11-300.fc42.x86_64

File hashes

Hashes for mkrdf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f88b0949feda4d63a34bcfa5179a80d16124ee4a1385cf9074a84c8853c136a1
MD5 bc5a4d13c9b2bf4e7a9f3ee306cccbdd
BLAKE2b-256 1a7905691b32007926c5123d51765bd029b77c55fd3f9fd18eafdbd9b5a58002

See more details on using hashes here.

File details

Details for the file mkrdf-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mkrdf-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Linux/6.14.11-300.fc42.x86_64

File hashes

Hashes for mkrdf-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97bb989b309d0d0149762687237708fcc08c1a157b3f0036e5e1296ab7a753fc
MD5 1c1b81b35dac73aaace04b5873fb4318
BLAKE2b-256 fd3c29b978db8da6e00c5af886b2cc0bd4384166a78fe75bb4edfd74b2ce9156

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page