Metadata-Version: 2.4
Name: tripper
Version: 0.4.3
Summary: A triplestore wrapper for Python.
Keywords: triplestore,ontology,RDF
Author-email: SINTEF <TEAM4.0@sintef.no>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Environment :: Plugins
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
License-File: LICENSE
Requires-Dist: typing-extensions>=4.7.0,<4.13.1; python_version < '3.9'
Requires-Dist: dlite-python>=0.5.27 ; extra == "backends" and ( python_version<='3.13')
Requires-Dist: emmontopy>=0.5.0,<0.7.1 ; extra == "backends" and ( python_version<'3.13')
Requires-Dist: graphviz>=0.20.1,<0.20.2 ; extra == "backends"
Requires-Dist: numpy<2.1.0 ; extra == "backends" and ( python_version=='3.13')
Requires-Dist: rdflib>=6.3.0,<7.0.0 ; extra == "backends"
Requires-Dist: tripper[mappings] ; extra == "datadoc"
Requires-Dist: PyLD>=2.0.0,<2.0.5 ; extra == "datadoc" and ( python_version<='3.13')
Requires-Dist: PyYaml>=3.0.0,<6.0.3 ; extra == "datadoc"
Requires-Dist: requests>=2.0.0,<3.4.1 ; extra == "datadoc"
Requires-Dist: sparqlwrapper>=2.0.0,<2.0.1 ; extra == "datadoc"
Requires-Dist: tripper[pre-commit, docs] ; extra == "dev"
Requires-Dist: tripper[testing] ; extra == "docs"
Requires-Dist: mike==2.1.3 ; extra == "docs"
Requires-Dist: mkdocs==1.6.1 ; extra == "docs"
Requires-Dist: mkdocs-autorefs==1.4.1 ; extra == "docs"
Requires-Dist: mkdocs-awesome-pages-plugin==2.10.1 ; extra == "docs"
Requires-Dist: mkdocs-github-admonitions-plugin==0.0.3 ; extra == "docs"
Requires-Dist: mkdocs-material==9.6.11 ; extra == "docs"
Requires-Dist: mkdocstrings==0.27.0 ; extra == "docs"
Requires-Dist: mkdocstrings-python-legacy==0.2.4 ; extra == "docs"
Requires-Dist: tripper[units] ; extra == "mappings"
Requires-Dist: pre-commit==4.0.1 ; extra == "pre-commit"
Requires-Dist: pylint==3.3.4 ; extra == "pre-commit" and ( python_version>='3.9')
Requires-Dist: tripper[datadoc, backends, testing-core] ; extra == "testing"
Requires-Dist: pytest==8.3.4 ; extra == "testing-core"
Requires-Dist: pytest-cov==5.0.0 ; extra == "testing-core" and ( python_version<'3.9')
Requires-Dist: pytest-cov==6.0.0 ; extra == "testing-core" and ( python_version>='3.9')
Requires-Dist: pint>=0.21.1,<0.26 ; extra == "units" and ( python_version<'3.9')
Requires-Dist: pint>=0.24.1,<0.26 ; extra == "units" and ( python_version>='3.9')
Requires-Dist: rdflib>=6.3.0,<7.0.0 ; extra == "units"
Project-URL: Changelog, https://github.com/EMMC-ASBL/tripper/blob/master/CHANGELOG.md
Project-URL: Documentation, https://EMMC-ASBL.github.io/tripper
Project-URL: Home, https://github.com/EMMC-ASBL/tripper
Project-URL: Issue Tracker, https://github.com/EMMC-ASBL/tripper/issues
Project-URL: Package, https://pypi.org/project/tripper
Project-URL: Source, https://github.com/EMMC-ASBL/tripper
Provides-Extra: backends
Provides-Extra: datadoc
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: mappings
Provides-Extra: pre-commit
Provides-Extra: testing
Provides-Extra: testing-core
Provides-Extra: units

<img src="docs/figs/tripper_logo.svg" alt="Tripper logo" align="right" width="96" height="96">

[![PyPI](https://img.shields.io/pypi/v/tripper?logo=pypi)](https://pypi.org/project/tripper)
[![Documentation](https://img.shields.io/badge/documentation-informational?logo=github)](https://emmc-asbl.github.io/tripper/latest/)
[![CI tests](https://github.com/EMMC-ASBL/tripper/workflows/CI%20-%20Tests/badge.svg)](https://github.com/EMMC-ASBL/tripper/actions/workflows/ci_tests.yml?query=branch%3Amaster)
[![DOI](https://zenodo.org/badge/547162834.svg)](https://zenodo.org/badge/latestdoi/547162834)

*Triplestore wrapper for Python providing a simple and consistent interface to a range of triplestore backends*


Tripper
=======

Getting started
---------------
* [Tutorial]
* [Documentation]
* [Reference manual]


Basic concepts
--------------
Tripper provides a simple and consistent interface to a range of triplestore backends.
It strives for simplicity and is modelled after [rdflib] (with a few simplifications).

In Tripper:

* All IRIs are represented by Python strings.
  Example: `https://w3id.org/emmo#Metre`

* Blank nodes are strings starting with `_:`.
  Example: `_:bnode1`

* Literals are constructed with [`tripper.Literal`][Literal].
  Example: `tripper.Literal(3.14, datatype=XSD.float)`

To make it easy to work with IRIs, provide Tripper a set of pre-defined namespaces, like `XSD.float`.
New namespaces can be defined with the [`tripper.Namespace`][Namespace] class.

A triplestore wrapper is created with the [`tripper.Triplestore`][Triplestore] class.


Sub-packages
------------
Additional functionality beyond interfacing triplestore backends is provided by specialised sub-package:

* [tripper.datadoc]: An API for data documentation.
* [tripper.units]: Working with units and quantities defined in ontologies.
* [tripper.mappings]: Traverse mappings stored in the triplestore and find possible mapping routes.
* [tripper.convert]: Convert between RDF and other data representations.


Available backends
------------------
The following backends are currently available, either in Tripper or other packages.

| Backend name  | Provided by  | Requirements            | Comment
| ------------  | ------------ | ----------------------- | -----------------
| rdflib        | [tripper]    | rdflib                  | In-memory [rdflib] triplestore supporting all features.
| ontopy        | [tripper]    | EMMOntoPy               | Backend for [EMMOntoPy]. In-memory.
| sparqlwrapper | [tripper]    | sparqlwrapper           | Generic backend for all triplestores supported by [sparqlwrapper].
| collection    | [tripper]    | DLite-Python            | Backend to a [DLite] collection.
| graphdb       | [tripper]    | sparqlwrapper           | Backend to [GraphDB].
| fuseki        | [PyBackTrip] | sparqlwrapper           | Backend to [fuseki].
| stardog       | [PyBackTrip] | sparqlwrapper,pystardog | Backend to [StarDog].


Installation
------------
Tripper has by itself no dependencies outside the standard library, but the triplestore backends may have specific dependencies.


The package can be installed from [PyPI] using `pip`.
A minimal installation can be done with

```shell
pip install tripper
```

but typically, you would also like to install the requirements needed by the backends, the tripper sub-packages and extra features.
The requirements for the backends are listed in the table above, while sub-packages and extra features are enabled by specifying one or more of the "extras" listed in the table below when installing Tripper.


For example, the following command will install Tripper with the [tripper.datadoc] sub-package and the rdflib backend enabled:

```shell
pip install tripper[datadoc] rdflib
```

Developers should install Tripper with the `dev` extras and enable [pre-commit]:

```shell
pip install tripper[dev]
pre-commit install  # Enable pre-commit and installing hooks
```


| Extras   | Description of dependencies                                        | Implies          |
|----------|--------------------------------------------------------------------|------------------|
| units    | Required by the [tripper.units] sub-package.                       |                  |
| mappings | Required by the [tripper.mappings] sub-package.                    | units            |
| datadoc  | Required by the [tripper.datadoc] sub-package.                     | mappings         |
| backends | Installs dependencies for all backends                             |                  |
| testing  | For testing.                                                       | datadoc,backends |
| docs     | For generation of documentation                                    | testing          |
| dev      | For developers. Installs all dependencies, including [pre-commit]. | dev              |



License and copyright
---------------------
All files in this repository are licensed under the [MIT license].
If not stated otherwise in the top of the files, they have copyright &copy; 2022
SINTEF.


Acknowledgements
----------------
We gratefully acknowledge the following projects for supporting the development of Tripper:

  - [OntoTrans](https://ontotrans.eu/) (2020-2024) that receives funding from the European Union's Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 862136.
  - [OpenModel](https://www.open-model.eu/) (2021-2025) that receives funding from the European Union's Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 953167.
  - [SFI PhysMet](https://www.ntnu.edu/physmet) (2020-2028) funded by Forskningsrådet and Norwegian industry partners.
  - [DOME 4.0](https://dome40.eu/) (2021-2025) that receives funding from the European Union's Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 953163.
  - [VIPCOAT](https://www.vipcoat.eu/) (2021-2025) that receives funding from the European Union's Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 952903.
  - MEDIATE (2022-2025) that receives funding from the RCN, Norway; FNR, Luxenburg; SMWK Germany via the M-era.net programme, project 9557,
  - [MatCHMaker](https://he-matchmaker.eu/) (2022-2026) that receives funding from the European Union's Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 101091687.
  - [PINK](https://pink-project.eu/) (2024-2027) that receives funding from the European Union's Horizon 2020 Research and Innovation Programme, under Grant Agreement n. 101137809.



[Tutorial]: https://emmc-asbl.github.io/tripper/latest/tutorial/
[Documentation]: https://emmc-asbl.github.io/tripper/latest/
[Reference manual]: https://emmc-asbl.github.io/tripper/latest/api_reference/triplestore/
[Discovery of custom backends]: https://emmc-asbl.github.io/tripper/latest/backend_discovery/
[tripper.datadoc]: https://emmc-asbl.github.io/tripper/latest/datadoc/introduction/
[tripper.mappings]: https://emmc-asbl.github.io/tripper/latest/api_reference/mappings/mappings/
[tripper.units]: https://emmc-asbl.github.io/tripper/latest/units/units/
[tripper.convert]: https://emmc-asbl.github.io/tripper/latest/api_reference/convert/convert/
[Known issues]: https://emmc-asbl.github.io/tripper/latest/known-issues/
[MIT license]: https://emmc-asbl.github.io/tripper/latest/LICENSE/
[tripper]: https://emmc-asbl.github.io/tripper
[rdflib]: https://rdflib.readthedocs.io/en/stable/
[PyPI]: https://pypi.org/project/tripper
[PyBackTrip]: https://github.com/EMMC-ASBL/PyBackTrip/
[Literal]: https://emmc-asbl.github.io/tripper/latest/api_reference/triplestore/#tripper.triplestore.Literal
[Namespace]: https://emmc-asbl.github.io/tripper/latest/api_reference/triplestore/#tripper.triplestore.Namespace
[Triplestore]: https://emmc-asbl.github.io/tripper/latest/api_reference/triplestore/#tripper.triplestore.Triplestore
[EMMOntoPy]: https://emmo-repo.github.io/EMMOntoPy/stable/
[sparqlwrapper]: https://sparqlwrapper.readthedocs.io/en/latest/
[DLite]: https://sintef.github.io/dlite/
[fuseki]: https://jena.apache.org/documentation/fuseki2/
[StarDog]: https://www.stardog.com/
[GraphDB]: https://www.ontotext.com/products/graphdb/
[Pint]: https://pint.readthedocs.io/en/stable/
[pre-commit]: https://pre-commit.com/

