25 #include <unordered_map>
28 #include "result/result.hpp"
30 #include "graphar/macros.h"
31 #include "graphar/status.h"
65 using Result = cpp::result<T, Status>;
72 using IdType = int64_t;
75 enum Cardinality : int32_t { SINGLE, LIST, SET };
77 enum FileType : int32_t { CSV = 0, PARQUET = 1, ORC = 2, JSON = 3 };
78 enum SelectType : int32_t { PROPERTIES = 0, LABELS = 1 };
80 enum GetChunkVersion : int32_t { AUTO = 0, V1 = 1, V2 = 2 };
81 enum class AdjListType : int32_t;
97 using PropertyGroupVector = std::vector<std::shared_ptr<PropertyGroup>>;
98 using AdjacentListVector = std::vector<std::shared_ptr<AdjacentList>>;
99 using VertexInfoVector = std::vector<std::shared_ptr<VertexInfo>>;
100 using EdgeInfoVector = std::vector<std::shared_ptr<EdgeInfo>>;
111 std::shared_ptr<PropertyGroup> CreatePropertyGroup(
112 const std::vector<Property>& properties, FileType file_type,
113 const std::string& prefix = "");
124 std::shared_ptr<AdjacentList> CreateAdjacentList(
125 AdjListType type, FileType file_type, const std::string& prefix = "");
139 std::shared_ptr<VertexInfo> CreateVertexInfo(
140 const std::string& type, IdType chunk_size,
141 const PropertyGroupVector& property_groups,
142 const std::vector<std::string>& labels = {}, const std::string& prefix = "",
143 std::shared_ptr<const InfoVersion> version = nullptr);
162 std::shared_ptr<EdgeInfo> CreateEdgeInfo(
163 const std::string& src_type, const std::string& edge_type,
164 const std::string& dst_type, IdType chunk_size, IdType src_chunk_size,
165 IdType dst_chunk_size, bool directed,
166 const AdjacentListVector& adjacent_lists,
167 const PropertyGroupVector& property_groups, const std::string& prefix = "",
168 std::shared_ptr<const InfoVersion> version = nullptr);
183 std::shared_ptr<GraphInfo> CreateGraphInfo(
184 const std::string& name, const VertexInfoVector& vertex_infos,
185 const EdgeInfoVector& edge_infos, const std::vector<std::string>& labels,
186 const std::string& prefix,
187 std::shared_ptr<const InfoVersion> version = nullptr,
188 const std::unordered_map<std::string, std::string>& extra_info = {});
191 const std::shared_ptr<DataType>& boolean();
193 const std::shared_ptr<DataType>& int32();
195 const std::shared_ptr<DataType>& int64();
197 const std::shared_ptr<DataType>& float32();
199 const std::shared_ptr<DataType>& float64();
201 const std::shared_ptr<DataType>& string();
203 const std::shared_ptr<DataType>& date();
205 const std::shared_ptr<DataType>& timestamp();
211 std::shared_ptr<DataType> list(const std::shared_ptr<DataType>& value_type);
214 namespace graphar::util {
215 struct FilterOptions;
216 using Filter = std::shared_ptr<Expression>;
218 std::optional<std::reference_wrapper<std::vector<std::string>>>;