652 lines
115 KiB
HTML
652 lines
115 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html>
|
|||
|
<head>
|
|||
|
<meta charset="utf-8">
|
|||
|
<title>Gstore System</title>
|
|||
|
</head>
|
|||
|
<body>
|
|||
|
<div style="visibility: hidden; overflow: hidden; position: absolute; top: 0px; height: 1px; width: auto; padding: 0px; border: 0px none; margin: 0px; text-align: left; text-indent: 0px; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal;"><div id="MathJax_SVG_Hidden"></div><svg><defs id="MathJax_SVG_glyphs"><path d="M40 437Q21 437 21 445Q21 450 37 501T71 602L88 651Q93 669 101 677H569H659Q691 677 697 676T704 667Q704 661 687 553T668 444Q668 437 649 437Q640 437 637 437T631 442L629 445Q629 451 635 490T641 551Q641 586 628 604T573 629Q568 630 515 631Q469 631 457 630T439 622Q438 621 368 343T298 60Q298 48 386 46Q418 46 427 45T436 36Q436 31 433 22Q429 4 424 1L422 0Q419 0 415 0Q410 0 363 1T228 2Q99 2 64 0H49Q43 6 43 9T45 27Q49 40 55 46H83H94Q174 46 189 55Q190 56 191 56Q196 59 201 76T241 233Q258 301 269 344Q339 619 339 625Q339 630 310 630H279Q212 630 191 624Q146 614 121 583T67 467Q60 445 57 441T43 437H40Z" stroke-width="1" id="MJMATHI-54"></path><path d="M492 213Q472 213 472 226Q472 230 477 250T482 285Q482 316 461 323T364 330H312Q311 328 277 192T243 52Q243 48 254 48T334 46Q428 46 458 48T518 61Q567 77 599 117T670 248Q680 270 683 272Q690 274 698 274Q718 274 718 261Q613 7 608 2Q605 0 322 0H133Q31 0 31 11Q31 13 34 25Q38 41 42 43T65 46Q92 46 125 49Q139 52 144 61Q146 66 215 342T285 622Q285 629 281 629Q273 632 228 634H197Q191 640 191 642T193 659Q197 676 203 680H757Q764 676 764 669Q764 664 751 557T737 447Q735 440 717 440H705Q698 445 698 453L701 476Q704 500 704 528Q704 558 697 578T678 609T643 625T596 632T532 634H485Q397 633 392 631Q388 629 386 622Q385 619 355 499T324 377Q347 376 372 376H398Q464 376 489 391T534 472Q538 488 540 490T557 493Q562 493 565 493T570 492T572 491T574 487T577 483L544 351Q511 218 508 216Q505 213 492 213Z" stroke-width="1" id="MJMATHI-45"></path><path d="M308 24Q367 24 416 76T466 197Q466 260 414 284Q308 311 278 321T236 341Q176 383 176 462Q176 523 208 573T273 648Q302 673 343 688T407 704H418H425Q521 704 564 640Q565 640 577 653T603 682T623 704Q624 704 627 704T632 705Q645 705 645 698T617 577T585 459T569 456Q549 456 549 465Q549 471 550 475Q550 478 551 494T553 520Q553 554 544 579T526 616T501 641Q465 662 419 662Q362 662 313 616T263 510Q263 480 278 458T319 427Q323 425 389 408T456 390Q490 379 522 342T554 242Q554 216 546 186Q541 164 528 137T492 78T426 18T332 -20Q320 -22 298 -22Q199 -22 144 33L134 44L106 13Q83 -14 78 -18T65 -22Q52 -22 52 -14Q52 -11 110 221Q112 227 130 227H143Q149 221 149 216Q149 214 148 207T144 186T142 153Q144 114 160 87T203 47T255 29T308 24Z" stroke-width="1" id="MJMATHI-53"></path><path d="M78 35T78 60T94 103T137 121Q165 121 187 96T210 8Q210 -27 201 -60T180 -117T154 -158T130 -185T117 -194Q113 -194 104 -185T95 -172Q95 -168 106 -156T131 -126T157 -76T173 -3V9L172 8Q170 7 167 6T161 3T152 1T140 0Q113 0 96 17Z" stroke-width="1" id="MJMAIN-2C"></path><path d="M580 385Q580 406 599 424T641 443Q659 443 674 425T690 368Q690 339 671 253Q656 197 644 161T609 80T554 12T482 -11Q438 -11 404 5T355 48Q354 47 352 44Q311 -11 252 -11Q226 -11 202 -5T155 14T118 53T104 116Q104 170 138 262T173 379Q173 380 173 381Q173 390 173 393T169 400T158 404H154Q131 404 112 385T82 344T65 302T57 280Q55 278 41 278H27Q21 284 21 287Q21 293 29 315T52 366T96 418T161 441Q204 441 227 416T250 358Q250 340 217 250T184 111Q184 65 205 46T258 26Q301 26 334 87L339 96V119Q339 122 339 128T340 136T341 143T342 152T345 165T348 182T354 206T362 238T373 281Q402 395 406 404Q419 431 449 431Q468 431 475 421T483 402Q483 389 454 274T422 142Q420 131 420 107V100Q420 85 423 71T442 42T487 26Q558 26 600 148Q609 171 620 213T632 273Q632 306 619 325T593 357T580 385Z" stroke-width="1" id="MJMATHI-77"></path><path d="M137 683Q138 683 209 688T282 694Q294 694 294 685Q294 674 258 534Q220 386 220 383Q220 381 227 388Q288 442 357 442Q411 442 444 415T478 336Q478 285 440 178T402 50Q403 36 407 31T422 26Q450 26 474 56T513 138Q516 149 519 151T535 153Q555 153 555 145Q555 144 551 130Q535 71 500 33Q466 -10 419 -10H414Q367 -10 346 17T325 74Q325 90 361 192T398 345Q398 404 354 404H349Q266 404 205 306L198 293L164 158Q132 28 127 16Q114 -11 83 -11Q69 -11 59 -2T48 16Q48 30
|
|||
|
<ul>
|
|||
|
<li><a href="#gstore-system">Gstore System</a><ul>
|
|||
|
<li><a href="#chapter-00-a-quick-tour">Chapter 00: A Quick Tour</a><ul>
|
|||
|
<li><a href="#getting-started">Getting Started</a></li>
|
|||
|
<li><a href="#advanced-help">Advanced Help</a></li>
|
|||
|
<li><a href="#other-business">Other Business</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-01-system-requirements">Chapter 01: System Requirements</a></li>
|
|||
|
<li><a href="#chapter-02-basic-introduction">Chapter 02: Basic Introduction</a><ul>
|
|||
|
<li><a href="#what-is-gstore">What Is gStore</a></li>
|
|||
|
<li><a href="#why-gstore">Why gStore</a></li>
|
|||
|
<li><a href="#open-source">Open Source</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-03-install-guide">Chapter 03: Install Guide</a></li>
|
|||
|
<li><a href="#chapter-04-how-to-use">Chapter 04: How To Use</a><ul>
|
|||
|
<li><a href="#gstore-currently-includes-five-executables-and-others">gStore currently includes five executables and others.</a><ul>
|
|||
|
<li><a href="#0-gconsole">0. gconsole</a></li>
|
|||
|
<li><a href="#1-gload">1. gload</a></li>
|
|||
|
<li><a href="#2-gquery">2. gquery</a></li>
|
|||
|
<li><a href="#3-gserver">3. gserver</a></li>
|
|||
|
<li><a href="#4-gclient">4. gclient</a></li>
|
|||
|
<li><a href="#5-test-utilities">5. test utilities</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-05-api-explanation">Chapter 05: API Explanation</a><ul>
|
|||
|
<li><a href="#easy-examples">Easy Examples</a></li>
|
|||
|
<li><a href="#api-structure">API structure</a></li>
|
|||
|
<li><a href="#c-api">C++ API</a><ul>
|
|||
|
<li><a href="#interface">Interface</a></li>
|
|||
|
<li><a href="#compile">Compile</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#java-api">Java API</a><ul>
|
|||
|
<li><a href="#interface-1">Interface</a></li>
|
|||
|
<li><a href="#compile-1">Compile</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-06-project-structure">Chapter 06: Project Structure</a><ul>
|
|||
|
<li><ul>
|
|||
|
<li><a href="#the-core-source-codes-are-listed-below">The core source codes are listed below:</a></li>
|
|||
|
<li><a href="#the-parser-part-is-listed-below">The parser part is listed below:</a></li>
|
|||
|
<li><a href="#the-utilities-are-listed-below">The utilities are listed below:</a></li>
|
|||
|
<li><a href="#the-interface-part-is-listed-below">The interface part is listed below:</a></li>
|
|||
|
<li><a href="#more-details">More details</a></li>
|
|||
|
<li><a href="#others">Others</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-07-publications">Chapter 07: Publications</a><ul>
|
|||
|
<li><ul>
|
|||
|
<li><a href="#publications-related-with-gstore-are-listed-here">Publications related with gStore are listed here:</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-08-updated-logs">Chapter 08: Updated Logs</a><ul>
|
|||
|
<li><a href="#apr-01-2016">Apr 01, 2016</a></li>
|
|||
|
<li><a href="#nov-06-2015">Nov 06, 2015</a></li>
|
|||
|
<li><a href="#oct-20-2015">Oct 20, 2015</a></li>
|
|||
|
<li><a href="#sep-25-2015">Sep 25, 2015</a></li>
|
|||
|
<li><a href="#feb-2-2015">Feb 2, 2015</a></li>
|
|||
|
<li><a href="#dec-11-2014">Dec 11, 2014</a></li>
|
|||
|
<li><a href="#nov-20-2014">Nov 20, 2014</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-09-test-results">Chapter 09: Test Results</a><ul>
|
|||
|
<li><a href="#preparation">Preparation</a></li>
|
|||
|
<li><a href="#result">Result</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-10-recipe-book">Chapter 10: Recipe Book</a></li>
|
|||
|
<li><a href="#chapter-11-mailing-list">Chapter 11: Mailing List</a><ul>
|
|||
|
<li><a href="#people">People</a><ul>
|
|||
|
<li><a href="#faculty">Faculty</a></li>
|
|||
|
<li><a href="#students">Students</a></li>
|
|||
|
<li><a href="#alumni">Alumni</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-12-limit-description">Chapter 12: Limit Description</a></li>
|
|||
|
<li><a href="#chapter-13-frequently-asked-questions">Chapter 13: Frequently Asked Questions</a><ul>
|
|||
|
<li><ul>
|
|||
|
<li><a href="#when-i-use-the-newer-gstore-system-to-query-the-original-database-why-error">When I use the newer gStore system to query the original database, why error?</a></li>
|
|||
|
<li><a href="#why-error-when-i-try-to-write-programs-based-on-gstore-just-like-the-maingconsolecpp">Why error when I try to write programs based on gStore, just like the Main/gconsole.cpp?</a></li>
|
|||
|
<li><a href="#why-does-gstore-report-garbage-collection-failed-error-when-i-use-teh-java-api">Why does gStore report "garbage collection failed" error when I use teh Java API?</a></li>
|
|||
|
<li><a href="#when-i-compile-the-code-in-archlinux-why-the-error-that-no-ltermcap-is-reported">When I compile the code in ArchLinux, why the error that "no -ltermcap" is reported?</a></li>
|
|||
|
<li><a href="#why-does-gstore-report-errors-that-the-format-of-some-rdf-datasets-are-not-supported">Why does gStore report errors that the format of some RDF datasets are not supported?</a></li>
|
|||
|
<li><a href="#when-i-read-on-github-why-are-some-documents-unable-to-be-opened">When I read on GitHub, why are some documents unable to be opened?</a></li>
|
|||
|
<li><a href="#why-sometimes-strange-characters-appear-when-i-use-gstore">Why sometimes strange characters appear when I use gStore?</a></li>
|
|||
|
<li><a href="#in-centos7-if-the-watdivdba-generated-database-after-gload-is-copied-or-compresseduncompressed-the-size-of-watdivdb-will-be-differentgenerally-increasing-if-using-du-h-command-to-check">In centos7, if the watdiv.db(a generated database after gload) is copied or compressed/uncompressed, the size of watdiv.db will be different(generally increasing) if using du -h command to check?</a></li>
|
|||
|
<li><a href="#in-gclient-console-a-database-is-built-queried-and-then-i-quit-the-console-next-time-i-enter-the-console-load-the-originally-imported-database-but-no-output-for-any-queriesoriginally-the-output-is-not-empty">In gclient console, a database is built, queried, and then I quit the console. Next time I enter the console, load the originally imported database, but no output for any queries(originally the output is not empty)?</a></li>
|
|||
|
<li><a href="#if-query-results-contain-null-value-how-can-i-use-the-fulltest-utility-tab-separated-method-will-cause-problem-here-because-null-value-cannot-be-checked">If query results contain null value, how can I use the full_test utility? Tab separated method will cause problem here because null value cannot be checked!</a></li>
|
|||
|
<li><a href="#when-i-compile-and-run-the-api-examples-it-reports-the-unable-to-connect-to-server-error">When I compile and run the API examples, it reports the "unable to connect to server" error?</a></li>
|
|||
|
<li><a href="#when-i-use-the-java-api-to-write-my-own-program-it-reports-not-found-main-class-error">When I use the Java API to write my own program, it reports "not found main class" error?</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-14-future-plan">Chapter 14: Future Plan</a><ul>
|
|||
|
<li><a href="#improve-the-core">Improve The Core</a></li>
|
|||
|
<li><a href="#better-the-interface">Better The Interface</a></li>
|
|||
|
<li><a href="#idea-collection-box">Idea Collection Box</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
<li><a href="#chapter-15-thanks-list">Chapter 15: Thanks List</a></li>
|
|||
|
</ul>
|
|||
|
</li>
|
|||
|
</ul>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</p><hr><p data-anchor-id="udol"><span id="chapter00"></span></p><div class="md-section-divider"></div><h2 id="chapter-00-a-quick-tour" data-anchor-id="frpw">Chapter 00: A Quick Tour</h2><p data-anchor-id="4zlu">Gstore System(also called gStore) is a graph database engine for managing large graph-structured data, which is open-source and targets at Linux operation systems. The whole project is written in C++, with the help of some libraries such as readline, antlr, and so on. Only source tarballs are provided currently, which means you have to compile the source code if you want to use our system.</p><div class="md-section-divider"></div><h3 id="getting-started" data-anchor-id="y665">Getting Started</h3><p data-anchor-id="wh6q">This system is really user-friendly and you can pick it up in several minutes. Remember to check your platform where you want to run this system by viewing <a href="#chapter01">System Requirements</a>. After all are verified, please get this project's source code. There are several ways to do this:</p><ul data-anchor-id="q0vb">
|
|||
|
<li><p>download the zip from this repository and extract it</p></li>
|
|||
|
<li><p>fork this repository in your github account</p></li>
|
|||
|
<li><p>type <code>git clone git@github.com:Caesar11/gStore.git</code> in your terminal or use git GUI to acquire it</p></li>
|
|||
|
</ul><p data-anchor-id="bkf8">Then you need to compile the project, just type <code>make</code> in the gStore root directory, and all executables will be ok. To run gStore, please type <code>bin/gload database_name dataset_path</code> to build a database named by yourself. And you can use <code>bin/gquery database_name</code> command to query a existing database. What is more, <code>bin/gconsole</code> is a wonderful tool designed for you, providing all operations you need to use gStore. Notice that all commands should be typed in the root directory of gStore. </p><p data-anchor-id="lx85"><em>A detailed description can be found at Chapter 04 <a href="#chapter04">How to use</a> in this document.</em></p><div class="md-section-divider"></div><h3 id="advanced-help" data-anchor-id="ausv">Advanced Help</h3><p data-anchor-id="9yk6">If you want to understand the details of the gStore system, or you want to try some advanced operations(for example, using the API, server/client), please see the chapters below.</p><ul data-anchor-id="yokq">
|
|||
|
<li><p><a href="#chapter02">Basic Introduction</a>: introduce the theory and features of gStore</p></li>
|
|||
|
<li><p><a href="#chapter03">Install Guide</a>: instructions on how to install this system</p></li>
|
|||
|
<li><p><a href="#chapter04">How To Use</a>: detailed information about using the gStore system</p></li>
|
|||
|
<li><p><a href="#chapter05">API Explanation</a>: guide you to develop applications based on our API</p></li>
|
|||
|
<li><p><a href="#chapter06">Project Structure</a>: show the whole structure and sequence of this project</p></li>
|
|||
|
<li><p><a href="#chapter07">Publications</a>: contain essays and publications related with gStore</p></li>
|
|||
|
<li><p><a href="#chapter08">Update Logs</a>: keep the logs of the system updates</p></li>
|
|||
|
<li><p><a href="#chapter09">Test Results</a>: present the test results of a series of experiments</p></li>
|
|||
|
</ul><div class="md-section-divider"></div><h3 id="other-business" data-anchor-id="q7i5">Other Business</h3><p data-anchor-id="a8d5">We have written a series of short essays addressing recurring challenges in using gStore to realize applications, which are placed in <a href="#chapter10">Recipe Book</a>.</p><p data-anchor-id="uo0w">You are welcome to report any advice or errors in the github Issues part of this repository, if not requiring in-time reply. However, if you want to urgent on us to deal with your reports, please email to to submit your suggestions and report bugs to us by emailing to . A full list of our whole team is in <a href="#chapter11">Mailing List</a>.</p><p data-anchor-id="4977">There are some restrictions when you use the current gStore project, you can see them on <a href="#chapter12">Limit Description</a>.</p><p data-anchor-id="mtne">Sometimes you may find some strange phenomena(but not wrong case), or something hard to understand/solve(don't know how to do next), then do not hesitate to visit the <a href="#chapter13">Frequently Asked Questions</a> page.</p><p data-anchor-id="n745">Graph database engine is a new area and we are still trying to go further. Things we plan to do next is in <a href="#chapter14">Future Plan</a> chapter, and we hope more and more people will support or even join us. You can support in many ways:</p><ul data-anchor-id="lae6">
|
|||
|
<li><p>watch/star our project</p></li>
|
|||
|
<li><p>fork this repository and submit pull requests to us</p></li>
|
|||
|
<li><p>download and use this system, report bugs or suggestions</p></li>
|
|||
|
<li><p>...</p></li>
|
|||
|
</ul><p data-anchor-id="woxx">People who inspire us or contribute to this project will be listed in the <a href="#chapter15">Thanks List</a> chapter.</p><hr><p></p><p data-anchor-id="0pas"><span id="chapter01"></span></p><div class="md-section-divider"></div><h2 id="chapter-01-system-requirements" data-anchor-id="1i0w">Chapter 01: System Requirements</h2><p data-anchor-id="mtvl"><em>We have tested on linux server with CentOS 6.2 x86_64 and CentOS 6.6 x86_64. The version of GCC should be 4.4.7 or later.</em></p><table class="table table-striped-white table-bordered" data-anchor-id="xu20">
|
|||
|
<thead>
|
|||
|
<tr>
|
|||
|
<th style="text-align:left;">Item</th>
|
|||
|
<th style="text-align:left;">Requirement</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr>
|
|||
|
<td style="text-align:left;">operation system</td>
|
|||
|
<td style="text-align:left;">Linux, such as CentOS, Ubuntu and so on</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">architecture</td>
|
|||
|
<td style="text-align:left;">x86_64</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">disk size</td>
|
|||
|
<td style="text-align:left;">according to size of dataset</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">memory size</td>
|
|||
|
<td style="text-align:left;">according to size of dataset</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">glibc</td>
|
|||
|
<td style="text-align:left;">version >= 2.14</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">gcc</td>
|
|||
|
<td style="text-align:left;">version >= 4.4.7</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">g++</td>
|
|||
|
<td style="text-align:left;">version >= 4.4.7</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">make</td>
|
|||
|
<td style="text-align:left;">need to be installed</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">readline</td>
|
|||
|
<td style="text-align:left;">need to be installed</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">readline-devel</td>
|
|||
|
<td style="text-align:left;">need to be installed</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">openjdk</td>
|
|||
|
<td style="text-align:left;">needed if using Java api</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">openjdk-devel</td>
|
|||
|
<td style="text-align:left;">needed if using Java api</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">realpath</td>
|
|||
|
<td style="text-align:left;">needed if using gconsole</td>
|
|||
|
</tr>
|
|||
|
</tbody></table><p data-anchor-id="bos5">NOTICE:</p><ol data-anchor-id="46qj">
|
|||
|
<li><p>The name of some packages may be different in different platforms, just install the corresponding one in your own operation system.</p></li>
|
|||
|
<li><p>To install readline and readline-devel, just type <code>dnf install readline-devel</code> in Redhat/CentOS/Fedora, or <code>apt-get install libreadline-dev</code> in Debian/Ubuntu. Please use corresponding commands in other systems. If you use ArchLinux, just type <code>pacman -S readline</code> to install the readline and readline-devel.(so do other packages)</p></li>
|
|||
|
<li><p>You do not have to install realpath to use gStore, but if you want to use the gconsole for its convenience, please do so by using <code>dnf install realpath</code> or <code>apt-get install realpath</code>.</p></li>
|
|||
|
<li><p>Our programs use regEx functions, which are provided by GNU/Linux by default. You do not need to have to install boost and boost-devel for more powerful regEx libraries.</p></li>
|
|||
|
<li><p>ANTLR3.4 is used in gStore to produce lexer and parser code for SPARQL query. However, you do not need to install the corresponding antlr libraries because we have merged the libantlr3.4 in our system.</p></li>
|
|||
|
<li><p>When you type <code>make</code> in the root directory of the gStore project, the Java api will also be compiled. You can modify the makefile if you do not have JDK in your system. However, you are advised to install openjdk-devel in your Linux system.</p></li>
|
|||
|
<li><p>Any other questions, please go to <a href="#chapter13">FAQ</a> page.</p></li>
|
|||
|
</ol><hr><p></p><p data-anchor-id="uoby"><span id="chapter02"></span></p><div class="md-section-divider"></div><h2 id="chapter-02-basic-introduction" data-anchor-id="h2ul">Chapter 02: Basic Introduction</h2><p data-anchor-id="ah7w"><strong>The first essay to come up with Gstore System is <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/pdf/gStoreVLDBJ.pdf">gStore_VLDBJ</a>, and You can find related publications in <a href="#chapter07">Publications</a>.</strong></p><div class="md-section-divider"></div><h3 id="what-is-gstore" data-anchor-id="bdbi">What Is gStore</h3><p data-anchor-id="f7cw">gStore is a graph-based RDF data management system(or what is commonly called a "triple store") that maintains the graph structure of the original <a target="_blank" href="http://www.w3.org/TR/rdf11-concepts/">RDF</a> data. Its data model is a labeled, directed multi edge graph, where each vertex corresponds to a subject or an object. </p><p data-anchor-id="05fe">We represent a given <a target="_blank" href="http://www.w3.org/TR/sparql11-overview/">SPARQL</a> query by a query graph Q. Query processing involves finding subgraph matches of Q over the RDF graph G, instead of joining tables in relational data management system. gStore incorporates an index over the RDF graph (called VS-tree) to speed up query processing. VS-tree is a height balanced tree with a number of associated pruning techniques to speed up subgraph matching.</p><p data-anchor-id="0fz1"><strong>The gStore project is supported by the National Science Foundation of China (NSFC), Natural Sciences and Engineering Research Council (NSERC) of Canada, and Hong Kong RGC.</strong></p><div class="md-section-divider"></div><h3 id="why-gstore" data-anchor-id="hv1z">Why gStore</h3><p data-anchor-id="1nzj">After a series of test, we analyse and keep the result in <a href="#chapter09">Test Results</a>. gStore runs faster to answer complicated queries(for example, contain circles) than other database systems. For simple queries, both gStore and other database systems work well. </p><p data-anchor-id="6vfw">In addition, now is the big data era and more and more structured data is coming, while the original relational database systems(or database systems based on relational tables) cannot deal with them efficiently. In contrast, gStore can utilize the features of graph data structures, and improve the performance. </p><p data-anchor-id="20y3">What is more, gStore is a high-extensible project. Many new ideas of graph database have be proposed, and most of them can be used in gStore. For example, our group is also designing a distributed gstore system, which is expected to be released at the end of 2016. </p><div class="md-section-divider"></div><h3 id="open-source" data-anchor-id="djgi">Open Source</h3><p data-anchor-id="f823">The gStore source code is available as open-source code under the BSD license. You are welcome to use gStore, report bugs or suggestions, or join us to make gStore better. It is also allowed for you to build all kinds of applications based on gStore, while respecting our work.</p><hr><p></p><p data-anchor-id="i7nt"><span id="chapter03"></span></p><div class="md-section-divider"></div><h2 id="chapter-03-install-guide" data-anchor-id="gl9x">Chapter 03: Install Guide</h2><p data-anchor-id="1z8k">gStore is a green software, and you just need to compile it with one command. Please run</p><p data-anchor-id="2k3g"><code>make</code> </p><p data-anchor-id="bgla">in the gStore root directory to compile the gStore code, link the ANTLR lib, and build executable "gload", "gquery", "gserver", "gclient", "gconsole". What is more, the api of gStore is also built now.</p><p data-anchor-id="6nl7">If you want to use API examples of gStore, please run <code>make APIexample</code> to compile example codes for both C++ API and Java API. For details of API, please visit <a href="#chapter05">API</a> chapter.</p><p data-anchor-id="04qi">Use <code>make clean</code> command to clean all objects, executables, and use <code>make dist</code> command to clean all ob
|
|||
|
Gstore Console(gconsole), an interactive shell based utility to communicate with gStore repositories.
|
|||
|
usage: start-gconsole [OPTION]
|
|||
|
-h,--help print this help
|
|||
|
-s,--source source the SPARQL script
|
|||
|
For bug reports and suggestions, see https://github.com/Caesar11/gStore
|
|||
|
|
|||
|
notice that commands are a little different between native mode and remote mode!
|
|||
|
now is in native mode, please type your commands.
|
|||
|
please do not use any separators in the end.
|
|||
|
|
|||
|
gstore>help
|
|||
|
|
|||
|
gstore>help drop
|
|||
|
drop Drop a database according to the given path.
|
|||
|
|
|||
|
gstore>connect 127.0.0.1 3305
|
|||
|
now is in remote mode, please type your commands.
|
|||
|
|
|||
|
server>disconnect
|
|||
|
now is in native mode, please type your commands.
|
|||
|
|
|||
|
gstore>build lubm_10 ./data/LUBM_10.n3
|
|||
|
...
|
|||
|
import RDF file to database done.
|
|||
|
|
|||
|
gstore>unload
|
|||
|
|
|||
|
gstore>load lubm_10
|
|||
|
...
|
|||
|
database loaded successfully!
|
|||
|
|
|||
|
gstore>show
|
|||
|
lubm_10.db
|
|||
|
|
|||
|
gstore>query ./data/LUBM_q0.sql
|
|||
|
...
|
|||
|
final result is :
|
|||
|
?x
|
|||
|
<http://www.Department0.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department1.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department2.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department3.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department4.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department5.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department6.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department7.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department8.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department9.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department10.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department11.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department12.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department13.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department14.University0.edu/FullProfessor0>
|
|||
|
|
|||
|
gstore>query "select distinct ?x ?y where { ?x <rdf:type> <ub:UndergraduateStudent> . ?x <ub:takesCourse> ?y . ?y <ub:name> <FullProfessor1> . }"
|
|||
|
final result is :
|
|||
|
?x ?y
|
|||
|
[empty result]
|
|||
|
|
|||
|
gstore>unload
|
|||
|
|
|||
|
gstore>quit
|
|||
|
</code></pre><p data-anchor-id="6jz7">Just type <code>bin/gconsole</code> in the root directory of gStore to use this console, and you will find a <code>gstore></code> prompt, which indicates that you are in native mode and can type in native commands now. There are another mode of this console, which is called remote mode. Just type <code>connect</code> in the native mode to enter the remote mode, and type <code>disconnect</code> to exit to native mode.(the console connect to a gStore server whose ip is '127.0.0.1' and port is 3305, you can specify them by type <code>connect gStore_server_ip gStore_server_port</code>)</p><p data-anchor-id="yedc">You can use <code>help</code> or <code>?</code> either in native mode or remote mode to see the help information, or you can type <code>help command_name</code> or <code>? command_name</code> to see the information of a given command. Notice that there are some differences between the commands in native mode and commands in remote mode. For example, system commands like <code>ls</code>, <code>cd</code> and <code>pwd</code> are provided in native mode, but not in remote mode. Also take care that not all commands contained in the help page are totally achieved, and we may change some functions of the console in the future.</p><p data-anchor-id="b6vc">What we have done is enough to bring you much convenience to use gStore, just enjoy it!</p><div class="md-section-divider"></div><h4 id="1-gload" data-anchor-id="pd3w">1. gload</h4><p data-anchor-id="mmxs">gload is used to build a new database from a RDF triple format file.</p><p data-anchor-id="5hre"><code>bin/gload db_name rdf_triple_file_path</code></p><p data-anchor-id="knry">For example, we build a database from LUBM_10.n3 which can be found in example folder.</p><pre data-anchor-id="9fmu"><code>[bookug@localhost gStore]$ bin/gload LUBM10.db ./data/LUBM_10.n3
|
|||
|
gload...
|
|||
|
argc: 3 DB_store:db_LUBM10 RDF_data: ./data/LUBM_10.n3
|
|||
|
begin encode RDF from : ./data/LUBM_10.n3 ...
|
|||
|
</code></pre><div class="md-section-divider"></div><h4 id="2-gquery" data-anchor-id="7uc9">2. gquery</h4><p data-anchor-id="b0ih">gquery is used to query an existing database with files containing SPARQL queries.(each file contains exact one SPARQL query)</p><p data-anchor-id="qf4s">Type <code>bin/gquery db_name query_file</code> to execute the SPARQL query retrieved from query_file in the database named db_name.</p><p data-anchor-id="jola">Use <code>bin/gquery --help</code> for detail information of gquery usage.</p><p data-anchor-id="n1ck">To enter the gquery console, type <code>bin/gquery db_name</code>. The program shows a command prompt("gsql>"), and you can type in a command here. Use <code>help</code> to see basic information of all commands, while <code>help command_t</code> shows details of a specified command.</p><p data-anchor-id="hhc5">Type <code>quit</code> to leave the gquery console.</p><p data-anchor-id="wr9s">For <code>sparql</code> command, input a file path which contains a single SPARQL query. (<em>answer redirecting to file is supported</em>)</p><p data-anchor-id="lkig">When the program finish answering the query, it shows the command prompt again. </p><p data-anchor-id="0v7n"><em>gStore2.0 only support simple "select" queries(not for predicates) now.</em></p><p data-anchor-id="khzx">We also take LUBM_10.n3 as an example.</p><pre data-anchor-id="wy4r"><code>[bookug@localhost gStore]$ bin/gquery LUBM10.db
|
|||
|
gquery...
|
|||
|
argc: 2 DB_store:db_LUBM10/
|
|||
|
loadTree...
|
|||
|
LRUCache initial...
|
|||
|
LRUCache initial finish
|
|||
|
finish loadCache
|
|||
|
finish loadEntityID2FileLineMap
|
|||
|
open KVstore
|
|||
|
finish load
|
|||
|
finish loading
|
|||
|
Type `help` for information of all commands
|
|||
|
Type `help command_t` for detail of command_t
|
|||
|
gsql>sparql ./data/LUBM_q0.sql
|
|||
|
... ...
|
|||
|
Total time used: 4ms.
|
|||
|
final result is :
|
|||
|
<http://www.Department0.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department1.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department2.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department3.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department4.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department5.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department6.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department7.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department8.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department9.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department10.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department11.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department12.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department13.University0.edu/FullProfessor0>
|
|||
|
<http://www.Department14.University0.edu/FullProfessor0>
|
|||
|
</code></pre><p data-anchor-id="ujra">Notice: </p><ul data-anchor-id="3mt4">
|
|||
|
<li><p>"[empty result]" will be printed if no answer, and there is an empty line after all results.</p></li>
|
|||
|
<li><p>readline lib is used, so you can use arrow key in your keyboard to see command history, and use and arrow key to move and modify your entire command.</p></li>
|
|||
|
<li><p>path completion is supported for utility. (not built-in command completion)</p></li>
|
|||
|
</ul><div class="md-section-divider"></div><h4 id="3-gserver" data-anchor-id="53l4">3. gserver</h4><p data-anchor-id="47v1">gserver is a daemon. It should be launched first when accessing gStore by gclient or API. It communicates with client through socket. </p><pre data-anchor-id="879t"><code>[bookug@localhost gStore]$ bin/gserver
|
|||
|
port=3305
|
|||
|
Wait for input...
|
|||
|
</code></pre><p data-anchor-id="iii8">You can also assign a custom port for listening.</p><pre data-anchor-id="qu1s"><code>[bookug@localhost gStore]$ bin/gserver 3307
|
|||
|
port=3307
|
|||
|
Wait for input...
|
|||
|
</code></pre><p data-anchor-id="jmph">Notice: Multiple threads are not supported by gserver. If you start up gclient in more than one terminal in the same time, gserver will go down.</p><div class="md-section-divider"></div><h4 id="4-gclient" data-anchor-id="wvpv">4. gclient</h4><p data-anchor-id="nt58">gclient is designed as a client to send commands and receive feedbacks.</p><pre data-anchor-id="dvkb"><code>[bookug@localhost gStore]$ bin/gclient
|
|||
|
ip=127.0.0.1 port=3305
|
|||
|
gsql>help
|
|||
|
help - print commands message
|
|||
|
quit - quit the console normally
|
|||
|
import - build a database for a given dataset
|
|||
|
load - load an existen database
|
|||
|
unload - unload an existen database
|
|||
|
sparql - load query from the second argument
|
|||
|
show - show the current database's name
|
|||
|
gsql>import lubm.db data/LUBM_10.n3
|
|||
|
import RDF file to database done.
|
|||
|
gsql>load lubm.db
|
|||
|
load database done.
|
|||
|
gsql>sparql "select ?s ?o where { ?s <rdf:type> ?o . }"
|
|||
|
[empty result]
|
|||
|
|
|||
|
gsql>quit
|
|||
|
</code></pre><p data-anchor-id="fhqd">You can also assign gserver's ip and port.</p><pre data-anchor-id="1890"><code>[bookug@localhost gStore]$ bin/gclient 172.31.19.15 3307
|
|||
|
ip=172.31.19.15 port=3307
|
|||
|
gsql>
|
|||
|
</code></pre><p data-anchor-id="2j3o">We can use these following commands now:</p><ul data-anchor-id="sxc5">
|
|||
|
<li><p><code>help</code> shows the information of all commands</p></li>
|
|||
|
<li><p><code>import db_name rdf_triple_file_name</code> build a database from RDF triple file</p></li>
|
|||
|
<li><p><code>load db_name</code> load an existing database</p></li>
|
|||
|
<li><p><code>unload db_name</code> unload database, but will not delete it on disk, you can load it next time</p></li>
|
|||
|
<li><p><code>sparql "query_string"</code> query the current database with a SPARQL query string(quoted by "")</p></li>
|
|||
|
<li><p><code>show</code> displays the name of the current loaded database</p></li>
|
|||
|
</ul><p data-anchor-id="zl2v">Notice:</p><ul data-anchor-id="rs1b">
|
|||
|
<li><p>at most one database can be loaded in the gclient console</p></li>
|
|||
|
<li><p>you can place ' ' or '\t' between different parts of command, but not use characters like ';'</p></li>
|
|||
|
<li><p>you should not place any space or tab ahead of the start of any command</p></li>
|
|||
|
</ul><div class="md-section-divider"></div><h4 id="5-test-utilities" data-anchor-id="rsyx">5. test utilities</h4><p data-anchor-id="6uet">A series of test program are placed in the test/ folder, and we will introduce the two useful ones: gtest.cpp and full_test.sh</p><p data-anchor-id="a8cq"><strong>gtest is used to test gStore with multiple datasets and queries.</strong></p><p data-anchor-id="sgms">To use gtest utility, please type <code>make gtest</code> to compile the gtest program first. Program gtest is a test tool to generate structural logs for datasets. Please type <code>./gtest --help</code> in the working directory for details.</p><p data-anchor-id="rdtw"><strong>Please change paths in the test/gtest.cpp if needed.</strong></p><p data-anchor-id="ue1m">You should place the datasets and queries in this way: </p><pre data-anchor-id="znc1"><code>DIR/WatDiv/database/*.nt
|
|||
|
|
|||
|
DIR/WatDiv/query/*.sql
|
|||
|
</code></pre><p data-anchor-id="qbyi">Notice that DIR is the root directory where you place all datasets waiting to be used by gtest. And WatDiv is a class of datasets, as well as LUBM. Inside WatDiv(or LUBM, etc. please place all datasets(named with .nt) in a database/ folder, and place all queries(corresponding to datasets, named with .sql) in a query folder.</p><p data-anchor-id="0fad">Then you can run the gtest program with specified parameters, and the output will be sorted into three logs in gStore root directory: load.log/(for database loading time and size), time.log/(for query time) and result.log/(for all query results, not the entire output strings, but the information to record the selected two database systems matched or not).</p><p data-anchor-id="9nc5">All logs produced by this program are in TSV format(separated with '\t'), you can load them into Calc/Excel/Gnumeric directly. Notice that time unit is ms, and space unit is kb.</p><p data-anchor-id="5b4j"><strong>full_test.sh is used to compare the performance of gStore and other database systems on multiple datasets and queries.</strong></p><p data-anchor-id="z50x">To use full_test.sh utility, please download the database system which you want to tats and compare, and set the exact position of database systems and datasets in this script. The name strategy should be the same as the requirements of gtest, as well as the logs strategy. </p><p data-anchor-id="pong">Only gStore and Jena are tested and compared in this script, but it is easy to add other database systems, if you would like to spend some time on reading this script. You may go to <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/pdf/gstore测试报告.pdf">test report</a> or <a href="#chapter13">Frequently Asked Questions</a> for help if you encounter a problem.</p><hr><p></p><p data-anchor-id="f1a9"><span id="chapter05"></span></p><div class="md-section-divider"></div><h2 id="chapter-05-api-explanation" data-anchor-id="h5mh">Chapter 05: API Explanation</h2><p data-anchor-id="yljz"><strong>This Chapter guides you to use our API for accessing gStore.</strong></p><div class="md-section-divider"></div><h3 id="easy-examples" data-anchor-id="pho1">Easy Examples</h3><p data-anchor-id="7y8r">We provide JAVA and C++ API for gStore now. Please refer to example codes in <code>api/cpp/example</code> and <code>api/java/example</code>. To use the two examples to have a try, please ensure that executables have already been generated. Otherwise, just type <code>make APIexample</code> in the root directory of gStore to compile the codes, as well as API. </p><p data-anchor-id="ggka">Next, <strong>start up a gStore server by using <code>./gserver</code> command.</strong> It is ok if you know a running usable gStore server and try to connect to it, but notice that <strong>the server ip and port of server and client must be matched.</strong>(you don't need to change any thing if using examples, just by default) Then, you need to compile the example codes in the directory gStore/api/. We provide a utility to do this, and you just need to type <code>make APIexample</code> in the root directory of gStore. Or you can compile the codes by yourself, in this case please go to gStore/api/cpp/example/ and gStore/api/java/example/, respectively.</p><p data-anchor-id="2xtl">Finally, go to the example directory and run the corresponding executables. For C++, just use <code>./example</code> command to run it. And for Java, use <code>make run</code> command or <code>java -cp ../lib/GstoreJavaAPI.jar:. JavaAPIExample</code> to run it. Both the two executables will connect to a specified gStore server and do some load or query operations. Be sure that you see the query results in the terminal where you run the examples, otherwise please go to <a href="#chapter13">Frequently Asked Questions</a> for help or report it to us.(the report approach is described in <a href="#chapter00">README</a>)</p><p data-anchor-id="voho">You are advised to read the example code carefully, as well as the corresponding Makefi
|
|||
|
<li><p>gStore/api/</p>
|
|||
|
|
|||
|
<ul><li><p>cpp/ (the C++ API)</p>
|
|||
|
|
|||
|
<ul><li><p>src/ (source code of C++ API, used to build the lib/libgstoreconnector.a)</p>
|
|||
|
|
|||
|
<ul><li><p>GstoreConnector.cpp (interfaces to interact with gStore server)</p></li>
|
|||
|
<li><p>GstoreConnector.h</p></li>
|
|||
|
<li><p>Makefile (compile and build lib)</p></li></ul></li>
|
|||
|
<li><p>lib/ (where the static lib lies in)</p>
|
|||
|
|
|||
|
<ul><li><p>.gitignore</p></li>
|
|||
|
<li><p>libgstoreconnector.a (only exist after compiled, you need to link this lib when you use the C++ API)</p></li></ul></li>
|
|||
|
<li><p>example/ (small example program to show the basic idea of using the C++ API)</p>
|
|||
|
|
|||
|
<ul><li><p>CppAPIExample.cpp</p></li>
|
|||
|
<li><p>Makefile</p></li></ul></li></ul></li>
|
|||
|
<li><p>java/ (the Java API)</p>
|
|||
|
|
|||
|
<ul><li><p>src/ (source code of Java API, used to build the lib/GstoreJavaAPI.jar)</p>
|
|||
|
|
|||
|
<ul><li><p>jgsc/ (the package which you need to import when you use the Java API)</p>
|
|||
|
|
|||
|
<ul><li>GstoreConnector.java (interfaces to interact with gStore server)</li></ul></li>
|
|||
|
<li><p>Makefile (compile and build lib)</p></li></ul></li>
|
|||
|
<li><p>lib/</p>
|
|||
|
|
|||
|
<ul><li><p>.gitignore</p></li>
|
|||
|
<li><p>GstoreJavaAPI.jar (only exist after compiled, you need to include this JAR in your class path)</p></li></ul></li>
|
|||
|
<li><p>example/ (small example program to show the basic idea of using the Java API)</p>
|
|||
|
|
|||
|
<ul><li><p>JavaAPIExample.cpp</p></li>
|
|||
|
<li><p>Makefile</p></li></ul></li></ul></li></ul></li>
|
|||
|
</ul><div class="md-section-divider"></div><h3 id="c-api" data-anchor-id="sndh">C++ API</h3><div class="md-section-divider"></div><h4 id="interface" data-anchor-id="rr70">Interface</h4><p data-anchor-id="pq0x">To use the C++ API, please place the phrase <code>#include "GstoreConnector.h"</code> in your cpp code. Functions in GstoreConnector.h should be called like below:</p><div class="md-section-divider"></div><pre style="" data-anchor-id="v4v3" class="prettyprint linenums prettyprinted"><ol class="linenums"><li class="L0"><code><span class="com">// initialize the Gstore server's IP address and port.</span></code></li><li class="L1"><code><span class="typ">GstoreConnector</span><span class="pln"> gc</span><span class="pun">(</span><span class="str">"127.0.0.1"</span><span class="pun">,</span><span class="pln"> </span><span class="lit">3305</span><span class="pun">);</span></code></li><li class="L2"><code></code></li><li class="L3"><code><span class="com">// build a new database by a RDF file.</span></code></li><li class="L4"><code><span class="com">// note that the relative path is related to gserver.</span></code></li><li class="L5"><code><span class="pln">gc</span><span class="pun">.</span><span class="pln">build</span><span class="pun">(</span><span class="str">"LUBM10.db"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"example/LUBM_10.n3"</span><span class="pun">);</span></code></li><li class="L6"><code></code></li><li class="L7"><code><span class="com">// then you can execute SPARQL query on this database.</span></code></li><li class="L8"><code><span class="pln">std</span><span class="pun">::</span><span class="kwd">string</span><span class="pln"> sparql </span><span class="pun">=</span><span class="pln"> </span><span class="str">"select ?x where \</span></code></li><li class="L9"><code><span class="str"> { \</span></code></li><li class="L0"><code><span class="str"> ?x <rdf:type> <ub:UndergraduateStudent>. \</span></code></li><li class="L1"><code><span class="str"> ?y <ub:name> <Course1>. \</span></code></li><li class="L2"><code><span class="str"> ?x <ub:takesCourse> ?y. \</span></code></li><li class="L3"><code><span class="str"> ?z <ub:teacherOf> ?y. \</span></code></li><li class="L4"><code><span class="str"> ?z <ub:name> <FullProfessor1>. \</span></code></li><li class="L5"><code><span class="str"> ?z <ub:worksFor> ?w. \</span></code></li><li class="L6"><code><span class="str"> ?w <ub:name> <Department0>. \</span></code></li><li class="L7"><code><span class="str"> }"</span><span class="pun">;</span></code></li><li class="L8"><code><span class="pln">std</span><span class="pun">::</span><span class="kwd">string</span><span class="pln"> answer </span><span class="pun">=</span><span class="pln"> gc</span><span class="pun">.</span><span class="pln">query</span><span class="pun">(</span><span class="pln">sparql</span><span class="pun">);</span></code></li><li class="L9"><code></code></li><li class="L0"><code><span class="com">// unload this database.</span></code></li><li class="L1"><code><span class="pln">gc</span><span class="pun">.</span><span class="pln">unload</span><span class="pun">(</span><span class="str">"LUBM10.db"</span><span class="pun">);</span></code></li><li class="L2"><code></code></li><li class="L3"><code><span class="com">// also, you can load some exist database directly and then query.</span></code></li><li class="L4"><code><span class="pln">gc</span><span class="pun">.</span><span class="pln">load</span><span class="pun">(</span><span class="str">"LUBM10.db"</span><span class="pun">);</span></code></li><li class="L5"><code></code></li><li class="L6"><code><span class="com">// query a SPARQL in current database</span></code></li><li class="L7"><code><span class="pln">answer </span><span
|
|||
|
<li><p>When using GstoreConnector(), the default value for ip and port is 127.0.0.1 and 3305, respectively.</p></li>
|
|||
|
<li><p>When using build(), the rdf_file_path(the second parameter) should be related to the position where gserver lies in.</p></li>
|
|||
|
<li><p>Please remember to unload the database you have loaded, otherwise things may go wrong.(the errors may not be reported!)</p></li>
|
|||
|
</ol><div class="md-section-divider"></div><h4 id="compile" data-anchor-id="o321">Compile</h4><p data-anchor-id="y5do">You are advised to see gStore/api/cpp/example/Makefile for instructions on how to compile your code with the C++ API. Generally, what you must do is compile your own code to object with header in the C++ API, and link the object with static lib in the C++ API.</p><p data-anchor-id="61x3">Let us assume that your source code is placed in test.cpp, whose position is <span class="MathJax_Preview"></span><span aria-readonly="true" role="textbox" id="MathJax-Element-1-Frame" class="MathJax_SVG" style="font-size: 100%; display: inline-block;"><svg viewBox="0 -726.9033013280564 17489.666666666664 953.8066026561128" style="width: 40.667ex; height: 2.222ex; vertical-align: -0.667ex; margin: 1px 0px;" xmlns:xlink="http://www.w3.org/1999/xlink"><g transform="matrix(1 0 0 -1 0 0)" stroke-width="0" fill="black" stroke="black"><use xlink:href="#MJMATHI-54"></use><use y="0" x="704" xlink:href="#MJMATHI-45"></use><use y="0" x="1469" xlink:href="#MJMATHI-53"></use><use y="0" x="2114" xlink:href="#MJMATHI-54"></use><use y="0" x="2819" xlink:href="#MJMAIN-2C"></use><use y="0" x="3264" xlink:href="#MJMATHI-77"></use><use y="0" x="3980" xlink:href="#MJMATHI-68"></use><use y="0" x="4557" xlink:href="#MJMATHI-69"></use><use y="0" x="4902" xlink:href="#MJMATHI-6C"></use><use y="0" x="5201" xlink:href="#MJMATHI-65"></use><use y="0" x="5667" xlink:href="#MJMATHI-74"></use><use y="0" x="6029" xlink:href="#MJMATHI-68"></use><use y="0" x="6605" xlink:href="#MJMATHI-65"></use><use y="0" x="7072" xlink:href="#MJMATHI-67"></use><use y="0" x="7552" xlink:href="#MJMATHI-53"></use><use y="0" x="8198" xlink:href="#MJMATHI-74"></use><use y="0" x="8559" xlink:href="#MJMATHI-6F"></use><use y="0" x="9045" xlink:href="#MJMATHI-72"></use><use y="0" x="9496" xlink:href="#MJMATHI-65"></use><use y="0" x="9963" xlink:href="#MJMATHI-70"></use><use y="0" x="10466" xlink:href="#MJMATHI-72"></use><use y="0" x="10918" xlink:href="#MJMATHI-6F"></use><use y="0" x="11403" xlink:href="#MJMATHI-6A"></use><use y="0" x="11816" xlink:href="#MJMATHI-65"></use><use y="0" x="12282" xlink:href="#MJMATHI-63"></use><use y="0" x="12716" xlink:href="#MJMATHI-74"></use><use y="0" x="13077" xlink:href="#MJMATHI-70"></use><use y="0" x="13581" xlink:href="#MJMATHI-6F"></use><use y="0" x="14066" xlink:href="#MJMATHI-73"></use><use y="0" x="14536" xlink:href="#MJMATHI-69"></use><use y="0" x="14881" xlink:href="#MJMATHI-74"></use><use y="0" x="15243" xlink:href="#MJMATHI-69"></use><use y="0" x="15588" xlink:href="#MJMATHI-6F"></use><use y="0" x="16074" xlink:href="#MJMATHI-6E"></use><use y="0" x="16674" xlink:href="#MJMATHI-69"></use><use y="0" x="17020" xlink:href="#MJMATHI-73"></use></g></svg></span><script id="MathJax-Element-1" type="math/tex">{TEST}, while the gStore project position is </script>{GSTORE}/gStore.(if using devGstore as name instead of gStore, then the path is <span class="MathJax_Preview"></span><span aria-readonly="true" role="textbox" id="MathJax-Element-2-Frame" class="MathJax_SVG" style="font-size: 100%; display: inline-block;"><svg viewBox="0 -771.9033013280564 16010 1043.8066026561128" style="width: 37.222ex; height: 2.444ex; vertical-align: -0.778ex; margin: 1px 0px;" xmlns:xlink="http://www.w3.org/1999/xlink"><g transform="matrix(1 0 0 -1 0 0)" stroke-width="0" fill="black" stroke="black"><use xlink:href="#MJMATHI-47"></use><use y="0" x="786" xlink:href="#MJMATHI-53"></use><use y="0" x="1432" xlink:href="#MJMATHI-54"></use><use y="0" x="2136" xlink:href="#MJMATHI-4F"></use><use y="0" x="2900" xlink:href="#MJMATHI-52"></use><use y="0" x="3659" xlink:href="#MJMATHI-45"></use><use y="0" x="4424" xlink:href="#MJMAIN-2F"></use><use y="0" x="4924" xlink:href="#MJMATHI-64"></use><use y="0" x="5448" xlink:href="#MJMATHI-65"></use><use y="0" x="5914" xlink:href="#MJMATHI-76"></use><use y="0" x="6400" xlink:href="#MJMATHI-47"></use><use y="0" x="7186" xlink:href="#MJMATHI-73"></use><use y="0" x="7656" xlink:href="#MJMATHI-74"></use><use y="0" x="8017" xlink:h
|
|||
|
<p>Use <code>g++ -c -I${GSTORE}/gStore/api/cpp/src/ test.cpp -o test.o</code> to compile your test.cpp into test.o, relative API header is placed in api/cpp/src/.</p>
|
|||
|
|
|||
|
<p>Use <code>g++ -o test test.o -L${GSTORE}/gStore/api/cpp/lib/ -lgstoreconnector</code> to link your test.o with the libgstoreconnector.a(a static lib) in api/cpp/lib/.</p>
|
|||
|
</blockquote><p data-anchor-id="0pk5">Then you can type <code>./test</code> to execute your own program, which uses our C++ API. It is also advised for you to place relative compile commands in a Makefile, as well as other commands if you like.</p><div class="md-section-divider"></div><h3 id="java-api" data-anchor-id="od70">Java API</h3><div class="md-section-divider"></div><h4 id="interface-1" data-anchor-id="ok18">Interface</h4><p data-anchor-id="pdhh">To use the Java API, please place the phrase <code>import jgsc.GstoreConnector;</code> in your java code. Functions in GstoreConnector.java should be called like below:</p><div class="md-section-divider"></div><pre style="" data-anchor-id="8d5a" class="prettyprint linenums prettyprinted"><ol class="linenums"><li class="L0"><code><span class="com">// initialize the Gstore server's IP address and port.</span></code></li><li class="L1"><code><span class="typ">GstoreConnector</span><span class="pln"> gc </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">GstoreConnector</span><span class="pun">(</span><span class="str">"127.0.0.1"</span><span class="pun">,</span><span class="pln"> </span><span class="lit">3305</span><span class="pun">);</span></code></li><li class="L2"><code></code></li><li class="L3"><code><span class="com">// build a new database by a RDF file.</span></code></li><li class="L4"><code><span class="com">// note that the relative path is related to gserver.</span></code></li><li class="L5"><code><span class="pln">gc</span><span class="pun">.</span><span class="pln">build</span><span class="pun">(</span><span class="str">"LUBM10.db"</span><span class="pun">,</span><span class="pln"> </span><span class="str">"example/LUBM_10.n3"</span><span class="pun">);</span></code></li><li class="L6"><code></code></li><li class="L7"><code><span class="com">// then you can execute SPARQL query on this database.</span></code></li><li class="L8"><code><span class="typ">String</span><span class="pln"> sparql </span><span class="pun">=</span><span class="pln"> </span><span class="str">"select ?x where "</span></code></li><li class="L9"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"{"</span></code></li><li class="L0"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"?x <rdf:type> <ub:UndergraduateStudent>. "</span></code></li><li class="L1"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"?y <ub:name> <Course1>. "</span></code></li><li class="L2"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"?x <ub:takesCourse> ?y. "</span></code></li><li class="L3"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"?z <ub:teacherOf> ?y. "</span></code></li><li class="L4"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"?z <ub:name> <FullProfessor1>. "</span></code></li><li class="L5"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"?z <ub:worksFor> ?w. "</span></code></li><li class="L6"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"?w <ub:name> <Department0>. "</span></code></li><li class="L7"><code><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"}"</span><span class="pun">;</span></code></li><li class="L8"><code><span class="typ">String</span><span class="pln"> answer </span><span class="pun">=</span><span class="pln"> gc</span><span class="pun">.</span><span class="pln">query</span><span class="pun">(</span>
|
|||
|
<li><p>When using GstoreConnector(), the default value for ip and port is 127.0.0.1 and 3305, respectively.</p></li>
|
|||
|
<li><p>When using build(), the rdf_file_path(the second parameter) should be related to the position where gserver lies in.</p></li>
|
|||
|
<li><p>Please remember to unload the database you have loaded, otherwise things may go wrong.(the errors may not be reported!)</p></li>
|
|||
|
</ol><div class="md-section-divider"></div><h4 id="compile-1" data-anchor-id="5u9y">Compile</h4><p data-anchor-id="qpck">You are advised to see gStore/api/java/example/Makefile for instructions on how to compile your code with the Java API. Generally, what you must do is compile your own code to object with jar file in the Java API.</p><p data-anchor-id="uyzc">Let us assume that your source code is placed in test.java, whose position is <span class="MathJax_Preview"></span><span aria-readonly="true" role="textbox" id="MathJax-Element-3-Frame" class="MathJax_SVG" style="font-size: 100%; display: inline-block;"><svg viewBox="0 -726.9033013280564 17489.666666666664 953.8066026561128" style="width: 40.667ex; height: 2.222ex; vertical-align: -0.667ex; margin: 1px 0px;" xmlns:xlink="http://www.w3.org/1999/xlink"><g transform="matrix(1 0 0 -1 0 0)" stroke-width="0" fill="black" stroke="black"><use xlink:href="#MJMATHI-54"></use><use y="0" x="704" xlink:href="#MJMATHI-45"></use><use y="0" x="1469" xlink:href="#MJMATHI-53"></use><use y="0" x="2114" xlink:href="#MJMATHI-54"></use><use y="0" x="2819" xlink:href="#MJMAIN-2C"></use><use y="0" x="3264" xlink:href="#MJMATHI-77"></use><use y="0" x="3980" xlink:href="#MJMATHI-68"></use><use y="0" x="4557" xlink:href="#MJMATHI-69"></use><use y="0" x="4902" xlink:href="#MJMATHI-6C"></use><use y="0" x="5201" xlink:href="#MJMATHI-65"></use><use y="0" x="5667" xlink:href="#MJMATHI-74"></use><use y="0" x="6029" xlink:href="#MJMATHI-68"></use><use y="0" x="6605" xlink:href="#MJMATHI-65"></use><use y="0" x="7072" xlink:href="#MJMATHI-67"></use><use y="0" x="7552" xlink:href="#MJMATHI-53"></use><use y="0" x="8198" xlink:href="#MJMATHI-74"></use><use y="0" x="8559" xlink:href="#MJMATHI-6F"></use><use y="0" x="9045" xlink:href="#MJMATHI-72"></use><use y="0" x="9496" xlink:href="#MJMATHI-65"></use><use y="0" x="9963" xlink:href="#MJMATHI-70"></use><use y="0" x="10466" xlink:href="#MJMATHI-72"></use><use y="0" x="10918" xlink:href="#MJMATHI-6F"></use><use y="0" x="11403" xlink:href="#MJMATHI-6A"></use><use y="0" x="11816" xlink:href="#MJMATHI-65"></use><use y="0" x="12282" xlink:href="#MJMATHI-63"></use><use y="0" x="12716" xlink:href="#MJMATHI-74"></use><use y="0" x="13077" xlink:href="#MJMATHI-70"></use><use y="0" x="13581" xlink:href="#MJMATHI-6F"></use><use y="0" x="14066" xlink:href="#MJMATHI-73"></use><use y="0" x="14536" xlink:href="#MJMATHI-69"></use><use y="0" x="14881" xlink:href="#MJMATHI-74"></use><use y="0" x="15243" xlink:href="#MJMATHI-69"></use><use y="0" x="15588" xlink:href="#MJMATHI-6F"></use><use y="0" x="16074" xlink:href="#MJMATHI-6E"></use><use y="0" x="16674" xlink:href="#MJMATHI-69"></use><use y="0" x="17020" xlink:href="#MJMATHI-73"></use></g></svg></span><script id="MathJax-Element-3" type="math/tex">{TEST}, while the gStore project position is </script>{GSTORE}/gStore.(if using devGstore as name instead of gStore, then the path is <span class="MathJax_Preview"></span><span aria-readonly="true" role="textbox" id="MathJax-Element-4-Frame" class="MathJax_SVG" style="font-size: 100%; display: inline-block;"><svg viewBox="0 -771.9033013280564 16010 1043.8066026561128" style="width: 37.222ex; height: 2.444ex; vertical-align: -0.778ex; margin: 1px 0px;" xmlns:xlink="http://www.w3.org/1999/xlink"><g transform="matrix(1 0 0 -1 0 0)" stroke-width="0" fill="black" stroke="black"><use xlink:href="#MJMATHI-47"></use><use y="0" x="786" xlink:href="#MJMATHI-53"></use><use y="0" x="1432" xlink:href="#MJMATHI-54"></use><use y="0" x="2136" xlink:href="#MJMATHI-4F"></use><use y="0" x="2900" xlink:href="#MJMATHI-52"></use><use y="0" x="3659" xlink:href="#MJMATHI-45"></use><use y="0" x="4424" xlink:href="#MJMAIN-2F"></use><use y="0" x="4924" xlink:href="#MJMATHI-64"></use><use y="0" x="5448" xlink:href="#MJMATHI-65"></use><use y="0" x="5914" xlink:href="#MJMATHI-76"></use><use y="0" x="6400" xlink:href="#MJMATHI-47"></use><use y="0" x="7186" xlink:href="#MJMATHI-73"></use><use y="0" x="7656" xlink:href="#MJMATHI-74"></use><use y="0" x="8017" xlink:href="#MJMATHI-6F"></use><use y="0" x="8503"
|
|||
|
<p>Use <code>javac -cp ${GSTORE}/gStore/api/java/lib/GstoreJavaAPI.jar test.java</code> to compile your test.java into test.class with the GstoreJavaAPI.jar(a jar package used in Java) in api/java/lib/.</p>
|
|||
|
</blockquote><p data-anchor-id="vumd">Then you can type <code>java -cp ${GSTORE}/gStore/api/java/lib/GstoreJavaAPI.jar:. test</code> to execute your own program(notice that the ":." in command cannot be neglected), which uses our Java API. It is also advised for you to place relative compile commands in a Makefile, as well as other commands if you like.</p><hr><p></p><p data-anchor-id="awke"><span id="chapter06"></span></p><div class="md-section-divider"></div><h2 id="chapter-06-project-structure" data-anchor-id="x3hj">Chapter 06: Project Structure</h2><p data-anchor-id="dnuq"><strong>This chapter introduce the whole structure of the gStore system project.</strong></p><div class="md-section-divider"></div><h4 id="the-core-source-codes-are-listed-below" data-anchor-id="j54e">The core source codes are listed below:</h4><ul data-anchor-id="vriw">
|
|||
|
<li><p>Database/ (calling other core parts to deal with requests from interface part)</p>
|
|||
|
|
|||
|
<ul><li><p>Database.cpp (achieve functions)</p></li>
|
|||
|
<li><p>Database.h (class, members and functions definitions)</p></li>
|
|||
|
<li><p>Join.cpp (join the node candidates to get results)</p></li>
|
|||
|
<li><p>Join.h (class, members,, and functions definitions)</p></li></ul></li>
|
|||
|
<li><p>KVstore/ (a key-value store to swap between memory and disk)</p>
|
|||
|
|
|||
|
<ul><li><p>KVstore.cpp (interact with upper layers)</p></li>
|
|||
|
<li><p>KVstore.h</p></li>
|
|||
|
<li><p>heap/ (a heap of nodes whose content are in memory)</p>
|
|||
|
|
|||
|
<ul><li><p>Heap.cpp</p></li>
|
|||
|
<li><p>Heap.h</p></li></ul></li>
|
|||
|
<li><p>node/ (all kinds of nodes in B+-tree)</p>
|
|||
|
|
|||
|
<ul><li><p>Node.cpp (the base class of IntlNode and LeafNode)</p></li>
|
|||
|
<li><p>Node.h</p></li>
|
|||
|
<li><p>IntlNode.cpp (internal nodes in B+-tree)</p></li>
|
|||
|
<li><p>IntlNode.h</p></li>
|
|||
|
<li><p>LeafNode.cpp (leaf nodes in B+-tree)</p></li>
|
|||
|
<li><p>LeafNode.h</p></li></ul></li>
|
|||
|
<li><p>storage/ (swap contents between memory and disk)</p>
|
|||
|
|
|||
|
<ul><li><p>file.h</p></li>
|
|||
|
<li><p>Storage.cpp</p></li>
|
|||
|
<li><p>Storage.h</p></li></ul></li>
|
|||
|
<li><p>tree/ (implement all tree operations and interfaces)</p>
|
|||
|
|
|||
|
<ul><li><p>Tree.cpp</p></li>
|
|||
|
<li><p>Tree.h</p></li></ul></li></ul></li>
|
|||
|
<li><p>Query/ (needed to answer SPARQL query)</p>
|
|||
|
|
|||
|
<ul><li><p>BasicQuery.cpp (basic type of queries without aggregate operations)</p></li>
|
|||
|
<li><p>BasicQuery.h</p></li>
|
|||
|
<li><p>IDList.cpp (candidate list of a node/variable in query)</p></li>
|
|||
|
<li><p>IDList.h </p></li>
|
|||
|
<li><p>ResultSet.cpp (keep the result set corresponding to a query)</p></li>
|
|||
|
<li><p>ResultSet.h</p></li>
|
|||
|
<li><p>SPARQLquery.cpp (deal with a entire SPARQL query)</p></li>
|
|||
|
<li><p>SPARQLquery.h</p></li>
|
|||
|
<li><p>Varset.cpp</p></li>
|
|||
|
<li><p>Varset.h</p></li>
|
|||
|
<li><p>QueryTree.cpp</p></li>
|
|||
|
<li><p>QueryTree.h</p></li>
|
|||
|
<li><p>GeneralEvaluation.cpp</p></li>
|
|||
|
<li><p>GeneralEvaluation.h</p></li>
|
|||
|
<li><p>RegexExpression.h</p></li></ul></li>
|
|||
|
<li><p>Signature/ (assign signatures for nodes and edges, but not for literals)</p>
|
|||
|
|
|||
|
<ul><li><p>SigEntry.cpp</p></li>
|
|||
|
<li><p>SigEntry.h</p></li>
|
|||
|
<li><p>Signature.cpp</p></li>
|
|||
|
<li><p>Signature.h</p></li></ul></li>
|
|||
|
<li><p>VSTree/ (an tree index to prune more efficiently)</p>
|
|||
|
|
|||
|
<ul><li><p>EntryBuffer.cpp</p></li>
|
|||
|
<li><p>EntryBuffer.h</p></li>
|
|||
|
<li><p>LRUCache.cpp</p></li>
|
|||
|
<li><p>LRUCache.h</p></li>
|
|||
|
<li><p>VNode.cpp</p></li>
|
|||
|
<li><p>VNode.h</p></li>
|
|||
|
<li><p>VSTree.cpp</p></li>
|
|||
|
<li><p>VSTree.h</p></li></ul></li>
|
|||
|
</ul><div class="md-section-divider"></div><h4 id="the-parser-part-is-listed-below" data-anchor-id="fof0">The parser part is listed below:</h4><ul data-anchor-id="gdf6">
|
|||
|
<li><p>Parser/</p>
|
|||
|
|
|||
|
<ul><li><p>DBParser.cpp</p></li>
|
|||
|
<li><p>DBParser.h</p></li>
|
|||
|
<li><p>RDFParser.cpp</p></li>
|
|||
|
<li><p>RDFParser.h</p></li>
|
|||
|
<li><p>SparqlParser.c (auto-generated, subtle modified manually, compressed)</p></li>
|
|||
|
<li><p>SparqlParser.h (auto-generated, subtle modified manually, compressed)</p></li>
|
|||
|
<li><p>SparqlLexer.c (auto-generated, subtle modified manually, compressed)</p></li>
|
|||
|
<li><p>SparqlLexer.h (auto-generated, subtle modified manually, compressed)</p></li>
|
|||
|
<li><p>TurtleParser.cpp</p></li>
|
|||
|
<li><p>TurtleParser.h</p></li>
|
|||
|
<li><p>Type.h</p></li>
|
|||
|
<li><p>QueryParser.cpp</p></li>
|
|||
|
<li><p>QueryParser.h</p></li></ul></li>
|
|||
|
</ul><div class="md-section-divider"></div><h4 id="the-utilities-are-listed-below" data-anchor-id="0y9z">The utilities are listed below:</h4><ul data-anchor-id="vhu5">
|
|||
|
<li><p>Util/</p>
|
|||
|
|
|||
|
<ul><li><p>Util.cpp (headers, macros, typedefs, functions...)</p></li>
|
|||
|
<li><p>Util.h</p></li>
|
|||
|
<li><p>Bstr.cpp (represent strings of arbitrary length)</p></li>
|
|||
|
<li><p>Bstr.h (class, members and functions definitions)</p></li>
|
|||
|
<li><p>Stream.cpp (store and use temp results, which may be very large)</p></li>
|
|||
|
<li><p>Stream.h</p></li>
|
|||
|
<li><p>Triple.cpp (deal with triples, a triple can be divided as subject(entity), predicate(entity), object(entity or literal))</p></li>
|
|||
|
<li><p>Triple.h</p></li>
|
|||
|
<li><p>BloomFilter.cpp</p></li>
|
|||
|
<li><p>BloomFilter.h</p></li></ul></li>
|
|||
|
</ul><div class="md-section-divider"></div><h4 id="the-interface-part-is-listed-below" data-anchor-id="g4mk">The interface part is listed below:</h4><ul data-anchor-id="w4d9">
|
|||
|
<li><p>Server/ (client and server mode to use gStore)</p>
|
|||
|
|
|||
|
<ul><li><p>Client.cpp</p></li>
|
|||
|
<li><p>Client.h</p></li>
|
|||
|
<li><p>Operation.cpp</p></li>
|
|||
|
<li><p>Operation.h</p></li>
|
|||
|
<li><p>Server.cpp</p></li>
|
|||
|
<li><p>Server.h</p></li>
|
|||
|
<li><p>Socket.cpp</p></li>
|
|||
|
<li><p>Socket.h</p></li></ul></li>
|
|||
|
<li><p>Main/ (a series of applications/main-program to operate on gStore)</p>
|
|||
|
|
|||
|
<ul><li><p>gload.cpp (import a RDF dataset)</p></li>
|
|||
|
<li><p>gquery.cpp (query a database)</p></li>
|
|||
|
<li><p>gserver.cpp (start up the gStore server)</p></li>
|
|||
|
<li><p>gclient.cpp (connect to a gStore server and interact)</p></li></ul></li>
|
|||
|
</ul><div class="md-section-divider"></div><h4 id="more-details" data-anchor-id="x26p">More details</h4><p data-anchor-id="7z72">To acquire a deep understanding of gStore codes, please go to <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/pdf/代码目录及概览.pdf">Code Detail</a>. See <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/pdf/Gstore2.0_useCaseDoc.pdf">use case</a> to understand the design of use cases, and see <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/pdf/OOA_class.pdf">OOA</a> and <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/pdf/OOD_class.pdf">OOD</a> for OOA design and OOD design, respectively.</p><p data-anchor-id="gbuu">If you want to know the sequence of a running gStore, please view the list below:</p><ul data-anchor-id="8lxv">
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A01-连接Server.jpg">connect to server</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A02-断开与Server的连接.jpg">disconnect server</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A03-加载数据库实例.jpg">load database</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A04-卸载数据库实例.jpg">unload database</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A05-创建数据库实例.jpg">create database</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A06-删除数据库实例.jpg">delete database</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A07-连接数据库实例.jpg">connect to database</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A08-断开与数据库实例的连接.jpg">disconnect database</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A09-查看数据库实例列表.jpg">show databases</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A10-查询SPARQL.jpg">SPARQL query</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A11-导入RDF数据集.jpg">import RDF dataset</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A12-插入一条RDF三元组数据.jpg">insert a triple</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/A13-删除一条RDF三元组数据.jpg">delete a triple</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/B01-创建账户.jpg">create account</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/B02-删除账户.jpg">delete account</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/B03-修改账户权限.jpg">modify account authority</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/B04-强制卸载数据库实例.jpg">compulsively unload database</a></p></li>
|
|||
|
<li><p><a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/jpg/B05-查看账户权限信息.jpg">see account authority</a></p></li>
|
|||
|
</ul><p data-anchor-id="7q0l">It is really not strange to see something different with the original design in the source code. And some designed functions may have not be achieved so far.</p><div class="md-section-divider"></div><h4 id="others" data-anchor-id="d9f4">Others</h4><p data-anchor-id="j61u">The api/ folder in gStore is used to store API program, libs and examples, please go to <a href="#chapter05">API</a> for details. And test/ is used to store a series test programs or utilities, such as gtest, full_test and so on. Chapters related with test/ are <a href="#chapter04">How To Use</a> and <a href="#chapter09">Test Result</a>. This project need an ANTLR lib to parse the SPARQL query, whose code is placed in tools/(also archived here) and the compiled libantlr.a is placed in lib/ directory.</p><p data-anchor-id="fgqw">We place some datasets and queries in data/ directory as examples, and you can try them to see how gStore works. Related instructions are in <a href="#chapter04">How To Use</a>. The docs/ directory contains all kinds of documents of gStore, including a series of markdown files and two folders, pdf/ and jpg/. Files whose type is pdf are placed in pdf/ folder, while files with jpg type are placed in jpg/ folder.</p><p data-anchor-id="yirl">You are advised to start from the <a href="#chapter00">README</a> in the gStore root directory, and visit other chapters only when needed. At last, you will see all documents from link to link if you are really interested in gStore.</p><hr><p></p><p data-anchor-id="9kml"><span id="chapter07"></span></p><div class="md-section-divider"></div><h2 id="chapter-07-publications" data-anchor-id="03gp">Chapter 07: Publications</h2><div class="md-section-divider"></div><h4 id="publications-related-with-gstore-are-listed-here" data-anchor-id="qg4t">Publications related with gStore are listed here:</h4><ul data-anchor-id="cn88">
|
|||
|
<li><p>Lei Zou, M. Tamer Özsu,Lei Chen, Xuchuan Shen, Ruizhe Huang, Dongyan Zhao, <a target="_blank" href="http://www.icst.pku.edu.cn/intro/leizou/projects/papers/gStoreVLDBJ.pdf">gStore: A Graph-based SPARQL Query Engine</a>, VLDB Journal , 23(4): 565-590, 2014.</p></li>
|
|||
|
<li><p>Lei Zou, Jinghui Mo, Lei Chen,M. Tamer Özsu, Dongyan Zhao, <a target="_blank" href="http://www.icst.pku.edu.cn/intro/leizou/projects/papers/p482-zou.pdf">gStore: Answering SPARQL Queries Via Subgraph Matching</a>, Proc. VLDB 4(8): 482-493, 2011.</p></li>
|
|||
|
<li><p>Xuchuan Shen, Lei Zou, M. Tamer Özsu, Lei Chen, Youhuan Li, Shuo Han, Dongyan Zhao, <a target="_blank" href="http://www.icst.pku.edu.cn/intro/leizou/projects/papers/demo.pdf">A Graph-based RDF Triple Store</a>, in Proc. 31st International Conference on Data Engineering (ICDE), 2015; To appear (demo).</p></li>
|
|||
|
<li><p>Peng Peng, Lei Zou, M. Tamer Özsu, Lei Chen, Dongyan Zhao: Processing SPARQL queries over distributed RDF graphs. VLDB Journal (2016) (accepted, to appear)</p></li>
|
|||
|
<li><p>Dong Wang, Lei Zou, Yansong Feng, Xuchuan Shen, Jilei Tian, and Dongyan Zhao, <a target="_blank" href="http://www.icst.pku.edu.cn/intro/leizou/projects/papers/Store.pdf">S-store: An Engine for Large RDF Graph Integrating Spatial Information</a>, in Proc. 18th International Conference on Database Systems for Advanced Applications (DASFAA), pages 31-47, 2013.</p></li>
|
|||
|
<li><p>Dong Wang, Lei Zou and Dongyan Zhao, <a target="_blank" href="http://www.icst.pku.edu.cn/intro/leizou/projects/papers/edbtdemo2014.pdf">gst-Store: An Engine for Large RDF Graph Integrating Spatiotemporal Information</a>, in Proc. 17th International Conference on Extending Database Technology (EDBT), pages 652-655, 2014 (demo).</p></li>
|
|||
|
<li><p>Lei Zou, Yueguo Chen, <a target="_blank" href="http://www.icst.pku.edu.cn/intro/leizou/documentation/pdf/2012CCCF.pdf">A Survey of Large-Scale RDF Data Management</a>, Comunications of CCCF Vol.8(11): 32-43, 2012 (Invited Paper, in Chinese).</p></li>
|
|||
|
</ul><hr><p></p><p data-anchor-id="7z0m"><span id="chapter08"></span></p><div class="md-section-divider"></div><h2 id="chapter-08-updated-logs" data-anchor-id="55p2">Chapter 08: Updated Logs</h2><div class="md-section-divider"></div><h3 id="apr-01-2016" data-anchor-id="3bt2">Apr 01, 2016</h3><p data-anchor-id="o93p">The structure of this project has changed a lot now. A new join method has been achieved and we use it to replace the old one. The test result shows that speed is improved and the memory cost is lower. We also do some change to Parser/Sparql*, which are all generated by ANTLR. They must be modified because the code is in C, which brings several multiple definition problems, and its size is too large. </p><p data-anchor-id="nrpz">There is a bug in the original Stream module, which brings some control characters to the output, such as ^C, ^V and so on. We have fixed it now and enabled the Stream to sort the output strings(both internal and external). In addition, SPARQL queries which are not BGP(Basic Graph Pattern) are also supported now, using the naive method.</p><p data-anchor-id="nyvr">A powerful interactive console, which is named <code>gconsole</code> now, is achieved to bring convenience to users. What is more, we use valgrind tools to test our system, and deal with several memory leaks.</p><p data-anchor-id="d22i">The docs and API have also changed, but this is of little importance.</p><div class="md-section-divider"></div><h3 id="nov-06-2015" data-anchor-id="xuti">Nov 06, 2015</h3><p data-anchor-id="iq69">We merge several classes(like Bstr) and adjust the project structure, as well as the debug system. </p><p data-anchor-id="5lnd">In addition, most warnings are removed, except for warnings in Parser module, which is due to the use of ANTLR.</p><p data-anchor-id="fezv">What is more, we change RangeValue module to Stream, and add Stream for ResultSet. We also better the gquery console, so now you can redirect query results to a specified file in the gsql console.</p><p data-anchor-id="p1uh">Unable to add Stream for IDlist due to complex operations, but this is not necessary. Realpath is used to supported soft links in the gquery console, but it not works in Gstore.(though works if not in Gstore)</p><div class="md-section-divider"></div><h3 id="oct-20-2015" data-anchor-id="fji6">Oct 20, 2015</h3><p data-anchor-id="ygw4">We add a gtest tool for utility, you can use it to query several datasets with their own queries.</p><p data-anchor-id="xqva">In addition, gquery console is improved. Readline lib is used for input instead of fgets, and the gquery console can support commands history, modifying command and commands completion now.</p><p data-anchor-id="46pc">What is more, we found and fix a bug in Database/(a pointer for debugging log is not set to NULL after fclose operation, so if you close one database and open another, the system will fail entirely because the system think that the debugging log is still open)</p><div class="md-section-divider"></div><h3 id="sep-25-2015" data-anchor-id="7ore">Sep 25, 2015</h3><p data-anchor-id="3510">We implement the version of B+Tree, and replace the old one.</p><p data-anchor-id="1v66">After testing on DBpedia, LUBM, and WatDiv benchmark, we conclude that the new BTree performs more efficient than <br>
|
|||
|
the old version. For the same triple file, the new version spends shorter time on executing gload command.</p><p data-anchor-id="0z8l">Besides, the new version can handle the long literal objects efficiently, while triples whose object's length exceeds 4096 bytes result in frequent inefficient split operations on the old version BTree. </p><div class="md-section-divider"></div><h3 id="feb-2-2015" data-anchor-id="rvbe">Feb 2, 2015</h3><p data-anchor-id="emhc">We modify the RDF parser and SPARQL parser.</p><p data-anchor-id="pdtw">Under the new RDF parser, we also redesign the encode strategy, which reduces RDF file scanning times.</p><p data-anchor-id="0idd">Now we can parse the standard SPARQL v1.1 grammar correctly, and can support basic graph pattern(BGP) SPARQL queries written by this standard grammar.</p><div class="md-section-divider"></div><h3 id="dec-11-2014" data-anchor-id="61r2">Dec 11, 2014</h3><p data-anchor-id="xiao">We add API for C/CPP and JAVA.</p><div class="md-section-divider"></div><h3 id="nov-20-2014" data-anchor-id="y254">Nov 20, 2014</h3><p data-anchor-id="7dy5">We share our gStore2.0 code as an open-source project under BSD license on github.</p><hr><p></p><p data-anchor-id="rrkb"><span id="chapter09"></span></p><div class="md-section-divider"></div><h2 id="chapter-09-test-results" data-anchor-id="e0hb">Chapter 09: Test Results</h2><div class="md-section-divider"></div><h3 id="preparation" data-anchor-id="o0lw">Preparation</h3><p data-anchor-id="ipuk">We have compared the performance of gStore with several other database systems, such as <a target="_blank" href="http://jena.apache.org/">Jena</a>, <a target="_blank" href="http://www.rdf4j.org/">Sesame</a>, <a target="_blank" href="http://virtuoso.openlinksw.com/">Virtuoso</a> and so on. Contents to be compared are the time to build database, the size of the built database, the time to answer single SPARQL query and the matching case of single query's results. In addition, if the memory cost is very large(>20G), we will record the memory cost when running these database systems.(not accurate, just for your reference)</p><p data-anchor-id="xnv2">To ensure all database systems can run correctly on all datasets and queries, the format of datasets must be supported by all database systems and the queries should not contain update operations, aggregate operations and operations related with uncertain predicates. Notice that when measuring the time to answer queries, the time of loading database index should not be included. To ensure this principle, we load the database index first for some database systems, and warm up several times for others.</p><p data-anchor-id="k7ha">Datasets used here are WatDiv, Lubm, Bsbm and DBpedia. Some of them are provided by websites, and others are generated by algorithms. Queries are generated by algorithms or written by us.</p><p data-anchor-id="0lnv">The experiment environment is a CentOS server, whose memory size is 82G and disk size is 7T. We use <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/test/full_test.sh">full_test</a> to do this test.</p><div class="md-section-divider"></div><h3 id="result" data-anchor-id="0ncc">Result</h3><p data-anchor-id="k75d">The performance of different database management systems is as below(in watdiv_200, time unit is millisecond):</p><table class="table table-striped-white table-bordered" data-anchor-id="3r3e">
|
|||
|
<thead>
|
|||
|
<tr>
|
|||
|
<th style="text-align:left;">dbms</th>
|
|||
|
<th style="text-align:left;">time</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr>
|
|||
|
<td style="text-align:left;">gstore</td>
|
|||
|
<td style="text-align:left;">4429</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">jena</td>
|
|||
|
<td style="text-align:left;">31857</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">sesame</td>
|
|||
|
<td style="text-align:left;">12468</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">virtuoso</td>
|
|||
|
<td style="text-align:left;">15117</td>
|
|||
|
</tr>
|
|||
|
</tbody></table><table class="table table-striped-white table-bordered" data-anchor-id="gurk">
|
|||
|
<thead>
|
|||
|
<tr>
|
|||
|
<th style="text-align:left;">dbms</th>
|
|||
|
<th style="text-align:left;">time</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr>
|
|||
|
<td style="text-align:left;">gstore</td>
|
|||
|
<td style="text-align:left;">197</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">jena</td>
|
|||
|
<td style="text-align:left;">1158</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">sesame</td>
|
|||
|
<td style="text-align:left;">1695</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">virtuoso</td>
|
|||
|
<td style="text-align:left;">2488</td>
|
|||
|
</tr>
|
|||
|
</tbody></table><table class="table table-striped-white table-bordered" data-anchor-id="thpr">
|
|||
|
<thead>
|
|||
|
<tr>
|
|||
|
<th style="text-align:left;">dbms</th>
|
|||
|
<th style="text-align:left;">time</th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody><tr>
|
|||
|
<td style="text-align:left;">gstore</td>
|
|||
|
<td style="text-align:left;">245</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">jena</td>
|
|||
|
<td style="text-align:left;">381</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">sesame</td>
|
|||
|
<td style="text-align:left;">1069</td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td style="text-align:left;">virtuoso</td>
|
|||
|
<td style="text-align:left;">359</td>
|
|||
|
</tr>
|
|||
|
</tbody></table><p data-anchor-id="7xhq">This program produces many logs placed in result.log/, load.log/ and time.log/. You can see that all results of all queries are matched by viewing files in result.log/, and the time cost and space cost of gStore to build database are larger than others by viewing files in load.log/. More precisely, there is an order of magnitude difference between gStore and others in the time/space cost of building database. </p><p data-anchor-id="84as">Through analysing time.log/, we can find that gStore behave better than others on very complicated queries(many variables, circles, etc). For other simple queries, there is not much difference between the time of these database systems.</p><p data-anchor-id="201r">Generally speaking, the memory cost of gStore when answering queries is higher than others. More complicated the query is and more large the dataset is, more apparent the phenomenon is.</p><p data-anchor-id="ghsj">You can find more detailed information in <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/docs/pdf/gstore测试报告.pdf">test report</a>. Notice that some questions in the test report have already be solved now.</p><hr><p></p><p data-anchor-id="0shw"><span id="chapter10"></span></p><div class="md-section-divider"></div><h2 id="chapter-10-recipe-book" data-anchor-id="2bd0">Chapter 10: Recipe Book</h2><p data-anchor-id="gm53"><strong>This chapter introduces some useful tricks if you are using gStore to implement applications.</strong></p><p data-anchor-id="wys3"><em>no tips available now</em></p><hr><p></p><p data-anchor-id="av0n"><span id="chapter11"></span></p><div class="md-section-divider"></div><h2 id="chapter-11-mailing-list" data-anchor-id="ldd0">Chapter 11: Mailing List</h2><div class="md-section-divider"></div><h3 id="people" data-anchor-id="9nra">People</h3><p data-anchor-id="pora"><strong>Li Zeng and Jiaqi Chen are responsible for the gStore now.</strong></p><div class="md-section-divider"></div><h4 id="faculty" data-anchor-id="vmy2">Faculty</h4><ul data-anchor-id="boqp">
|
|||
|
<li><p>Lei Zou (Peking University) email:zoulei@pku.edu.cn, Project Leader</p></li>
|
|||
|
<li><p>M. Tamer Özsu (University of Waterloo) email: tamer.ozsu@uwaterloo.ca</p></li>
|
|||
|
<li><p>Lei Chen (Hong Kong University of Science and Technology) email: leichen@cse.ust.hk</p></li>
|
|||
|
<li><p>Dongyan Zhao (Peking Univeristy) email:zhaodongyan@pku.edu.cn</p></li>
|
|||
|
</ul><div class="md-section-divider"></div><h4 id="students" data-anchor-id="l69w">Students</h4><ul data-anchor-id="59dp">
|
|||
|
<li><p>Peng Peng (Peking University) (PhD student) email: pku09pp@pku.edu.cn</p></li>
|
|||
|
<li><p>Youhuan Li (Peking University) (PhD student) email:liyouhuan@pku.edu.cn</p></li>
|
|||
|
<li><p>Shuo Han (Peking University) (PhD student) email:hanshuo@pku.edu.cn</p></li>
|
|||
|
</ul><div class="md-section-divider"></div><h4 id="alumni" data-anchor-id="f509">Alumni</h4><ul data-anchor-id="6jd0">
|
|||
|
<li><p>Xuchuan Shen (Peking University) (Master's student, graduated) email:shenxuchuan@pku.edu.cn</p></li>
|
|||
|
<li><p>Dong Wang (Peking University) (PhD student, graduated) email:wangdong@pku.edu.cn</p></li>
|
|||
|
<li><p>Ruizhe Huang (Peking University) (Undergraudate intern, graduated)</p></li>
|
|||
|
<li><p>Jinhui Mo (Peking University) (Master's, graduated)</p></li>
|
|||
|
<li><p>Li Zeng (Peking University) (Undergraudate intern) email:zengli-syzz@pku.edu.cn</p></li>
|
|||
|
<li><p>Jiaqi Chen (Peking University) (Undergraudate intern) email:chenjiaqi93@pku.edu.cn</p></li>
|
|||
|
</ul><hr><p></p><p data-anchor-id="s6jn"><span id="chapter12"></span></p><div class="md-section-divider"></div><h2 id="chapter-12-limit-description" data-anchor-id="18h7">Chapter 12: Limit Description</h2><ol data-anchor-id="ie78">
|
|||
|
<li><p>Queries related with uncertain predicates are not supported.</p></li>
|
|||
|
<li><p>This version only supports SPARQL select query. </p></li>
|
|||
|
<li><p>Only support RDF file in N3 file format. More file formats will be supported in the next version. </p></li>
|
|||
|
<li><p>The cost of disk and memory is still very large.</p></li>
|
|||
|
</ol><hr><p></p><p data-anchor-id="r77t"><span id="chapter13"></span></p><div class="md-section-divider"></div><h2 id="chapter-13-frequently-asked-questions" data-anchor-id="56g5">Chapter 13: Frequently Asked Questions</h2><div class="md-section-divider"></div><h4 id="when-i-use-the-newer-gstore-system-to-query-the-original-database-why-error" data-anchor-id="731a">When I use the newer gStore system to query the original database, why error?</h4><p data-anchor-id="9v5s">The database produced by gStore contains several indexes, whose structures may have been chnaged in the new gStore version. So, please rebuild your dataset just in case.</p><div class="md-section-divider"></div><h4 id="why-error-when-i-try-to-write-programs-based-on-gstore-just-like-the-maingconsolecpp" data-anchor-id="z2zx">Why error when I try to write programs based on gStore, just like the Main/gconsole.cpp?</h4><p data-anchor-id="o9py">You need to add these phrases at the beginning of your main program, otherwise gStore will not run correctly: <br>
|
|||
|
//NOTICE:this is needed to set several debug files <br>
|
|||
|
Util util;</p><div class="md-section-divider"></div><h4 id="why-does-gstore-report-garbage-collection-failed-error-when-i-use-teh-java-api" data-anchor-id="3ha1">Why does gStore report "garbage collection failed" error when I use teh Java API?</h4><p data-anchor-id="oyao">You need to adjust the parameters of jvm, see <a target="_blank" href="http://www.cnblogs.com/edwardlauxh/archive/2010/04/25/1918603.html">url1</a> and <a target="_blank" href="http://www.cnblogs.com/redcreen/archive/2011/05/04/2037057.html">url2</a> for details.</p><div class="md-section-divider"></div><h4 id="when-i-compile-the-code-in-archlinux-why-the-error-that-no-ltermcap-is-reported" data-anchor-id="n4ig">When I compile the code in ArchLinux, why the error that "no -ltermcap" is reported?</h4><p data-anchor-id="6rlh">In ArchLinux, you only need to use <code>-lreadline</code> to link the readline library. Please remove the <code>-ltermcap</code> in the makefile which is located in the root of the gStore project if you would like to use ArchLinux.</p><div class="md-section-divider"></div><h4 id="why-does-gstore-report-errors-that-the-format-of-some-rdf-datasets-are-not-supported" data-anchor-id="m0ma">Why does gStore report errors that the format of some RDF datasets are not supported?</h4><p data-anchor-id="ceg1">gStore does not support all RDF formats currently, please see <a target="_blank" href="https://github.com/Caesar11/gStore/tree/master/test/format_question.txt">formats</a> for details.</p><div class="md-section-divider"></div><h4 id="when-i-read-on-github-why-are-some-documents-unable-to-be-opened" data-anchor-id="vth5">When I read on GitHub, why are some documents unable to be opened?</h4><p data-anchor-id="brnm">Codes, markdowns or other text files, and pictures can be read directly on GitHub. However, if you are using some light weight browsers like midori, for files in pdf type, please download them and read on your computer or other devices.</p><div class="md-section-divider"></div><h4 id="why-sometimes-strange-characters-appear-when-i-use-gstore" data-anchor-id="w5rn">Why sometimes strange characters appear when I use gStore?</h4><p data-anchor-id="ve0t">There are some documents's names are in Chinese, and you don't need to worry about it.</p><div class="md-section-divider"></div><h4 id="in-centos7-if-the-watdivdba-generated-database-after-gload-is-copied-or-compresseduncompressed-the-size-of-watdivdb-will-be-differentgenerally-increasing-if-using-du-h-command-to-check" data-anchor-id="tiek">In centos7, if the watdiv.db(a generated database after gload) is copied or compressed/uncompressed, the size of watdiv.db will be different(generally increasing) if using <code>du -h</code> command to check?</h4><p data-anchor-id="k7wl">It's the change of B+-trees' size in watdiv/kv_store/ that causes the change of the whole database's size. The reason is that in storage/Storage.cpp, many operations use fseek to move file pointer. As everyone knows, file is organized in blocks, and if we request for new block, file pointer may be moved beyond the end of this file(file operations are all achieved by C in gStore, no errors are reported), then contents will be written in the new position!</p><p data-anchor-id="naqf">In <strong>Advanced Programming In The Unix Environment</strong>, "file hole" is used to describe this phenomenon. "file hole" will be filled with 0, and it's also one part of the file. You can use <code>ls -l</code> to see the size of file(computing the size of holes), while <code>du -h</code> command shows the size of blocks that directory/file occupies in system. Generally, the output of <code>du -h</code> is large than that of <code>ls -l</code>, but if "file hole" exists, the opposite is the case because the size of holes are neglected.</p><p data-anchor-id="vg0k">The actual size of files containing holes are fixed, while in some operation systems, holes will be transformed to contents(also 0) when copied. Operation <code>mv</code> will not affect the size if not across different devices.(only need to adjust the file tree ind
|
|||
|
<li><p>optimize the join operation of node candidates. multiple methods should be achieved, and design a score module to select a best one</p></li>
|
|||
|
<li><p>add numeric value query function. need to answer numeric range query efficiently and space consume cannot be too large</p></li>
|
|||
|
<li><p>add a control module to heuristically select an kind of index for a SPARQL query to filter(not always vstree)</p></li>
|
|||
|
<li><p>typedef all frequently used types, to avoid inconsistence and high modify cost</p></li>
|
|||
|
</ul><div class="md-section-divider"></div><h3 id="better-the-interface" data-anchor-id="c96f">Better The Interface</h3><ul data-anchor-id="yl4g">
|
|||
|
<li><p>build a console named gconsole, which provides all operations supported by gStore.(parser and auto-complete is required)</p></li>
|
|||
|
<li><p>write web interface for gStore, and a web page to operate on it, just like virtuoso</p></li>
|
|||
|
</ul><div class="md-section-divider"></div><h3 id="idea-collection-box" data-anchor-id="638v">Idea Collection Box</h3><ul data-anchor-id="w1ig">
|
|||
|
<li><p>to support soft links in console: realpath not work...(redefined in ANTLR?)</p></li>
|
|||
|
<li><p>store command history for consoles</p></li>
|
|||
|
<li><p>warnings remain in using Parser/(antlr)!(modify sparql.g 1.1 and regenerate). change name to avoid redefine problem, or go to use executable to parse</p></li>
|
|||
|
<li><p>build compress module(such as key-value module and stream module), but the latter just needs one-pass read/write, which may causes the compress method to be used both in disk and memory. all operations of string in memory can be changed to operations after compress: provide compress/archive interface, compare function. there are many compress algorithms to be chosen, then how to choose? what about utf-8 encoding problem? this method can lower the consume of memory and disk, but consumes more CPU. However, the time is decided by isomorphism. Simple compress is not good, but too complicated method will consume too much time, how to balance? (merge the continuous same characters, Huffman tree)</p></li>
|
|||
|
<li><p>mmap to speedup KVstore?</p></li>
|
|||
|
<li><p>the strategy for Stream:is 85% valid? consider sampling, analyse the size of result set and decide strategy? how to support order by: sort in memory if not put in file; otherwise, partial sort in memory, then put into file, then proceed external sorting</p></li>
|
|||
|
</ul><hr><p></p><p data-anchor-id="6d4q"><span id="chapter15"></span></p><div class="md-section-divider"></div><h2 id="chapter-15-thanks-list" data-anchor-id="lcbr">Chapter 15: Thanks List</h2><p data-anchor-id="wim5"><strong>This chapter lists people who inspire us or contribute to this project.</strong></p><p data-anchor-id="wc1d"><em>nobody now</em></p><hr><p></p><p data-anchor-id="yenr"><strong>Thank you for reading this document. If any question or advice, or you have interests in this project, please don't hesitate to get in touch with us.</strong></p></div>
|
|||
|
</body>
|
|||
|
</html>
|