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.
Metadata
Release files for redis_triplestore 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| redis_triplestore-0.1.tar.gz | 2.5 kB | Without provenance | Details for redis_triplestore-0.1.tar.gz |
Release files / redis_triplestore-0.1.tar.gz
| Download URL | redis_triplestore-0.1.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d21b13ec11b63d08c02d44972322a569fbb6b2a927b3feec1831892579be7f63
|
|
BLAKE2b-256 checksum How to use checksums |
7e07f354463dbad3be02cd8a669e9af7a0876bc5939ec530e62926c27fd99062
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for redis_triplestore 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.