Name | prezmanifest JSON |
Version |
1.0.14
JSON |
| download |
home_page | None |
Summary | A Python package that provides a series of functions to work with Prez Manifests. |
upload_time | 2025-07-26 11:39:42 |
maintainer | None |
docs_url | None |
author | None |
requires_python | <4.0,>=3.12 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Prez Manifest
This repository contains the `prezmanifest` Python package that provides a series of functions to work with Prez Manifests.
## Contents
* [What is a Prez Manifest?](#what-is-a-prez-manifest)
* [Functions](#functions)
* [Use](#use)
* [Testing](#testing)
* [Extending](#extending)
* [License](#license)
* [Contact](#contact)
* [Background concepts & other resources](#background-concepts--other-resources)
* [Case Studies](#case-studies)
## What is a Prez Manifest?
A Prez Manifest is an RDF file that describes and links to a set of resources that can be loaded into an RDF database for the [Prez graph database publication system](http://prez.dev) to provide access to. The Prez Manifest specification is online at: <https://prez.dev/manifest/>.
## Functions
The functions provided 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](#conformance-claims)given in the Manifest)
* **label**
* lists all the IRIs for elements with a Manifest's Resources that don't have labels. Given a source of additional labels, such as the [KurrawongAI Semantic Background](#kurrawongai-semantic-background), 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 ASCCIIDOC 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
* **load**
* extract all the content of all Resources listed in a Prez Manifest and load it into either a single RDF multi-graph ('quads') file or into an RDF DB instance by using the Graph Store Protocol
* **sync**
* synchronises some kinds of resources list in a Manifest with versions of them in a SPARQL Endpoint
* acts as `load` if run against an empty SPARQL Endpoint
* does not yet load background resources
## 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](https://pypi.org) at <https://pypi.org/project/prezmanifest/> so can be installed using [Poetry](https://python-poetry.org) or PIP etc. We do recommend [UV](https://github.com/astral-sh/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](https://docs.astral.sh/uv/getting-started/installation/), then:
```bash
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](#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:
```python
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:
```bash
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:
```bash
pm load -h
```
> [!TIP]
> See the [Case Study: Sync](#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 artifacts for the `sync` function, see the [`compare_version_indicators()`](prezmanifest/utils.py#L397)
## License
This code is available for reuse according to the https://opensource.org/license/bsd-3-clause[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 amin 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](https://kurrawong.ai) makes available labels for all the elements of about 100 well-known ontologies and vocabularies at <https://demo.dev.kurrawong.ai/catalogs/exm:demo-vocabs>. 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](https://mspgh.unimelb.edu.au/centres-institutes/onemda/research-group/indigenous-studies-unit)
at the [University of Melbourne](https://www.unimelb.edu.au).
The catalogue is available online via an instance of the [Prez](https://prez.dev) system at <https://data.idnau.org>
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 handwritten.
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:
1. 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.ttl` in the ISU catalogue repo
* the initial manifest file was validated with prezmanifest/validator: `pm validate isu-catalogue/manifest.ttl`
2. A labels file was automatically generated using prezmanifest/labeller
* using the [KurrawongAI Semantic Background](https://demo.dev.kurrawong.ai/catalogs/exm:demo-vocabs) 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.ttl` was 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 manifest` command
3. 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
4. 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_
5. A final missing labels test was performed
* running `pm label iris isu-catalogue/manifest.ttl > iris.txt` again indicated no important IRIs were still missing labels
6. The catalogue was enhanced
* `pm document catalogue isu-catalogue/manifest.ttl` was run to add all the resources of the catalogue to the `catalogue.ttl` file
7. 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.
8. The catalogue was prepared for upload
* `pm load file isu-catalogue/manifest.ttl isu-catalogue.trig` was run
* it produced a single _trig_ file `isu-catalogue.trig` containing RDF graphs which can easily be uploaded to the
database delivering the catalogue
* `pm load sparql isu-catalogue/manifest.ttl http://a-sparql-endpoint.com/ds -u username -p password` could have been run to load the content directly into the ISU RDF DB, if it had been available
### Case Study: Sync
If I have a manifest locally, I can load it into a remote SPARQL Endpoint like this:
```bash
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 artifact, determines which is more recent and then reports on whether the local artifact should be uploaded, teh remote one downloaded or whether there are new artifacts 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:
```bash
pm sync tests/test_sync/local/manifest.ttl {SPARQL-ENDPOINT}
```
You will see a report like this:
```
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Artifact ┃ Main Entity ┃ Direction ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ /../../../artifact4.ttl │ http://example.com/dataset/4 │ upload │
│ /../../../artifact5.ttl │ http://example.com/dataset/5 │ add-remotely │
│ /../../../artifact6.ttl │ http://example.com/dataset/6 │ download │
│ /../../../artifact7.ttl │ http://example.com/dataset/7 │ upload │
│ /../../../artifact9.ttl │ http://example.com/dataset/9 │ same │
│ /../../../artifacts/artifact1.ttl │ http://example.com/dataset/1 │ same │
│ /../../../artifacts/artifact2.ttl │ http://example.com/dataset/2 │ upload │
│ /../../../artifacts/artifact3.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 artifact, what `sync` will do.
* the local copy of `artifact4.ttl` is newer than the remote one, so it wants to "upload"
* the remote location is missing `artifact5.ttl`, so it wants to upload that too
* `artifact9` is the "same" - no action required
* `artifact6.ttl` is 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 where not set, e.g.:
```bash
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`.
Raw data
{
"_id": null,
"home_page": null,
"name": "prezmanifest",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Nicholas Car <nick@kurrawong.ai>",
"download_url": "https://files.pythonhosted.org/packages/7b/a0/9a213936ce3e79df444ba30ec6dc167df2a007deb6a511e98c7a844fa33a/prezmanifest-1.0.14.tar.gz",
"platform": null,
"description": "# Prez Manifest\n\nThis repository contains the `prezmanifest` Python package that provides a series of functions to work with Prez Manifests.\n\n## Contents\n\n* [What is a Prez Manifest?](#what-is-a-prez-manifest)\n* [Functions](#functions)\n* [Use](#use)\n* [Testing](#testing)\n* [Extending](#extending)\n* [License](#license)\n* [Contact](#contact)\n* [Background concepts & other resources](#background-concepts--other-resources)\n* [Case Studies](#case-studies)\n\n## What is a Prez Manifest?\n\nA Prez Manifest is an RDF file that describes and links to a set of resources that can be loaded into an RDF database for the [Prez graph database publication system](http://prez.dev) to provide access to. The Prez Manifest specification is online at: <https://prez.dev/manifest/>.\n\n## Functions\n\nThe functions provided are:\n\n* **validate**\n * 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](#conformance-claims)given in the Manifest)\n* **label**\n * lists all the IRIs for elements with a Manifest's Resources that don't have labels. Given a source of additional labels, such as the [KurrawongAI Semantic Background](#kurrawongai-semantic-background), it can try to extract any missing labels and insert them into a Manifest as an additional labelling resource\n* **document**\n * **table**: can create a Markdown or ASCCIIDOC table of Resources from a Prez Manifest file for use in README files in repositories\n * **catalogue**: add the IRIs of resources within a Manifest's 'Resource Data' object to a catalogue RDF file\n* **load**\n * extract all the content of all Resources listed in a Prez Manifest and load it into either a single RDF multi-graph ('quads') file or into an RDF DB instance by using the Graph Store Protocol\n* **sync**\n * synchronises some kinds of resources list in a Manifest with versions of them in a SPARQL Endpoint\n * acts as `load` if run against an empty SPARQL Endpoint\n * does not yet load background resources\n\n## Installation\n\nThis 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.\n\n### Library \n\nIt is available on [PyPI](https://pypi.org) at <https://pypi.org/project/prezmanifest/> so can be installed using [Poetry](https://python-poetry.org) or PIP etc. We do recommend [UV](https://github.com/astral-sh/uv) as that's the package manager we find easiest to work with.\n\n### Command Line\n\nTo make available the command line script `pm` you need to first install `UV`, see the [uv installation instructions](https://docs.astral.sh/uv/getting-started/installation/), then:\n\n```bash\nuv tool install prezmanifest\n```\n\nNow you can invoke `pm` anywhere in your terminal as long as `~/,local/bin/` is in your `PATH`.\n\n### Latest\n\nYou 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.\n\n## Use\n\n> [!TIP]\n> See the [Case Study: Establish](#case-study-establish) below for a short description of the \n> establishment of a new catalogue using prezmanifest.\n\n### Library\n\nInstall as above and then, in your Python code, import the functions you want to use. Currently, these are the public functions:\n\n```python\nfrom prezmanifest.validator import validate\nfrom prezmanifest.labeller import LabellerOutputTypes, label\nfrom prezmanifest.documentor import table, catalogue\nfrom prezmanifest.loader import load\nfrom prezmanifest.syncer import sync\n```\n\n### Command Line\n\nAll 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:\n\n```bash\npm -h\n```\n\nWhich will print something like this:\n\n```\nPrezManifest top-level Command Line Interface. Ask for help (-h) for each Command \n \n\u256d\u2500 Options \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 --version -v \u2502\n\u2502 --help -h Show this message and exit. \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500 Commands \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 validate Validate the structure and content of a Prez Manifest \u2502\n\u2502 sync Synchronize a Prez Manifest's resources with loaded copies of them in a SPARQL Endpoint \u2502\n\u2502 label Discover labels missing from data in a in a Prez Manifest and patch them \u2502\n\u2502 document Create documentation from a Prez Manifest \u2502\n\u2502 load Load a Prez Manifest's content into a file or DB \u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n```\n\nTo find out more about each Command, ask for helo like this - for load:\n\n```bash\npm load -h\n```\n\n> [!TIP]\n> See the [Case Study: Sync](#case-study-sync) below for a description of the different ways to sync\n\n## Testing\n\nRun `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.\n\n## Extending\n\nMany functions have been placed into `prezmanifest/utils.py` and hopefully extensions can be made to individual functions there. \n\nFor example, to extend the criteria `prezmanifest` uses to judge the newness of a local v. a remote artifacts for the `sync` function, see the [`compare_version_indicators()`](prezmanifest/utils.py#L397)\n\n## License\n\nThis code is available for reuse according to the https://opensource.org/license/bsd-3-clause[BSD 3-Clause License].\n\n© 2024-2025 KurrawongAI\n\n## Contact\n\nFor all matters, please contact:\n\n**KurrawongAI** \n<info@kurrawong.ai> \n<https://kurrawong.ai> \n\n## Background concepts & other resources\n\nThe amin 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.\n\n### Conformance Claims\n\nA 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.\n\nSee 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`\n\n### KurrawongAI Semantic Background\n\n[KurrawongAI](https://kurrawong.ai) makes available labels for all the elements of about 100 well-known ontologies and vocabularies at <https://demo.dev.kurrawong.ai/catalogs/exm:demo-vocabs>. You can use this as a source (SPARQL Endpoint) of labels to patch content in Manifests that are missing labels with.\n\n## Case Studies\n\n### Case Study: Establish\n\nThe Indigenous Studies Unit Catalogue is a new catalogue of resources - books, articles, boxes of archived documents - \nproduced by the [Indigenous Studies Unit](https://mspgh.unimelb.edu.au/centres-institutes/onemda/research-group/indigenous-studies-unit) \nat the [University of Melbourne](https://www.unimelb.edu.au).\n\nThe catalogue is available online via an instance of the [Prez](https://prez.dev) system at <https://data.idnau.org>\nand the content is managed in the GitHub repository <https://github.com/idn-au/isu-catalogue>.\n\nThe catalogue container object is constructed as a `schema:DataCatalog` (and also a `dcat:Catalog`, for compatibility \nwith legacy systems) containing multiple `schema:CreativeWork` instances with subtyping to indicate 'book', 'artwork' \netc.\n\nThe source of the catalogue metadata is the static RDF file `_background/catalogue-metadata.ttl` that was handwritten.\n\nThe source of the resources' information is the CSV file `_background/datasets.csv` which was created by hand during a \nvisit to the Indigenous Studies Unit. This CSV information was converted to RDF files in `resources/` using the custom\nscript `_background/resources_make.py`.\n\nAfter creation of the catalogue container object's metadata and the primary resource information, prezmanifest was used\nto improve the presentation of the data in Prez in the following ways:\n\n1. A manifest files was created\n * based on the example in this repository in `tests/demo-vocabs/manifest.ttl`\n * the example was copy 'n pasted with only minor changes, see `manifest.ttl` in the ISU catalogue repo\n * the initial manifest file was validated with prezmanifest/validator: `pm validate isu-catalogue/manifest.ttl`\n2. A labels file was automatically generated using prezmanifest/labeller\n * using the [KurrawongAI Semantic Background](https://demo.dev.kurrawong.ai/catalogs/exm:demo-vocabs) as a source of labels\n * using the command `pm label rdf isu-catalogue/manifest.ttl http://demo.dev.kurrawong.ai/sparql > labels.ttl`\n * the file, `labels.ttl` was stored in the ISU Catalogue repo `_background/` folder and indicated in the manifest \n file with the role of _Incomplete Catalogue And Resource Labels_ as it doesn't provide all missing labels\n * note that this storage could have been done automatically using the `pm label manifest` command\n3. IRIs still missing labels were determined\n * using prezmanifest/labeller again with the command `pm label iris isu-catalogue/manifest.ttl > iris.txt`, all IRIs still missing labels were listed\n4. Labels for remaining IRIs were manually created\n * 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`\n * the manual labels file was added to the catalogue's manifest, also with a role of _Incomplete Catalogue And Resource Labels_\n5. A final missing labels test was performed\n * running `pm label iris isu-catalogue/manifest.ttl > iris.txt` again indicated no important IRIs were still missing labels\n6. The catalogue was enhanced\n * `pm document catalogue isu-catalogue/manifest.ttl` was run to add all the resources of the catalogue to the `catalogue.ttl` file\n7. The manifest was documented\n * using prezmanifest/documentor, a Markdown table of the manifest's content was created using the command `pm document table isu-catalogue/manifest.ttl`\n * the output of this command - a Markdown table - is visible in the ISU Catalogue repo's README file.\n8. The catalogue was prepared for upload\n * `pm load file isu-catalogue/manifest.ttl isu-catalogue.trig` was run\n * it produced a single _trig_ file `isu-catalogue.trig` containing RDF graphs which can easily be uploaded to the \n database delivering the catalogue\n * `pm load sparql isu-catalogue/manifest.ttl http://a-sparql-endpoint.com/ds -u username -p password` could have been run to load the content directly into the ISU RDF DB, if it had been available\n\n### Case Study: Sync\n\nIf I have a manifest locally, I can load it into a remote SPARQL Endpoint like this:\n\n```bash\npm load sparql {PATH-TO-MANIFEST} {SPARQL-ENDPOINT}\n```\n\nGoing 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.\n\n`sync` compares \"version indicators\" per artifact, determines which is more recent and then reports on whether the local artifact should be uploaded, teh remote one downloaded or whether there are new artifacts present locally or remotely.\n\nThe `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:\n\n```bash\npm sync tests/test_sync/local/manifest.ttl {SPARQL-ENDPOINT}\n```\n\nYou will see a report like this:\n\n```\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Artifact \u2503 Main Entity \u2503 Direction \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 /../../../artifact4.ttl \u2502 http://example.com/dataset/4 \u2502 upload \u2502\n\u2502 /../../../artifact5.ttl \u2502 http://example.com/dataset/5 \u2502 add-remotely \u2502\n\u2502 /../../../artifact6.ttl \u2502 http://example.com/dataset/6 \u2502 download \u2502\n\u2502 /../../../artifact7.ttl \u2502 http://example.com/dataset/7 \u2502 upload \u2502\n\u2502 /../../../artifact9.ttl \u2502 http://example.com/dataset/9 \u2502 same \u2502\n\u2502 /../../../artifacts/artifact1.ttl \u2502 http://example.com/dataset/1 \u2502 same \u2502\n\u2502 /../../../artifacts/artifact2.ttl \u2502 http://example.com/dataset/2 \u2502 upload \u2502\n\u2502 /../../../artifacts/artifact3.ttl \u2502 http://example.com/dataset/3 \u2502 upload \u2502\n\u2502 /../../../catalogue.ttl \u2502 https://example.com/sync-test \u2502 same \u2502\n\u2502 http://example.com/dataset/8 \u2502 http://example.com/dataset/8 \u2502 add-locally \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\nThis is telling you, per artifact, what `sync` will do. \n\n* the local copy of `artifact4.ttl` is newer than the remote one, so it wants to \"upload\"\n* the remote location is missing `artifact5.ttl`, so it wants to upload that too\n* `artifact9` is the \"same\" - no action required\n* `artifact6.ttl` is newer remotely, it should be downloaded\n\nYou 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 where not set, e.g.:\n\n```bash\npm sync tests/test_sync/local/manifest.ttl http://localhost:3030/test/ False False False False\n```\n\nOther than doing all this \"manually\" - interactively, on the command line - I might want to use `sync` in Python application code or cloud _infracode_ scriptin.\n\nFor 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`.\n\nFor use in _infracode_, note that the `pm sync` function can return the table above in JSON by setting the `response format` input parameter, `-f`.\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package that provides a series of functions to work with Prez Manifests.",
"version": "1.0.14",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "04fa8fa7f0419cc23dfa2257d95e281c855c9eece32aab4b3c575426a7e57cf5",
"md5": "3a0a97786a3c564f6c9493e03041beed",
"sha256": "30f8a2a47055ee9c2cc96f4774d6ad267a7d60390fd1c84aa86807ecf090af70"
},
"downloads": -1,
"filename": "prezmanifest-1.0.14-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3a0a97786a3c564f6c9493e03041beed",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 47882,
"upload_time": "2025-07-26T11:39:28",
"upload_time_iso_8601": "2025-07-26T11:39:28.687182Z",
"url": "https://files.pythonhosted.org/packages/04/fa/8fa7f0419cc23dfa2257d95e281c855c9eece32aab4b3c575426a7e57cf5/prezmanifest-1.0.14-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7ba09a213936ce3e79df444ba30ec6dc167df2a007deb6a511e98c7a844fa33a",
"md5": "6bebb7087de56f9b1782bfa683447ee3",
"sha256": "23e200179b73789dfd6da4794973c98f20bbf218e8e191e8f96119ba7f9be953"
},
"downloads": -1,
"filename": "prezmanifest-1.0.14.tar.gz",
"has_sig": false,
"md5_digest": "6bebb7087de56f9b1782bfa683447ee3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 8742722,
"upload_time": "2025-07-26T11:39:42",
"upload_time_iso_8601": "2025-07-26T11:39:42.525065Z",
"url": "https://files.pythonhosted.org/packages/7b/a0/9a213936ce3e79df444ba30ec6dc167df2a007deb6a511e98c7a844fa33a/prezmanifest-1.0.14.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 11:39:42",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "prezmanifest"
}