ws-mtdb.py - a bare bones HTTP interface to the machine tag database (mtbd) ------------------------------------------------------------------------ EXAMPLE ------------------------------------------------------------------------ http://127.0.0.1:9991/?method=mt.document.search_by_range&value=19,45 http://www.flickr.com/photos/bopuc http://www.flickr.com/photos/bar ------------------------------------------------------------------------ GET METHODS ------------------------------------------------------------------------ mt.namespaces.list ------------------------------------------------------------------------ * predicate (optional) An optional string representing a predicate used to filter the query. For example, all the values where the predicate is 'title'. * value (optional) An optional string representing a value used to filter the query. For example, all the predicates where the value is 'barcelona'. Returns a list of document URIs mt.predicates.list ------------------------------------------------------------------------ * namespace (optional) An optional string representing a namespace used to filter the query. For example, all the predicates where the namespace is 'dc'. * value (optional) An optional string representing a value used to filter the query. For example, all the predicates where the value is 'barcelona'. Returns a list of document URIs mt.values.list ------------------------------------------------------------------------ * namespace (optional) An optional string representing a namespace used to filter the query. For example, all the values where the namespace is 'dc'. * predicate (optional) An optional string representing a predicate used to filter the query. For example, all the values where the predicate is 'title'. Returns a list of document URIs mt.documents.search ------------------------------------------------------------------------ * namespace (optional) An optional string representing a namespace used to filter the query. For example, all the documents where the namespace is 'dc'. * namespace (optional) An optional string representing a predicate used to filter the query. For example, all the documents where the predicate is 'title'. * value (optional) An optional string representing a value used to filter the query. For example, all the documents where the value is 'barcelona'. Returns a list of document URIs mt.documents.search_by_range ------------------------------------------------------------------------ * value (required) A comma-separated list of two values to use as range constraints against the value of the machine tags associated with a document * namespace (optional) An optional string representing a namespace used to filter the query. For example, all the documents where the namespace is 'dc'. * namespace (optional) An optional string representing a predicate used to filter the query. For example, all the documents where the predicate is 'title'. Returns a list of document URIs mt.document.tags ------------------------------------------------------------------------ * uri (required) The URI of the document you want to list machine tags for Returns a list of machine tags ------------------------------------------------------------------------ POST METHODS ------------------------------------------------------------------------ mt.document.add ------------------------------------------------------------------------ * uri (required) A URI for the document you want to add to the machinetag database * tags (required) A comma-separated list of machine tags to associate with the document URI Returns OK on success mt.document.remove ------------------------------------------------------------------------ * uri (required) The URI of the document you want to remove from the machinetag database Returns OK on success ------------------------------------------------------------------------ ADDITIONAL PARAMETERS ------------------------------------------------------------------------ * format (optional) Valid options are 'xml' and 'json'. Set this value to indicate the format you would like to receive API responses in. The default format is 'xml' ------------------------------------------------------------------------ ERRORS ------------------------------------------------------------------------ Errors are returned with the HTTP status code 500. Specific error codes and messages are returned both in the message body as XML and in the 'X-ErrorCode' and 'X-ErrorMessage' headers. ------------------------------------------------------------------------ QUESTIONS ------------------------------------------------------------------------ Is it fast? Not really. It is designed, primarily, to be run on the same machine that is calling the interface. Will it ever be fast? Sure. It is on The List (tm) to create a mod_python and/or wsgi version. Patches are welcome. Will it denormalize URLs? No. Why do you hate freedom? Or at least me? Can I get a pony? No. How about a machine pony? Go away. ------------------------------------------------------------------------ LICENSE ------------------------------------------------------------------------ Copyright (c) 2007 Aaron Straup Cope. All Rights Reserved. This is free software. You may redistribute it and/or modify it under the same terms the Perl Artistic License.