Skip to content

kurra

kurra is a Python package and command-line application for working with RDF data. It provides file conversion and hierarchy tools, label handling, SPARQL access, SHACL validation, Graph Store Protocol operations, and database helpers.

It is built on top of RDFLib and, over time, some of its functionality is likely to be absorbed into RDFLib.

Note

kurra is mainly maintained by kurrawong.ai but is Open Source, so feel free to contribute!

Install

pip install kurra

Use

Use kurra as a library:

from kurra.file import hierarchy

hierarchy("vocabulary.ttl", use_names=True)

Or from the command line:

kurra file hierarchy vocabulary.ttl -u

Running -h at any level of the Command Line will print out help. For example, for the top-level

kurra -h

which will print something like:

 Usage: kurra [OPTIONS] COMMAND [ARGS]...

 Main callback for the CLI app

╭─ Options ───────────────────────────────────────────────────────────────────────────╮
│ --version  -v                                                                       │
│ --help     -h        Show this message and exit.                                    │
╰─────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────╮
│ db      RDF Database commands                                                       │
│ file    RDF file commands                                                           │
│ labels  Labelling commands                                                          │
│ shacl   SHACL commands                                                              │
│ sparql  SPARQL queries to local RDF files or a database                             │
╰─────────────────────────────────────────────────────────────────────────────────────╯

For SPARQL command help:

kurra sparql --help
kurra sparql query --help
kurra sparql validate --help

Run a query against a local file:

kurra sparql vocabulary.ttl "SELECT * WHERE { ?s ?p ?o }"

Validate SPARQL query or update syntax without executing it:

kurra sparql validate "SELECT * WHERE { ?s ?p ?o }"
kurra sparql validate query.sparql

The validator accepts inline SPARQL text or a file path. It prints Valid SPARQL syntax on success and reports syntax errors with a nonzero exit status. See the SPARQL commands and Python API for details.

The API reference is generated from kurra's Python docstrings, so it stays aligned with the installed interfaces.

License

BSD-3-Clause license. See the LICENSE file.

Contributing

In the usual way on GitHub with Issues at https://github.com/Kurrawong/kurra/issues and PRs at https://github.com/Kurrawong/kurra/pulls.

Contact & Support

kurra is maintained by:

KurrawongAI
http://kurrawong.ai
info@kurrawong.ai

Please contact them for all use & support issues.

You can also log issues at the kurra issue tracker.