Package rdflib :: Package sparql :: Module graphPattern :: Class BasicGraphPattern
[show private | hide private]
[frames | no frames]

Class BasicGraphPattern

GraphPattern --+
               |
              BasicGraphPattern


One, justified, problem with the current definition of GraphPattern is that it makes it difficult for users to use a literal of the type "?XXX", because any string beginning with "?" will be considered to be an unbound variable. The only way of doing this is that the user explicitly creates a Literal object and uses that as part of the pattern.

This class is a superclass of GraphPattern which does not do this, but requires the usage of a separate variable class instance
Method Summary
  __init__(self, patterns)
  _generatePattern(self, tupl)
Append a tuple to the local patterns.
    Inherited from GraphPattern
  __add__(self, other)
Adding means concatenating all the patterns and filters arrays
  __iadd__(self, other)
Adding means concatenating all the patterns and filters arrays
  __repr__(self)
  __str__(self)
  addConstraint(self, func)
Add a global filter constraint to the graph pattern.
  addConstraints(self, lst)
Add a list of global filter constraints to the graph pattern.
  addPattern(self, tupl)
Append a tuple to the local patterns.
  addPatterns(self, lst)
Append a list of tuples to the local patterns.
  construct(self, tripleStore, bindings)
Add triples to a tripleStore based on a variable bindings of the patterns stored locally.
  insertPattern(self, tupl)
Insert a tuple to to the start of local patterns.
  insertPatterns(self, lst)
Insert a list of tuples to the start of the local patterns.
Boolean isEmpty(self)
Is the pattern empty?

Method Details

__init__(self, patterns=[])
(Constructor)

Parameters:
patterns - an initial list of graph pattern tuples
Overrides:
rdflib.sparql.graphPattern.GraphPattern.__init__

_generatePattern(self, tupl)

Append a tuple to the local patterns. Possible type literals are converted to real literals on the fly. Each tuple should be contain either 3 elements (for an RDF Triplet pattern) or four, where the fourth element is a per-pattern constraint (filter). (The general constraint of SPARQL can be optimized by assigning a constraint to a specific pattern; because it stops the graph expansion, its usage might be much more optimal than the the 'global' constraint).
Parameters:
tupl - either a three or four element tuple
Overrides:
rdflib.sparql.graphPattern.GraphPattern._generatePattern

Generated by Epydoc 2.1 on Wed Apr 4 16:05:46 2007 http://epydoc.sf.net