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.
71 lines
2.3 KiB
71 lines
2.3 KiB
pyoxigraph |release|
|
|
====================
|
|
|
|
.. image:: https://img.shields.io/pypi/v/pyoxigraph
|
|
:alt: PyPI
|
|
:target: https://pypi.org/project/pyoxigraph/
|
|
.. image:: https://img.shields.io/pypi/implementation/pyoxigraph
|
|
:alt: PyPI - Implementation
|
|
.. image:: https://img.shields.io/pypi/pyversions/pyoxigraph
|
|
:alt: PyPI - Python Version
|
|
.. image:: https://img.shields.io/pypi/l/pyoxigraph
|
|
:alt: PyPI - License
|
|
|
|
|
|
Pyoxigraph is a graph database library implementing the `SPARQL <https://www.w3.org/TR/sparql11-overview/>`_ standard.
|
|
|
|
It is built on top of `Oxigraph <https://github.com/oxigraph/oxigraph>`_ using `PyO3 <https://pyo3.rs/>`_ to provides a Python API.
|
|
|
|
It offers two stores with `SPARQL 1.1 Query <https://www.w3.org/TR/sparql11-query/>`_ 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 <https://www.w3.org/TR/turtle/>`_,
|
|
`TriG <https://www.w3.org/TR/trig/>`_,
|
|
`N-Triples <https://www.w3.org/TR/n-triples/>`_,
|
|
`N-Quads <https://www.w3.org/TR/n-quads/>`_ and
|
|
`RDF/XML <https://www.w3.org/TR/rdf-syntax-grammar/>`_.
|
|
|
|
Pyoxigraph is `distributed on Pypi <https://pypi.org/project/pyoxigraph/>`_.
|
|
|
|
There exists also a small library providing `rdflib <https://rdflib.readthedocs.io>`_ store using pyoxigraph: `oxrdflib <https://github.com/oxigraph/oxrdflib>`_.
|
|
|
|
Oxigraph and pyoxigraph source code are on `GitHub <https://github.com/oxigraph/oxigraph/tree/master/python>`_.
|
|
|
|
|
|
Installation
|
|
""""""""""""
|
|
|
|
Pyoxigraph is distributed on `Pypi <https://pypi.org/project/pyoxigraph/>`_.
|
|
|
|
To install it, run the usual ``pip install pyoxigraph``
|
|
|
|
|
|
Example
|
|
"""""""
|
|
|
|
Insert the triple ``<http://example/> <http://schema.org/name> "example"`` and print the name of ``<http://example/>`` in SPARQL:
|
|
|
|
::
|
|
|
|
from pyoxigraph import *
|
|
|
|
store = MemoryStore()
|
|
ex = NamedNode('http://example/')
|
|
schemaName = NamedNode('http://schema.org/name')
|
|
store.add((ex, schemaName, Literal('example')))
|
|
for binding in store.query('SELECT ?name WHERE { <http://example/> <http://schema.org/name> ?name }'):
|
|
print(binding['name'].value)
|
|
|
|
|
|
Table of contents
|
|
"""""""""""""""""
|
|
|
|
.. toctree::
|
|
:maxdepth: 2
|
|
|
|
model
|
|
io
|
|
store/memory
|
|
store/sled
|
|
sparql
|
|
|