NAME
Jubatus::Graph::Types - Perl extension for treating a data structure to use interface of graph mining server 'jubagraph'
SYNOPSIS
use Jubatus::Graph::Types;
# If you want to any Jubatus::Graph::* packages,
# all one need to do is write "use Jubatus::Graph::Types;"
DESCRIPTION
This module provide the constructors and the methods to use interface of recommendation server 'jubagraph'.
METHODS
Jubatus::Graph::Types will provide many packages and constructors, methods. These are used in Jubatus::Graph::Clients.
See Jubatus::Graph::Client for more detail.
Packages
Jubatus::Graph::Datum
If you want to use this package, all one need to do is write "use Jubatus::Graph::Types;"
Constructors
Jubatus::Graph::Datum->new($string_values, $num_values);
Input:
- $string_values is a array reference which are allowed to locate many array
references. Each of located arrry references should have two string
value which are called "key" and "value".
- $num_values is a array reference which are allowed to locate many array
references. Each of located arrry references should have two values.
First string value which are called "key" and second float value which
are called "value".
Output:
- Jubatus::Graph::Datum object.
This object have two fields.
'string_values' field locate the array reference which was inputed as
$string_values in constructor.
'num_values' field locate the array reference which was inputed as
$num_values in constructor.
Functions
to_msgpack->()
Input:
- None
Output:
- A array reference
This array reference locate $string_values and $num_values which are given
in constructor.
This array reference certainly locate two array references. First
reference are allowed to locate many array references. Each of located
arrry references should have two string value which are called "key"
and "value". Second reference are allowed to locate many array references.
Each of located arrry references should have two values. First string
value which are called "key" and second float value which are called
"value".
from_msgpack->($return_value_from_msgpack)
Input:
- $return_value_from_msgpack is a array reference.
This array reference certainly locate two array references. First
reference are allowed to locate many array references. Each of located
arrry references should have two string value which are called "key"
and "value". Second reference are allowed to locate many array references.
Each of located arrry references should have two values. First string
value which are called "key" and second float value which are called
"value".
Output:
- Jubatus::Graph::Datum object.
Jubatus::Graph::Node
If you want to use this package, all one need to do is write "use Jubatus::Graph::Types;"
Constructors
Jubatus::Graph::Node->new($property, $in_edges, $out_edges);
Input: - $property is a hash reference which are allowed to contain many "key-value" pairs. This property hash reference is used in a query match process of get_shotest_path() and get_centrality().
In the query match process, $property needs to contain all key-value pair
of a search query.
$property is allowed to Nothing be included. You can use {};
- $in_edges is a array reference of the ids of the incoming edge.
Each ids are id of edge which can get when you create the edge.
Therefore you should record the all of ids of edges when you create.
- $out_edges is a array reference of the ids of the incoming edge.
Each ids are id of edge which can get when you create the edge.
Therefore you should record the all of ids of edges when you create.
Output:
- Jubatus::Graph::Node object.
This object have three fields.
'property' field locate the hash reference which was inputed as
$property in constructor.
'in_edges' field locate the array reference which was inputed as
$in_edges in constructor.
'out_edges' field locate the array reference which was inputed as
$out_edges in constructor.
Functions
from_msgpack->($return_value_from_msgpack)
Input:
- $return_value_from_msgpack is three reference.
First reference is locate the hash reference which may be include some
"key-value" pairs which are used as a "property" in a query match
process.
Second reference is locate the array reference which maybe include some
ids of edges which are "incomming edge ids".
Third reference is locate the array reference which maybe include some
ids of edges which are "outgoing edge ids".
Output:
- Jubatus::Graph::Node object.
to_msgpack->()
Input:
- None
Output:
- A array reference
This array reference locate $property and $in_edges, $out_edges which
are given in constructor.
Jubatus::Graph::PresetQuery;
If you want to use this package, all one need to do is write "use Jubatus::Graph::Types;"
Constructors
Jubatus::Graph::PresetQuery->new($edge_query, $node_query);
Input:
- $edge_query is a array reference which are allowed to locate many array
references. Each of located arrry references should have two string
value which are called "key" and "value". These pairs are used in a query
match process of get_shotest_path() and get_centrality(). If you set
$edge_query, you can get a result include the edges which have a property
field which includes all key-value pairs of $edge_query.
- $node_query is a array reference which are allowed to locate many array
references. Each of located arrry references should have two string
value which are called "key" and "value". These pairs are used in a query
match process of get_shotest_path() and get_centrality(). If you set
$node_query, you can get a result include the nodes which have a property
field which includes all key-value pairs of $node_query.
Output:
- Jubatus::Graph::PresetQuery object.
This object have two fields.
'edge_query' field locate the array reference which was inputed as
$edge_query in constructor.
'node_query' field locate the array reference which was inputed as
$node_query in constructor.
Functions
from_msgpack->($return_value_from_msgpack)
Input:
- $return_value_from_msgpack is a array reference.
This array reference certainly locate two array reference. Each
references are used to call constructor of Jubatus::Graph::PresetQuery.
Output:
- Jubatus::Graph::PresetQuery object
to_msgpack->()
Input:
- None
Output:
- A araay reference
This array reference locate $edge_query and $node_query which are given
in constructor.
Jubatus::Graph::Edge;
If you want to use this package, all one need to do is write "use Jubatus::Graph::Types;"
Constructors
Jubatus::Graph::Edge->new($property, $source, $target);
Input:
- $property is a hash reference which are allowed to contain many
"key-value" pairs. This property hash reference is used in a query
match process of get_shotest_path() and get_centrality().
In the query match process, $property needs to contain all key-value pair
of a search query.
$property is allowed to Nothing be included. You can use {};
- $source is a id of node to create out going edge. When you create the node,
you can receive the node id. Therefore you should record the all of ids of
the node when you create.
- $target is a id of node to create in coming edge. When you create the node,
you can receive the node id. Therefore you should record the all of ids of
the node when you create.
Output:
- Jubatus::Graph::Edge object.
This object have three fields.
'property' field locate the hash reference which was inputed as $property
in constructor.
'source' field locate the array reference which was inputed as $source in
constructor.
'target' field locate the array reference which was inputed as $target in
constructor.
Functions
from_msgpack->($return_value_from_msgpack)
Input:
- $return_value_from_msgpack is a array reference.
First reference is locate the hash reference which may be include some
"key-value" pairs which are used as a "property" in a query match
process.
Second reference is locate the string value which is id of a node which
have outgoing edge.
Third reference is locate the string value which is id of a node which
have outgoing edge.
Output:
- Jubatus::Graph::Edge object.
to_msgpack->()
Input:
- None
Output:
- A array reference
This array reference locate $property and $source, $target which are
given in constructor.
Jubatus::Graph::ShortestPathQuery;
If you want to use this package, all one need to do is write "use Jubatus::Graph::Types;"
Constructors
Jubatus::Graph::ShortestPathQuery->new($source, $target, $max_hop, $query);
Input:
- $source is string value of a id of node which is a start point of the
shortest path which you want.
- $target is string value of a id of node which is a end point of the
shortest path which you want.
- $max_hop is int value of the max number of the nodes. This number
restrains result of mining by jubagraph.
- $query is reference of Jubatus::Graph::PresetQuery object.
Output:
- Jubatus::Graph::ShortestPathQuery object.
This object have four fields.
'source' field locate the string value of a id of node which was inputed
as $source in the constructor.
'target' field locate the string value of a id of node which was inputed
as $target in the constructor.
'max_hop' field locate the int value of a id of node which was inputed
as $max_hop in the constructor.
'query' field locate the Jubatus::Graph::PresetQuery object which was
inputed as $query in the constructor.
Functions
from_msgpack->($return_value_from_msgpack)
Input:
- $return_value_from_msgpack is a array reference.
First reference is locate the string value which is id of a node which
is a start point node.
Second reference is locate the string value which is id of a node which
is a end point node.
Third reference is locate int value which is max number of nodes. This
number restrains result of mining by jubagraph.
Output:
- Jubatus::Graph::ShortestPathQuery object.
to_msgpack->()
Input:
- None
Output:
- A array reference
This array reference locate $source and $target, $max_hop, $query which
are given in constructor.
SEE ALSO
http://jubat.us/ https://github.com/jubatus
AnyEvent::MPRPC AnyEvent::MPRPC::Client http://msgpack.org/ http://wiki.msgpack.org/display/MSGPACK/RPC+specification
https://github.com/overlast/p5-Jubatus
LICENSE
Copyright (C) 2013 by Toshinori Sato (@overlast).
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The licence of Jubatus is LGPL 2.1.
Jubatus: Online machine learning framework for distributed environment
Copyright (C) 2011,2012 Preferred Infrastructure and Nippon Telegraph and Telephone Corporation.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.
However Jubatus.pm and Jubatus::*.pm is the pure Perl modules. Therefor the licence of Jubatus.pm and Jubatus::*.pm is the Perl's licence.
AUTHOR
Toshinori Sato (@overlast) <overlasting@gmail.com>