Net::FluidDB::Object - FluidDB objects
use Net::FluidDB::Object; # create, with optional about $object = Net::FluidDB::Object->new( fdb => $fdb, about => $unique_about ); $object->create; $object->id; # returns the object's ID in FluidDB # get by ID, optionally fetching about $object = Net::FluidDB::Object->get($fdb, $object_id, about => 1); # search @ids = Net::FluidDB::Object->search($fdb, "has fxn/rating");
Net::FluidDB::Object models FluidDB objects.
Net::FluidDB::Object is a subclass of Net::FluidDB::Base.
Net::FluidDB::Object
Constructs a new object. The constructor accepts these parameters:
An instance of Net::FluidDB.
A string, if any.
This constructor is only useful for creating new objects in FluidDB. Already existing objects are fetched with get.
get
Retrieves the object with ID $id from FluidDB. Options are:
$id
Tells get whether you want to get the about attribute of the object.
If about is not fetched has_about will be false even if the object has an about attribute in FluidDB.
has_about
Performs the query $query and returns a (possibly empty) array of strings with the IDs of the macthing objects.
$query
Creates the object in FluidDB.
Returns the UUID of the object, or undef if it is new.
undef
Predicate to test whether the object has an ID.
Gets/sets the about attribute. About can't be modified in existing objects, the setter is only useful for new objects.
Note that you need to set the about flag when you fetch an object for this attribute to be initialized.
about
Says whether the object has an about attribute.
Returns the paths of the existing tags on the object as a (possibly empty) arrayref of strings.
This interface is subject to revision.
Tags an object. You can pass either a Tag instance or a tag path in the first argument. By now $value must be any of the primitive FluidDB types integer, float, string, or set of strings (represented as arrayref of strings). But this could change.
Tag
$value
Please ensure the type of the scalar matches the FluidDB type. Either numify
$object->tag($tag_or_tag_path, $value + 0);
or stringify:
$object->tag($tag_or_tag_path, "$value");
as needed.
Gets the value of a tag on an object. You can refer to it either with a Tag object or a tag path. By now it returns a scalar of any of the primitive FluidDB types integer, float, string, or set of strings (represented as arrayref of strings). But this could change.
http://doc.fluidinfo.com/fluidDB/objects.html
http://doc.fluidinfo.com/fluidDB/api/objects.html
http://api.fluidinfo.com/fluidDB/api/*/objects/*
Xavier Noria (FXN), <fxn@cpan.org>
Copyright (C) 2009 Xavier Noria
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Net::FluidDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::FluidDB
CPAN shell
perl -MCPAN -e shell install Net::FluidDB
For more information on module installation, please visit the detailed CPAN module installation guide.