Fork of https://github.com/oxigraph/oxigraph.git for the purpose of NextGraph project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
oxigraph/python
Edmond 80d96f90f2 Add info on what stubdoc does not generate 3 years ago
..
docs Add development container and update READMEs. Add Sphinx furo theme. (#221) 3 years ago
src Fix docstring for Store.quad_for_pattern method 3 years ago
tests Python: Allows to give a file path to I/O methods 3 years ago
Cargo.lock Python: Adds lockfile to source archive 3 years ago
Cargo.toml Releases v0.3.4 3 years ago
README.md Add info on what stubdoc does not generate 3 years ago
base.pyi Add base.pyi with pyoxigraph type hints 3 years ago
generate_type_hints.py Add generate_type_hints.py with instructions in pyoxigraph README 3 years ago
pyoxigraph.pyi Add pyoxigrapy.pyi 3 years ago
pyproject.toml Releases v0.3.4 3 years ago

README.md

Pyoxigraph (Oxigraph for Python)

PyPI PyPI - Implementation PyPI - Python Version actions status Gitter

Pyoxigraph is a graph database library implementing the SPARQL standard. It is a Python library written on top of Oxigraph.

Pyoxigraph offers two stores with SPARQL 1.1 capabilities. One of the store is in-memory, and the other one is disk based.

It also provides a set of utility functions for reading, writing and processing RDF files in Turtle, TriG, N-Triples, N-Quads and RDF/XML.

Pyoxigraph is distributed on Pypi. Run pip install pyoxigraph to install it.

There exists also a small library providing rdflib stores using pyoxigraph: oxrdflib.

Pyoxigraph documentation is available on the Oxigraph website.

Build the development version

To build and install the development version of pyoxigraph you need to clone this git repository and to run pip install . in the python directory (the one this README is in).

Help

Feel free to use GitHub discussions or the Gitter chat to ask questions or talk about Oxigraph. Bug reports are also very welcome.

If you need advanced support or are willing to pay to get some extra features, feel free to reach out to Tpt.

How to contribute

Pyoxigraph is written in Rust using PyO3.

Pyoxigraph is built using Maturin. Maturin could be installed using the pip install 'maturin>=0.9,<0.10'. To install a development version of Oxigraph just run maturin develop in this README directory.

Tests

The Python bindings tests are written in Python. To run them use python -m unittest in the tests directory.

Docs

The Sphinx documentation can be generated and viewed in the browser using the following command:

sphinx-autobuild docs docs/_build/html

Note that you will need to have sphinx-autobuild installed. This should be installed already if you are using this repository's development container.

Alternatively, you can use sphinx-build with Python's http.server to achieve the same thing.

Python type hints

Python type hints for pyoxigraph are defined in the python stub file pyoxigraph.pyi. This is the final python stub file generated from base.pyi using generate_type_hints.py. pyoxigraph.pyi should not be modified directly. Instead, modify base.pyi and run the following command in this directory:

python generate_type_hints.py

generate_type_hints.py

generate_type_hints.py makes a copy of base.pyi and runs stubdoc on it to pull the docstrings from the rust code into the generated pyoxigraph.pyi file. Unfortunately, stubdoc is not a perfect solution yet for pyoxigraph as it is only able to partially pull out docstrings from functions and class methods. stubdoc currently ignores class docstrings, class properties and PyO3 functions. The plan is to monkey patch stubdoc and contribute the fixes back to upstream.

We currently commit the generated pyoxigraph.pyi file to the repository. In the future, we may look at generating pyoxigraph.pyi in GitHub Actions to ensure it is always up to date.

In the future, PyO3 may be able to generate the Python Interface files (.pyi) once the proposal in this issue #2454 is implemented.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Oxigraph by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.