This is a simple object tagger interface that provides relational support for tagging objects (identified
by string IDs) with arbitrary string tags.
METHODS
$tagger = Bio::DB::Tagger->new(@args)
Constructor for the tagger class. Arguments are:
-dsn <dsn> A DBI data source, possibly including host and
password information
-create <0|1> If true, then database will be initialized with a
new schema. Database must already exist.
The dsn can be a preopened database handle or a dbi: data source string.
@objects = $tagger->search_tag($tag [,$value])
$object_arrayref = $tagger->search_tag($tag [,$value])
Return all object names and keys that are tagged with "$tag", optionally qualified by tag value
$value.
$boolean = $tagger->has_tag($object,$tag [,$value])
Returns true if indicated object has the indicated tag, or the indicated combination of tag and
value.
@tags = $tagger->get_tag($object,$tag)
Returns all the tags of type $tag.
$tags = $tagger->tags()
@tags = $tagger->tags()
Return a list of all tags in the database. In a list context, returns the list of tags. In an array
context, returns an array ref.
$iterator = $tagger->tag_match('prefix')
Returns an iterator that matches all tags beginning with 'prefix' (case insensitive). Call
$iterator->next_tag() to get the next match.
$iterator = $tagger->tag_match('prefix')
Returns an iterator that matches all tags beginning with 'prefix' (case insensitive). Call
$iterator->next_tag() to get the next match.
$tags = $tagger->tag_counts()
@tags = $tagger->tag_counts()
Return a set of Bio::DB::Tagger::Tag objects representing all known tags. The tag values correspond
to the number of times that tag has been used to tag objects.
$result = $tagger->add_tag(@args);
Add a tag to the database. The following forms are accepted:
$tagger->add_tag($object_name=>$tag);
Add a Bio::DB::Tagger::Tag to the object named "$object_name".
$tagger->add_tag(-object => $object_name,
-tag => $tag);
The same as above using -option syntax.
$tagger->add_tag(-object => $object_name,
-tag => $tagname,
-value => $tagvalue,
-author => $authorname);
Generate the tag from the options provided in -tag, -value (optional) and -author (optional), and
then add the tag to the object.
Returns true on success.
$result = $tagger->set_tags(@args);
Set the tags of an object, replacing all previous tags.
Arguments: -object Name of the object to tag.
-tags List of Bio::DB::Tagger::Tag objects
Returns true on success.
$result = $tagger->set_tag(@args);
Set a tag, replacing all previous tags of the same name.
Arguments: -object Name of the object to tag.
-tag A Bio::DB::Tagger::Tag object, or tag name
Returns true on success.
$result = $tagger->clear_tags($objectname);
Clear all tags from the indicated object. Returns true if the operation was successful.
$result = $tagger->delete_tag($objectname,$tagname [,$tagvalue]);
Clear the one tag from the indicated object, filtering by tagname, optionally by value.
$result = $tagger->nuke_object($objectname);
Removes the object named $objectname. Returns true if the operation was successful.
$result = $tagger->nuke_author($authorname);
Removes the author named $authorname. Returns true if the operation was successful.
$result = $tagger->nuke_tag($tagname);
Removes the tag named $tagname. Returns true if the operation was successful.
@tags = $tagger->get_tags($object_name [,$author])
Return all tags assigned to the indicated object, optionally filtering by the author.
$oid = $tagger->object_to_id($objectname [,$create] [,$key])
Fetch the object id (oid) of the object named "$objectname". If the object doesn't exist, and $create
is true, will create a new entry for the object in the database.
$tid = $tagger->tag_to_id($tagname [,$create])
Fetch the tag id (tid) of the object named "$tagname". If the tag doesn't exist, and $create is true,
will create a new entry for the tag in the database.
$aid = $tagger->author_to_id($authorname [,$create])
Fetch the author id (aid) of the object named "$authorname". If the tag doesn't exist, and $create is
true, will create a new entry for the author in the database.
$dbh = $tagger->dbh
Return underlying DBI handle.
$tagger->initialize
Initialize the database with a fresh schema.