Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into Workspace-Tutorial-EC…
Browse files Browse the repository at this point in the history
…C-5933

# Conflicts:
#	docs/build/.pages
#	poetry.lock
  • Loading branch information
rpietzsch committed Aug 3, 2023
2 parents 96ff21e + e9a29d4 commit d4d2e65
Show file tree
Hide file tree
Showing 168 changed files with 3,161 additions and 726 deletions.
1 change: 1 addition & 0 deletions .obsidian/core-plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"switcher",
"graph",
"backlink",
"canvas",
"outgoing-link",
"tag-pane",
"page-preview",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: "cmemc: Command Group - admin client"
description: "List client accounts, get or generate client account secrets."
icon: material/account-cog
tags:
- Keycloak
- Security
- cmemc
---
# admin client Command Group
<!-- This file was generated - DO NOT CHANGE IT MANUALLY -->

List client accounts, get or generate client account secrets.

This command group is an opinionated interface to the Keycloak realm of your Corporate Memory instance. In order to be able to use the commands in this group, the configured cmemc connection account needs to be equipped with the `manage-clients` role in the used realm.

Client accounts are identified by a client ID which is unique in the scope of the used realm.

In case your Corporate Memory deployment does not use the default deployment layout, the following additional config variables can be used in your connection configuration: ``KEYCLOAK_BASE_URI`` defaults to `{`CMEM_BASE_URI`}/auth` and locates your Keycloak deployment; ``KEYCLOAK_REALM_ID`` defaults to `cmem` and identifies the used realm.


## admin client list

List client accounts.

```shell-session title="Usage"
$ cmemc admin client list [OPTIONS]
```




Outputs a list of client accounts, which can be used to get an overview as well as a reference for the other commands of the `admin client` command group.

!!! note
The list command only outputs clients which have a client secret. Use the `--raw` option to get a JSON description of all clients.




??? info "Options"
```text

--raw Outputs raw JSON.
--id-only Lists only Client ID. This is useful for piping the IDs into
other commands.
```

## admin client secret

Get or generate a new secret for a client account.

```shell-session title="Usage"
$ cmemc admin client secret [OPTIONS] CLIENT_ID
```




This command retrieves or generates a new secret for a client account from a realm.



??? info "Options"
```text

--generate Generate a new secret
--output Display client secret
```

## admin client open

Open clients in the browser.

```shell-session title="Usage"
$ cmemc admin client open [CLIENT_IDS]...
```




With this command, you can open a client in the keycloak web interface in your browser.

The command accepts multiple client IDs which results in opening multiple browser tabs.



Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,14 @@ With this command, the password of a user account can be changed. The default ex
??? info "Options"
```text

--value TEXT With this option, the new password can be set in a non-
interactive way.
--value TEXT With this option, the new password can be set in a non-
interactive way.

--temporary If enabled, the user must change the password on next login.
--temporary If enabled, the user must change the password on next
login.

--request-change If enabled, will send a email to user to reset the
password.
```

## admin user open
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ tags:
| ------------: | :------ | :---------- |
| [admin](admin/index.md) | [status](admin/index.md#admin-status) | Output health and version information. |
| [admin](admin/index.md) | [token](admin/index.md#admin-token) | Fetch and output an access token. |
| [admin client](admin/client/index.md) | [list](admin/client/index.md#admin-client-list) | List client accounts. |
| [admin client](admin/client/index.md) | [secret](admin/client/index.md#admin-client-secret) | Get or generate a new secret for a client account. |
| [admin client](admin/client/index.md) | [open](admin/client/index.md#admin-client-open) | Open clients in the browser. |
| [admin metrics](admin/metrics/index.md) | [get](admin/metrics/index.md#admin-metrics-get) | Get sample data of a metric. |
| [admin metrics](admin/metrics/index.md) | [inspect](admin/metrics/index.md#admin-metrics-inspect) | Inspect a metric. |
| [admin metrics](admin/metrics/index.md) | [list](admin/metrics/index.md#admin-metrics-list) | List metrics for a specific job. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ This command deletes existing data integration projects from Corporate Memory.
Create projects.

```shell-session title="Usage"
$ cmemc project create PROJECT_IDS...
$ cmemc project create [OPTIONS] PROJECT_IDS...
```


Expand All @@ -193,6 +193,16 @@ This command creates one or more new projects. Existing projects will not be ove



??? info "Options"
```text

--from-transformation TEXT This option can be used to explicitly create the
link specification, which is internally executed
when using the mapping suggestion of a
transformation task. You need the task ID of the
transformation task.
```

## project reload

Reload projects from the workspace provider.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,30 @@ With this command, you can execute a workflow that uses variable datasets as inp
??? info "Options"
```text

-i, --input FILE From which file the input is taken: note
that the maximum file size to upload is
limited to a server configured value. If the
-i, --input FILE From which file the input is taken. If the
workflow has no defined variable input
dataset, this can be ignored.
dataset, this option is not allowed.

-o, --output FILE To which file the result is written to: use
-o, --output FILE To which file the result is written to. Use
'-' in order to output the result to stdout.
If the workflow has no defined variable
output dataset, this can be ignored. Please
note that the io command will not warn you
on overwriting existing output files.
output dataset, this option is not allowed.
Please note that the io command will not
warn you on overwriting existing output
files.

--input-mimetype [guess|application/xml|application/json|text/csv]
--input-mimetype [application/x-plugin-csv|application/x-plugin-json|application/xml|application/x-plugin-excel|application/octet-stream|application/x-plugin-multiCsv|text/plain|guess]
Which input format should be processed: If
not given, cmemc will try to guess the mime
type based on the file extension or will
fail
fail.

--output-mimetype [guess|application/xml|application/json|application/n-triples|application/vnd.openxmlformats-officedocument.spreadsheetml.sheet|text/csv]
--output-mimetype [application/x-plugin-csv|application/x-plugin-excel|application/n-triples|application/n-triples|application/x-plugin-json|application/xml|guess]
Which output format should be requested: If
not given, cmemc will try to guess the mime
type based on the file extension or will
fail. In case of an output to stdout, a
default mime type will be used (currently
xml).
default mime type will be used (JSON).

--autoconfig / --no-autoconfig Setup auto configuration of input datasets,
e.g. in order to process CSV files with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ This is especially needed if you want to use cmemc in orchestrations.

The following image - tag combinations are available for public use:

- `docker-registry.eccenca.com/eccenca-cmemc:v22.1` - a specific release
- `docker-registry.eccenca.com/eccenca-cmemc:v23.2` - a specific release
- `docker-registry.eccenca.com/eccenca-cmemc:latest` - same as the latest release

``` shell-session title="Image retrieval and check cmemc version"
$ docker run -it --rm docker-registry.eccenca.com/eccenca-cmemc:v22.1 --version
Unable to find image 'docker-registry.eccenca.com/eccenca-cmemc:v22.1' locally
v22.1: Pulling from eccenca-cmemc
Digest: sha256:29bdd320e02f1b7758df22528740964225b62530c73c773a55c36c0e9e18b647
Status: Downloaded newer image for docker-registry.eccenca.com/eccenca-cmemc:v22.1
cmemc, version v22.1.1, running under python 3.9.13
$ docker run -it --rm docker-registry.eccenca.com/eccenca-cmemc:v23.2 --version
Unable to find image 'docker-registry.eccenca.com/eccenca-cmemc:v23.2' locally
v23.2: Pulling from eccenca-cmemc
Digest: sha256:....
Status: Downloaded newer image for docker-registry.eccenca.com/eccenca-cmemc:v23.2
cmemc, version v23.2 running under python 3.11.4
```

## Volumes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ In order to control eccenca Corporate Memory instances from within Github Action
## Runner Provisioning

Providing a working cmemc command is simple.
You just need to install a python environment suitable to run cmemc (currently `3.9`).
You just need to install a python environment suitable to run cmemc (currently `3.11`).
This can be done with the [setup-python](https://github.com/actions/setup-python) action.
After that, simply use `pip` to install cmemc:

```yaml title="Partial github action yaml showing cmemc provisioning"
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'
- name: install cmemc
run: |
pip install -q cmem-cmemc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The workflow is then called via an HTTP REST call (or via [cmemc](../cmemc-comm

This allows for solving all kinds of [☆ Automation](../) tasks when you need to process lots of small data snippets or similar.

!!! Abstract
!!! Abstract

The complete tutorial is available as a [project file](tutorial-varinput.project.zip). You can import this project

Expand All @@ -35,15 +35,15 @@ First, install all required ontologies/vocabularies which are needed for mapping

In this tutorial, we need the _Schema.org_ and the _RDFS_ vocabulary. Press the (toggle switch) button on the right to install them.

![Vocabulary catalog](pdwviw-vocab-catalog.png)
![Vocabulary catalog](pdwviw-vocab-catalog.png){ class="bordered" }

## 2 Create a new project

Second, create in the tab **DATA INTEGRATION** a new project. Provide it with a _Title_ and _Description_.

The project will include everything you need to build a workflow for extracting Feed XML data, transforming it into RDF, and loading it into a Knowledge Graph.

![Create new project dialog](pdwviw-create-new-project.png)
![Create new project dialog](pdwviw-create-new-project.png){ class="bordered" }

## 3 Create an (example) feed dataset and target graph dataset

Expand All @@ -54,7 +54,7 @@ For this tutorial, you may take this file: [feed.xml](feed.xml)(1)

1. Original feed source was: `https://www.ecdc.europa.eu/en/taxonomy/term/2942/feed`

![Create XML dataset dialog](pdwviw-create-xml-dataset.png)
![Create XML dataset dialog](pdwviw-create-xml-dataset.png){ class="bordered" }

## 4 Create the feed transformation

Expand All @@ -64,14 +64,14 @@ The mappings are based on classes and properties defined by the _Schema.org_ and

In case you need help with mapping data from XML to RDF, feel free to visit your respective tutorial: [Lift data from JSON and XML sources](../../build/lift-data-from-json-and-xml-sources/).

![Feed transformation](pdwviw-feed-transformation.png)
![Feed transformation](pdwviw-feed-transformation.png){ class="bordered" }

## 5 Create the variable input and workflow

Create a new workflow in your project.
Move the **input** XML feed dataset and the **Feed Data** Graph into the workflow editor and connect them with your created **Transform feed**.

![Workflow with variable input](pdwviw-variable-input-workflow.png)
![Workflow with variable input](pdwviw-variable-input-workflow.png){ class="bordered" }

## 6 Use `cmemc` to feed data into the workflow

Expand Down Expand Up @@ -107,4 +107,4 @@ http://feeds.bbci.co.uk/news/rss.xml

In **EXPLORATION**, you can study the ingested feed data in your Knowledge Graph.

![Explore the result](pdwviw-review-knowledge-graph.png)
![Explore the result](pdwviw-review-knowledge-graph.png){ class="bordered" }
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/build/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ nav:
- Connect to Snowflake: snowflake-tutorial
- Active learning: active-learning
- Worspace-Tutorial: workspace-tutorial

- Link Intrusion Detection Systems to Open-Source INTelligence: tutorial-how-to-link-ids-to-osint
Binary file modified docs/build/define-prefixes-namespaces/DM-query-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/build/define-prefixes-namespaces/DM-turtle-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 13 additions & 14 deletions docs/build/define-prefixes-namespaces/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,23 @@ Namespace declarations allow for the abbreviation of IRIs by using a prefixed re

For example, after defining a namespace with the values

- **prefix name** = `cohw`, and the
- **namespace IRI** = `https://data.company.org/hardware/`
- **prefix name** = `cohw`, and the
- **namespace IRI** = `https://data.company.org/hardware/`

you can use the term `cohw:test` as an abbreviation for the full IRI `https://data.company.org/hardware/test`.

This is particularly useful when you have to write source code in Turtle and SPARQL.

## Managing Namespace Declarations


### Using the Vocabulary Catalog

After installing a vocabulary from the [Vocabulary Catalog](/explore-and-author/vocabulary-catalog), the vocabulary namespace declaration is automatically added to all integration projects.

In order to get the **prefix name** and the **namespace IRI** from the vocabulary graph, the following terms from the [VANN vocabulary](https://vocab.org/vann/) need to be used on the Ontology resource.

- [vann:preferredNamespacePrefix](https://vocab.org/vann/#preferredNamespacePrefix) - to specify the **prefix name**
- [vann:preferredNamespaceUri](https://vocab.org/vann/#preferredNamespaceUri) - to specify the **namespace IRI**
- [vann:preferredNamespacePrefix](https://vocab.org/vann/#preferredNamespacePrefix) - to specify the **prefix name**
- [vann:preferredNamespaceUri](https://vocab.org/vann/#preferredNamespaceUri) - to specify the **namespace IRI**

In the Explore area, an Ontology with a correct namespace declaration looks like this:

Expand All @@ -43,7 +42,7 @@ The `vocabulary` command group of [cmemc](../../automate/cmemc-command-line-inte
Beginning with v22.2, this command has an additional option `--namespace` which you can use to set a vocabulary namespace even if the vocabulary does not include the data needed for autodiscovery:

```shell-session
$ cmemc vocabulary import my-ont.ttl --namespace myo https//example.org/my/`
cmemc vocabulary import my-ont.ttl --namespace myo https//example.org/my/`
```

### Using the Project Configuration
Expand All @@ -52,10 +51,10 @@ In addition to the used vocabulary namespace declarations, you may want to add w

Such organization use cases include:

- Namespaces per class / resource type:
- **prefix name** = `persons`, **namespace IRI** = `https://example.org/data/persons/`
- Namespaces per data owner or origin:
- **prefix name** = `sales`, **namespace IRI** = `https://example.org/data/sales/`
- Namespaces per class / resource type:
- **prefix name** = `persons`, **namespace IRI** = `https://example.org/data/persons/`
- Namespaces per data owner or origin:
- **prefix name** = `sales`, **namespace IRI** = `https://example.org/data/sales/`

Prefixes in Data Integration are defined on a project basis. When creating a new project, a list of well-know prefixes is already declared.

Expand All @@ -69,15 +68,15 @@ By using the **Edit Prefix Settings** button in this Configuration area, you wil

In this dialog, you are able to

- Delete a namespace declaration → **Delete Prefix**
- Add a new namespace declaration → **Add**
- Delete a namespace declaration → **Delete Prefix**
- Add a new namespace declaration → **Add**

## Validating Namespace Declarations

After adding namespace declarations to a project you are able to use the abbreviated IRIs in the user interface, for instance, in the mapping editor, the Turtle editor or the Query editor:

![Prefixes displayed in the mapping dialogs, e.g. property selection.](prefix-displayed-in-mapping.png)

![Query Editor](DM-query-editor.png)
![Query Editor](DM-query-editor.png){ class="bordered" }

![Turtle Editor](DM-turtle-editor.png)
![Turtle Editor](DM-turtle-editor.png){ class="bordered" }
Loading

0 comments on commit d4d2e65

Please sign in to comment.