""" This is an RDFLib store around Ivan Herman et al.'s SPARQL service wrapper. This was first done in layer-cake, and then ported to RDFLib """ from __future__ import annotations import collections import re from typing import ( TYPE_CHECKING, Any, Callable, Dict, Generator, Iterable, Iterator, List, Mapping, Optional, Tuple, Union, overload, ) from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Graph from rdflib.plugins.stores.regexmatching import NATIVE_REGEX from rdflib.store import Store from rdflib.term import BNode, Identifier, Node, URIRef, Variable if TYPE_CHECKING: import typing_extensions as te # noqa: I001 from rdflib.graph import ( _TripleType, _ContextType, _QuadType, _TripleChoiceType, _TriplePatternType, _SubjectType, _PredicateType, _ObjectType, _ContextIdentifierType, ) from rdflib.plugins.sparql.sparql import Query, Update from rdflib.query import Result, ResultRow from .sparqlconnector import SPARQLConnector # Defines some SPARQL keywords LIMIT = "LIMIT" OFFSET = "OFFSET" ORDERBY = "ORDER BY" BNODE_IDENT_PATTERN = re.compile(r"(?P