Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0eaacc4
Format all files using black formatter
soerenweindel Nov 7, 2025
3cb15a0
Merge branch 'refactor-cleanup' into 'main'
soerenweindel Nov 19, 2025
9233c0b
Modify existing tests
soerenweindel Dec 1, 2025
633264f
Add new tests
soerenweindel Dec 1, 2025
eafaf6b
Update test naming convention
soerenweindel Dec 1, 2025
fa2b9d1
Squash: Implement changes, update docstrings
soerenweindel Dec 1, 2025
25a6d8e
Update requirements: Add pydantic
soerenweindel Dec 1, 2025
ef2b3ab
Fix nested quotes bug
soerenweindel Dec 2, 2025
acceddd
Fix local named graph overrides
soerenweindel Dec 2, 2025
7c95c1b
Bump version to 1.2.0
soerenweindel Dec 2, 2025
483f5c3
Add SPARQLQuery support to GraphDB.query
soerenweindel Dec 4, 2025
d572ec8
Add typemap
soerenweindel Dec 2, 2025
4afbc43
Add IRI lined and onto support, fix process_bindings_select
soerenweindel Dec 8, 2025
d82265c
Add regex dependency
soerenweindel Dec 8, 2025
9dbfeb9
Enhance triples_get to handle BNode types in query results
EHoffm Dec 8, 2025
f87f27d
Various
soerenweindel Dec 8, 2025
fb31d14
Fix IRI shortening
soerenweindel Dec 8, 2025
c4a37b8
Add SPARQLQuery classmethods for simple queries
soerenweindel Dec 15, 2025
06d32dd
Add new IRI and blank id generation
soerenweindel Dec 15, 2025
5842b21
Add sanitize_triple partial test
soerenweindel Dec 15, 2025
23ada50
Add XSDToPythonTypes and XSDToPythonMapper to init and __all__
soerenweindel Dec 15, 2025
1637b5e
Allow fragment in base of randomly generated IRI
soerenweindel Dec 16, 2025
19a8689
Expose Triple and PartialTriple TypeAlias
soerenweindel Dec 16, 2025
79fad59
Switch result type conversion to query convert_bindings handler
soerenweindel Dec 16, 2025
89386c6
Fix bug in convert_binding_to_python_type
soerenweindel Jan 7, 2026
d0ca635
Add verbose types in types.py, Add support for BNodes in sanitize met…
soerenweindel Jan 9, 2026
1fbd501
Rename typemap to xsd_typemap to distinguish it from python types
soerenweindel Jan 9, 2026
32fa3ed
Modify new_iri to new schema IRI -> IRI
soerenweindel Jan 12, 2026
faf79e3
Fix bug in new_iri where passing `schema=None` breaks the method
soerenweindel Jan 12, 2026
2a9d859
Enhance IRI class with lined property for Punycode-style encoding and…
EHoffm Jan 19, 2026
42abdd7
Add test to IRI.lined and IRI.from_lined
soerenweindel Jan 19, 2026
1b0ed1a
Improve lined property documentation with detailed encoding explanati…
EHoffm Jan 20, 2026
5163c26
Merge branch 'feature-iri-squashed' into 'main'
soerenweindel Jan 21, 2026
853feff
WIP: Fix any_triple_exists
soerenweindel Jan 30, 2026
85c4886
Refactor triples_update to enhance SPARQL query generation with impro…
EHoffm Feb 10, 2026
7b5f9b1
Fix merge error from feature_types
soerenweindel Mar 25, 2026
9d36759
Merge branch 'main' into release
soerenweindel Mar 25, 2026
becd8fb
Fix CI repository selection in tests
JaFeKl Mar 25, 2026
44d12bf
Fix environment variable handling in tests and update repository conf…
JaFeKl Mar 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:

env:
GRAPHDB_URL: http://localhost:7200
GRAPHDB_REPOSITORY: test-repo
GRAPHDB_USERNAME: admin
GRAPHDB_PASSWORD: root
GRAPHDB_TEST_REPOSITORY: test-repo

services:
graphdb:
Expand Down Expand Up @@ -58,14 +58,14 @@ jobs:

- name: Create test repository
run: |
cat > repo-config.ttl << 'EOF'
cat > repo-config.ttl << EOF
@prefix rep: <http://www.openrdf.org/config/repository#> .
@prefix sr: <http://www.openrdf.org/config/repository/sail#> .
@prefix sail: <http://www.openrdf.org/config/sail#> .
@prefix owlim: <http://www.ontotext.com/trree/owlim#> .

[] a rep:Repository ;
rep:repositoryID "test-repo" ;
rep:repositoryID "${GRAPHDB_TEST_REPOSITORY}" ;
rdfs:label "Test Repository" ;
rep:repositoryImpl [
rep:repositoryType "graphdb:SailRepository";
Expand Down
5 changes: 5 additions & 0 deletions graph_db_interface/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
from .sparql_query import SPARQLQuery
from .graph_db import GraphDB
from .utils.graph_db_credentials import GraphDBCredentials
from .utils.iri import IRI
from .utils.utils import to_literal
from .utils.processing import process_bindings_select
from .utils.pretty_print import format_result
from .kafka.kafka_manager import KafkaManager
from .utils.xsd_typemap import XSDToPythonTypes, XSDToPythonMapper

__all__ = [
"GraphDB",
"GraphDBCredentials",
"IRI",
"SPARQLQuery",
"to_literal",
"process_bindings_select",
"format_result",
"KafkaManager",
"XSDToPythonTypes",
"XSDToPythonMapper",
]
85 changes: 69 additions & 16 deletions graph_db_interface/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,105 @@
class GraphDBInterfaceError(Exception):
"""Base class for exceptions in this module."""
"""
Base exception for the GraphDB interface.

Serves as the common ancestor for all custom exceptions in this
package to allow catching them collectively when desired.
"""

pass


class InvalidRepositoryError(GraphDBInterfaceError):
"""Exception raised for invalid repository."""
"""
Invalid repository configuration or selection.

Args:
message (str): Explanation of why the repository is invalid.
"""

def __init__(self, message: str):
def __init__(
self,
message: str,
):
self.message = message
super().__init__(self.message)


class AuthenticationError(GraphDBInterfaceError):
"""Exception raised for authentication errors."""
"""
Authentication failure when communicating with GraphDB.

Args:
message (str): Details about the authentication error.
"""

def __init__(self, message: str):
def __init__(
self,
message: str,
):
self.message = message
super().__init__(self.message)


class InvalidQueryError(GraphDBInterfaceError):
"""Exception raised for invalid SPARQL queries."""
"""
Invalid SPARQL query or update string.

def __init__(self, message: str):
Args:
message (str): Description of why the query is invalid.
"""

def __init__(
self,
message: str,
):
self.message = message
super().__init__(self.message)


class InvalidInputError(GraphDBInterfaceError):
"""Exception raised for invalid input."""
"""
Invalid input provided to an interface method.

Args:
message (str): Explanation of the invalid input condition.
"""

def __init__(self, message: str):
def __init__(
self,
message: str,
):
self.message = message
super().__init__(self.message)


class InvalidIRIError(GraphDBInterfaceError):
"""Exception raised for invalid IRIs."""
"""
Invalid IRI value or format encountered.

def __init__(self, message: str):
Args:
message (str): Description of the IRI validation failure.
"""

def __init__(
self,
message: str,
):
self.message = message
super().__init__(self.message)


class GraphDbException(GraphDBInterfaceError):
"""Exception raised for general GraphDB errors."""

def __init__(self, message: str):
"""
General error raised for HTTP or runtime issues with GraphDB.

Args:
message (str): The error message returned or constructed for the failure.
"""

def __init__(
self,
message: str,
):
self.message = message
super().__init__(self.message)
Loading
Loading