Help on module mtdb: NAME mtdb FILE mtdb/mtdb/__init__.py CLASSES mtdb class mtdb | Class used to instantiate a machine tag database | | Methods defined here: | | mtdb(self, dbconn, ctx=0) | dbconn is an active database connection conforming to PEP 249 (The | Python Database API Specification v2.0) | | (I say that but as of version 0.1 this package has only been tested with | sqlite3. Specifically hooks to trap "integrity errors" for other RDBMS | systems are missing. Patches are not only welcomed but encouraged.) | | ctx is an optional integer representing the 'context' that a machine tag | is stored with. Context is left up to individual applications to define. | For example, a context could be a userid or a privacy indicator (friends, | family, etc.) | | If defined, it is applied to all queries. By default it is left empty. | | add_document(self, uri, tags) | Associate a document URI with a list of machine tags | | add_tag(self, uri, tag) | Associate a document URI with a single machine tag | | find_documents(self, ns=None, pred=None, value=None) | Returns a list of document URIs matching at least one part of a machine | tag triple. | | ns is an optional string representing a namespace used to filter | the query. For example, all the documents where the namespace is | 'dc'. | | pred is an optional string representing a predicate used to filter | the query. For example, all the documents where the namespace is | 'dc' and the predicate is 'subject'. | | value is an optional string representing a value used to filter | the query. For example, all the documents where the namespace is | 'dc' and the predicate is 'subject' and the the value is 'ponies'. | | find_documents_by_like(self, like, ns=None, pred=None) | Returns a list of document URIs whose string value matches a given | string. | | like is a string used to filter the query. For example, all the documents | where the value starts with 'str' | | ns is an optional string representing a namespace used to filter | the query. For example, all the documents where the value starts with | 'str' and the namespace is 'dc'. | | pred is an optional string representing a predicate used to filter | the query. For example, all the documents where the value starts with | 'str' and the predicate is 'user'. | | find_documents_by_range(self, range, ns=None, pred=None) | Returns a list of document URIs whose numeric value is between a specific | range. | | value is a list containing two numeric values used to filter the | query. For example, all the documents where the value is between | 18 and 14. | | ns is an optional string representing a namespace used to filter | the query. For example, all the documents where the value is between | 18 and 14 and the namespace is 'person'. | | pred is an optional string representing a predicate used to filter | the query. For example, all the documents where the value is between | 18 and 14 and the namespace is 'person' and the predicate is 'age'.. | | find_namespaces(self, pred=None, value=None) | Return a list containing distinct namespaces in the mtdb. | | pred is an optional string representing a predicate used to filter | the query. For example, all the namespaces where the predicate is | 'title'. | | value is an optional string representing a value used to filter | the query. For example, all the namespaces where the predicate is | 'title' and the value is 'OH HAI'. | | find_predicates(self, ns=None, value=None) | Return a list containing all the distinct predicates in the mtdb. | | ns is an optional string representing a namespace used to filter | the query. For example, all the predicates where the namespace is | 'dc'. | | value is an optional string representing a value used to filter | the query. For example, all the predicates where the namespace is | 'flickr' and the value is 'bike'. | | find_tags(self, uri) | Return a list of machine tags for a given URI. | | find_values(self, ns=None, pred=None) | Return a list containing all the distinct values in the mtdb. | | ns is an optional string representing a namespace used to filter | the query. For example, all the values where the namespace is | 'dc'. | | pred is an optional string representing a predicate used to filter | the query. For example, all the values where the namespace is | 'flickr' and the predicate is 'user'. | | remove_document(self, uri) | Remove all instances of a document URI from the machine tag store | | Note : As of version 0.1 neither the document URI or the individual | parts of a machine tag are removed from the 'documentstore' or the | 'tagstore', respectively. Only the association between a given URI | and a machine tag (and its application context) are removed. | | remove_tag(self, uri, ns=None, pred=None, value=None) | Remove a machinetag from a document URI | | ns is an optional string representing a namespace with which to | remove tags. For example, remove all tags whose namespace is 'dc'. | | pred is an optional string representing a predicate with which to | remove tags. For example, remove all tags whose namespace is 'dc' | and whose predicate is 'date'. | | value is an optional string representing a predicate with which to | remove tags. For example, remove all tags whose value is 'poop'. | | Note : As of version 0.1 neither the document URI or the individual | parts of a machine tag are removed from the 'documentstore' or the | 'tagstore', respectively. Only the association between a given URI | and a machine tag (and its application context) are removed. DATA __author__ = 'Aaron Straup Cope' __copyright__ = 'Copyright (c) 2007 Aaron Straup Cope. Perl Artistic L... __cvsversion__ = '$Revision: 1.19 $' __date__ = '$Date: 2007/09/01 06:28:48 $' __package__ = 'mtdb' __url__ = 'http://www.aaronland.info/python/mtdb/' __version__ = '0.1' VERSION 0.1 DATE $Date: 2007/09/01 06:28:48 $ AUTHOR Aaron Straup Cope