6 #ifndef TURI_UNITY_GL_SGRAPH_HPP 7 #define TURI_UNITY_GL_SGRAPH_HPP 13 #include <core/data/flexible_type/flexible_type.hpp> 14 #include <model_server/lib/sgraph_triple_apply_typedefs.hpp> 15 #include "gl_gframe.hpp" 22 class unity_sgraph_base;
219 const std::string& vid_field=
"__id",
220 const std::string& src_field=
"__src_id",
221 const std::string& dst_field=
"__dst_id");
228 explicit gl_sgraph(
const std::string& directory);
233 gl_sgraph(std::shared_ptr<unity_sgraph>);
234 gl_sgraph(std::shared_ptr<unity_sgraph_base>);
235 operator std::shared_ptr<unity_sgraph>()
const;
236 operator std::shared_ptr<unity_sgraph_base>()
const;
244 typedef std::pair<flexible_type, flexible_type> vid_pair;
312 const std::map<std::string, flexible_type>& fields=std::map<std::string, flexible_type>())
const;
374 const std::map<std::string, flexible_type>& fields=std::map<std::string, flexible_type>())
const;
397 std::map<std::string, flexible_type>
summary()
const;
616 const std::string& src_field,
617 const std::string& dst_field)
const;
959 const std::vector<std::string>& mutated_fields)
const;
964 void save(
const std::string& directory)
const;
1018 const std::vector<std::string>& newnames);
1056 const std::vector<std::string>& newnames);
1061 virtual std::shared_ptr<unity_sgraph>
get_proxy()
const;
1064 void instantiate_new();
1065 void instantiate_from_proxy(std::shared_ptr<unity_sgraph>);
1066 void _swap_vertex_fields(
const std::string& field1,
const std::string& field2);
1067 void _swap_edge_fields(
const std::string& field1,
const std::string& field2);
1070 std::shared_ptr<unity_sgraph> m_sgraph;
void rename_vertex_fields(const std::vector< std::string > &oldnames, const std::vector< std::string > &newnames)
void remove_vertex_field(const std::string &field)
std::vector< std::string > get_vertex_fields() const
gl_sgraph select_edge_fields(const std::vector< std::string > &fields) const
std::map< std::string, flexible_type > summary() const
void add_edge_field(gl_sarray column_data, const std::string &field)
std::vector< std::string > get_fields() const
gl_sgraph add_vertices(const gl_sframe &vertices, const std::string &vid_field) const
gl_sgraph select_vertex_fields(const std::vector< std::string > &fields) const
gl_sframe get_vertices(const std::vector< flexible_type > &ids=std::vector< flexible_type >(), const std::map< std::string, flexible_type > &fields=std::map< std::string, flexible_type >()) const
gl_sgraph select_fields(const std::vector< std::string > &fields) const
gl_sframe get_edges(const std::vector< vid_pair > &ids=std::vector< vid_pair >(), const std::map< std::string, flexible_type > &fields=std::map< std::string, flexible_type >()) const
void save_reference(const std::string &directory) const
gl_sgraph add_edges(const gl_sframe &edges, const std::string &src_field, const std::string &dst_field) const
std::vector< std::string > get_edge_fields() const
std::vector< flex_type_enum > get_vertex_field_types() const
size_t num_vertices() const
std::function< void(edge_triple &)> lambda_triple_apply_fn
gl_sgraph triple_apply(const lambda_triple_apply_fn &lambda, const std::vector< std::string > &mutated_fields) const
void add_vertex_field(gl_sarray column_data, const std::string &field)
virtual std::shared_ptr< unity_sgraph > get_proxy() const
std::vector< flex_type_enum > get_edge_field_types() const
void rename_edge_fields(const std::vector< std::string > &oldnames, const std::vector< std::string > &newnames)
void save(const std::string &directory) const
void remove_edge_field(const std::string &field)