CLI tools for OLDAP
Project description
OLDAP tools
OLDAP tools is a CLI tool for managing parts of the OLDAP framework. It allows to
- dump all the data of a given project to a gzipped TriG file
- load a project from a gzipped TriG file created by oldap-tools
- load a hierarchical list from a YAML file
- dump a hierarchical list to a YAML file
Installation
The installation is done using pip: pip install oldap-tools
Documentation
Structured documentation is available in docs/:
- Installation and Connection
- Command Reference
- Ontology YAML
- Hierarchical Lists
- Update Semantics
- Operations and Backups
Usage
The CLI tool provides the following commands:
oldap-tools project dump: Dump all the data of a given project to a gzipped TriG fileoldap-tools project load: Load a project from a gzipped TriG file created by oldap-toolsoldap-tools lists dump: Dump a hierarchical list to a YAML fileoldap-tools lists load: Load a hierarchical list from a YAML fileoldap-tools ontology validate: Validate an ontology datamodel YAML fileoldap-tools ontology load: Load or update an ontology datamodel from YAMLoldap-tools ontology dump: Dump an ontology datamodel to YAML or TriG
Common options
--graphdb,-g: URL of the GraphDB server (default: "http://localhost:7200")--repo,-r: Name of the repository (default: "oldap")--user,-u: OLDAP user (required) which performs the operations--password-p: OLDAP password (required)--graphdb_user: GraphDB user (default: None). Not needed if GraphDB runs without athentification.--graphdb_password: GraphDB password (default: None). Not needed if GraphDB runs without athentification.--verbose,-v: Print more information
Command
Project dump
This command dumps all the data of a given project to a gzipped TriG file. It includes user information of all users associated with the project. The command has the following syntax (in addition to the common options):
oldap-tools [common_options] [graphdb-options] project dump [-out <filename>] [--data | --no-data] [-verbose] <project_id>
The graphdb options see above. The other options are defined as follows:
-out <filename>: Name of the output file (default: "<project_id>.trig.gz")--data | --no-data: Include or exclude the data of the project (default: include)-verbose: Print more information<project_id>: Project identifier (project shortname)
The file is basically a dump of the project specific named graphs of the GraphDB repository. This are the following graphs:
<project_id>:shacl: Contains all the SHACL shapes of the project<project_id>:onto: Contains all the OWL ontology information of the project<project_id>:lists: Contains all the hierarchical lists of the project<project_id>:data: Contains all the resources (instances) of the project
The user information is stored as special comment in the TriG file and is interpreted by oldap-tools project load.
Project load
This command loads a project from a gzipped TriG file created by oldap-tools. It has the following syntax (in addition to the common options):
oldap-tools [common_options] [graphdb-options] project load --i <filename>
The options are as follows:
--inf,-i: Name of the input file (required)-verbose: Print more information
If a user does not exist, then the user is created. If the User is already existing, then the user is replaced.
NOTE: This will change in the future in order to only update project specific permissions to the existing user.
List dump
This command dumps a hierarchical list to a YAML file. This file can be edited to add/remove or change list items. The command has the following syntax (in addition to the common options):
oldap-tools [common_options] lists dump [-out <filename>] <project_id> <list_id>
This command generates a YAML file which can be edited and contains the list and all it nodes
The options are as follows:
-out,-o: Output file<project_id>: Project identifier (project shortname)<list_id>: List identifier
List load
This command loads a hierarchical list from a YAML file into the given project. The command has the following syntax (in addition to the common options):
oldap-tools [common_options] lists load --inf <filename> <project_id>
If a list already exists, loading is additive: nodes that are present in YAML but missing in the store are inserted, including their subtrees. Existing nodes are never deleted or moved; if the YAML would place an existing node below a different parent, the load aborts with an error.
The options are as follows:
--inf,-i: Name of the input file (required)<project_id>: Project identifier (project shortname)
Ontology validate
This command validates an ontology YAML file against the bundled schema:
oldap-tools [common_options] ontology validate --inf <filename>
Ontology load
This command loads or updates a project datamodel from a YAML file:
oldap-tools [common_options] ontology load --inf <filename> [--mode update|replace] [--connectors create|replace] [--backup|--no-backup] [--backup-out <filename>]
By default, the command makes a TriG gzip backup of the model and list graphs before loading. The
replace mode deletes the existing datamodel graphs (<project>:shacl and <project>:onto) and
recreates them from YAML. The update mode compares the YAML classes and properties with the current
datamodel and lets oldaplib perform the corresponding updates.
Set an attribute to null in update mode to delete it, for example label, comment, name,
description, min_count, or max_count.
Hierarchical lists can be referenced as external YAML files or defined inline. A property can point to
a list node class with to_class: list:<ListId>. Existing lists are extended additively from YAML:
missing nodes are inserted, while existing nodes are not deleted or moved.
Lucene connectors can be declared in the same YAML file. They are skipped by default and only applied
when --connectors create or --connectors replace is passed. Single-property fields can use a QName
directly and get their Lucene field name from the property fragment. Multi-step chains must be given an
explicit Lucene field name.
Example:
ontology:
project:
shortname: fasnacht
iri: https://fasnacht.digital
namespace: http://fasnacht.digital/ns/
start: 2025-06-01
lists:
CreativeCommons: CreativeCommons.yaml
external_ontologies:
schema:
namespace: https://schema.org/
label: schema.org
proposedResourceClass:
- Person
- Organization
classes:
fasnacht:Person:
label:
en: Person
de: Person
superclass:
- schema:Person
properties:
- iri: schema:familyName
datatype: xsd:string
name:
en: Family name
de: Nachname
min_count: 1
max_count: 1
order: 1
editor: TEXT_FIELD
lucene_connectors:
fasnacht:
types:
- fasnacht:Story
- fasnacht:ArchiveObject
- fasnacht:ArchiveMediaObject
fields:
- fasnacht:storyContent
- schema:abstract
- fasnacht:archiveObjectTitle
- schema:description
- fieldName: representedArchiveObjectTitle
chain:
- fasnacht:archiveMediaObjectOf
- fasnacht:archiveObjectTitle
oldap-tools creates one GraphDB Lucene connector per project. The connector
name is always the project short name. Multiple entries below
lucene_connectors are treated as YAML grouping/specification blocks and are
merged into that project connector.
Ontology dump
This command dumps an ontology datamodel either as YAML or as a TriG gzip file containing the
<project>:shacl, <project>:onto, and <project>:lists graphs:
oldap-tools [common_options] ontology dump [-out <filename>] [--format yaml|trig] [--include-taxonomies] <project_id>
When dumping YAML, --include-taxonomies writes all project lists as separate <ListId>.yaml
files next to the ontology YAML file and adds an ontology.lists block that references them.
Project details
Release history Release notifications | RSS feed
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 oldap_tools-0.3.5.tar.gz.
File metadata
- Download URL: oldap_tools-0.3.5.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.14.4 Darwin/25.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0ad257ee8e47686ed83d36bae3eba5f8d0b6bc728fb5a92cc87256dd1156222
|
|
| MD5 |
10f8b4c0f95f72c366620f5f33be21bb
|
|
| BLAKE2b-256 |
f4813089c58c53261ed7358fbbc98dfe140c0180f9d3d90fd80ac474107c9d7d
|
File details
Details for the file oldap_tools-0.3.5-py3-none-any.whl.
File metadata
- Download URL: oldap_tools-0.3.5-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.14.4 Darwin/25.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d18f6a8b799f9a02b7e95a363684055b788d8ad55e387fe6115db171ed182ae7
|
|
| MD5 |
d12563ef5c702e801e609b1952738d05
|
|
| BLAKE2b-256 |
8a702e9b6b1d5bb71e65d3e5827ca5f820fb164b9cd477f83dfd580512576dfc
|