Prez Manifest
Prez Manifest - pm - is a tool that performs data management functions, such as synchronising between RDF files in a version control repository and an RDF DB, and also a data model that provides the scaffolding for data to be managed by the tool. The tool is implemented as a Python application and library.
Contents
- What is a pm Manifest?
- Functions
- Installation
- Use
- Testing
- Extending
- License
- Contact
- Background concepts & other resources
- Case Studies
What is a pm Manifest?
A pm Manifest is an RDF file that describes and links to a set of files, usually stored in version control, that can be validated and managed by the pm tool. Usual management goals are:
- validation - checking content conforms to SHACL Shapes Graphs
- synchronisation - maintaining data in an RDF DB up-to-date with files
- labelling - finding things that are missing labels and proving labels
A simple Manifest file, for Geoscience Australia's vocabularies online at https://github.com/GeoscienceAustralia/ga-vocabs/blob/master/manifest.ttl, looks like this:
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX mrr: <https://prez.dev/ManifestResourceRoles/>
PREFIX prez: <https://prez.dev/>
PREFIX prof: <http://www.w3.org/ns/dx/prof/>
PREFIX schema: <https://schema.org/>
[]
a prez:Manifest ;
prof:hasResource
[
prof:hasartefact "catalogue.ttl" ;
prof:hasRole mrr:CatalogueData ;
schema:name "Catalogue Definition" ;
] ,
[
prof:hasartefact "vocabularies/*.ttl" ;
prof:hasRole mrr:ResourceData ;
schema:name "Resource Data" ;
dcterms:conformsTo <https://linked.data.gov.au/def/vocpub/validator> ;
] ,
[
prof:hasartefact "labels.ttl" ;
prof:hasRole mrr:CompleteCatalogueAndResourceLabels ;
schema:name "Labels" ;
] ;
.
In the file above, we have a prez:Manifest object which has 3 prof:resource instances, one for the "Catalogue Definition", the vocabularies - "Resource Data" - and "Labels". The vocabularies are shown to be conformant to the VocPub profile of SKOS which they will be validated against before any data synchronisation.
The complete data model of a pm Manifest file is online at: https://prez.dev/manifest/.
Functions
The functions provided my pm are discoverable by running the tool as a command line application - see Command Line below - and are:
- validate
- performs SHACL validation on the Manifest, followed by existence checking for each resource - are they reachable by this script on the file system or over the Internet? Will also check any Conformance Claims given in the Manifest)
- label
- lists all the IRIs for elements within a Manifest's resources that don't have labels. Given a source of additional
labels, it can try to extract any
missing labels and insert them into a Manifest as an additional labelling resource
- KurrawongAI's Semantic Background is included as a source of labels be default
- lists all the IRIs for elements within a Manifest's resources that don't have labels. Given a source of additional
labels, it can try to extract any
missing labels and insert them into a Manifest as an additional labelling resource
- document
- table: can create a Markdown or ASCIIDOC table of Resources from a Prez Manifest file for use in README files in repositories
- catalogue: add the IRIs of resources within a Manifest's 'Resource Data' object to a catalogue RDF file
- sync
- synchronises resources listed in a Manifest with versions of them in a SPARQL Endpoint
- acts as
loadif run against an empty SPARQL Endpoint - does not yet load background resources
- event
- event-based Prez Manifests actions - for advanced systems use
Installation
This Python package is intended to be used as a Python library, called directly from other Python code, or on the command line on Linux/UNIX-like systems.
Library
It is available on PyPI at https://pypi.org/project/prezmanifest/ so can be installed using Poetry or PIP etc. We do recommend UV as that's the package manager we find easiest to work with.
Command Line
To make available the command line script pm you need to first install UV, see
the uv installation instructions, then:
uv tool install prezmanifest
Now you can invoke pm anywhere in your terminal as long as /local/bin/ is in your PATH.
Latest
You can also always install the latest, unstable, release from its version control repository: https://github.com/Kurrawong/prez-manifest/, but we make prezmanifest releases often, so the latest shouldn't ever be too far ahead of the most recent release.
Use
[!TIP] See the Case Study: Establish below for a short description of the establishment of a new catalogue using prezmanifest.
Library
Install as above and then, in your Python code, import the functions you want to use. Currently, these are the public functions:
from prezmanifest.validator import validate
from prezmanifest.labeller import LabellerOutputTypes, label
from prezmanifest.documentor import table, catalogue
from prezmanifest.loader import load
from prezmanifest.syncer import sync
Command Line
All the functions of the library are made available as a command line application called pm. After installation, as
above, you can inspect the command line tool by asking for "help" like this:
pm -h
Which will print something like this:
PrezManifest top-level Command Line Interface. Ask for help (-h) for each Command
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────╮
│ --version -v │
│ --help -h Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────╮
│ validate Validate the structure and content of a Prez Manifest │
│ sync Synchronize a Prez Manifest's resources with loaded copies of them in a SPARQL Endpoint │
│ label Discover labels missing from data in a in a Prez Manifest and patch them │
│ document Create documentation from a Prez Manifest │
│ load Load a Prez Manifest's content into a file or DB │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯
To find out more about each Command, ask for helo like this - for load:
pm load -h
[!NOTE] If (when?) pm runs into problems such as trying to synchronise resources between files and an RDF DB with missmatching version numbers, you can always run kurra commands to directly manage DB resources.
For example, you can run
kurra db gsp put {FILE} {SPARQL-ENDPOINT} -g {GRAPH-NAME}to force a replacement of the grapf,GRAPH-NAME, in the RDF DB with the contents of theFILE.
Logging
You can control the verbosity of the command line tool by setting the PM_LOG_LEVEL environment variable to one of
Python's standard logging levels: DEBUG, INFO, WARNING, ERROR, or CRITICAL. The default level is WARNING.
For example, to see detailed debug output:
PM_LOG_LEVEL=DEBUG pm load file my-manifest.ttl output.trig
Or for informational messages:
PM_LOG_LEVEL=INFO pm validate my-manifest.ttl
[!TIP] See the Case Study: Sync below for a description of the different ways to sync
Testing
Run uv run pytest, or Poetry etc. equivalents, to execute pytest. You must have Docker Desktop running to allow all
loader tests to be executed as some use temporary test containers.
Extending
Many functions have been placed into prezmanifest/utils.py and hopefully extensions can be made to individual
functions there.
For example, to extend the criteria prezmanifest uses to judge the newness of a local v. a remote artefacts for the
sync function, see the compare_version_indicators()
License
This code is available for reuse according to the BSD 3-Clause License.
© 2024-2025 KurrawongAI
Contact
For all matters, please contact:
KurrawongAI
info@kurrawong.ai
https://kurrawong.ai
Background concepts & other resources
The admin documentation for Prez Manifests - what they are, how to make them etc., is online at https://prez.dev, however, here are also two concepts referred to above, summarised.
Conformance Claims
A claim that some data conforms to a standard or a profile. In Prez Manifest, this is about indicating that a Resource should and is expected to conform to a standard.
See the various Manifest files in tests/demo-vocabs/ for examples of them in use for individual resources or all
resources, e.g. tests/demo-vocabs/manifest-conformance.ttl
KurrawongAI Semantic Background
KurrawongAI makes available labels for all the elements of about 100 well-known ontologies and vocabularies at KurrawongAI Semantic Background. You can use this as a source (SPARQL Endpoint) of labels to patch content in Manifests that are missing labels with.
Case Studies
Case Study: Establish
The Indigenous Studies Unit Catalogue is a new catalogue of resources - books, articles, boxes of archived documents - produced by the Indigenous Studies Unit at the University of Melbourne.
The catalogue is available online via an instance of the Prez system at https://data.idnau.org/pid/isu-catalogue and the content is managed in the GitHub repository https://github.com/idn-au/isu-catalogue.
The catalogue container object is constructed as a schema:DataCatalog (and also a dcat:Catalog, for compatibility
with legacy systems) containing multiple schema:CreativeWork instances with subtyping to indicate 'book', 'artwork'
etc.
The source of the catalogue metadata is the static RDF file _background/catalogue-metadata.ttl that was made by hand.
The source of the resources' information is the CSV file _background/datasets.csv which was created by hand during a
visit to the Indigenous Studies Unit. This CSV information was converted to RDF files in resources/ using the custom
script _background/resources_make.py.
After creation of the catalogue container object's metadata and the primary resource information, prezmanifest was used to improve the presentation of the data in Prez in the following ways:
- A manifest files was created
- based on the example in this repository in
tests/demo-vocabs/manifest.ttl - the example was copy 'n pasted with only minor changes, see
manifest.ttlin the ISU catalogue repo - the initial manifest file was validated with prezmanifest/validator:
pm validate isu-catalogue/manifest.ttl
- based on the example in this repository in
- A labels file was automatically generated using prezmanifest/labeller
- using the KurrawongAI Semantic Background as a source of labels
- using the command
pm label rdf isu-catalogue/manifest.ttl http://demo.dev.kurrawong.ai/sparql > labels.ttl - the file,
labels.ttlwas stored in the ISU Catalogue repo_background/folder and indicated in the manifest file with the role of Incomplete Catalogue And Resource Labels as it doesn't provide all missing labels- note that this storage could have been done automatically using the
pm label manifestcommand
- note that this storage could have been done automatically using the
- IRIs still missing labels were determined
- using prezmanifest/labeller again with the command
pm label iris isu-catalogue/manifest.ttl > iris.txt, all IRIs still missing labels were listed
- using prezmanifest/labeller again with the command
- Labels for remaining IRIs were manually created
- there were only 7 important IRIs (as opposed to system objects that don't need labels) that still needed labels.
These where manually created in the file
_background/labels-manual.ttl - the manual labels file was added to the catalogue's manifest, also with a role of Incomplete Catalogue And Resource Labels
- there were only 7 important IRIs (as opposed to system objects that don't need labels) that still needed labels.
These where manually created in the file
- A final missing labels test was performed
- running
pm label iris isu-catalogue/manifest.ttl > iris.txtagain indicated no important IRIs were still missing labels
- running
- The catalogue was enhanced
pm document catalogue isu-catalogue/manifest.ttlwas run to add all the resources of the catalogue to thecatalogue.ttlfile
- The manifest was documented
- using prezmanifest/documentor, a Markdown table of the manifest's content was created using the command
pm document table isu-catalogue/manifest.ttl - the output of this command - a Markdown table - is visible in the ISU Catalogue repo's README file.
- using prezmanifest/documentor, a Markdown table of the manifest's content was created using the command
- The catalogue was prepared for upload
pm load file isu-catalogue/manifest.ttl isu-catalogue.trigwas run- it produced a single trig file
isu-catalogue.trigcontaining RDF graphs which was one-time uploaded to the database delivering the catalogue
- The catalogue and repo were synchronised
pm syncwas then used repeatedly to synchronise updates to the files in version control with the RDF BY read by Prez
Case Study: Sync
If I have a manifest locally, I can load it into a remote SPARQL Endpoint like this:
pm load sparql {PATH-TO-MANIFEST} {SPARQL-ENDPOINT}
Going forward, I don't have to blow away all the content in the SPARQL Endpoint and reload everything whenever I have
content changes, instead I can use the sync command.
sync compares "version indicators" per artefact, determines which is more recent and then reports on whether the local
artefact should be uploaded, teh remote one downloaded or whether there are new artefacts present locally or remotely.
The tests/test_sync/ directory in this repository contains a local and a remote manifest and content. Following
the logic in the testing function tests/test_sync/test_sync.py::test_sync, if the remote manifest is loaded, as per
pm load sparql tests/test_sync/remote/manifest.ttl {SPARQL-ENDPOINT} and then sync is run like this:
pm sync tests/test_sync/local/manifest.ttl {SPARQL-ENDPOINT}
You will see a report like this:
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ artefact ┃ Main Entity ┃ Direction ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ /../../../artefact4.ttl │ http://example.com/dataset/4 │ upload │
│ /../../../artefact5.ttl │ http://example.com/dataset/5 │ add-remotely │
│ /../../../artefact6.ttl │ http://example.com/dataset/6 │ download │
│ /../../../artefact7.ttl │ http://example.com/dataset/7 │ upload │
│ /../../../artefact9.ttl │ http://example.com/dataset/9 │ same │
│ /../../../artefacts/artefact1.ttl │ http://example.com/dataset/1 │ same │
│ /../../../artefacts/artefact2.ttl │ http://example.com/dataset/2 │ upload │
│ /../../../artefacts/artefact3.ttl │ http://example.com/dataset/3 │ upload │
│ /../../../catalogue.ttl │ https://example.com/sync-test │ same │
│ http://example.com/dataset/8 │ http://example.com/dataset/8 │ add-locally │
└───────────────────────────────────┴───────────────────────────────┴──────────────┘
This is telling you, per artefact, what sync will do.
- the local copy of
artefact4.ttlis newer than the remote one, so it wants to "upload" - the remote location is missing
artefact5.ttl, so it wants to upload that too artefact9is the "same" - no action requiredartefact6.ttlis newer remotely, it should be downloaded
You can choose to have sync carry out all these actions or only some - default is all - by setting the update_remote
and so on input parameters. Setting all to False will cause sync to do nothing and report only what it would do if
they were not set, e.g.:
pm sync tests/test_sync/local/manifest.ttl http://localhost:3030/test/ False False False False
Other than doing all this "manually" - interactively, on the command line - I might want to use sync in Python
application code or cloud infracode scriptin.
For use in Python applications, just import prezmanifest - uv add prezmanifest etc. - and use, as per the use of
sync in tests/test_sync/test_sync.py::test_sync.
For use in infracode, note that the pm sync function can return the table above in JSON by setting the
response format input parameter, -f.
Release Procedure
- format code:
task format - pass tests:
task test - update version in pyproject.toml
- commit all updates:
git commit -a "..." - make GitHub release
- this will trigger pypi.yml workflow to publish to PyPI
- update version in pyproject.toml to next release alpha and push
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prezmanifest-1.2.5.tar.gz.
File metadata
- Download URL: prezmanifest-1.2.5.tar.gz
- Upload date:
- Size: 115.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7e328fe7a6e769d28c29e567e606d591532fa0b5142f0f6486e61a2d0a08456
|
|
| MD5 |
46ab5e779eb83e15d1b1c5c1f8d0e03f
|
|
| BLAKE2b-256 |
68a349686aa49edb73502b0cb2e00ac903cb187decb333e0dfcf824ef73c5b45
|
Provenance
The following attestation bundles were made for prezmanifest-1.2.5.tar.gz:
Publisher:
pypi.yml on Kurrawong/prezmanifest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prezmanifest-1.2.5.tar.gz -
Subject digest:
c7e328fe7a6e769d28c29e567e606d591532fa0b5142f0f6486e61a2d0a08456 - Sigstore transparency entry: 2090704498
- Sigstore integration time:
-
Permalink:
Kurrawong/prezmanifest@1c19cf3e4cae8467428f0e732d157ca867811166 -
Branch / Tag:
refs/tags/1.2.5 - Owner: https://github.com/Kurrawong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c19cf3e4cae8467428f0e732d157ca867811166 -
Trigger Event:
release
-
Statement type:
File details
Details for the file prezmanifest-1.2.5-py3-none-any.whl.
File metadata
- Download URL: prezmanifest-1.2.5-py3-none-any.whl
- Upload date:
- Size: 41.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f5552188a4721c16229402d3f816f59aa24cf40e30c5cabbce8a9fd5142520b
|
|
| MD5 |
960b7166632b69394fc1265d472caffa
|
|
| BLAKE2b-256 |
0d326cb7c35214f09e0d119636ddec90e0608d71a5ac119f2d7a9ed70d7b7ac7
|
Provenance
The following attestation bundles were made for prezmanifest-1.2.5-py3-none-any.whl:
Publisher:
pypi.yml on Kurrawong/prezmanifest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prezmanifest-1.2.5-py3-none-any.whl -
Subject digest:
1f5552188a4721c16229402d3f816f59aa24cf40e30c5cabbce8a9fd5142520b - Sigstore transparency entry: 2090705246
- Sigstore integration time:
-
Permalink:
Kurrawong/prezmanifest@1c19cf3e4cae8467428f0e732d157ca867811166 -
Branch / Tag:
refs/tags/1.2.5 - Owner: https://github.com/Kurrawong
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1c19cf3e4cae8467428f0e732d157ca867811166 -
Trigger Event:
release
-
Statement type: