prezmanifest


Nameprezmanifest JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummaryA Python package that provides a series of functions to work with Prez Manifests.
upload_time2025-01-26 13:21:52
maintainerNone
docs_urlNone
authorNicholas Car
requires_python<4.0,>=3.12
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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/>._

This repository contains the `prezmanifest` Python package that provides a series of functions to work with Prez Manifests. The functions provided are:

* **documentation**: 
    * `create_table` creates an ASCIIDOC or Markdown table of Manifest content from a Manifest file
    * `create_catalgue`: creates an RDF file from catalogue metadata and with `hasPart` relations to all resources indicated in the Manifest 
* `validate`: validates that a Manifest file conforms to the specification and that all linked-to assets are available
* `load`: loads a Manifest file, and all the content it specifies, into either an n-quads file or a Fuseki database
* `labeller`: lists IRIs for which no labels are present in any Manifest resource or outputs an RDF file of labels for IRIs missing them if additional context (files or folders of RDF or a SPARQL Endpoint) are supplied. Can also create a new resource within a Manifest containing newly generated labels 


## Installation & Use

This Python package is intended to be used on the command line on Linux/UNIX-like systems and/or as a Python library, called directly from other Python code.

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.

You can also install the latest, unstable, release from its version control repository: <https://github.com/Kurrawong/prez-manifest/>.

Please see the `documentor.py`, `loader.py`, & `validator.py` files in the `prezmanifest` folder and the test files in `test` for documentation text and examples of use.

> [!TIP]
> See the [Case Study](#case-study---indigenous-studies-unit-catalogue) below for a short description of the 
> establishment of a new catalogue using prezmanifest.


## Testing

Run `python -m pytest` or `poetry run pytest` r similar - to execute pytest - in the top-level folder to test. You must have Docker Desktop running to allow all loader tests to be executed.


## License

This code is available for reuse according to the https://opensource.org/license/bsd-3-clause[BSD 3-Clause License].

&copy; 2024-2025 KurrawongAI


## Contact

For all matters, please contact:

**KurrawongAI**  
<info@kurrawong.ai>  
<https://kurrawong.ai>  


## Case Study - Indigenous Studies Unit Catalogue

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/manifet.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: `python prezmanifest/validator.py isu-catalogue/manifest.ttl`
2. A labels file was automatically generated using prezmanifest/labeller
    * using the [KurrawongAI Semantic Background](https://demo.dev.kurrawong.ai) as a source of labels
    * using the command `python prezmanifest/labeller.py -o rdf -a http://demo.dev.kurrawong.ai/sparql isu-catalogue/manifest.ttl > 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
3. IRIs still missing labels were determined
    * using prezmanifest/labeller again with the command `python prezmanifest/labeller.py -o iris -a http://localhost:3030/ds/query 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 `python prezmanifest/labeller.py -o iris -a http://localhost:3030/ds/query isu-catalogue/manifest.ttl > iris.txt`
      again indicated no important IRIs were still missing labels
6. The catalogue was enhanced
    * using prezmanifest/documentor, the command `python prezmanifest/documentor.py catalogue ~/work/idn/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 
      `python prezmanifest/documentor.py table ~/work/idn/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
    * using prezmanifest/loader the command `python prezmanifest/loader.py -d isu-catalogue.trig ~/work/idn/isu-catalogue/manifest.ttl`
      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


            

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": "Nicholas Car",
    "author_email": "nick@kurrawong.ai",
    "download_url": "https://files.pythonhosted.org/packages/6f/75/d5213e4d5ad574104d57a309d92586c40eee75467f9d494f86e82d38482c/prezmanifest-0.5.0.tar.gz",
    "platform": null,
    "description": "# Prez Manifest\n\n_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/>._\n\nThis repository contains the `prezmanifest` Python package that provides a series of functions to work with Prez Manifests. The functions provided are:\n\n* **documentation**: \n    * `create_table` creates an ASCIIDOC or Markdown table of Manifest content from a Manifest file\n    * `create_catalgue`: creates an RDF file from catalogue metadata and with `hasPart` relations to all resources indicated in the Manifest \n* `validate`: validates that a Manifest file conforms to the specification and that all linked-to assets are available\n* `load`: loads a Manifest file, and all the content it specifies, into either an n-quads file or a Fuseki database\n* `labeller`: lists IRIs for which no labels are present in any Manifest resource or outputs an RDF file of labels for IRIs missing them if additional context (files or folders of RDF or a SPARQL Endpoint) are supplied. Can also create a new resource within a Manifest containing newly generated labels \n\n\n## Installation & Use\n\nThis Python package is intended to be used on the command line on Linux/UNIX-like systems and/or as a Python library, called directly from other Python code.\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.\n\nYou can also install the latest, unstable, release from its version control repository: <https://github.com/Kurrawong/prez-manifest/>.\n\nPlease see the `documentor.py`, `loader.py`, & `validator.py` files in the `prezmanifest` folder and the test files in `test` for documentation text and examples of use.\n\n> [!TIP]\n> See the [Case Study](#case-study---indigenous-studies-unit-catalogue) below for a short description of the \n> establishment of a new catalogue using prezmanifest.\n\n\n## Testing\n\nRun `python -m pytest` or `poetry run pytest` r similar - to execute pytest - in the top-level folder to test. You must have Docker Desktop running to allow all loader tests to be executed.\n\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&copy; 2024-2025 KurrawongAI\n\n\n## Contact\n\nFor all matters, please contact:\n\n**KurrawongAI**  \n<info@kurrawong.ai>  \n<https://kurrawong.ai>  \n\n\n## Case Study - Indigenous Studies Unit Catalogue\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/manifet.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: `python prezmanifest/validator.py 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) as a source of labels\n    * using the command `python prezmanifest/labeller.py -o rdf -a http://demo.dev.kurrawong.ai/sparql isu-catalogue/manifest.ttl > 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\n3. IRIs still missing labels were determined\n    * using prezmanifest/labeller again with the command `python prezmanifest/labeller.py -o iris -a http://localhost:3030/ds/query isu-catalogue/manifest.ttl > iris.txt`, \n      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. \n      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 \n      Resource Labels_\n5. A final missing labels test was performed\n    * running `python prezmanifest/labeller.py -o iris -a http://localhost:3030/ds/query isu-catalogue/manifest.ttl > iris.txt`\n      again indicated no important IRIs were still missing labels\n6. The catalogue was enhanced\n    * using prezmanifest/documentor, the command `python prezmanifest/documentor.py catalogue ~/work/idn/isu-catalogue/manifest.ttl`\n      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 \n      `python prezmanifest/documentor.py table ~/work/idn/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    * using prezmanifest/loader the command `python prezmanifest/loader.py -d isu-catalogue.trig ~/work/idn/isu-catalogue/manifest.ttl`\n      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\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "A Python package that provides a series of functions to work with Prez Manifests.",
    "version": "0.5.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8fb8ba69b9d58460f89bda8ed2f2a4419223e1eeef871fff011f04a68b8e0699",
                "md5": "97b48c562d7c3ad65f4067efb90dc2bb",
                "sha256": "6262572adc34b57d1fa11d7c94a0bd37cafb16562f5876c6038110894315477b"
            },
            "downloads": -1,
            "filename": "prezmanifest-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "97b48c562d7c3ad65f4067efb90dc2bb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 31457,
            "upload_time": "2025-01-26T13:21:51",
            "upload_time_iso_8601": "2025-01-26T13:21:51.153205Z",
            "url": "https://files.pythonhosted.org/packages/8f/b8/ba69b9d58460f89bda8ed2f2a4419223e1eeef871fff011f04a68b8e0699/prezmanifest-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6f75d5213e4d5ad574104d57a309d92586c40eee75467f9d494f86e82d38482c",
                "md5": "cf84ffbc1d6bdd6c9434ec258dcc527f",
                "sha256": "2cb7ff7b59c6375ed5f50b3cfb4d34fe8a640f705915fb07b2a6733870a4da90"
            },
            "downloads": -1,
            "filename": "prezmanifest-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cf84ffbc1d6bdd6c9434ec258dcc527f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 26510,
            "upload_time": "2025-01-26T13:21:52",
            "upload_time_iso_8601": "2025-01-26T13:21:52.899829Z",
            "url": "https://files.pythonhosted.org/packages/6f/75/d5213e4d5ad574104d57a309d92586c40eee75467f9d494f86e82d38482c/prezmanifest-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-26 13:21:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "prezmanifest"
}
        
Elapsed time: 0.76242s