| Home | Trees | Index | Help |
|---|
| Package rdflib :: Package store :: Module AbstractSQLStore :: Class AbstractSQLStore |
|
SQLGenerator--+ |object--+ | | |Store--+ | AbstractSQLStore
SQL-92 formula-aware implementation of an rdflib Store. It stores it's triples in the following partitions: - Asserted non rdf:type statements - Asserted literal statements - Asserted rdf:type statements (in a table which models Class membership) The motivation for this partition is primarily query speed and scalability as most graphs will always have more rdf:type statements than others - All Quoted statements In addition it persists namespace mappings in a seperate table
| Method Summary | |
|---|---|
identifier: URIRef of the Store. | |
Number of statements in the store. | |
__repr__(self)
| |
Add a triple to the store of triples. | |
Adds each item in the list of statements to a specific context. | |
bind(self,
prefix,
namespace)
| |
FIXME: Add documentation!! | |
commit(self)
| |
Generator over all contexts in the graph. | |
namespace(self,
prefix)
| |
namespaces(self)
| |
A generator of objects with the given subject and predicate. | |
A generator of (predicate, object) tuples for the given subject | |
prefix(self,
namespace)
| |
Remove a triple from the store | |
rollback(self)
| |
A generator of (subject, object) tuples for the given predicate | |
A generator of (subject, predicate) tuples for the given object | |
A generator of subjects with the given predicate and object. | |
A generator over all the triples matching pattern. | |
A variant of triples that can take a list of terms instead of a single term in any slot. | |
Get a value for a subject/predicate, predicate/object, or subject/object pair -- exactly one of subject, predicate, object must be None. | |
| Inherited from SQLGenerator | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Ported from Ft.Lib.DbUtil | |
This takes the query string and parameters and (depending on the SQL implementation) either fill in the parameter in-place or pass it on to the Python DB impl (if it supports this). | |
| |
| Inherited from Store | |
| |
This destroys the instance of the store identified by the configuration string. | |
Allows the store to perform any needed garbage collection | |
Opens the store specified by the configuration string. | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Property Summary | |
|---|---|
| Inherited from Store | |
node_pickler | |
| Class Variable Summary | |
|---|---|
bool |
autocommit_default = True
|
bool |
context_aware = True
|
bool |
formula_aware = True
|
int |
regex_matching = 1 |
bool |
transaction_aware = True
|
| Method Details |
|---|
__init__(self,
identifier=None,
configuration=None)
identifier: URIRef of the Store. Defaults to CWD configuration:
string containing infomation open can use to connect to datastore.
|
__len__(self,
context=None)
Number of statements in the store.
|
add(self, (subject, predicate, obj), context=None, quoted=False)Add a triple to the store of triples.
|
addN(self, quads)Adds each item in the list of statements to a specific context. The quoted argument is interpreted by formula-aware stores to indicate this statement is quoted/hypothetical. Note that the default implementation is a redirect to add
|
close(self, commit_pending_transaction=False)FIXME: Add documentation!!
|
contexts(self, triple=None)Generator over all contexts in the graph. If triple is specified, a generator over all contexts the triple is in.
|
objects(self, subject=None, predicate=None)A generator of objects with the given subject and predicate. |
predicate_objects(self, subject=None)A generator of (predicate, object) tuples for the given subject |
remove(self, (subject, predicate, obj), context)Remove a triple from the store
|
subject_objects(self, predicate=None)A generator of (subject, object) tuples for the given predicate |
subject_predicates(self, object=None)A generator of (subject, predicate) tuples for the given object |
subjects(self, predicate=None, obj=None)A generator of subjects with the given predicate and object. |
triples(self, (subject, predicate, obj), context=None)A generator over all the triples matching pattern. Pattern can be any objects for comparing against nodes in the store, for example, RegExLiteral, Date? DateRange? quoted table: <id>_quoted_statements asserted rdf:type table: <id>_type_statements asserted non rdf:type table: <id>_asserted_statements triple columns: subject,predicate,object,context,termComb,objLanguage,objDatatype class membership columns: member,klass,context termComb FIXME: These union all selects *may* be further optimized by joins
|
triples_choices(self, (subject, predicate, object_), context=None)A variant of triples that can take a list of terms instead of a single term in any slot. Stores can implement this to optimize the response time from the import default 'fallback' implementation, which will iterate over each term in the list and dispatch to tripless
|
value(self, subject, predicate=u'http://www.w3.org/1999/02/22-rdf-syntax-ns#value', object=None, default=None, any=False)
Get a value for a subject/predicate, predicate/object, or
subject/object pair -- exactly one of subject, predicate,
object must be None. Useful if one knows that there may only
be one value.
It is one of those situations that occur a lot, hence this
'macro' like utility
Parameters:
-----------
subject, predicate, object -- exactly one must be None
default -- value to be returned if no values found
any -- if True:
return any value in the case there is more than one
else:
raise UniquenessError
|
| Class Variable Details |
|---|
autocommit_default
|
context_aware
|
formula_aware
|
regex_matching
|
transaction_aware
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Wed Apr 4 16:05:45 2007 | http://epydoc.sf.net |