Beispiel #1
0
    def populate(self):
        SleepycatMetadataCache.populate(self)

        data = u('\n').join(item.rdf() for item in self.sample_data_factory())

        self.graph.open(self.cache_uri, create=True)
        with closing(self.graph):
            self.graph.parse(data=data, format=self.data_format)
Beispiel #2
0
    def populate(self):
        SleepycatMetadataCache.populate(self)

        data = '\n'.join(item.rdf() for item in self.sample_data_factory())

        self.graph.open(self.cache_uri, create=True)
        with closing(self.graph):
            self.graph.parse(data=data, format=self.data_format)
#from gutenberg.acquire import get_metadata_cache

from gutenberg.acquire.metadata import SleepycatMetadataCache

#from gutenberg.acquire import set_metadata_cache
#from gutenberg.acquire.metadata import SqliteMetadataCache
#cache = SqliteMetadataCache('/my/custom/location/cache.sqlite')
#cache.populate()
#set_metadata_cache(cache)

if __name__ == '__main__':
    #cache = get_metadata_cache()local/code/doctable/examples/gutenberg
    cache = SleepycatMetadataCache(
        'gutenberg_python_package_db/guten_cache_bak.db')
    cache.populate()
    set_metadata_cache(cache)