query.py

View code on Github

Classes and methods for querying a file in the query check process.

class scribe_data.wikidata.check_query.query.QueryFile(path: Path)[source]

Holds a reference to a file containing a SPARQL query.

load(limit: int) str[source]

Load the SPARQL query from ‘path’ into a string.

Parameters:
limitint

The maximum number of results a query should return.

Returns:
str

The SPARQL query.

exception scribe_data.wikidata.check_query.query.QueryExecutionException(message: str, query: QueryFile)[source]

Raised when execution of a query fails.

Parameters:
messagestr

The error message.

queryQueryFile

The query that failed.