-
Notifications
You must be signed in to change notification settings - Fork 577
Description
rdflib/rdflib/plugins/stores/sparqlstore.py
Line 212 in 0856ac8
def triples(self, spo, context=None): |
rdflib/rdflib/plugins/stores/sparqlstore.py
Lines 223 to 228 in 0856ac8
**context** may include three parameter | |
to refine the underlying query: | |
* LIMIT: an integer to limit the number of results | |
* OFFSET: an integer to enable paging of results | |
* ORDERBY: an instance of Variable('s'), Variable('o') or Variable('p') or, by default, the first 'None' from the given triple |
rdflib/rdflib/plugins/stores/sparqlstore.py
Lines 272 to 276 in 0856ac8
if ( | |
hasattr(context, LIMIT) | |
or hasattr(context, OFFSET) | |
or hasattr(context, ORDERBY) | |
): |
For reference, context is the Graph in which the queried triples should occur in.
This approach is not ideal as it passes arguments to a function through the state of another object, one of the side effects of this is that it won't be thread safe, and furthermore it is also awkward to use, and there is no way to pass in these parameters without also passing in a context, so a whole host of the domain of the function is deleted by making it impossible to use with these custom parameters.
There are better ways to achieve the same thing that should be used instead.