RDFLib

Comments ( Section )

by eikeon on Tuesday 24 April, 2007 regarding Namespace getattr related bug:

We have added a NamespaceDict class to the rdflib.Namespace module. The NamespaceDict class can be use to avoid getattr madness.

by Joshua Tacoma on Saturday 31 March, 2007 regarding MySQL backend issues:

I ran into this too.  However, after installing mysql-server, I *still* had the problem :-P
>>> from rdflib import ConjunctiveGraph
>>> graph = ConjunctiveGraph('MySQL')
Now I can connect through a socket:
>>> graph.open('user=,password=,host=localhost,db=test')
table kb_bec6803d52_relations Doesn't exist
0
But not through a port number:
>>> graph.open('user=,password=,host=localhost,db=test,port=3306')
Traceback (most recent call last):
  ...
  File "MySQLdb/connections.py", line 170, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
TypeError: an integer is required
The code that parses the connection string into connection arguments is part of MySQLdb (or the mysql-python package), not RDFLib.  A comment at the bottom of this page (http://sourceforge.net/tracker/index.php?func=detail&aid=1554492&group_id=22307&atid=374932) suggests using 127.0.0.1 instead of localhost, though that didn't solve the problem for me.  Guessing local connections are *always* treated specially, I tried connecting to a remote server: with no port number it tries 3306 (correctly), but with a port number it throws TypeError as above.

by Chimezie Ogbuji on Wednesday 21 March, 2007 regarding Sleepycat backend does not support transactions and thus hotcopy functionality. Patch included.:

A tested, transaction-aware BerkeleyDB rdflib Store implementation:
---------------------------------------------------
from rdflib.store import Store, VALID_STORE, CORRUPTED_STORE, NO_STORE, UNKNOWN
from rdflib.URIRef import URIRef
from bsddb import db
from os import mkdir, rmdir, makedirs
from os.path import exists, abspath, join
from urllib import pathname2url
from threading import Thread
from time import sleep, time
from rdflib.term_utils import *
import md5,sha
import logging
_logger = logging.getLogger("rdflib.store.BerkeleyDB")
def integerMD5Hash(term):
    """
    Takes an RDFLib term and returns the base 16 encoding applied to the MD5 hash of the term concatenated to it's term type letter
    The same mechanism is used in the MySQL store for interning terms with minimal chance of collision
    """
    termType = term2Letter(term)
    if term is None:
        term = u'http://www.w3.org/2002/07/owl#NothingU'
    else:
        term = (isinstance(term,Graph) and term.identifier or term) + termType
    return int(md5.new(isinstance(term,unicode) and term.encode('utf-8') or term).hexdigest(),16)
class BerkeleyDB(Store):
    """
    A transaction-capable BerkeleyDB implementation
    The major difference are:
      - a dbTxn attribute which is the transaction object used for all bsddb databases
      - All operations (put,delete,get) take the dbTxn instance
      - The actual directory used for the bsddb persistence is the name of the identifier as a subdirectory of the 'path'
    """
    context_aware = True
    formula_aware = True
    transaction_aware = True
    def __init__(self, configuration=None, identifier=None):
        self.__open = False
        self.__txHandled = False
        self.__identifier = identifier and identifier or 'home'
        super(BerkeleyDB, self).__init__(configuration)
        self.configuration = configuration
        self._loads = self.node_pickler.loads
        self._dumps = self.node_pickler.dumps
    def __get_identifier(self):
        return self.__identifier
    identifier = property(__get_identifier)
    def destroy(self, configuration):
        """
        Destroy the underlying bsddb persistence for this store
        """
        fullDir = join(configuration,self.identifier)
        if exists(configuration):
            self.db_env(fullDir)
    def open(self, path, create=True):
        if self.__open:
            return
        homeDir = path
        #NOTE: The identifeir is appended to the path as the location for the db
        #This provides proper isolation for stores which have the same path but different identifiers
        fullDir = join(homeDir,self.identifier)
        envsetflags  = db.DB_CDB_ALLDB
        envflags = db.DB_INIT_MPOOL | db.DB_INIT_LOCK | db.DB_THREAD | db.DB_INIT_TXN | db.DB_RECOVER
        if not exists(fullDir):
            if create==True:
                makedirs(fullDir)
                self.create(path)
            else:                
                return NO_STORE
        if self.__identifier is None:
            self.__identifier = URIRef(pathname2url(abspath(fullDir)))
        self.db_env = db_env = db.DBEnv()
        db_env.set_cachesize(0, 1024*1024*50) # TODO
        #db_env.set_lg_max(1024*1024)
        #db_env.set_flags(envsetflags, 1)
        db_env.open(fullDir, envflags | db.DB_CREATE,0)
        #Transaction object
        self.dbTxn = db_env.txn_begin()
        self.__open = True
        dbname = None
        dbtype = db.DB_BTREE
        dbopenflags = db.DB_THREAD
        dbmode = 0660
        dbsetflags   = 0
        # create and open the DBs
        self.__indicies = [None,] * 3
        self.__indicies_info = [None,] * 3
        for i in xrange(0, 3):
            index_name = to_key_func(i)(("s", "p", "o"), "c")
            index = db.DB(db_env)
            index.set_flags(dbsetflags)
            index.open(index_name, dbname, dbtype, dbopenflags|db.DB_CREATE, dbmode,txn=self.dbTxn)
            self.__indicies[i] = index
            self.__indicies_info[i] = (index, to_key_func(i), from_key_func(i))
        lookup = {}
        for i in xrange(0, 8):
            results = []
            for start in xrange(0, 3):
                score = 1
                len = 0
                for j in xrange(start, start+3):
                    if i & (1<<(j%3)):
                        score = score << 1
                        len += 1
                    else:
                        break
                tie_break = 2-start
                results.append(((score, tie_break), start, len))
            results.sort()
            score, start, len = results[-1]
            def get_prefix_func(start, end):
                def get_prefix(triple, context):
                    if context is None:
                        yield ""
                    else:
                        yield context
                    i = start
                    while i<end:
                        yield triple[i%3]
                        i += 1
                    yield ""
                return get_prefix
            lookup[i] = (self.__indicies[start], get_prefix_func(start, start + len), from_key_func(start), results_from_key_func(start, self._from_string))
        self.__lookup_dict = lookup
        self.__contexts = db.DB(db_env)
        self.__contexts.set_flags(dbsetflags)
        self.__contexts.open("contexts", dbname, dbtype, dbopenflags|db.DB_CREATE, dbmode,txn=self.dbTxn)
        self.__namespace = db.DB(db_env)
        self.__namespace.set_flags(dbsetflags)
        self.__namespace.open("namespace", dbname, dbtype, dbopenflags|db.DB_CREATE, dbmode,txn=self.dbTxn)
        self.__prefix = db.DB(db_env)
        self.__prefix.set_flags(dbsetflags)
        self.__prefix.open("prefix", dbname, dbtype, dbopenflags|db.DB_CREATE, dbmode,txn=self.dbTxn)
        self.__i2k = db.DB(db_env)
        self.__i2k.set_flags(dbsetflags)
        self.__i2k.open("i2k", dbname, db.DB_HASH, dbopenflags|db.DB_CREATE, dbmode,txn=self.dbTxn)
        self.__needs_sync = False
        t = Thread(target=self.__sync_run)
        t.setDaemon(True)
        t.start()
        self.__sync_thread = t
        #print "returning valid store indication"
        return VALID_STORE
    def __sync_run(self):
        min_seconds, max_seconds = 10, 300
        while self.__open:
            if self.__needs_sync:
                t0 = t1 = time()
                self.__needs_sync = False
                while self.__open:
                    sleep(.1)
                    if self.__needs_sync:
                        t1 = time()
                        self.__needs_sync = False
                    if time()-t1 > min_seconds or time()-t0 > max_seconds:
                        self.__needs_sync = False
                        _logger.debug("sync")
                        self.sync()
                        break
            else:
                sleep(1)
    def sync(self):
        if self.__open:
            for i in self.__indicies:
                i.sync()
            self.__contexts.sync()
            self.__namespace.sync()
            self.__prefix.sync()
            self.__i2k.sync()
            #self.__k2i.sync()
    #Transactional interfaces
    def commit(self):
        """
        Only commits if the tx handle has not already been properly aborted or commited (by a close for ex.) 
        """         
        if not self.__txHandled:
            print "commiting"
            self.dbTxn.commit(0)
            self.__txHandled = True        
    def rollback(self):
        """
        Only rolls back if the tx handle has not already been properly aborted commited
        """           
        if not self.__txHandled:
            print "rollingback"
            self.dbTxn.abort()
            self.__txHandled = True
    def __del__(self):
        """
        Redirects python's native garbage collection into Store.close 
        """
        self.close()    
    def close(self, commit_pending_transaction=False):
        """
        Properly handles transactions explicitely (with parameter) or by default
        """
        if not self.__open:
            return        
        if not self.__txHandled and not commit_pending_transaction:
            self.rollback()        
        if not self.__txHandled and commit_pending_transaction:
            self.commit()            
        self.__open = False
        self.__sync_thread.join()
        for i in self.__indicies:
            i.close()
        self.__contexts.close()
        self.__namespace.close()
        self.__prefix.close()
        self.__i2k.close()
        #self.__k2i.close()      
        self.db_env.close()
    def add(self, (subject, predicate, object_), context, quoted=False):
        """\
        Add a triple to the store of triples.
        """
        print "add((%s,%s,%s),context=%s)"%(subject,predicate,object_,context)
        assert self.__open, "The Store must be open."
        assert context!=self, "Can not add triple directly to store"
        Store.add(self, (subject, predicate, object_), context, quoted)
        _to_string = self._to_string
        s = _to_string(subject)
        p = _to_string(predicate)
        o = _to_string(object_)
        c = _to_string(context)
        cspo, cpos, cosp = self.__indicies
        value = cspo.get("%s^%s^%s^%s^" % (c, s, p, o),txn=self.dbTxn)
        if value is None:
            self.__contexts.put(c, "",self.dbTxn)
            contexts_value = cspo.get("%s^%s^%s^%s^" % ("", s, p, o),txn=self.dbTxn) or ""
            contexts = set(contexts_value.split("^"))
            contexts.add(c)
            contexts_value = "^".join(contexts)
            assert contexts_value!=None
            cspo.put("%s^%s^%s^%s^" % (c, s, p, o), "",self.dbTxn)
            cpos.put("%s^%s^%s^%s^" % (c, p, o, s), "",self.dbTxn)
            cosp.put("%s^%s^%s^%s^" % (c, o, s, p), "",self.dbTxn)
            if not quoted:
                cspo.put("%s^%s^%s^%s^" % ("", s, p, o), contexts_value,self.dbTxn)
                cpos.put("%s^%s^%s^%s^" % ("", p, o, s), contexts_value,self.dbTxn)
                cosp.put("%s^%s^%s^%s^" % ("", o, s, p), contexts_value,self.dbTxn)
            self.__needs_sync = True
    def __remove(self, (s, p, o), c, quoted=False):
        cspo, cpos, cosp = self.__indicies
        contexts_value = cspo.get("^".join(("", s, p, o, "")),txn=self.dbTxn) or ""
        contexts = set(contexts_value.split("^"))
        contexts.discard(c)
        contexts_value = "^".join(contexts)
        for i, _to_key, _from_key in self.__indicies_info:
            i.delete(_to_key((s, p, o), c),txn=self.dbTxn)
        if not quoted:
            if contexts_value:
                for i, _to_key, _from_key in self.__indicies_info:
                    i.put(_to_key((s, p, o), ""), contexts_value,self.dbTxn)
            else:
                for i, _to_key, _from_key in self.__indicies_info:
                    try:
                        i.delete(_to_key((s, p, o), ""),txn=self.dbTxn)
                    except db.DBNotFoundError, e: 
                        pass # TODO: is it okay to ignore these?
    def remove(self, (subject, predicate, object_), context):
        assert self.__open, "The Store must be open."
        Store.remove(self, (subject, predicate, object_), context)
        _to_string = self._to_string
        if context is not None:
            if context == self:
                context = None
        if subject is not None and predicate is not None and object_ is not None and context is not None:
            s = _to_string(subject)
            p = _to_string(predicate)
            o = _to_string(object_)
            c = _to_string(context)
            value = self.__indicies[0].get("%s^%s^%s^%s^" % (c, s, p, o),txn=self.dbTxn)
            if value is not None:
                self.__remove((s, p, o), c)
                self.__needs_sync = True
        else:
            cspo, cpos, cosp = self.__indicies
            index, prefix, from_key, results_from_key = self.__lookup((subject, predicate, object_), context)
            cursor = index.cursor(txn=self.dbTxn)
            try:
                current = cursor.set_range(prefix)
                needs_sync = True
            except db.DBNotFoundError:
                current = None
                needs_sync = False
            cursor.close()
            while current:
                key, value = current
                cursor = index.cursor(txn=self.dbTxn)
                try:
                    cursor.set_range(key)
                    current = cursor.next()
                except db.DBNotFoundError:
                    current = None
                cursor.close()
                if key.startswith(prefix):
                    c, s, p, o = from_key(key)
                    if context is None:
                        contexts_value = index.get(key,txn=self.dbTxn) or ""
                        contexts = set(contexts_value.split("^")) # remove triple from all non quoted contexts
                        contexts.add("") # and from the conjunctive index
                        for c in contexts:
                            for i, _to_key, _ in self.__indicies_info:
                                i.delete(_to_key((s, p, o), c),txn=self.dbTxn)
                    else:
                        self.__remove((s, p, o), c)
                else:
                    break
            if context is not None:
                if subject is None and predicate is None and object_ is None:
                    # TODO: also if context becomes empty and not just on remove((None, None, None), c)
                    try:
                        self.__contexts.delete(_to_string(context),txn=self.dbTxn)
                    except db.DBNotFoundError, e:
                        pass
            self.__needs_sync = needs_sync
    def triples(self, (subject, predicate, object_), context=None):
        """A generator over all the triples matching """
        print "triples((%s,%s,%s),context=%s)"%(subject,predicate,object_,context)
        assert self.__open, "The Store must be open."
        if context is not None:
            if context == self:
                context = None
        _from_string = self._from_string
        index, prefix, from_key, results_from_key = self.__lookup((subject, predicate, object_), context)
        cursor = index.cursor(txn=self.dbTxn)
        try:
            current = cursor.set_range(prefix)
        except db.DBNotFoundError:
            current = None
        cursor.close()
        while current:
            key, value = current
            cursor = index.cursor(txn=self.dbTxn)
            try:
                cursor.set_range(key)
                current = cursor.next()
            except db.DBNotFoundError:
                current = None
            cursor.close()
            if key and key.startswith(prefix):
                contexts_value = index.get(key,txn=self.dbTxn)
                yield results_from_key(key, subject, predicate, object_, contexts_value)
            else:
                break
    def __len__(self, context=None):
        assert self.__open, "The Store must be open."
        if context is not None:
            if context == self:
                context = None
        if context is None:
            prefix = "^"
        else:
            prefix = "%s^" % self._to_string(context)
        index = self.__indicies[0]
        cursor = index.cursor(txn=self.dbTxn)
        current = cursor.set_range(prefix)
        count = 0
        while current:
            key, value = current
            if key.startswith(prefix):
                count +=1
                current = cursor.next()
            else:
                break
        cursor.close()
        return count
    def bind(self, prefix, namespace):
        prefix = prefix.encode("utf-8")
        namespace = namespace.encode("utf-8")
        bound_prefix = self.__prefix.get(namespace,txn=self.dbTxn)
        if bound_prefix:
            self.__namespace.delete(bound_prefix,txn=self.dbTxn)
        self.__prefix.put(namespace, prefix,self.dbTxn)
        #self.__prefix[namespace] = prefix
        self.__namespace.put(prefix, namespace,self.dbTxn)
        #self.__namespace[prefix] = namespace
    def namespace(self, prefix):
        prefix = prefix.encode("utf-8")
        return self.__namespace.get(prefix, None,txn=self.dbTxn)
    def prefix(self, namespace):
        namespace = namespace.encode("utf-8")
        return self.__prefix.get(namespace, None,txn=self.dbTxn)
    def namespaces(self):
        cursor = self.__namespace.cursor(txn=self.dbTxn)
        results = []
        current = cursor.first()
        while current:
            prefix, namespace = current
            results.append((prefix, namespace))
            current = cursor.next()
        cursor.close()
        for prefix, namespace in results:
            yield prefix, URIRef(namespace)
    def contexts(self, triple=None):
        _from_string = self._from_string
        _to_string = self._to_string
        if triple:
            s, p, o = triple
            s = _to_string(s)
            p = _to_string(p)
            o = _to_string(o)
            contexts = self.__indicies[0].get("%s^%s^%s^%s^" % ("", s, p, o),txn=self.dbTxn)
            if contexts:
                for c in contexts.split("^"):
                    if c:
                        yield _from_string(c)
        else:
            index = self.__contexts
            cursor = index.cursor(txn=self.dbTxn)
            current = cursor.first()
            cursor.close()
            while current:
                key, value = current
                context = _from_string(key)
                yield context
                cursor = index.cursor(txn=self.dbTxn)
                try:
                    cursor.set_range(key)
                    current = cursor.next()
                except db.DBNotFoundError:
                    current = None
                cursor.close()
    def _from_string(self, i):
        k = self.__i2k.get(i,txn=self.dbTxn)
        return self._loads(k)
    def _to_string(self, term):
        """
        i2k:  hashInt -> pickledTerm
        i2k basically stores the reverse lookup of the base16 encoded MD5 hash of the term 
        """
        i = str(integerMD5Hash(term))
        self.__i2k.put(i,self._dumps(term),txn=self.dbTxn)
        return i
    def __lookup(self, (subject, predicate, object_), context):
        _to_string = self._to_string
        if context is not None:
            context = _to_string(context)
        i = 0
        if subject is not None:
            i += 1
            subject = _to_string(subject)
        if predicate is not None:
            i += 2
            predicate = _to_string(predicate)
        if object_ is not None:
            i += 4
            object_ = _to_string(object_)
        index, prefix_func, from_key, results_from_key = self.__lookup_dict[i]
        prefix = "^".join(prefix_func((subject, predicate, object_), context))
        return index, prefix, from_key, results_from_key
def to_key_func(i):
    def to_key(triple, context):
        "Takes a string; returns key"
        return "^".join((context, triple[i%3], triple[(i+1)%3], triple[(i+2)%3], "")) # "" to tac on the trailing ^
    return to_key
def from_key_func(i):
    def from_key(key):
        "Takes a key; returns string"
        parts = key.split("^")
        return parts[0], parts[(3-i+0)%3+1], parts[(3-i+1)%3+1], parts[(3-i+2)%3+1]
    return from_key
def results_from_key_func(i, from_string):
    def from_key(key, subject, predicate, object_, contexts_value):
        "Takes a key and subject, predicate, object; returns tuple for yield"
        parts = key.split("^")
        if subject is None:
            # TODO: i & 1: # dis assemble and/or measure to see which is faster
            # subject is None or i & 1
            s = from_string(parts[(3-i+0)%3+1])
        else:
            s = subject
        if predicate is None:#i & 2:
            p = from_string(parts[(3-i+1)%3+1])
        else:
            p = predicate
        if object_ is None:#i & 4:
            o = from_string(parts[(3-i+2)%3+1])
        else:
            o = object_
        return (s, p, o), (from_string(c) for c in contexts_value.split("^") if c)
    return from_key
def readable_index(i):
    s, p, o = "?" * 3
    if i & 1: s = "s"
    if i & 2: p = "p"
    if i & 4: o = "o"
    return "%s,%s,%s" % (s, p, o)
-------------------------------------------------

by Daniel Krech on Thursday 15 March, 2007 regarding FOAF parse error... rdflib bug?:

eikeon: Did http://xmlns.com/foaf/0.1/ stop doing content negotiation several months back? I can no longer load the RDF/XML via that URL 
[02:39am] eikeon: wget -S --header='Accept: application/rdf+xml' http://xmlns.com/foaf/0.1/
[02:39am] eikeon: --02:36:28--  http://xmlns.com/foaf/0.1/
[02:39am] eikeon:           => `index.html.1'
[02:39am] eikeon: Resolving xmlns.com... 208.113.134.174
[02:39am] eikeon: Connecting to xmlns.com[208.113.134.174]:80... connected.
[02:39am] eikeon: HTTP request sent, awaiting response...
[02:39am] eikeon:  1 HTTP/1.1 200 OK
[02:39am] eikeon:  2 Date: Thu, 15 Mar 2007 06:36:30 GMT
[02:39am] eikeon:  3 Server: Apache/1.3.37 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.4 mod_ssl/2.8.22 OpenSSL/0.9.7e
[02:39am] eikeon:  4 Last-Modified: Sun, 29 Jan 2006 22:38:45 GMT
[02:39am] eikeon:  5 ETag: "338923b-2d925-43dd43f5"
[02:39am] eikeon:  6 Accept-Ranges: bytes
[02:39am] eikeon:  7 Content-Length: 186661
[02:39am] eikeon:  8 Keep-Alive: timeout=5, max=100
[02:39am] eikeon:  9 Connection: Keep-Alive
[02:39am] eikeon: 10 Content-Type: text/html
[02:41am] eikeon: Unless somehow I manage to parser the HTML as RDF/XML before and now the striping has shifted by one?
[02:43am] eikeon: Ever since the root element rdf:RDF was made optional, I'm not sure how RDF/XML parsers know when to start parsing RDF from a document like http://xmlns.com/foaf/0.1/

by Daniel Krech on Monday 12 March, 2007 regarding FOAF parse error... rdflib bug?:

Testing...

by Matt on Tuesday 06 March, 2007 regarding It would be nice if __iadd__ of rdflib.Graph.Graph was context aware:

just to follow up .... a simple work around seems to be
    def __iadd__(self, other):
        quads = other.graph.quads((None,None,None))
        self.graph.addN(quads)
(haven't tested this over the test suite yet - not sure what coverage it gets anyway)

by Daniel Krech on Monday 05 March, 2007 regarding MySQL floating point truncation warnings:

chimezie * r940 rdflib/store/FOPLRelationalModel/BinaryRelationPartition.py: Fixed context column comparison. The hash integer was being compared with 'F' causing a warning:Warning: Truncated incorrect DOUBLE value: 'F'

by Mike Pittaro on Friday 02 March, 2007 regarding MySQL floating point truncation warnings:

Here's a trace of the actual SQL statements we saw during execution, printing out the SQL, and the parameters to the SQL.
The following output indicates that a large number is inserted to the 'context' column (datatype BIGINT(20)) in _literalProperties table.  Whereas in the subsequent SELECT and DELETE statements, a condition of _literalProperties.context != 'F' is embdded.
$ python Quick/Utils/repository/test/testGraphMySQL.py
========= flushInsertions ============ (BinaryRelationPartition.py)
(False, True) INSERT INTO kb_22199ec38c_literalProperties (subject,subject_term,predicate,predicate_term,object,context,
context_term,language) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
[(2089168256456688139L, 'U', 7938321822530351659L, 'U', 14154739877016554841L, 6385400757550499479L, 'B', 'en')]
======= PatternResolution ========== (BinaryRelationPartition.py)
(SELECT rt_subject.lexical as subject,rt_subject.term_type as subjectTermType,rt_predicate.lexical as predicate,rt_predi
cate.term_type as predicateTermType,rt_object.lexical as object,'L' as objectTermType,rt_context.lexical as context,rt_c
ontext.term_type as contextTermType,rt_data_type.lexical as dataType,kb_22199ec38c_literalProperties.language as languag
e FROM kb_22199ec38c_literalProperties LEFT JOIN kb_22199ec38c_identifiers rt_data_type ON (kb_22199ec38c_literalPropert
ies.data_type = rt_data_type.id) INNER JOIN kb_22199ec38c_identifiers rt_predicate ON (kb_22199ec38c_literalProperties.p
redicate = rt_predicate.id AND kb_22199ec38c_literalProperties.predicate_term = rt_predicate.term_type) INNER JOIN kb_22
199ec38c_identifiers rt_context ON (kb_22199ec38c_literalProperties.context = rt_context.id AND kb_22199ec38c_literalPro
perties.context_term = rt_context.term_type) INNER JOIN kb_22199ec38c_literals rt_object ON (kb_22199ec38c_literalProper
ties.object = rt_object.id) INNER JOIN kb_22199ec38c_identifiers rt_subject ON (kb_22199ec38c_literalProperties.subject
= rt_subject.id AND kb_22199ec38c_literalProperties.subject_term = rt_subject.term_type) WHERE kb_22199ec38c_literalProp
erties.subject = %s AND kb_22199ec38c_literalProperties.subject_term = %s AND kb_22199ec38c_literalProperties.context !=
 'F') union all (SELECT rt_subject.lexical,rt_subject.term_type,rt_predicate.lexical,rt_predicate.term_type,rt_object.le
xical,rt_object.term_type,rt_context.lexical,rt_context.term_type,NULL,NULL FROM kb_22199ec38c_relations INNER JOIN kb_2
2199ec38c_identifiers rt_predicate ON (kb_22199ec38c_relations.predicate = rt_predicate.id AND kb_22199ec38c_relations.p
redicate_term = rt_predicate.term_type) INNER JOIN kb_22199ec38c_identifiers rt_context ON (kb_22199ec38c_relations.cont
ext = rt_context.id AND kb_22199ec38c_relations.context_term = rt_context.term_type) INNER JOIN kb_22199ec38c_identifier
s rt_object ON (kb_22199ec38c_relations.object = rt_object.id AND kb_22199ec38c_relations.object_term = rt_object.term_t
ype) INNER JOIN kb_22199ec38c_identifiers rt_subject ON (kb_22199ec38c_relations.subject = rt_subject.id AND kb_22199ec3
8c_relations.subject_term = rt_subject.term_type) WHERE kb_22199ec38c_relations.subject = %s AND kb_22199ec38c_relations
.subject_term = %s AND kb_22199ec38c_relations.context != 'F') union all (SELECT rt_subject.lexical,rt_subject.term_type
,'http://www.w3.org/1999/02/22-rdf-syntax-ns#type','U',rt_object.lexical,rt_object.term_type,rt_context.lexical,rt_conte
xt.term_type,NULL,NULL FROM kb_22199ec38c_associativeBox INNER JOIN kb_22199ec38c_identifiers rt_object ON (kb_22199ec38
c_associativeBox.class = rt_object.id AND kb_22199ec38c_associativeBox.class_term = rt_object.term_type) INNER JOIN kb_2
2199ec38c_identifiers rt_context ON (kb_22199ec38c_associativeBox.context = rt_context.id AND kb_22199ec38c_associativeB
ox.context_term = rt_context.term_type) INNER JOIN kb_22199ec38c_identifiers rt_subject ON (kb_22199ec38c_associativeBox
.member = rt_subject.id AND kb_22199ec38c_associativeBox.member_term = rt_subject.term_type) WHERE kb_22199ec38c_associa
tiveBox.member = %s AND kb_22199ec38c_associativeBox.member_term = %s AND kb_22199ec38c_associativeBox.context != 'F') O
RDER BY subject,predicate,object
[2089168256456688139L, 'U', 2089168256456688139L, 'U', 2089168256456688139L, 'U']
c:\Programs\Python24\lib\site-packages\rdflib\store\FOPLRelationalModel\BinaryRelationPartition.py:637: Warning: Truncat
ed incorrect DOUBLE value: 'F'
  cursor.execute(query,tuple(unionQueriesParams))
======= MySQL 1 ========== (MySQL.py)
select count(*) from kb_22199ec38c_literalProperties
None
======= MySQL 1 ========== (MySQL.py)
select count(*) from kb_22199ec38c_relations
None
======= MySQL 1 ========== (MySQL.py)
select count(*) from kb_22199ec38c_associativeBox
None
======= MySQL 3 ========== (MySQL.py)
DELETE kb_22199ec38c_literalProperties from kb_22199ec38c_literalProperties LEFT JOIN kb_22199ec38c_identifiers rt_data_
type ON (kb_22199ec38c_literalProperties.data_type = rt_data_type.id) INNER JOIN kb_22199ec38c_identifiers rt_predicate
ON (kb_22199ec38c_literalProperties.predicate = rt_predicate.id AND kb_22199ec38c_literalProperties.predicate_term = rt_
predicate.term_type) INNER JOIN kb_22199ec38c_identifiers rt_context ON (kb_22199ec38c_literalProperties.context = rt_co
ntext.id AND kb_22199ec38c_literalProperties.context_term = rt_context.term_type) INNER JOIN kb_22199ec38c_literals rt_o
bject ON (kb_22199ec38c_literalProperties.object = rt_object.id) INNER JOIN kb_22199ec38c_identifiers rt_subject ON (kb_
22199ec38c_literalProperties.subject = rt_subject.id AND kb_22199ec38c_literalProperties.subject_term = rt_subject.term_
type) WHERE kb_22199ec38c_literalProperties.subject = %s AND kb_22199ec38c_literalProperties.subject_term = %s AND kb_22
199ec38c_literalProperties.predicate = %s AND kb_22199ec38c_literalProperties.predicate_term = %s AND kb_22199ec38c_lite
ralProperties.object = %s AND kb_22199ec38c_literalProperties.context != 'F' AND kb_22199ec38c_literalProperties.languag
e = %s
[2089168256456688139L, 'U', 7938321822530351659L, 'U', 14154739877016554841L, 'en']
c:\Programs\Python24\lib\site-packages\rdflib\store\MySQL.py:178: Warning: Truncated incorrect DOUBLE value: 'F'
  cursor.execute(qStr,tuple(params))

by U Maung Hla on Monday 26 February, 2007 regarding http://www.rosettaproject.org:

I heard about this website from the Voice of America.I am very interested to
learn English and other languages.Here in Myanmar,going to an English Class is
very expensive and beyond my reach.
I hope and believe I will be able to benefit from this website.I will also be
very thankful if you can kindly give me some advice as to improve my English.
U Maung Hla
 

by Daniel Krech on Monday 26 February, 2007 regarding Sleepycat backend does not support transactions and thus hotcopy functionality. Patch included.:

Hum... bsddb.db.DBInvalidArgError: (22, 'Invalid argument -- configured environment flags incompatible with existing environment'). We'll need to figure out how to deal with the compatibility issue. But looks like all works fine for new instances.

by Daniel Krech on Monday 26 February, 2007 regarding Sleepycat backend does not support transactions and thus hotcopy functionality. Patch included.:

Is this change compatible with existing instances? I'm going to test this change out on some existing instances to see.

by Daniel Krech on Monday 26 February, 2007 regarding N3 parser: trying to get filename+extension in path:

Added a test case for this issue: testFileName (test.n3.N3TestCase). Next up is to actually dig in and fix it.

by Daniel Krech on Monday 26 February, 2007 regarding graph.value(None, ...) shouldn't raise AssertionError:

graph.value is now returning None in the cases where it used to raise AssertionErrors. This seems to make sense. Does this work for others?

by Daniel Krech on Monday 26 February, 2007 regarding Limit or eliminate hierarchical inlining of referenced resources in the XML serialization:

Okay... we now have g.serialize(format="pretty-xml", max_depth=3) -- think this addresses this issue.

by Daniel Krech on Sunday 25 February, 2007 regarding Namespace getattr related bug:

Okay... we've (on #redfoot) have spent a fair amount of time digging into this issue. We're thinking we may want two versions. One that does the getattr and getitem thing but is not a subclass of URIRef. And one that does not do that getattr and getitem thing, instead, implements a new method called term, and is a subclass of URIRef. If we go this route we'll need to manage the complexity by naming and documenting the choice well.

by DanPy on Friday 09 February, 2007 regarding Can't complete install because "The .NET Framework SDK needs to be installed before building extensions for Python.":

I found an Alternate Solution by configuring MingW
Task:
 RDFLib installation
Problem:    
 error: Python was built with Visual Studio 2003;
 extensions must be built with a compiler than can generate compatible binaries.
 Visual Studio 2003 was not found on this system. If you have Cygwin installed,
 you can try compiling with MingW32, by passing "-c mingw32" to setup.py. 
Solution:
 How to Configure Mingw:
	* Download last release from http://prdownloads.sourceforge.net/mingw  (MinGW-5.1.3.exe)
	* Run the file to start the installation process
	* Keep all values at their defaults and select at least next components:
          	o MinGW base tools
          	o g++ compiler
          	o MinGW Make 
	* Add the C:\mingw\bin directory to the system PATH
	* Create (or edit) a .cfg file for distutils (distutils.cfg) eg: C:\Python25\Lib\distutils\distutils.cfg with this content:
		[build]
  		compiler=mingw32
Then type in your RDFlib directory> python setup.py install 
creating C:\Python25\Lib\site-packages\rdflib\store
copying build\lib.win32-2.5\rdflib\store\AbstractSQLStore.py -> C:\Python25\Lib\
site-packages\rdflib\store
copying build\lib.win32-2.5\rdflib\store\AuditableStorage.py -> C:\Python25\Lib\
site-packages\rdflib\store
copying build\lib.win32-2.5\rdflib\store\Concurrent.py -> C:\Python25\Lib\site-p
ackages\rdflib\store
....
....
....
Writing C:\Python25\Lib\site-packages\rdflib-2.3.3-py2.5.egg-info
Thats it Good Luck!
Further Source:  http://livingpyxml.python-hosting.com/wiki/AmaraWindowsInstallTips

by DanPy on Monday 29 January, 2007 regarding Can't complete install because "The .NET Framework SDK needs to be installed before building extensions for Python.":

I found similar issues , I use Python 2.5:
running install
running build
running build_py
running build_ext
building 'rdflib.sparql.bison.SPARQLParserc' extension
error: Python was built with Visual Studio version 7.1, and extensions need to b
e built with the same version of the compiler, but it isn't installed.

by Pham Van Dong on Monday 08 January, 2007 regarding Pham Van Dong:

dfe39a4eea95dabf0517b3193e4e8557

by Sergio Fdez on Saturday 06 January, 2007 regarding Releases:

I also announced it in the mailing list [1] that RDFLib package [1] was accepted in Debian GNU/Linux. Then it could be installed using APT tools (using Debian official mirrors or single packages [2]).
[1] http://rdflib.net/pipermail/dev/2007-January/000130.html
[2] http://zoidberg.criptonita.com/~nacho/debian/rdflib/

by John Black on Wednesday 03 January, 2007 regarding John Black:

http://kashori.com/JohnBlack/foaf.rdf#jpb

by Mike Pittaro on Thursday 07 December, 2006 regarding Problems with Graph.Seq() when sequences contain more than 9 items.:

duh...I pasted the diff backwards.  
[mikeyp@indigo64 rdflib]$ svn diff
Index: Graph.py
===================================================================
--- Graph.py    (revision 8)
+++ Graph.py    (working copy)
@@ -881,7 +881,7 @@
         for (p, o) in graph.predicate_objects(subject):
             if p.startswith(LI_INDEX): #!= RDF.Seq: #
                 i = int(p.replace(LI_INDEX, ''))
-                _list.append(("%s" % i, o))
+                _list.append((i, o))
         # here is the trick: the predicates are _1, _2, _3, etc. Ie,
         # by sorting the keys (by integer) we have what we want!
         _list.sort()

by Graham Higgins on Saturday 25 November, 2006 regarding Better / clearer documentation and examples:

My mistake, a setuptools dependency had introduced a contaminating alternate, older rdflib. 

by Graham Higgins on Saturday 25 November, 2006 regarding Better / clearer documentation and examples:

FYI:
Some editing may be required, in 2.3.3, the lines
[(x,y,z) for x,y,z in primer]
and
print primer.serialize(format='n3')
cause an exception: "ValueError: need more than 2 values to unpack".

by Ewan Klein on Thursday 23 November, 2006 regarding Another problem with Unicode strings in SPARQL queries?:

My first point of entry into formulating SPARQL queries in RDFLib was your Wikipedia article. After flailing around fruitlessly for a while tying to use the bison parser, I realized that it all worked straightforwardly using the ConjunctiveGraph query() method. Would it not make sense to update the Wikipedia article to present the latter as the simplest mode of using SPARQL? 

by Daniel Krech on Thursday 16 November, 2006 regarding graph.value(None, ...) shouldn't raise AssertionError:

I've been annoyed by cases involving graph.value(None, ...) too. In particular, I think in the case of Any=True the value method should just return None.

by Drew Perttula on Thursday 16 November, 2006 regarding rdflib.net times are off:

disregard!
I thought the bottom issues were mine, because I apparently cannot read.

by Daniel Krech on Wednesday 15 November, 2006 regarding Unicode strings in SPARQL query is not supported:

Added a test case and fix for this issue. Thank you for submitting the issue.

by Daniel Krech on Wednesday 15 November, 2006 regarding Another problem with Unicode strings in SPARQL queries?:

I added a test case for this issue and also commited a fix for the issue. Thank you for reporting the issue.

by Daniel Krech on Sunday 05 November, 2006 regarding Better / clearer documentation and examples:

Thank you for the example. We'll add it to the next release.

by Daniel Krech on Sunday 05 November, 2006 regarding Issues Functionality added to this Site:

In addition to the feeds for issues and comments you can also get alerts via jabber if you'd like. I'll add a user profile page where you can specify if you'd like alerts sent to you or not. In the mean time, let me know if you'd like me to turn alerts on for you.

by mailto:testing on Sunday 05 November, 2006 regarding RFE: intern and/or shorten URIs in database storage:

Chimezie, have you seen this issue yet? (Testing the alert system ;)

by Daniel Krech on Saturday 04 November, 2006 regarding SQLite open argument should be a filename:

Sounds good to me. I'll check with Chimezie for his thoughts first before proceeding with this change. 

by Daniel Krech on Saturday 04 November, 2006 regarding Bug/typo in plugin.py wrt TurtleSerializer:

Thank you. I've applied the patches. Also note that we now have functionality for tracking issues. See the issues section. Thank you again for sending along the patches.

by Daniel Krech on Saturday 04 November, 2006 regarding RFE: intern and/or shorten URIs in database storage:

The Sleepycat store implementation does interning of terms (URIRef's, Literals, etc). I don't recall off hand if the MySQL store implementation does or not. Chimezie should know off hand. Let's check with him and/or dive into the source.

by Daniel Krech on Saturday 04 November, 2006 regarding Limit or eliminate hierarchical inlining of referenced resources in the XML serialization:

Anyone interested at taking a crack at a patch for the pretty-xml serializer or creating another serializer with some of these changes?

by Matt Chaput on Thursday 02 November, 2006 regarding Limit or eliminate hierarchical inlining of referenced resources in the XML serialization:

Right... I should have said pretty-xml.
I think a pretty-printer that listed all resources inside the document element, with properties that refer to other resources by URI, would be better... although there may be use-cases (with less intertwingled graphs than mine) where the nested format is useful.

by Daniel Krech on Thursday 02 November, 2006 regarding Site navigation:

I don't actually store the passwords, just their digests. So how about we have a password reset option instead?

by Daniel Krech on Thursday 02 November, 2006 regarding Limit or eliminate hierarchical inlining of referenced resources in the XML serialization:

There are a couple RDF/XML serializers to choose from currently. The default serializer is the one registered for format="xml" (look in rdflib/plugin.py to see which serializers are registered with what names) and does not do inlining, IIRC. The serializer you get when you specify format="pretty-xml" does do inlining with a bunch of other things to try and make it more human readable. Ah, so it sounds like you might be wanting the more human readable serializer, but just not something that gets overly indented?

by Stefano Debenedetti on Wednesday 01 November, 2006 regarding Site navigation:

a password reminder would also help

by Stefano Debenedetti on Wednesday 01 November, 2006 regarding Sparql code cleanup needed:

Here's a patch for the SPARQL construct tests.
It's helpful to patch them because it turns out that on one of them (Test10_22) the engine fails
Index: trunk-test-sparql/test/sparql/ConstructTests/Test10_21.py
===================================================================
--- trunk-test-sparql/test/sparql/ConstructTests/Test10_21.py	(revisione 866)
+++ trunk-test-sparql/test/sparql/ConstructTests/Test10_21.py	(copia locale)
@@ -7,7 +7,6 @@
 from testSPARQL import ns_rdf
 from testSPARQL import ns_rdfs
-from testSPARQL import ns_dc
 from testSPARQL import ns_dc0
 from testSPARQL import ns_foaf
 from testSPARQL import ns_ns
@@ -18,7 +17,7 @@
 from rdflib.Literal     import Literal
 from rdflib.sparql.sparqlOperators import lt, ge
 import datetime
-from rdflib.sparql import GraphPattern
+from rdflib.sparql.graphPattern import GraphPattern
 thresholdDate = datetime.date(2005,01,01)
Index: trunk-test-sparql/test/sparql/ConstructTests/constuctTest.py
===================================================================
--- trunk-test-sparql/test/sparql/ConstructTests/constuctTest.py	(revisione 866)
+++ trunk-test-sparql/test/sparql/ConstructTests/constuctTest.py	(copia locale)
@@ -12,13 +12,11 @@
 from testSPARQL import ns_rdf
 from testSPARQL import ns_rdfs
-from testSPARQL import ns_dc
-from testSPARQL import ns_dc0
 from testSPARQL import ns_foaf
 from testSPARQL import ns_vcard
 from testSPARQL import ns_person
-from rdflib.sparql import sparqlGraph, retrieveRDFFiles
+from rdflib.sparql import sparqlGraph
 from rdflib.FileInputSource import FileInputSource
 tests = {
@@ -39,20 +37,14 @@
         defs = mod.__dict__
         ##################################################
-        # Three ways of identifying the RDF data:
+        # Two ways of identifying the RDF data:
         # 1. A Triple Store generated in the module
         graph = None
         try :
                 graph = defs["graph"]
         except :
                 pass
-        # 2. A reference to a set of RDF Files
-        fils = None
-        try :
-                fils        = defs["datafiles"]
-        except :
-                pass
-        # 3. Directly in the test module as a string
+        # 2. Directly in the test module as a string
         rdfData = None
         try :
                 rdfData     = defs["rdfData"]
@@ -61,12 +53,9 @@
         # Get the final of the triple store...
         if graph == None :
-                if rdfData == None :
-                        graph = retrieveRDFFiles(fils)
-                else :
-                        stream = FileInputSource(StringIO.StringIO(rdfData))
-                        graph = sparqlGraph.SPARQLGraph()
-                        graph.parse(stream,format="xml")
+                stream = FileInputSource(StringIO.StringIO(rdfData))
+                graph = sparqlGraph.SPARQLGraph()
+                graph.parse(stream,format="xml")
         ###############################################
         # Retrive the query data
@@ -80,7 +69,7 @@
         results     = graph.queryObject(pattern,optPattern)
         graph = results.construct(construct)
-        graph.save("output.rdf")
+        graph.serialize("output.rdf")
         print "=== generated RDF file (output.rdf):\n"
         for l in file("output.rdf") :
@@ -88,7 +77,9 @@
 if __name__ == '__main__' :
         if len(sys.argv) == 1 :
-                print "Usage: %s modname1 modname2 ..." % sys.argv[0]
+                #print "Usage: %s modname1 modname2 ..." % sys.argv[0]
+                for mod in tests.values():
+                        run(mod)
         else :
                 for mod in sys.argv[1:] :
                         if mod.endswith(".py") :
Index: trunk-test-sparql/test/sparql/ConstructTests/Test10_22.py
===================================================================
--- trunk-test-sparql/test/sparql/ConstructTests/Test10_22.py	(revisione 866)
+++ trunk-test-sparql/test/sparql/ConstructTests/Test10_22.py	(copia locale)
@@ -7,7 +7,6 @@
 from testSPARQL import ns_rdf
 from testSPARQL import ns_rdfs
-from testSPARQL import ns_dc
 from testSPARQL import ns_dc0
 from testSPARQL import ns_foaf
 from testSPARQL import ns_ns
@@ -16,9 +15,11 @@
 from testSPARQL import ns_person
 from rdflib.Literal     import Literal
+from rdflib import BNode
+from rdflib.sparql.sparql import PatternBNode
 from rdflib.sparql.sparqlOperators import lt, ge
 import datetime
-from rdflib.sparql import GraphPattern
+from rdflib.sparql.graphPattern import GraphPattern
 thresholdDate = datetime.date(2005,01,01)
 rdfData = """<?xml version="1.0" encoding="UTF-8"?>
@@ -42,7 +43,8 @@
 select      = []
 pattern     = GraphPattern([("?x",ns_foaf["givenname"],"?name"),("?x",ns_foaf["family_name"],"?fname")])
 optional    = []
-construct   = GraphPattern([("_:v1", ns_vcard["N"],"_:x"),("_:x",ns_vcard["givenName"],"?name"),("_:x",ns_vcard["familyName"],"?fname")])
+bnode = BNode("v") #PatternBNode("")
+construct   = GraphPattern([("?x", ns_vcard["N"],bnode),(bnode,ns_vcard["givenName"],"?name"),(bnode,ns_vcard["familyName"],"?fname")])
 tripleStore = None
Index: trunk-test-sparql/test/sparql/ConstructTests/Test10_23.py
===================================================================
--- trunk-test-sparql/test/sparql/ConstructTests/Test10_23.py	(revisione 866)
+++ trunk-test-sparql/test/sparql/ConstructTests/Test10_23.py	(copia locale)
@@ -7,7 +7,6 @@
 from testSPARQL import ns_rdf
 from testSPARQL import ns_rdfs
-from testSPARQL import ns_dc
 from testSPARQL import ns_dc0
 from testSPARQL import ns_foaf
 from testSPARQL import ns_ns
@@ -18,7 +17,7 @@
 from rdflib.Literal     import Literal
 from rdflib.sparql.sparqlOperators import lt, ge
 import datetime
-from rdflib.sparql import GraphPattern
+from rdflib.sparql.graphPattern import GraphPattern
 thresholdDate = datetime.date(2005,01,01)
 rdfData = """<?xml version="1.0" encoding="UTF-8"?>
Index: trunk-test-sparql/test/sparql/testSPARQL.py
===================================================================
--- trunk-test-sparql/test/sparql/testSPARQL.py	(revisione 866)
+++ trunk-test-sparql/test/sparql/testSPARQL.py	(copia locale)
@@ -9,16 +9,16 @@
 """
 import sys, os, time, datetime
-from rdflib.sparql import ns_rdf  as ns_rdf
-from rdflib.sparql import ns_rdfs as ns_rdfs
-from rdflib.sparql import ns_dc   as ns_dc
-from rdflib.sparql import ns_owl  as ns_owl
+from rdflib.constants   import RDFNS  as ns_rdf
+from rdflib.constants   import RDFSNS as ns_rdfs
+#from rdflib.sparql import ns_dc   as ns_dc
+#from rdflib.sparql import ns_owl  as ns_owl
-from rdflib.sparql import type_integer
-from rdflib.sparql import type_double
-from rdflib.sparql import type_float
-from rdflib.sparql import type_decimal
-from rdflib.sparql import type_dateTime
+from rdflib.sparql.sparql import type_integer
+from rdflib.sparql.sparql import type_double
+from rdflib.sparql.sparql import type_float
+from rdflib.sparql.sparql import type_decimal
+from rdflib.sparql.sparql import type_dateTime
 from rdflib.Namespace import Namespace

by Daniel Krech on Wednesday 01 November, 2006 regarding Namespace getattr related bug:

Not sure how we are going to unhack our way out of this one. Think we either need to loose the subclassing from URIRef or the getattr and getitem hacks. And both changes are going to break some code for people. I'll take a look at home much code changing Namespace to subclass from object will break in my bits -- I'm guessing that's the direction we'll need to go in.

by Daniel Krech on Wednesday 01 November, 2006 regarding Namespace getattr related bug:

Hum... I'm not sure how we can unhack Namespace. Maybe if we override __getattribute__ instead? 
See: http://docs.python.org/ref/new-style-attribute-access.html

by Chimezie Ogbuji on Saturday 10 June, 2006 regarding RDFLib:

see also: http://en.wikipedia.org/wiki/RDFLib

by Freek Dijkstra on Thursday 27 April, 2006 regarding Releases:

http://rdflib.net/latest/ also still points to 2.3.0 instead of 2.3.1. I can't leave a comment there. Perhaps someone is kind enough to fix it there as well.

by Freek Dijkstra on Thursday 27 April, 2006 regarding Releases:

            There are newer releases:
2.3.1 (2005-02-27) http://rdflib.net/2.3.1/
In addition, the RoadMap page mentions a 2.3.2 release, although there is no 2.3.2 webpage yet.

by inkel on Friday 24 March, 2006 regarding 2.3.0:

How about backward compatibility? I'm having this problem:
Traceback (most recent call last):
  File "C:\Documents and Settings\Inkel\Mis documentos\www\2006\03\21\topics.py", line 17, in topics2rdf
    g = rdflib.Graph(backend='Memory')
  File "C:\Python24\lib\site-packages\rdflib\Graph.py", line 648, in __init__
    super(BackwardCompatGraph, self).__init__(store=backend)
  File "C:\Python24\lib\site-packages\rdflib\Graph.py", line 456, in __init__
    assert self.store.context_aware, "ConjunctiveGraph must be backed by a context aware store."
AssertionError: ConjunctiveGraph must be backed by a context aware store.
But five minutes ago I was using RDFLib 2.2.1 and it worked fine. Any clue?

by David Harris on Monday 13 February, 2006 regarding 2.3.0:

The unit test appeared to run correctly although I did not have any of the persistance backends installed. When I ran example.py I got the following error:
   File "D:\bin\python\rdflib-2.3.0\example.py", line 34, in __main__
    store.save("foaf.rdf", format="pretty-xml")
AttributeError: 'BackwardCompatGraph' object has no attribute 'save'
Is this error due to something I need to install ?
I am running on Windows XP with Active State Python 2.4

by Duncan McGreggor on Thursday 12 January, 2006 regarding Trac installation set up for RDFLib:

I added some text and an example with MusicBrainz to the wiki tonight.

by Dorai Thodla on Monday 09 January, 2006 regarding What is the best way to log bugs?:

 I am using Python 2.4 and just installed rdflib 2.3.0. The example.py program when run, fails with the following errors:
--- printing raw triples ---
nEUcmnIk3 http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://xmlns.com/foaf/
0.1/Person
nEUcmnIk3 http://xmlns.com/foaf/0.1/name Donna Fales
nEUcmnIk3 http://xmlns.com/foaf/0.1/nick donna
--- printing mboxes ---
Traceback (most recent call last):
  File "example.py", line 34, in ?
    store.save("foaf.rdf", format="pretty-xml")
AttributeError: 'BackwardCompatGraph' object has no attribute 'save'

by tamer on Sunday 11 December, 2005 regarding Trac installation set up for RDFLib:

test

by Leo Simons on Tuesday 15 November, 2005 regarding What is the best way to log bugs?:

Index: rdflib-3.0-dev/rdflib/backends/Sleepycat.py
===================================================================
--- rdflib-3.0-dev/rdflib/backends/Sleepycat.py	(revision 482)
+++ rdflib-3.0-dev/rdflib/backends/Sleepycat.py	(working copy)
@@ -83,13 +83,17 @@
 	self.__syncing = False
     def _schedule_sync(self):
-        from threading import Timer
-        if self.__open and self.__pending_sync is None:
-            t = Timer(60.0, self.sync)
-            self.__pending_sync = t
-            t.setDaemon(True)
-            t.start()
-    
+	#
+	# Should be doing locking/thread syncing. This is broken.
+	#
+        #from threading import Timer
+        #if self.__open and self.__pending_sync is None:
+        #    t = Timer(60.0, self.sync)
+        #    self.__pending_sync = t
+        #    t.setDaemon(True)
+        #    t.start()
+	self.sync()
+
     def sync(self):
         if self.__open:
 	    self.__syncing = True
Index: rdflib-3.0-dev/rdflib/backends/MySQL.py
===================================================================
--- rdflib-3.0-dev/rdflib/backends/MySQL.py	(revision 482)
+++ rdflib-3.0-dev/rdflib/backends/MySQL.py	(working copy)
@@ -173,10 +173,13 @@
     predicate   = rtDict.get('predicate')
     objDatatype = rtDict.get('objDatatype')
+    try:
+        termComb=int(rtContext)
+    except:
+        termComb=0
     rdf_type_caveat = predicate == RDF.type and objDatatype
     if rdf_type_caveat:
         context=objDatatype
-        termComb=int(rtContext)
     else:
         context = rtContext and rtContext or hardCodedContext
@@ -938,7 +941,7 @@
             namespace)
         )
         rt = [rtDict['prefix'] for rtDict in c.fetchall()]
-        return rt and rt or None
+        return rt and rt[0] or None
     def namespace(self, prefix):
         """ """
@@ -948,7 +951,7 @@
             prefix)
         )
         rt = [rtDict['uri'] for rtDict in c.fetchall()]
-        return rt and rt or None
+        return rt and rt[0] or None
     def namespaces(self):
         """ """

by http://eikeon.com# on Monday 24 October, 2005 regarding Contributors:

We still need FOAF identifiers for:
Alford, Ron
Clark, Kendall
da Silva, Sidnei
Dawes, Phil
Eland, Andrew
Jones, David H
McVittie, Simon
Niederhauser, Stefan
Kuchling, Andrew
Pearson, Phillip
Pelletier, Michel
Torre, Lucio

by http://eikeon.com# on Monday 17 October, 2005 regarding What is the best way to log bugs?:

Creating a post or a comment for a bug is probably the best way of logging a bug for now. It'll put them on the record in a way people can monitor via the blog or comment feed. And will also let us comment on them. If it's a big bug perhaps it should get its own post and a small bug could be attacked to something like one of the release pages.
We're also hoping to implement a simple issue tracker in Redfoot soon. (blog like, but with a few issue tracking features)
Thank you for your question and bug report.

by zute on Monday 17 October, 2005 regarding What is the best way to log bugs?:

What is the best way of logging bugs.
Leave a comment here ?
In backends.IOMemory
Lines 93, 103 and 111
they all refer to 
index = sel.
when they should read 
index = self.
Rgds
Tim 

by Chimezie Ogbuji on Thursday 13 October, 2005 regarding http://rdflib.net/A Universal RDF Store Interface:

Since Formulae are distinguishable first class terms, are they automatically matched by the following triple pattern (rule antecendant):?
?formula rdf:type log:Formula

by Chimezie Ogbuji on Wednesday 28 September, 2005 regarding http://rdflib.net/4RDF / rdflib Merge:

The optimized interfaces (that 4RDF's Versa implementation relies heavily on for speed) may not map effiently to their rdflib.Graph counterparts since in every case, one of their parameters is a list, not a single item and would require calling the corresponding interface N times - where N is the length of the list. For example:
subjectsFromPredsAndObj([pred1,pred2,pred3],object)
would result in
subjects=[]
for pred in predicates:
  subjects.append(rdflib.Graph.subjects(pred,object))
return subjects
Once again, if the triple pattern resolver were used, it would (should) be able to optimize the following triple patterns (and solve for ?subj):
?subj pred1 object
?subj pred2 object
?subj pred3 object
Instead of relying on an explicit, and perhaps unoptimized dispatch to an interface directly.

by Tom Stambaugh on Wednesday 14 September, 2005 regarding unittests?:

Hey, that's totally cool. Thanks for the quick reply & response.

by http://eikeon.com# on Wednesday 14 September, 2005 regarding unittests?:

The release script recently got changed to use the distutils sdist command to create the .tar.gz and .zip file. And it was not set up correctly to package up all the files that the old way did. The missing files have been added to MANIFEST.in and the release script re-run for rdflib-2.2.2 (hope it's okay not to bump the version number since nothing changed other than the addition of the missing files).

by fdrake on Thursday 01 September, 2005 regarding zope.interface support:

I think you're looking for something like what we have in the 'zope.component' package.  I've posted a more general explanation in response to your post on the interface-dev mailing list:
http://mail.zope.org/pipermail/interface-dev/2005-August/000129.html

by Daniel Krech on Thursday 18 August, 2005 regarding Contributors:

TODO: ask developers for pointers to their FOAF

by Drew Perttula on Monday 15 August, 2005 regarding Blog:

I'm testing the new login. This comment should be associated with my foaf:person

by Drew on Monday 15 August, 2005 regarding Blog:

Here's one vote for more advanced n3/turtle parsing. I would like to get my project from librdf back to rdflib, but I am using librdf's turtle and sparql features. http://cvs.bigasterisk.com/viewcvs/room/midicodes.n3?rev=1.3&content-type=text/vnd.viewcvs-markup is my input file.