Skip to content

Commit

Permalink
Merge branch 'master' into dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis committed Oct 15, 2024
2 parents 69e4cdb + d45e9e6 commit 676c1c5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
13 changes: 12 additions & 1 deletion docs/developers.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
9 changes: 9 additions & 0 deletions tests/test_triplestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tripper/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions tripper/triplestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
),
)

Expand Down

0 comments on commit 676c1c5

Please sign in to comment.