This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description

redis_triplestore

Implements a triplestore using Redis to store relations, in Python.

Requires Redis 2.0+, newest version of redis-py and redis_wrap.

redis-py can be downloaded from here: * http://github.com/andymccurdy/redis-py

Note that you can use the requirements.txt file to install dependencies with pip.

Examples

Atribution:

FOAF = Namespace('http://xmlns.com/foaf/0.1/')

frodo = Resource('http://example.com/comte/frodo', **{
    FOAF.name: 'Frodo',
    FOAF.familyName: 'Baggins',
})
assert frodo[FOAF.name] == 'Frodo'

Persistence:

frodo = Resource('http://example.com/comte/frodo')
assert frodo[FOAF.name] == 'Frodo'

gandalf = Resource('http://example.com/wizards/gandalf', **{
    FOAF.name: 'Gandalf',
    FOAF.familyName: 'the White',
})
saruman = Resource('http://example.com/wizards/saruman', **{
    FOAF.name: 'Saruman',
    FOAF.familyName: 'of Many Colors',
})

Relations:

frodo.add_relation(FOAF.knows, gandalf)
assert frodo.relations(FOAF.knows) == [gandalf]
gandalf.add_relation(FOAF.knows, saruman)
assert gandalf.relations(FOAF.knows) == [saruman]
assert gandalf.reversed_relations(FOAF.knows) == [frodo]
frodo.add_relation(FOAF.knows, saruman)
assert frodo.relations(FOAF.knows) == [gandalf, saruman]

Clean up:

frodo.delete_relation(FOAF.knows, saruman)
assert frodo.relations(FOAF.knows) == [gandalf]
frodo.delete_relation(FOAF.knows, gandalf)
gandalf.delete_relation(FOAF.knows, saruman)
assert gandalf.relations(FOAF.knows) == []
assert gandalf.reversed_relations(FOAF.knows) == []
frodo.remove()
gandalf.remove()
saruman.remove()
assert frodo[FOAF.name] == None

Copyright: 2010 by David Larlet License: BSD.

Release History

Release History

0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
redis_triplestore-0.1.tar.gz (2.5 kB) Copy SHA256 Checksum SHA256 Source Dec 2, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting