Module sqltriples
[show private | hide private]
[frames | no frames]

Module sqltriples

A simple SQL-accessible RDF triple store.

Copyright (C) 2006 Paul Boddie <paul@boddie.org.uk>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

--------

To initialise the database, first open a store:

from sqltriples import TripleStore, PgSQLAdapter # using PgSQL adapter = PgSQLAdapter(connection) store = TripleStore(adapter) # "triples" is the default table name

Alternatively, use the open function:

import sqltriples store = sqltriples.open(dbname, dbmodulename)

Then, use the init method on the TripleStore object as follows:

store.init() store.commit()

See the attributes of the different adapter classes for details of the table and sequence employed.

To remove the triple store objects from the database, use the delete method on the TripleStore object as follows:

store.delete() store.commit()

NOTE: The statements sent to the database system can be configured, but this NOTE: should be made convenient in future releases.
Classes
AbstractExpression  
Adapter  
BNode  
Conjunction  
CountableResults A class representing a count of some results.
Defined  
Disjunction  
Expression  
Intersection A class representing the intersection of a number of queries.
Literal  
Namespace  
Negation  
Objects A class representing a selection of objects.
Pattern  
PgSQLAdapter  
Predicates A class representing a selection of predicates.
pysqlite2Adapter  
Query An abstract class providing support for lazy query evaluation.
Results A class representing a selection of results.
SetQuery A class representing a set operation on query results.
SingleResults A class representing a selection of single value results.
Special  
Subject A class representing a more conveniently accessible subject.
Subjects A class representing a selection of subjects.
Triples A class representing a selection of triples.
TripleStore A triple store whose contents are stored in an SQL-accessible database table.
Union A class representing the union of a number of queries.
URIRef  

Exceptions
NotSupportedError  

Function Summary
  open(database_name, database_module_name, adapter, table_name, sequence_name, debug, **kw)
Open a triple store using either a connection identified by 'database_name' and using the given 'database_module_name' along with other keyword arguments, or using the given 'adapter' object.

Variable Summary
str __version__ = '0.2.1'
Namespace RDFNS = Namespace: http://www.w3.org/1999/02/22-rdf-synt...
Namespace TYPE = Namespace: http://www.w3.org/1999/02/22-rdf-synta...

Function Details

open(database_name=None, database_module_name=None, adapter=None, table_name=None, sequence_name=None, debug=0, **kw)

Open a triple store using either a connection identified by 'database_name' and using the given 'database_module_name' along with other keyword arguments, or using the given 'adapter' object. If the optional 'table_name' and 'sequence_name' are provided, override the default settings in the TripleStore class in order to access stored information in the database. The optional 'debug' parameter (set to false by default) can be used to show the working of the triple store.

Variable Details

__version__

Type:
str
Value:
'0.2.1'                                                                

RDFNS

Type:
Namespace
Value:
Namespace: http://www.w3.org/1999/02/22-rdf-syntax-ns#                 

TYPE

Type:
Namespace
Value:
Namespace: http://www.w3.org/1999/02/22-rdf-syntax-ns#type             

Generated by Epydoc 2.1 on Fri Mar 31 17:48:37 2006 http://epydoc.sf.net