| Home | Trees | Index | Help |
|---|
| Package rdflib :: Package sparql :: Module sparql :: Class Query |
|
queryObject method.
| Method Summary | |
|---|---|
| |
This may be useful when several queries are performed and one wants the 'union' of those. | |
| Boolean |
Whether a specific pattern has a solution or not. |
Cluster: a combination of Query.clusterBackward and Query.clusterForward. | |
sparqlGraph
|
Backward clustering, using all the results of the query as seeds (when appropriate). |
sparqlGraph
|
Forward clustering, using all the results of the query as seeds (when appropriate). |
sparqlGraph
|
Expand the subgraph based on the pattern or, if None, the internal bindings. |
The DESCRIBE Form in the SPARQL draft is still in state of flux, so this is just a temporary method, in fact. | |
Run a selection on the query. | |
| Method Details |
|---|
__init__(self,
sparqlnode,
triples,
parent1=None,
parent2=None)
|
__add__(self,
other)
This may be useful when several queries are performed and one wants
the 'union' of those. Caveat: the triple store must be the same for
each argument. This method is used internally only anyway... Efficiency
trick (I hope it works): the various additions on subgraphs are not
done here; the results are calculated only if really necessary, ie, in
a lazy evaluation manner. This is achieved by storing self and the
'other' in the new object
|
ask(self)Whether a specific pattern has a solution or not.
|
cluster(self, selection)Cluster: a combination ofQuery.clusterBackward and Query.clusterForward. @param
selection: a selection to define the seeds for clustering via the
selection; the result of select used for the clustering seed
|
clusterBackward(self, selection)Backward clustering, using all the results of the query as seeds (when appropriate). It is based on the usage of thecluster
backward method for triple store.
|
clusterForward(self, selection)Forward clustering, using all the results of the query as seeds (when appropriate). It is based on the usage of thecluster
forward method for triple store.
|
construct(self, pattern=None)Expand the subgraph based on the pattern or, if None, the internal bindings. In the former case the binding is used to instantiate the triplets in the patterns; in the latter, the original statements are used as patterns. The result is a separate triple store containing the subgraph.
|
describe(self, selection, forward=True, backward=True)The DESCRIBE Form in the SPARQL draft is still in state of flux, so this is just a temporary method, in fact. It may not correspond to what the final version of describe will be (if it stays in the draft at all, that is). At present, it is simply a wrapper aroundcluster.
|
select(self, selection, distinct=True, limit=None, orderBy=None, orderAscend=None, offset=0)
Run a selection on the query.
@param selection: Either a single query string, or an array or tuple thereof.
@param distinct: if True, identical results are filtered out
@type distinct: Boolean
@param limit: if set to an integer value, the first 'limit' number of results are returned; all of them otherwise
@type limit: non negative integer
@param orderBy: either a function or a list of strings (corresponding to variables in the query). If None, no sorting occurs
on the results. If the parameter is a function, it must take two dictionary arguments (the binding dictionaries), return
-1, 0, and 1, corresponding to smaller, equal, and greater, respectively.
@param orderAscend: if not None, then an array of booelans of the same length as orderBy, True for ascending and False
for descending. If None, an ascending order is used.
@offset the starting point of return values in the array of results. Obviously, this parameter makes real sense if
some sort of order is defined.
@return: selection results
@rtype: list of tuples
@raise SPARQLError: invalid selection argument
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Mon Oct 23 14:11:24 2006 | http://epydoc.sf.net |