Source code for frex.stores.sparql_queryable
from abc import ABC, abstractmethod
from rdflib.query import Result
[docs]class SparqlQueryable(ABC):
"""
SparqlQueryable is the base class for stores that can be queried in some way using SPARQL queries.
"""
[docs] @abstractmethod
def query(self, *, sparql: str) -> Result:
"""
Query the sparql queryable and retrieve a result.
:param sparql: A string containing valid SPARQL to query.
:return: A Result containing the result from calling the SPARQL query.
"""
pass