diff --git a/docs/developers.md b/docs/developers.md index b1d5b21..da8bd41 100644 --- a/docs/developers.md +++ b/docs/developers.md @@ -1,6 +1,12 @@ # For developers -## New release +## Adding new backends + +See [interface.py], which defines the interface of a backend and may serve as a template for creating new backends. + + + +## Creating new release To create a new release, it is good to have a release summary. @@ -15,3 +21,8 @@ Then, go to [create a new GitHub releases](https://github.com/EMMC-ASBL/tripper/ Add again the tag as the release title (optionally write something else that defines this release as a title). Finally, press the "Publish release" button and ensure the release workflow succeeds (check [the release workflow](https://github.com/EMMC-ASBL/tripper/actions/workflows/cd_release.yml)). + + + + +[interface.py]: https://github.com/EMMC-ASBL/tripper/blob/master/tripper/interface.py diff --git a/pyproject.toml b/pyproject.toml index 472dc7e..2211ab0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ dataset = [ "requests>=2.0.0,<3.4.1", # todo: check lower version ] pre-commit = [ - "pre-commit==2.21.0", + "pre-commit==4.0.1", "pylint==2.15.5", ] testing-core = [ diff --git a/tests/test_triplestore.py b/tests/test_triplestore.py index dcce55f..d409feb 100644 --- a/tests/test_triplestore.py +++ b/tests/test_triplestore.py @@ -109,6 +109,15 @@ def test_triplestore( # pylint: disable=too-many-locals # ) == example_function.__doc__ assert ts.value(func_iri, DCTERMS.description, lang="de") is None + # Test the `prefer_sparql` property + facit = { + "collection": False, + "ontopy": False, + "rdflib": False, + "sparqlwrapper": True, + } + assert ts.prefer_sparql == facit[backend] + # if True: def test_restriction() -> None: # pylint: disable=too-many-statements diff --git a/tripper/interface.py b/tripper/interface.py index dfcd562..a16f5b9 100644 --- a/tripper/interface.py +++ b/tripper/interface.py @@ -24,7 +24,7 @@ class ITriplestore(Protocol): ```python - # Whether the backend perfers SPQRQL queries instead calling the + # Whether the backend perfers SPQRQL queries instead of using the # triples() method. prefer_sparql = True diff --git a/tripper/triplestore.py b/tripper/triplestore.py index b7e5ab7..71dc585 100644 --- a/tripper/triplestore.py +++ b/tripper/triplestore.py @@ -545,6 +545,15 @@ def list_databases(cls, backend: str, **kwargs): doc=( "Whether the backend prefer SPARQL over the triples() interface. " "Is None if not specified by the backend." + "\n\n" + "Even though Tripper requires that the Triplestore.triples() is " + "implemented, Triplestore.query() must be used for some " + "backends in specific cases (like fuseki when working on RDF " + "lists) because of how blank nodes are treated. " + "\n\n" + "The purpose of this property is to let tripper " + "automatically select the most appropriate interface depending " + "on the current backend settings." ), )