Metadata-Version: 2.4
Name: cmem-plugin-querycatalog
Version: 0.5.0
Summary: Use queries from the Corporate Memory query catalog in workflows.
License: Apache-2.0
License-File: LICENSE
Keywords: eccenca Corporate Memory,plugin
Author: eccenca GmbH
Author-email: cmempy-developer@eccenca.com
Requires-Python: >=3.13,<4.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Dist: cmem-client (>=1.1.0,<2.0.0)
Requires-Dist: cmem-plugin-base (>=4.20.0,<5.0.0)
Requires-Dist: httpx (>=0.27)
Requires-Dist: rdflib (>=7.0)
Description-Content-Type: text/markdown

# cmem-plugin-querycatalog

Use queries from the Corporate Memory query catalog in workflows.

[![eccenca Corporate Memory][cmem-shield]][cmem-link]

This is a plugin for [eccenca Corporate Memory](https://documentation.eccenca.com). You can install it with the [cmemc](https://eccenca.com/go/cmemc) command line client like this:

```
cmemc admin workspace python install cmem-plugin-querycatalog
```

## Tasks

This plugin adds three workflow tasks, all of which work on a query catalog rather
than on a query pasted into the workflow.

- **List Catalog Queries** emits one entity per query a catalog holds, describing it:
  the catalog graph, the query IRI, label, description, type, the query text as stored
  and the names of the placeholders it contains.
- **Get Catalog Query** emits the same description for a single query, chosen on the
  task or named by an incoming entity.
- **Execute Catalog Query** runs a stored query. A SELECT produces one entity per
  result row, an ASK a single answer, a CONSTRUCT or DESCRIBE its statements as quad
  entities, and an update query produces nothing and reports what it wrote.

A query that contains `{{placeholder}}` holes turns their names into input fields on
**Execute Catalog Query**, and runs once per incoming entity.

The catalog graph is picked from a list that groups the registered query catalogs
first, then the shape catalogs, then any other graph that happens to hold queries.

## Known limitations

The whole result of a query is held in memory. Corporate Memory sends it in a single
response, so a query returning very many rows is limited by what the DataIntegration
process can hold.

**Execute Catalog Query** derives its input port from the placeholders of the stored
query, and DataIntegration caches that port on the task. After upgrading this plugin
to a version that changes the shape of a port, reload the projects that use it -
`cmemc project reload <project>`, or the reload action in the workspace. Until then an
existing task keeps the ports it was created with, and a workflow built on it can fail
with an error naming a schema the current version no longer uses. Saving the task
again has the same effect, and tasks created after the upgrade are unaffected.

 [![pypi version](https://img.shields.io/pypi/v/cmem-plugin-querycatalog)](https://pypi.org/project/cmem-plugin-querycatalog) [![license](https://img.shields.io/pypi/l/cmem-plugin-querycatalog)](https://pypi.org/project/cmem-plugin-querycatalog)
[![poetry][poetry-shield]][poetry-link] [![ruff][ruff-shield]][ruff-link] [![mypy][mypy-shield]][mypy-link] [![copier][copier-shield]][copier] 

[cmem-link]: https://documentation.eccenca.com
[cmem-shield]: https://img.shields.io/endpoint?url=https://documentation.eccenca.com/latest/badge.json
[poetry-link]: https://python-poetry.org/
[poetry-shield]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json
[ruff-link]: https://docs.astral.sh/ruff/
[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json&label=Code%20Style
[mypy-link]: https://mypy-lang.org/
[mypy-shield]: https://www.mypy-lang.org/static/mypy_badge.svg
[copier]: https://copier.readthedocs.io/
[copier-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json


