-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
513 lines (478 loc) · 32.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
<!doctype html>
<html class="no-js" lang="en">
<head><meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="color-scheme" content="light dark"><meta property="og:title" content="GraphAr" />
<meta property="og:type" content="website" />
<meta property="og:url" content="index.html" />
<meta property="og:site_name" content="GraphAr" />
<meta property="og:description" content="GraphAr CI GraphAr Docs GraphAr is an open source, standard data file format with C++ SDK and Spark tools for graph data storage and retrieval. The GraphAr project includes such modules as: The des..." />
<meta name="description" content="GraphAr CI GraphAr Docs GraphAr is an open source, standard data file format with C++ SDK and Spark tools for graph data storage and retrieval. The GraphAr project includes such modules as: The des..." />
<link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Overview" href="user-guide/overview.html" />
<meta name="generator" content="sphinx-5.3.0, furo 2022.09.29"/>
<title>GraphAr</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo.css?digest=d81277517bee4d6b0349d71bb2661d4890b5617c" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css" />
<link rel="stylesheet" type="text/css" href="_static/panels-bootstrap.5fd3999ee7762ccc51105388f4a9d115.css" />
<link rel="stylesheet" type="text/css" href="_static/panels-variables.06eb56fa6e07937060861dad626602ad.css" />
<link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
<link rel="stylesheet" type="text/css" href="_static/css/brands.min.css" />
<link rel="stylesheet" type="text/css" href="_static/css/v4-shims.min.css" />
<link rel="stylesheet" type="text/css" href="_static/css/custom.css" />
<link rel="stylesheet" type="text/css" href="_static/css/panels.css" />
<style>
body {
--color-code-background: #f8f8f8;
--color-code-foreground: black;
}
@media not print {
body[data-theme="dark"] {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #202020;
--color-code-foreground: #d0d0d0;
}
}
}
</style></head>
<body>
<script>
document.body.dataset.theme = "light";
</script>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-toc" viewBox="0 0 24 24">
<title>Contents</title>
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24">
<title>Light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24">
<title>Dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
</svg>
</symbol>
<symbol id="svg-sun-half" viewBox="0 0 24 24">
<title>Auto light/dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r="9" />
<path d="M13 12h5" />
<path d="M13 15h4" />
<path d="M13 18h1" />
<path d="M13 9h4" />
<path d="M13 6h1" />
</svg>
</symbol>
</svg>
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
<label class="overlay sidebar-overlay" for="__navigation">
<div class="visually-hidden">Hide navigation sidebar</div>
</label>
<label class="overlay toc-overlay" for="__toc">
<div class="visually-hidden">Hide table of contents sidebar</div>
</label>
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<div class="visually-hidden">Toggle site navigation sidebar</div>
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
</label>
</div>
<div class="header-center">
<a href="#"><div class="brand">GraphAr</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
<div class="sidebar-sticky"><a class="sidebar-brand" href="#">
<span class="sidebar-brand-text">GraphAr</span>
</a><form class="sidebar-search-container" method="get" action="search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
<p class="caption" role="heading"><span class="caption-text">User Guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="user-guide/overview.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="user-guide/getting-started.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="user-guide/file-format.html">GraphAr File Format</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Application Cases</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="applications/out-of-core.html">Out-of-core Graph Algorithms</a></li>
<li class="toctree-l1"><a class="reference internal" href="applications/bgl.html">Co-Work with BGL</a></li>
<li class="toctree-l1"><a class="reference internal" href="applications/graphscope.html">Integrate into GraphScope</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Contribution Guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="user-guide/contributing.html">Contributing to GraphAr</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">API Reference</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="api-reference.html">API Reference</a></li>
</ul>
</div>
</div>
</div>
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<a href="#" class="back-to-top muted-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
</svg>
<span>Back to top</span>
</a>
<div class="content-icon-container">
<div class="edit-this-page">
<a class="muted-link" href="https://github.com/GraphScope/gsf/edit/main/docs/index.rst" title="Edit this page">
<svg aria-hidden="true" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M4 20h4l10.5 -10.5a1.5 1.5 0 0 0 -4 -4l-10.5 10.5v4" />
<line x1="13.5" y1="6.5" x2="17.5" y2="10.5" />
</svg>
<span class="visually-hidden">Edit this page</span>
</a>
</div><div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
<article role="main">
<div class="section" id="graphar">
<h1>GraphAr<a class="headerlink" href="#graphar" title="Permalink to this heading">#</a></h1>
<p><a class="reference external" href="https://github.com/alibaba/GraphAr/actions"><img alt="GraphAr CI" src="https://github.com/alibaba/GraphAr/actions/workflows/ci.yml/badge.svg" /></a> <a class="reference external" href="https://alibaba.github.io/GraphAr/"><img alt="GraphAr Docs" src="https://img.shields.io/badge/docs-latest-brightgreen.svg" /></a></p>
<p>GraphAr is an open source, standard data file format with C++ SDK and Spark tools for graph data storage and retrieval.</p>
<p>The GraphAr project includes such modules as:</p>
<ul class="simple">
<li><p>The design of the standardized file format (GAR) for graph data.</p></li>
<li><p>A C++ Library for reading and writing GAR files.</p></li>
<li><p>Apache Spark tools for generating, loading and transforming GAR files (coming soon).</p></li>
<li><p>Examples of applying GraphAr to graph processing applications or existing systems such as GraphScope.</p></li>
</ul>
<p><a class="reference internal" href="https://github.com/alibaba/GraphAr/blob/main/docs/images/overview.png"><img alt="Overview" src="https://github.com/alibaba/GraphAr/blob/main/docs/images/overview.png" style="width: 650px;" /></a></p>
<div class="section" id="motivation">
<h2>Motivation<a class="headerlink" href="#motivation" title="Permalink to this heading">#</a></h2>
<p>Graph processing serves as the essential building block for a diverse variety of real-world applications such as social network analytics, data mining, network routing, and scientific computing.</p>
<p>GraphAr (GAR) is established to enable diverse graph applications and systems (in-memory and out-of-core storages, databases, graph computing systems and interactive graph query frameworks) to build and access the graph data conveniently and efficiently. It specifies a standardized system-independent file format for graph and provides a set of interfaces to generate and access such formatted files.</p>
<p>GraphAr (GAR) targets two main scenarios:</p>
<ul class="simple">
<li><p>To serve as the standard file format for importing/exporting and persistent storage of the graph data for diverse existing systems, reducing the overhead when various systems co-work.</p></li>
<li><p>To serve as the direct data source for graph processing applications.</p></li>
</ul>
</div>
<div class="section" id="what-s-in-graphar">
<h2>What’s in GraphAr<a class="headerlink" href="#what-s-in-graphar" title="Permalink to this heading">#</a></h2>
<p>The <strong>GAR</strong> file format that defines a standard store file format for graph data.</p>
<p>The <strong>GAR SDK</strong> library that contains a C++ library to provide APIs for accessing and generating the GAR format files.</p>
</div>
<div class="section" id="graphar-file-format">
<h2>GraphAr File Format<a class="headerlink" href="#graphar-file-format" title="Permalink to this heading">#</a></h2>
<p>GraphAr specifies a standardized system-independent file format (GAR) for storing property graphs.
It uses metadata to record all the necessary information of a graph, and maintains the actual data
in a chunked way.</p>
<div class="section" id="what-is-property-graph">
<h3>What is Property Graph<a class="headerlink" href="#what-is-property-graph" title="Permalink to this heading">#</a></h3>
<p>GraphAr is designed for representing and storing the property graphs. Graph (in discrete mathematics) is a structure made of vertices and edges. Property graph is then a type of graph model where the vertices/edges could carry a name (also called as type or label) and some properties. Since carrying additional information than non-property graphs, the property graph is able to represent connections among data scattered across diverse data databases and with different schemas. Compared with the relational database schema, the property graph excels at showing data dependencies. Therefore, it is widely-used in modeling modern applications including social network analytics, data mining, network routing, scientific computing and so on.</p>
<p>A property graph includes vertices and edges. Each vertex contains:</p>
<ul class="simple">
<li><p>A unique identifier (called vertex id or vertex index).</p></li>
<li><p>A text label that describes the vertex type.</p></li>
<li><p>A collection of properties, with each property can be represented by a key-value pair.</p></li>
</ul>
<p>And each edge contains:</p>
<ul class="simple">
<li><p>A unique identifier (called edge id or edge index).</p></li>
<li><p>The outgoing vertex (source).</p></li>
<li><p>The incoming vertex (destination).</p></li>
<li><p>A text label that describes the relationship between the two vertices.</p></li>
<li><p>A collection of properties.</p></li>
</ul>
<p>The following is an example property graph containing two types of vertices “person” and “comment” and three types of edges.</p>
<p><a class="reference internal" href="https://github.com/alibaba/GraphAr/blob/main/docs/images/property_graph.png"><img alt="property graph" src="https://github.com/alibaba/GraphAr/blob/main/docs/images/property_graph.png" style="width: 650px;" /></a></p>
</div>
<div class="section" id="vertices-in-graphar">
<h3>Vertices in GraphAr<a class="headerlink" href="#vertices-in-graphar" title="Permalink to this heading">#</a></h3>
<div class="section" id="logical-table-of-vertices">
<h4>Logical table of vertices<a class="headerlink" href="#logical-table-of-vertices" title="Permalink to this heading">#</a></h4>
<p>Each type of vertices (with the same label) constructs a logical vertex table, with each vertex assigned with a global index (vertex id) starting from 0, that is, the row number of that vertex in the logical vertex table. The following example shows the layout of the logical table for vertices that with label “person”.</p>
<p>Given a vertex id as well as the vertex label, a vertex can be identified uniquely, and the properties of it can be accessed from this table. When maintaining the topology of a graph, the vertex id is used to identify the source and destination for each of the edges.</p>
<p><a class="reference internal" href="https://github.com/alibaba/GraphAr/blob/main/docs/images/vertex_logical_table.png"><img alt="vertex logical table" src="https://github.com/alibaba/GraphAr/blob/main/docs/images/vertex_logical_table.png" style="width: 650px;" /></a></p>
</div>
<div class="section" id="physical-table-of-vertices">
<h4>Physical table of vertices<a class="headerlink" href="#physical-table-of-vertices" title="Permalink to this heading">#</a></h4>
<p>For enhancing the reading/writing efficiency, the logical vertex table will be partitioned into multiple continuous vertex chunks. And to maintain the ability of random access, the size of vertex chunks for the same label is fixed. To support to access required properties avoiding reading all properties from the files, and to add properties for vertices without modifying the existing files, the columns of the logical table will be divided into several column groups.</p>
<p>Take the “person” vertex table as an example, if the chunk size is set to be 500, the logical table will be separated into sub-logical-tables of 500 rows except the last one, which can be less than 500 rows. And the columns for maintaining properties are also separated, being divided into several groups (e.g., 2 groups for our example). Therefore, there are 4 physical vertex tables in total for actually storing the example logical table, as the following figure shows.</p>
<p><a class="reference internal" href="https://github.com/alibaba/GraphAr/blob/main/docs/images/vertex_physical_table.png"><img alt="vertex physical table" src="https://github.com/alibaba/GraphAr/blob/main/docs/images/vertex_physical_table.png" style="width: 650px;" /></a></p>
</div>
</div>
<div class="section" id="edges-in-graphar">
<h3>Edges in GraphAr<a class="headerlink" href="#edges-in-graphar" title="Permalink to this heading">#</a></h3>
<div class="section" id="logical-table-of-edges">
<h4>Logical table of edges<a class="headerlink" href="#logical-table-of-edges" title="Permalink to this heading">#</a></h4>
<p>For maintaining a type of edges (that with the same triplet of the source label, edge label, and destination label), a logical edge table is established. And in order to support quickly creating a graph from the graph storage file, the logical edge table could maintain the topology information in a way similar to CSR/CSC (learn more about <a class="reference external" href="https://en.wikipedia.org/wiki/Sparse_matrix">CSR/CSC</a>), that is, the edges are ordered by the vertex id of source/destination. In this way, one offset table is required to store the start offset for each vertex’s edges. And the edges with the same source/destination will be stored continuously in the logical table.</p>
<p>Take the logical table for “person likes person” edges as an example, the logical edge table looks like:</p>
<p><a class="reference internal" href="https://github.com/alibaba/GraphAr/blob/main/docs/images/edge_logical_table.png"><img alt="edge logical table" src="https://github.com/alibaba/GraphAr/blob/main/docs/images/edge_logical_table.png" style="width: 650px;" /></a></p>
</div>
<div class="section" id="physical-table-of-edges">
<h4>Physical table of edges<a class="headerlink" href="#physical-table-of-edges" title="Permalink to this heading">#</a></h4>
<p>According to the partition strategy and the order of the edges, edges can be one of the four types: <strong>ordered_by_source</strong>, <strong>ordered_by_dest</strong>, <strong>unordered_by_source</strong> or <strong>unordered_by_dest</strong>. A logical edge table could contain physical tables of three categories:</p>
<ul class="simple">
<li><p>The adjList table (which contains only two columns: the vertex id of the source and the destination).</p></li>
<li><p>The edge property tables (if there are properties on edges).</p></li>
<li><p>The offset table (optional, only required for ordered edges).</p></li>
</ul>
<p>Since the vertex table are partitioned into multiple chunks, the logical edge table is also partitioned into some sub-logical-tables, with each sub-logical-table contains edges that the source (if the type is <strong>ordered_by_source</strong> or <strong>unordered_by_source</strong>) or destination (if the type is <strong>ordered_by_dest</strong> or <strong>unordered_by_dest</strong>) vertices are in the same vertex chunk. After that, a sub-logical-table is further divided into edge chunks in which the number of rows is fixed (called edge chunk size). Finally, an edge chunk is separated into an adjList table and 0 or more property tables.</p>
<p>Also, the partition of the offset table is aligned with the partition of the corresponding vertex table. The first row of each offset chunk is always 0, means that to start with the first row of the corresponding sub-logical-table for edges.</p>
<p>Take the “person knows person” edges to illustrate, when the vertex chunk size is set to be 500 and the edge chunk size is 1024, the edges will be saved in the following physical tables:</p>
<p><a class="reference internal" href="https://github.com/alibaba/GraphAr/blob/main/docs/images/edge_physical_table1.png"><img alt="edge logical table1" src="https://github.com/alibaba/GraphAr/blob/main/docs/images/edge_physical_table1.png" style="width: 650px;" /></a>
<a class="reference internal" href="https://github.com/alibaba/GraphAr/blob/main/docs/images/edge_physical_table2.png"><img alt="edge logical table2" src="https://github.com/alibaba/GraphAr/blob/main/docs/images/edge_physical_table2.png" style="width: 650px;" /></a></p>
</div>
</div>
</div>
<div class="section" id="building-sdk-steps">
<h2>Building SDK Steps<a class="headerlink" href="#building-sdk-steps" title="Permalink to this heading">#</a></h2>
<div class="section" id="dependencies">
<h3>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this heading">#</a></h3>
<p><strong>GraphAr</strong> is developed and tested on ubuntu 20.04. It should also work on other unix-like distributions. Building GraphAr requires the following softwares installed as dependencies.</p>
<ul class="simple">
<li><p>A modern C++ compiler compliant with C++17 standard (On Linux, gcc >=7.1).</p></li>
<li><p><a class="reference external" href="https://cmake.org/">CMake</a> (>=2.8)</p></li>
</ul>
<p>Here are the dependencies for optional features:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.doxygen.nl/index.html">Doxygen</a> (>= 1.8) for generating documentation;</p></li>
<li><p><a class="reference external" href="https://www.sphinx-doc.org/en/master/index.html">sphinx</a> for generating documentation.</p></li>
</ul>
<p>Extra dependencies are required by examples and unit tests:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.boost.org/doc/libs/1_80_0/libs/graph/doc/index.html">BGL</a> (>= 1.58).</p></li>
</ul>
</div>
<div class="section" id="building-and-install-graphar-c-library">
<h3>Building and install GraphAr C++ library<a class="headerlink" href="#building-and-install-graphar-c-library" title="Permalink to this heading">#</a></h3>
<p>Once the required dependencies have been installed, go to the root directory of GraphAr and do an out-of-source build using CMake.</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>git submodule update --init
mkdir build <span class="o">&&</span> <span class="nb">cd</span> build
cmake ..
make -j<span class="k">$(</span>nproc<span class="k">)</span>
</pre></div>
</div>
<p><strong>Optional</strong>: Using a Custom Namespace</p>
<p>The <cite>namespace</cite> that <cite>gar</cite> is defined in is configurable. By default,
it is defined in <cite>namespace GraphArchive</cite>; however this can be toggled by
setting <cite>NAMESPACE</cite> option with cmake:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>mkdir build
<span class="nb">cd</span> build
cmake .. -DNAMESPACE<span class="o">=</span>MyNamespace
make -j<span class="k">$(</span>nproc<span class="k">)</span>
</pre></div>
</div>
<p>Run the test with command:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>make <span class="nb">test</span>
</pre></div>
</div>
<p>Install the GraphAr library:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>sudo make install
</pre></div>
</div>
<p>Build the documentation of GraphAr library:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="c1"># assume doxygen and sphinx has been installed.</span>
pip3 install -r ../requirements-dev.txt --user
make doc
</pre></div>
</div>
</div>
</div>
<div class="section" id="using-graphar-c-library-in-your-own-project">
<h2>Using GraphAr C++ library in your own project<a class="headerlink" href="#using-graphar-c-library-in-your-own-project" title="Permalink to this heading">#</a></h2>
<p>The way we recommend to integrate the GraphAr C++ library in your own C++ project is to use
CMake’s <cite>find_package</cite> function for locating and integrating dependencies.</p>
<p>Here is a minimal <cite>CMakeLists.txt</cite> that compiles a source file <cite>my_example.cc</cite> into an executable
target linked with GraphAr C++ shared library.</p>
<div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nb">project</span><span class="p">(</span><span class="s">MyExample</span><span class="p">)</span>
<span class="nb">find_package</span><span class="p">(</span><span class="s">gar</span><span class="w"> </span><span class="s">REQUIRED</span><span class="p">)</span>
<span class="nb">include_directories</span><span class="p">(</span><span class="o">${</span><span class="nv">GAR_INCLUDE_DIRS</span><span class="o">}</span><span class="p">)</span>
<span class="nb">add_executable</span><span class="p">(</span><span class="s">my_example</span><span class="w"> </span><span class="s">my_example.cc</span><span class="p">)</span>
<span class="nb">target_compile_features</span><span class="p">(</span><span class="s">my_example</span><span class="w"> </span><span class="s">PRIVATE</span><span class="w"> </span><span class="s">cxx_std_17</span><span class="p">)</span>
<span class="nb">target_link_libraries</span><span class="p">(</span><span class="s">my_example</span><span class="w"> </span><span class="s">PRIVATE</span><span class="w"> </span><span class="o">${</span><span class="nv">GAR_LIBRARIES</span><span class="o">}</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="contributing-to-graphar">
<h2>Contributing to GraphAr<a class="headerlink" href="#contributing-to-graphar" title="Permalink to this heading">#</a></h2>
<ul class="simple">
<li><p>Read the <a class="reference external" href="https://github.com/alibaba/GraphAr/blob/main/CONTRIBUTING.rst">Contribution Guide</a>.</p></li>
<li><p>Please report bugs by submitting <a class="reference external" href="https://github.com/alibaba/GraphAr/issues/new">GitHub Issues</a> or ask me anything in <a class="reference external" href="https://github.com/alibaba/GraphAr">Github Discussions</a>.</p></li>
<li><p>Submit contributions using pull requests.</p></li>
</ul>
<p>Thank you in advance for your contributions to GraphAr!</p>
</div>
<div class="section" id="license">
<h2>License<a class="headerlink" href="#license" title="Permalink to this heading">#</a></h2>
<p><strong>GraphAr</strong> is distributed under <a class="reference external" href="https://github.com/alibaba/GraphAr/blob/main/LICENSE">Apache License 2.0</a>. Please note that
third-party libraries may not have the same license as GraphAr.</p>
<div class="toctree-wrapper compound">
</div>
<div class="toctree-wrapper compound">
</div>
<div class="toctree-wrapper compound">
</div>
<div class="toctree-wrapper compound">
</div>
</div>
</div>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="user-guide/overview.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Overview</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
</div>
<div class="bottom-of-page">
<div class="left-details">
<div class="copyright">
Copyright © 2022, The GraphAr Authors
</div>
Made with
<a href="https://github.com/pradyunsg/furo">Furo</a>
</div>
<div class="right-details">
<div class="icons">
<a class="muted-link fa fa-solid fa-github fa-2x" href="https://github.com/GraphScope/gsf" aria-label="GitHub"></a>
</div>
</div>
</div>
</footer>
</div>
<aside class="toc-drawer">
<div class="toc-sticky toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
On this page
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">GraphAr</a><ul>
<li><a class="reference internal" href="#motivation">Motivation</a></li>
<li><a class="reference internal" href="#what-s-in-graphar">What’s in GraphAr</a></li>
<li><a class="reference internal" href="#graphar-file-format">GraphAr File Format</a><ul>
<li><a class="reference internal" href="#what-is-property-graph">What is Property Graph</a></li>
<li><a class="reference internal" href="#vertices-in-graphar">Vertices in GraphAr</a><ul>
<li><a class="reference internal" href="#logical-table-of-vertices">Logical table of vertices</a></li>
<li><a class="reference internal" href="#physical-table-of-vertices">Physical table of vertices</a></li>
</ul>
</li>
<li><a class="reference internal" href="#edges-in-graphar">Edges in GraphAr</a><ul>
<li><a class="reference internal" href="#logical-table-of-edges">Logical table of edges</a></li>
<li><a class="reference internal" href="#physical-table-of-edges">Physical table of edges</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#building-sdk-steps">Building SDK Steps</a><ul>
<li><a class="reference internal" href="#dependencies">Dependencies</a></li>
<li><a class="reference internal" href="#building-and-install-graphar-c-library">Building and install GraphAr C++ library</a></li>
</ul>
</li>
<li><a class="reference internal" href="#using-graphar-c-library-in-your-own-project">Using GraphAr C++ library in your own project</a></li>
<li><a class="reference internal" href="#contributing-to-graphar">Contributing to GraphAr</a></li>
<li><a class="reference internal" href="#license">License</a><ul>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</aside>
</div>
</div><script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/scripts/furo.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
</body>
</html>