<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Carla Sanches</title>
    <description>The latest articles on DEV Community by Carla Sanches (@carlasanches).</description>
    <link>https://dev.to/carlasanches</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1027045%2F1954aa5c-04f2-4907-8c7a-9ffccd0df09f.jpeg</url>
      <title>DEV Community: Carla Sanches</title>
      <link>https://dev.to/carlasanches</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/carlasanches"/>
    <language>en</language>
    <item>
      <title>How to Debug Apache AGE Source Code Using Apache Netbeans IDE</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Sat, 22 Jul 2023 01:57:43 +0000</pubDate>
      <link>https://dev.to/carlasanches/how-to-debug-apache-age-source-code-using-apache-netbeans-ide-nkh</link>
      <guid>https://dev.to/carlasanches/how-to-debug-apache-age-source-code-using-apache-netbeans-ide-nkh</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/carlasanches/how-to-configure-apache-age-and-postgresql-for-debugging-in-apache-netbeans-ide-2i84"&gt;previous post&lt;/a&gt;, I demonstrated how to configure Netbeans for debugging PostgreSQL and Apache AGE. Now, in continuation of that topic, I will explain how to set project preferences and perform the debugging process. So, if you have already configured the PostgreSQL and Apache AGE projects in Netbeans, you can follow the next steps.&lt;/p&gt;

&lt;p&gt;First, we need to create a new database. In the terminal, choose the directory of your preference. Then, start a new PostgreSQL service with the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;initdb agedb
pg_ctl &lt;span class="nt"&gt;-D&lt;/span&gt; path/to/agedb &lt;span class="nt"&gt;-l&lt;/span&gt; logfile start
createdb agedb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's now return to the Netbeans projects. Specifically for the AGE project, there's no need to make any alterations from the last tutorial. You can leave it as it was created previously. However, we need to configure some preferences in the IDE for PostgreSQL.&lt;/p&gt;

&lt;p&gt;In your PostgreSQL project, right-click and choose &lt;strong&gt;Properties&lt;/strong&gt;. A new window will pop up. Choose the category &lt;strong&gt;Debug&lt;/strong&gt; to set up the command to debug the code. Fill &lt;strong&gt;Debug command&lt;/strong&gt; with &lt;code&gt;psql agedb&lt;/code&gt;. This will start the command line tool to work with Apache AGE. Next, fill &lt;strong&gt;Working dir&lt;/strong&gt; with the path to psql. In the source code, the psql executable is located in &lt;code&gt;/src/bin/psql&lt;/code&gt;. This is the path Netbeans will use to run the debug command.&lt;/p&gt;

&lt;p&gt;❗ Troubleshooting Tip 1: Even if you don't intend to use the Run command, it's essential to set it up. This is a problem that I spent a couple of hours to figure out. Set the &lt;strong&gt;Run command&lt;/strong&gt; as &lt;code&gt;psql agedb&lt;/code&gt; and the &lt;strong&gt;Run directory&lt;/strong&gt; the same as the &lt;strong&gt;Debug Working dir&lt;/strong&gt;, with the path to psql. Otherwise, Netbeans will show the message below, and the IDE will not recognize psql as an executable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9it3ozufv6y2r4lqwl80.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9it3ozufv6y2r4lqwl80.png" alt="Figure 1 - “File is not an executable” issue."&gt;&lt;/a&gt;&lt;br&gt;Figure 1 - “File is not an executable” issue.
  &lt;/p&gt;

&lt;p&gt;You can let the remaining fields as default, and now the setup is ready to Debug. Right-click your Netbeans PostgreSQL project and choose &lt;strong&gt;Debug&lt;/strong&gt;. The psql CLI tool will start. Connect the database with the AGE extension with the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="n"&gt;EXTENSION&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;LOAD&lt;/span&gt; &lt;span class="s1"&gt;'age'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;search_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ag_catalog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;"$user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;public&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next step is to attach the debugger to the postgres process. Run &lt;code&gt;select pg_backend_pid();&lt;/code&gt; to find the process ID (pid). The terminal will return info similar to the following output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;pg_backend_pid&lt;/span&gt; 
&lt;span class="c1"&gt;----------------&lt;/span&gt;
          &lt;span class="mi"&gt;11587&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy the number returned in the terminal and select &lt;strong&gt;Debug &amp;gt; Attach Debugger&lt;/strong&gt; at the top toolbar. Paste the ID number in the &lt;strong&gt;Filter&lt;/strong&gt; field. The system will return the postgres process info:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtpogm9y62p92jp61lrl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtpogm9y62p92jp61lrl.png" alt="Figure 2 - Attach Debugger window."&gt;&lt;/a&gt;&lt;br&gt;Figure 2 - Attach Debugger window.
  &lt;/p&gt;

&lt;p&gt;For this tutorial, I left all the setups as default. The Debugger is Gdb Debugger, and the Host is localhost. I recommend not choosing a project because Netbeans will ask for the executable file, and you will face the same problem as Figure 2. So, select the postgres process and click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;❗ Troubleshoot Tip 2: You may face a debugger error when attaching the debugger to the postgres process, as illustrated by Figure 3.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkfdbwgdoyhir92f55ln.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkfdbwgdoyhir92f55ln.png" alt="Figure 3 - Ptrace “Operation not permitted” error."&gt;&lt;/a&gt;&lt;br&gt;Figure 3 - Ptrace “Operation not permitted” error.
  &lt;/p&gt;

&lt;p&gt;The PostgreSQL Wiki says it may be due to Ubuntu introducing a patch to disallow the ptracing of non-child processes by non-root users. ⚠️ Warning: you can disable this restriction, but this is not recommended since this can cause vulnerabilities to the system. Do it at your own risk. I will update this post when I find a better solution for PostgreSQL. See the following thread to learn more: &lt;a href="https://askubuntu.com/a/153970" rel="noopener noreferrer"&gt;https://askubuntu.com/a/153970&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To temporarily disable the restriction, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo &lt;/span&gt;0 | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /proc/sys/kernel/yama/ptrace_scope
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that it is necessary to run this command every time you start a new terminal session. While you can permanently allow it, this is not recommended. Edit &lt;code&gt;/etc/sysctl.d/10-ptrace.conf&lt;/code&gt; and change the line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kernel.yama.ptrace_scope &lt;span class="o"&gt;=&lt;/span&gt; 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kernel.yama.ptrace_scope &lt;span class="o"&gt;=&lt;/span&gt; 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, try to attach the postgres process again. If everything works, Netbeans will show this status:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy07ql919dsw8quvzzg8l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy07ql919dsw8quvzzg8l.png" alt="Figure 4 - Netbeans Debug sessions."&gt;&lt;/a&gt;&lt;br&gt;Figure 4 - Netbeans Debug sessions.
  &lt;/p&gt;

&lt;p&gt;To begin debugging, create a breakpoint on a line within the function you want to analyze. Afterward, call it via psql CLI. For instance, let's examine the &lt;code&gt;create_graph()&lt;/code&gt; function, defined in &lt;code&gt;age/src/backend/commands/graph_commands.c&lt;/code&gt;. The function header is &lt;code&gt;Datum create_graph(PG_FUNCTION_ARGS)&lt;/code&gt;. In Figure 5, I have added a breakpoint in the first function call:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frswkd5kk58cyly1jepjf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frswkd5kk58cyly1jepjf.png" alt="Figure 5 - Breakpoint example."&gt;&lt;/a&gt;&lt;br&gt;Figure 5 - Breakpoint example.
  &lt;/p&gt;

&lt;p&gt;In the CLI, call the &lt;code&gt;create_graph()&lt;/code&gt; function using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;create_graph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'graph_name'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that the Debug will stop at/close to the breakpoint:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xhoo33iijsm3uf65hwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xhoo33iijsm3uf65hwy.png" alt="Figure 6 - Debug stopped at a breakpoint at graph_commands.c file, line 69."&gt;&lt;/a&gt;&lt;br&gt;Figure 6 - Debug stopped at a breakpoint at graph_commands.c file, line 69.
  &lt;/p&gt;

&lt;p&gt;You can navigate through Debug buttons at the top (Step Over (F8), Step Into (F7), Step Out (Ctrl+F7), and Run to Cursor (F4)) to examine each line and see the variables at the Variables tab at the bottom:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fioc92avuuannrfzge46i.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fioc92avuuannrfzge46i.gif" alt="Figure 7 - Debug “Step Over” navigation."&gt;&lt;/a&gt;&lt;br&gt;Figure 7 - Debug “Step Over” navigation.
  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgw44lo06azs1yd062tq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmgw44lo06azs1yd062tq.png" alt="Figure 9 - Debug navigation buttons."&gt;&lt;/a&gt;&lt;br&gt;Figure 9 - Debug navigation buttons.
  &lt;/p&gt;

&lt;p&gt;And when you are done with debugging the function, you can click &lt;strong&gt;Continue (F5)&lt;/strong&gt; to proceed with the execution:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhbn2ylqu2qohkxg0l6et.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhbn2ylqu2qohkxg0l6et.gif" alt="Figure 10 - Proceeding with program execution."&gt;&lt;/a&gt;&lt;br&gt;Figure 10 - Proceeding with program execution.
  &lt;/p&gt;

&lt;p&gt;You can finish the Debugger session by clicking the red square button at the debug tools or pressing Shift+F5. Remember to run &lt;code&gt;\q&lt;/code&gt; to quit the psql CLI.&lt;/p&gt;

&lt;p&gt;And that’s it! This was a simple tutorial on how to Debug Apache AGE functions via Netbeans IDE. I hope you liked it and hope this can make the Debug process easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;Ask Ubuntu. “&lt;em&gt;What is the 'ptrace_scope' workaround for Wine programs and are there any risks?&lt;/em&gt;.” 2012. Available at &lt;a href="https://askubuntu.com/q/146160" rel="noopener noreferrer"&gt;https://askubuntu.com/q/146160&lt;/a&gt;. Accessed on 07/20/2023.&lt;/p&gt;

&lt;p&gt;The PostgreSQL Wiki. &lt;strong&gt;Working with Eclipse&lt;/strong&gt;. Available at &lt;a href="https://wiki.postgresql.org/wiki/Working_with_Eclipse" rel="noopener noreferrer"&gt;https://wiki.postgresql.org/wiki/Working_with_Eclipse&lt;/a&gt;. Accessed on 07/20/2023.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/" rel="noopener noreferrer"&gt;https://age.apache.org/&lt;/a&gt;&lt;br&gt;
Apache AGE Github: &lt;a href="https://github.com/apache/age" rel="noopener noreferrer"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>development</category>
      <category>c</category>
      <category>netbeans</category>
    </item>
    <item>
      <title>How to Configure Apache AGE and PostgreSQL for Debugging in Apache NetBeans IDE</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Sat, 01 Jul 2023 04:17:09 +0000</pubDate>
      <link>https://dev.to/carlasanches/how-to-configure-apache-age-and-postgresql-for-debugging-in-apache-netbeans-ide-2i84</link>
      <guid>https://dev.to/carlasanches/how-to-configure-apache-age-and-postgresql-for-debugging-in-apache-netbeans-ide-2i84</guid>
      <description>&lt;p&gt;In the previous post, I showcased 10 NetBeans IDE tools to accelerate the software development process. One of them is Debugging. I attempted to solely use GDB in the terminal for application debugging. However, it was challenging to find the exact line of the code I was debugging and determine which function to debug. This made the process extremely slow. With this tool, it is easier to visualize variables and identify the specific line where issues occur in the code. In this post, I will provide a step-by-step guide to configuring Apache AGE in NetBeans to utilize the debugging tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Prerequisites
&lt;/h2&gt;

&lt;p&gt;For this tutorial, I used the following resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ubuntu 22.04 LTS;&lt;/li&gt;
&lt;li&gt;NetBeans 18;&lt;/li&gt;
&lt;li&gt;Apache AGE 1.3.0;&lt;/li&gt;
&lt;li&gt;PostgreSQL 13.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you don't have Apache AGE and/or PostgreSQL installed yet, you can follow these guides to install from the source code according to your operating system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.to/carlasanches/easy-guide-to-install-and-configure-postgresql-with-apache-age-on-windows-n6p"&gt;PostgreSQL with Apache AGE installation on Windows with WSL&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/markgomer/installing-apache-age-with-docker-on-windows-e22"&gt;Installing Apache AGE with Docker on Windows&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/carlasanches/step-by-step-guide-to-install-apache-age-and-postgresql-via-package-management-on-ubuntu-259l"&gt;PostgreSQL with Apache AGE installation on Ubuntu&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruf13/installation-of-postgresql-age-on-mac-4gc9"&gt;Easy Installation of PostgreSQL, AGE &amp;amp; Age-viewer on Mac&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. C/C++ Environment Setup
&lt;/h2&gt;

&lt;p&gt;By default, when creating a C++ project, NetBeans offers the following options:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g5g2E0G6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ei6iy8jogdzcgf5foun.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g5g2E0G6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ei6iy8jogdzcgf5foun.png" alt="Image description" width="720" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To configure full support for C/C++ projects, we need to add a plugin. In the top toolbar, go to &lt;strong&gt;Tools &amp;gt; Plugins&lt;/strong&gt;. Then, select the Settings tab and check the option &lt;strong&gt;NetBeans 8.2 Plugin Portal&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Sy3B0FfZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uxlmlq5nl4dlnats1hl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sy3B0FfZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uxlmlq5nl4dlnats1hl4.png" alt="Image description" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, select &lt;strong&gt;Available Plugins&lt;/strong&gt; tab and click &lt;strong&gt;Check for Newest&lt;/strong&gt; button. The option for C/C++ should appear. Check this option and click on the &lt;strong&gt;Install&lt;/strong&gt; button. A new window will open. To proceed with the installation, click &lt;strong&gt;Next&lt;/strong&gt; and accept the terms and license agreements. You will also see a selection button next to the word &lt;strong&gt;Plugins&lt;/strong&gt;. This button indicates all the features that come with the installation. Finally, click on &lt;strong&gt;Install&lt;/strong&gt; to complete the process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EUgS1vrj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0bwnmcor5rxba9q5g2m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EUgS1vrj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0bwnmcor5rxba9q5g2m1.png" alt="Image description" width="800" height="681"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The installation may take a few minutes to complete. Another pop-up window may appear at the end, asking for confirmation. Click on &lt;strong&gt;Continue&lt;/strong&gt;, and the installation will finish successfully.&lt;/p&gt;

&lt;p&gt;To configure the debugging and compilation tools, go to the top toolbar and select &lt;strong&gt;Tools &amp;gt; Options&lt;/strong&gt;, then click on the &lt;strong&gt;C/C++&lt;/strong&gt; tab. In the &lt;strong&gt;Build Tools&lt;/strong&gt; section, make sure that the directories for the tools are correctly specified:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g2UjnhYD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0f68qq1bjqsvue5tn0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g2UjnhYD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0f68qq1bjqsvue5tn0r.png" alt="Image description" width="800" height="575"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Importing Projects in NetBeans
&lt;/h2&gt;

&lt;p&gt;After installing the plugin, you will notice that new options have appeared for creating C/C++ projects. Go to &lt;strong&gt;File &amp;gt; New Project &amp;gt; C/C++&lt;/strong&gt; and select option &lt;strong&gt;C/C++ Project with Existing Sources&lt;/strong&gt;. Next, I will explain how to create projects for the source code of PostgreSQL and Apache AGE.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.1. PostgreSQL
&lt;/h3&gt;

&lt;p&gt;Select the directory of the PostgreSQL repository. You can leave the options marked as default and only change the &lt;strong&gt;Select Configuration Mode&lt;/strong&gt; to &lt;strong&gt;Custom&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kFZvX90Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9e5p33ap2ddl515a3bs7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kFZvX90Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9e5p33ap2ddl515a3bs7.png" alt="Image description" width="723" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NetBeans will automatically find the PostgreSQL configuration file. Keep the option &lt;strong&gt;Pre-Build&lt;/strong&gt; selected, and then we can configure the compilation flags. In the &lt;strong&gt;Arguments&lt;/strong&gt; section, set &lt;code&gt;CC=${IDE_CC}&lt;/code&gt; to configure the compiler to the directory specified in the last step of the previous section. A &lt;em&gt;very important&lt;/em&gt; step is to define the flags for debugging and installation. Set &lt;code&gt;CFLAGS="-g3 -O0" --enable-cassert --enable-debug&lt;/code&gt; for debugging, and &lt;code&gt;--prefix&lt;/code&gt; pointing to the installation directory of PostgreSQL. In my case, it is &lt;code&gt;--prefix=/usr/local/postgresql/13.0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6u5pzWiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlnwjddqyip62wm38mjl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6u5pzWiD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlnwjddqyip62wm38mjl.png" alt="Image description" width="729" height="586"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, specify the working directory, the commands used for clean and build, and whether you want these commands executed as soon as the configuration is finished. Keep the option &lt;strong&gt;Clean and Build After Finish&lt;/strong&gt; selected. The working directory should be the directory of the PostgreSQL source code. Use &lt;code&gt;${MAKE}&lt;/code&gt; to configure the make command to the directory set in the last step of Section 2.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2jERqLru--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bldo2oc21z4byv2c2mjs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2jERqLru--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bldo2oc21z4byv2c2mjs.png" alt="Image description" width="729" height="586"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The next step is to select the directories where the relevant source code for the project is. Since we are only working with PostgreSQL, you can leave the options as default.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t30_i6Ps--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0jlmw7eovbkq5mpy4hk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t30_i6Ps--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0jlmw7eovbkq5mpy4hk.png" alt="Image description" width="725" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we select the directories to include. Choose the option &lt;strong&gt;Manual Configuration&lt;/strong&gt; and click &lt;strong&gt;Edit&lt;/strong&gt; in the &lt;strong&gt;Include Directories&lt;/strong&gt; field. Click &lt;strong&gt;Add&lt;/strong&gt; to add a new folder and browse for the directories &lt;code&gt;/src/include&lt;/code&gt; and &lt;code&gt;/src/fe_utils&lt;/code&gt; within the PostgreSQL source code directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QLrXHd1l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpvjxs44fhpyqp417j6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QLrXHd1l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpvjxs44fhpyqp417j6b.png" alt="Image description" width="725" height="588"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, let's define a name for the project and the directory where it will be saved. To avoid mixing the project with the PostgreSQL Git directory, I created a separate directory called &lt;code&gt;netbeans-projects&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FsGjXCN9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/si7whag7pv3taahycckz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FsGjXCN9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/si7whag7pv3taahycckz.png" alt="Image description" width="731" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;Finish&lt;/strong&gt;, and if you have selected the option to &lt;strong&gt;Clean and Build after Finish&lt;/strong&gt;, you will see in the integrated terminal that the command will compile the source code and return the following message, indicating that PostgreSQL has been successfully compiled.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VUvY3OZV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9nqs8m6k7he6yzyhjg8f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VUvY3OZV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9nqs8m6k7he6yzyhjg8f.png" alt="Image description" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can complete the installation through the integrated terminal by accessing the working directory. Click the &lt;strong&gt;Output&lt;/strong&gt; tab and select the option on the left, &lt;strong&gt;Open Working Directory in Terminal&lt;/strong&gt;. Then, run the command &lt;code&gt;make install&lt;/code&gt; to finalize the installation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K1es2nJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bfw9ngji8mr3a0bu0qvj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K1es2nJF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bfw9ngji8mr3a0bu0qvj.png" alt="Image description" width="800" height="249"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the end of the installation, the terminal will return the message &lt;strong&gt;Installation complete&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2. &lt;strong&gt;Apache AGE&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Apache AGE follows the step-by-step process for configuring PostgreSQL. Therefore, I will only explain the different settings from the previous walkthrough.&lt;/p&gt;

&lt;p&gt;After creating a new project and selecting the Apache AGE source code directory in the &lt;strong&gt;Pre-Build option&lt;/strong&gt;, export the environment variable &lt;code&gt;CFLAGS="-g3 -O0"&lt;/code&gt; to enable debugging.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TBHlkzSm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t9zvfktuklttgjkxg2c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TBHlkzSm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t9zvfktuklttgjkxg2c.png" alt="Image description" width="720" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, in the Build Actions option, configure the &lt;strong&gt;Clean Command&lt;/strong&gt; as &lt;code&gt;${MAKE} PG_CONFIG=/usr/local/postgresql/13.0/bin/pg_config distclean&lt;/code&gt; and the &lt;strong&gt;Build Command&lt;/strong&gt; as &lt;code&gt;${MAKE} PG_CONFIG=/usr/local/postgresql/13.0/bin/pg_config install&lt;/code&gt;. Note that the &lt;code&gt;PG_CONFIG&lt;/code&gt; variable will point to the &lt;code&gt;pg_config&lt;/code&gt; file in the PostgreSQL installation directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Aw_erQ9U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ok4q2xsol5ndzxf7hlj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Aw_erQ9U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ok4q2xsol5ndzxf7hlj.png" alt="Image description" width="720" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Skipping to the &lt;strong&gt;Code Assistance Configuration&lt;/strong&gt; step, add the &lt;code&gt;src/include&lt;/code&gt; folder inside the age source code directory, as well as the directories &lt;code&gt;/src/include&lt;/code&gt; and &lt;code&gt;/src/fe_utils&lt;/code&gt; from PostgreSQL. This will help prevent error suggestions when opening a code file in the IDE.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_APWJDpB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nmxv6s9j838lw05vxuxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_APWJDpB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nmxv6s9j838lw05vxuxd.png" alt="Image description" width="720" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Continue with the remaining configurations following the step-by-step process for PostgreSQL. In the end, if you have selected the option to &lt;strong&gt;Clean and Build after Finish&lt;/strong&gt;, you will see in the integrated terminal that the command will compile the source code and return the following message, indicating that AGE has been successfully compiled and installed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OZdHgOit--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8bctnaggz0mlmymnvxgq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OZdHgOit--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8bctnaggz0mlmymnvxgq.png" alt="Image description" width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this tutorial, I have provided a step-by-step guide on how to configure a NetBeans project to debug the Apache AGE source code. If you found this helpful, don't miss the next tutorial, where I will walk you through the process of debugging.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/"&gt;https://age.apache.org/&lt;/a&gt;&lt;br&gt;
Apache AGE Github: &lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. &lt;strong&gt;References&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This tutorial was based on the article &lt;em&gt;Working with Eclipse&lt;/em&gt;, available at &lt;strong&gt;&lt;a href="https://wiki.postgresql.org/wiki/Working_with_Eclipse"&gt;https://wiki.postgresql.org/wiki/Working_with_Eclipse&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>development</category>
      <category>c</category>
      <category>netbeans</category>
    </item>
    <item>
      <title>Apache AGE + Apache NetBeans: 10 Functionalities to Speed up code development</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Sat, 27 May 2023 00:07:36 +0000</pubDate>
      <link>https://dev.to/carlasanches/apache-age-apache-netbeans-10-functionalities-to-speed-up-code-development-4a8f</link>
      <guid>https://dev.to/carlasanches/apache-age-apache-netbeans-10-functionalities-to-speed-up-code-development-4a8f</guid>
      <description>&lt;p&gt;Over the past month, I have been working on a new grammar for Apache AGE using the NetBeans IDE. As a result of this experience, I have identified several features that can speed up the code development process.&lt;/p&gt;

&lt;p&gt;In this post, I will share 10 of these features essential for those who wish to take full advantage of the IDE environment and develop more quickly and efficiently. Over the next few days, I will publish other posts with more tips on using NetBeans so that you can further optimize your workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Debug
&lt;/h2&gt;

&lt;p&gt;You don't have to spend hours in the terminal looking for the correct line number to stop or typing each variable to print. Use the interface to monitor all variables and structures and evaluate the code step by step, quickly detecting errors.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BO02R6cp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k20zzjxvrsb6ftn9d6ql.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BO02R6cp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k20zzjxvrsb6ftn9d6ql.gif" alt="Figure 1 - Netbeans 17 debug tool." width="716" height="376"&gt;&lt;/a&gt;&lt;br&gt;Figure 1 - NetBeans 17 debug tool.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  2. Accessing definitions with Ctrl + click
&lt;/h2&gt;

&lt;p&gt;Are you studying a new code and need to review a structure definition? Have you found a bug in a function and want to see how it was defined? Navigate to where the structure, function, or variable was declared with Ctrl + click.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dazNkVRJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9e2ty7yj92ahbc6ywqcg.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dazNkVRJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9e2ty7yj92ahbc6ywqcg.gif" alt="Figure 2 - Link to function declarations demonstration on Netbeans 17 using Ctrl + click." width="800" height="470"&gt;&lt;/a&gt;&lt;br&gt;Figure 2 - Link to function declarations demonstration on NetBeans 17 using Ctrl + click.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  3. Multiple cursors
&lt;/h2&gt;

&lt;p&gt;Do you need to type several identical or similar lines within the same code? Speed up the process with multiple cursors. Hold down Ctrl + Shift and click elsewhere in the editor to create many cursors and type all at once.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UHVnwbUT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlel7jqgrtuukhtzar8l.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UHVnwbUT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vlel7jqgrtuukhtzar8l.gif" alt="Figure 3 - Using multiple cursors in Netbeans 17 with Ctrl + Shift." width="800" height="470"&gt;&lt;/a&gt;&lt;br&gt;Figure 3 - Using multiple cursors in NetBeans 17 with Ctrl + Shift.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Parameter passing
&lt;/h2&gt;

&lt;p&gt;With an IDE, you don't have to pass commands to the terminal every time you run the program. Just set default commands for Run and Debug, then choose an option. The parameters will always be saved there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--362XvQuo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4v6vkua2zmjxg80i6ft.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--362XvQuo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4v6vkua2zmjxg80i6ft.gif" alt="Figure 4 - Configuring commands for Run and Debug in Netbeans 17." width="800" height="454"&gt;&lt;/a&gt;&lt;br&gt;Figure 4 - Configuring commands for Run and Debug in NetBeans 17.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  5. Integration with Git/GitHub
&lt;/h2&gt;

&lt;p&gt;These are some Git/GitHub features, among other functionalities, that you can use with the NetBeans IDE:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;View the lines that were changed.&lt;/li&gt;
&lt;li&gt;Monitor branches.&lt;/li&gt;
&lt;li&gt;Clone a repository.&lt;/li&gt;
&lt;li&gt;Create commits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NehiM86V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pinf02382vzkvilhwze9.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NehiM86V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pinf02382vzkvilhwze9.gif" alt="Figure 5 - Git Diff demonstration." width="800" height="468"&gt;&lt;/a&gt;&lt;br&gt;Figure 5 - Git Diff demonstration.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  6. Spell-Checking
&lt;/h2&gt;

&lt;p&gt;Have you ever had a typo corrected by a colleague? Don't take it personally. It happens! But you can avoid it by using the spell-checking tool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--olTLfGf9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zunobn15m8wv92olutyb.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--olTLfGf9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zunobn15m8wv92olutyb.gif" alt="Figure 6 - Netbeans 17 spell checking." width="800" height="390"&gt;&lt;/a&gt;&lt;br&gt;Figure 6 - NetBeans 17 spell checking.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  7. Search tool
&lt;/h2&gt;

&lt;p&gt;Search for variables, structures, and any other type of text within the project using the search tool.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0ARqRLGv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/698w8xatsjuo4n40j7j7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0ARqRLGv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/698w8xatsjuo4n40j7j7.gif" alt="Figure 7 - Netbeans 17 search tool." width="800" height="451"&gt;&lt;/a&gt;&lt;br&gt;Figure 7 - NetBeans 17 search tool.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  8. Autocomplete
&lt;/h2&gt;

&lt;p&gt;Program faster using suggestions for autocomplete. Start typing the structure name, then hold down Ctrl + spacebar to view the autocomplete suggestions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VlF__iM7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thptgxt4au6t3kkqbf8c.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VlF__iM7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/thptgxt4au6t3kkqbf8c.gif" alt="Figure 8 - Netbeans 17 autocomplete tool." width="800" height="451"&gt;&lt;/a&gt;&lt;br&gt;Figure 8 - NetBeans 17 autocomplete tool.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  9. Code Assistance
&lt;/h2&gt;

&lt;p&gt;Avoid unexpected compilation errors with Code Assistance. The assistant helps identify possible logic problems in your code and suggests corrections to prevent the code from breaking.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P8ncIFB9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqy33oc2zkbt0xzyrgb6.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P8ncIFB9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqy33oc2zkbt0xzyrgb6.gif" alt="Figure 9 - Fixing error in NetBeans 17 with the Code Assistant." width="800" height="451"&gt;&lt;/a&gt;&lt;br&gt;Figure 9 - Fixing error in NetBeans 17 with the Code Assistant.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  10. Integrated Console
&lt;/h2&gt;

&lt;p&gt;The integrated console makes it easier to organize the environment and program everything in one place. You can use the OS terminal within the IDE.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n_m6hmy3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo4l8bpkrprs5oelwj8j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n_m6hmy3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qo4l8bpkrprs5oelwj8j.gif" alt="Figure 10 - Netbeans 17 integrated terminal." width="800" height="451"&gt;&lt;/a&gt;&lt;br&gt;Figure 10 - NetBeans 17 integrated terminal.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Using an IDE makes the developer's life much easier. It is possible to avoid unexpected errors and program more efficiently. The resources I use the most are Debug, terminal, parameter passing, and integration with Git/GitHub. Was any of these tips new to you? Do you know of any other advantages that I didn't mention? Feel free to share your thoughts in the comments below!&lt;/p&gt;

&lt;h2&gt;
  
  
  Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/"&gt;https://age.apache.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache AGE Github: &lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>programming</category>
      <category>netbeans</category>
    </item>
    <item>
      <title>How an RDBMS works #5: PostgreSQL Database Cluster Logical Structure</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Fri, 12 May 2023 23:11:28 +0000</pubDate>
      <link>https://dev.to/carlasanches/how-an-rdbms-works-5-postgresql-database-cluster-logical-structure-5h9c</link>
      <guid>https://dev.to/carlasanches/how-an-rdbms-works-5-postgresql-database-cluster-logical-structure-5h9c</guid>
      <description>&lt;h2&gt;
  
  
  1. Introduction
&lt;/h2&gt;

&lt;p&gt;In our &lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-4-creating-a-citation-graph-with-postgresql-apache-age-211j"&gt;latest blog post&lt;/a&gt;, we explored the implementation of a graph database using PostgreSQL. We used the &lt;a href="https://age.apache.org/"&gt;Apache AGE extension&lt;/a&gt;, which allows us to transform an SQL database into a graph database by combining SQL with Open Cypher. In this example, we started the PostgreSQL server as a service, using the command &lt;code&gt;sudo service postgresql start&lt;/code&gt;. This command is available when installing PostgreSQL from official Linux distribution packages. The script checks if the &lt;strong&gt;database cluster&lt;/strong&gt; exists in the default directory and creates a new one if it does not find. Finally, it  starts the service to run the cluster.&lt;/p&gt;

&lt;p&gt;In this article, we will introduce the concept of a cluster by presenting the logical structure of the PostgreSQL database cluster. Understanding this structure is fundamental for comprehending its operation, managing it effectively, simultaneously running separate databases, and optimizing performance with this tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The database cluster logical structure
&lt;/h2&gt;

&lt;p&gt;In PostgreSQL, the database cluster is a collection of databases managed by a server that runs on a single host. This concept may seem confusing, so let's break it down. Let's go back to the example of our scientific article database. This database only stores articles and their information (such as metadata). Suppose we have a second database containing information about the authors of these articles and a third database storing information about the publication vehicles of these articles. We can represent a database as shown in Figure 1.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a2416AYX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6xqefnhesb2dhpt2qb7u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a2416AYX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6xqefnhesb2dhpt2qb7u.png" alt="Representation of a database that contains scientific papers" width="251" height="334"&gt;&lt;/a&gt;&lt;br&gt;Figure 1 - Representation of a database that contains scientific papers. Elaborated by author. 
  &lt;/p&gt;

&lt;p&gt;Now, we can represent the cluster as a large structure that will store databases as objects, as shown in Figure 2.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eHX_is4K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1m8fr1vn7yldhun4wnq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eHX_is4K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z1m8fr1vn7yldhun4wnq.png" alt="Representation of the PostgreSQL database cluster that contains a collection of three databases. Elaborated by author." width="422" height="422"&gt;&lt;/a&gt;&lt;br&gt;Figure 2 - Representation of the PostgreSQL database cluster, that contains a collection of three databases. Elaborated by author. 
  &lt;/p&gt;

&lt;p&gt;In practice, if you installed PostgreSQL from the source code, it all starts with the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;initdb
pg_ctl start -l log

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;initdb&lt;/code&gt; command creates a new database cluster. With &lt;code&gt;pg_ctl&lt;/code&gt;, we can manually control the server, passing parameters to start, restart, and stop, &lt;a href="https://www.postgresql.org/docs/13/app-initdb.html"&gt;among others&lt;/a&gt;. When starting the server, it will manage the cluster and run on a single host, with localhost as the default. In other articles, I will present more details about the server. Basically, it is the parent of all processes related to cluster management. As explained in Section 1, if you installed PostgreSQL from Linux distribution packages, the same will happen when running &lt;code&gt;sudo service postgresql start&lt;/code&gt;. This command creates a new cluster if there is none and starts the server that manages it.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we reviewed the example of the scientific article database and learned the concept of the PostgreSQL database cluster and its logical structure. We also learned the commands that create the cluster and start the server that manages it. In the next post, I will present the concepts related to the cluster's physical structure, where we can delve deeper into the practical part of its operation.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Errata
&lt;/h2&gt;

&lt;p&gt;My intention is to provide access to technology information through reliable sources. If you have found any incorrect information, please let your contribution in the comments below 😊.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Related Articles
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-4-creating-a-citation-graph-with-postgresql-apache-age-211j"&gt;How an RDBMS works #4: Creating a citation graph with PostgreSQL + Apache AGE&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. References
&lt;/h2&gt;

&lt;p&gt;SUZUKI, Hironobu. The Internals of PostgreSQL for database administrators and system developers. Interdb. 2015. Available at &lt;a href="https://www.interdb.jp/pg/"&gt;https://www.interdb.jp/pg/&lt;/a&gt;. Accessed on 05/12/2023.&lt;/p&gt;

&lt;p&gt;The PostgreSQL Global Development Group. PostgreSQL 13.11 Documentation, Chapter VI. Reference, PostgreSQL Server Applications, initdb. Available at &lt;a href="https://www.postgresql.org/docs/13/app-initdb.html"&gt;https://www.postgresql.org/docs/13/app-initdb.html&lt;/a&gt;. Accessed on 05/12/2023.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/"&gt;https://age.apache.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache AGE Github: &lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>apacheage</category>
      <category>rdbms</category>
      <category>database</category>
    </item>
    <item>
      <title>AGE Viewer: How to display the contents of your Apache AGE database</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Sun, 30 Apr 2023 03:09:13 +0000</pubDate>
      <link>https://dev.to/carlasanches/age-viewer-how-to-display-the-contents-of-your-apache-age-database-ip5</link>
      <guid>https://dev.to/carlasanches/age-viewer-how-to-display-the-contents-of-your-apache-age-database-ip5</guid>
      <description>&lt;p&gt;This blog post is just a brief introduction to the &lt;a href="https://github.com/apache/age-viewer" rel="noopener noreferrer"&gt;AGE Viewer&lt;/a&gt;, a tool for visualizing graphs created with &lt;a href="https://github.com/apache/age" rel="noopener noreferrer"&gt;Apache AGE&lt;/a&gt;. Specifically, I will show how to visualize the citation graph created in &lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-4-creating-a-citation-graph-with-postgresql-apache-age-211j"&gt;the last post&lt;/a&gt; of the "&lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-lessons-from-the-internals-of-postgresql-1-45i4"&gt;How an RDBMS works&lt;/a&gt;" series.&lt;/p&gt;

&lt;p&gt;To use AGE Viewer, it will be necessary to download and install it. If you do not have the program on your machine yet, I recommend following this step-by-step guide: &lt;a href="https://dev.to/talhahahae/installing-apache-age-viewer-5dm3"&gt;Installing apache age-viewer&lt;/a&gt;. It is very simple. I am using Ubuntu 22.04 LTS with AGE Viewer 1.0.&lt;/p&gt;

&lt;p&gt;Through PostgreSQL CLI, it is possible to display all vertices of the graph with the query below, but it is not very easy to understand the output generated:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
MATCH &lt;span class="o"&gt;(&lt;/span&gt;v&lt;span class="o"&gt;)&lt;/span&gt;
RETURN v
&lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

v                                                                                                                                                                                                                                             
&lt;span class="nt"&gt;-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/span&gt;
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131970, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"williams2013towards"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2013, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Towards affective algorithmic composition"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Duncan Williams"&lt;/span&gt;, &lt;span class="s2"&gt;"Alexis Kirke"&lt;/span&gt;, &lt;span class="s2"&gt;"Eduardo R Miranda"&lt;/span&gt;, &lt;span class="s2"&gt;"Etienne Roesch"&lt;/span&gt;, &lt;span class="s2"&gt;"Slawomir Nasuto"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"University of Jyväskylä, Department of Music"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131971, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"schubert1999measurement"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 1999, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Measurement and Time Series Analysis of Emotion in Music"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Emery Schubert"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"University of New South Wales. Music &amp;amp; Music Education"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131973, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"scherer2004which"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2004, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Which Emotions Can be Induced by Music? What Are the Underlying Mechanisms? And How Can We Measure Them?"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Klaus R. Scherer"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Journal of New Music Research"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131974, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"gabrielsson2001emotion"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2001, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Emotion perceived and emotion felt: Same or different?"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Alf Gabrielsson"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Musicae Scientiae"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131975, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"scherer2001emotional"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2001, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Emotional effects of music: Production rules"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Klaus Scherer"&lt;/span&gt;, &lt;span class="s2"&gt;"Marcel Zentner"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Oxford University Press"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131976, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"juslin2001communicating"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2001, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Communicating emotion in music performance: A review and a theoretical framework"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Patrik Juslin"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Oxford University Press"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131977, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"williams2015dynamic"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2015, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Dynamic Game Soundtrack Generation in Response to a Continuously Varying Emotional Trajectory"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Duncan Williams"&lt;/span&gt;, &lt;span class="s2"&gt;"Alexis Kirke"&lt;/span&gt;, &lt;span class="s2"&gt;"Joel Eaton"&lt;/span&gt;, &lt;span class="s2"&gt;"Eduardo Miranda"&lt;/span&gt;, &lt;span class="s2"&gt;"Ian Daly"&lt;/span&gt;, &lt;span class="s2"&gt;"James Hallowell"&lt;/span&gt;, &lt;span class="s2"&gt;"Etienne Roesch"&lt;/span&gt;, &lt;span class="s2"&gt;"Faustina Hwang"&lt;/span&gt;, &lt;span class="s2"&gt;"Slawomir Nasuto"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Audio Engineering Society Conference: 56th International Conference: Audio for Games"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131978, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"williams2015investigating"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2015, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Investigating Perceived Emotional Correlates of Rhythmic Density in Algorithmic Music Composition"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Duncan Williams"&lt;/span&gt;, &lt;span class="s2"&gt;"Alexis Kirke"&lt;/span&gt;, &lt;span class="s2"&gt;"Joel Eaton"&lt;/span&gt;, &lt;span class="s2"&gt;"Eduardo Miranda"&lt;/span&gt;, &lt;span class="s2"&gt;"Ian Daly"&lt;/span&gt;, &lt;span class="s2"&gt;"James Hallowell"&lt;/span&gt;, &lt;span class="s2"&gt;"James Weaver"&lt;/span&gt;, &lt;span class="s2"&gt;"Asad Malik"&lt;/span&gt;, &lt;span class="s2"&gt;"Etienne Roesch"&lt;/span&gt;, &lt;span class="s2"&gt;"Faustina Hwang"&lt;/span&gt;, &lt;span class="s2"&gt;"Slawomir Nasuto"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Association for Computing Machinery"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131979, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"daly2015towards"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2015, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Towards human-computer music interaction: Evaluation of an affectively-driven music generator via galvanic skin response measures"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Duncan Williams"&lt;/span&gt;, &lt;span class="s2"&gt;"Alexis Kirke"&lt;/span&gt;, &lt;span class="s2"&gt;"Eduardo Miranda"&lt;/span&gt;, &lt;span class="s2"&gt;"Ian Daly"&lt;/span&gt;, &lt;span class="s2"&gt;"Faustina Hwang"&lt;/span&gt;, &lt;span class="s2"&gt;"Slawomir Nasuto"&lt;/span&gt;, &lt;span class="s2"&gt;"Asad Malik"&lt;/span&gt;, &lt;span class="s2"&gt;"James Weaver"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"2015 7th Computer Science and Electronic Engineering Conference (CEEC)"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131980, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"kirke2013artificial"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2013, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Artificial affective listening towards a machine learning tool for sound-based emotion therapy and control"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Alexis Kirke"&lt;/span&gt;, &lt;span class="s2"&gt;"Eduardo Miranda"&lt;/span&gt;, &lt;span class="s2"&gt;"Slawomir Nasuto"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Proceedings of the Sound and Music Computing Conference"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131981, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"kirke2012learningto"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2012, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Learning to Make Feelings: Expressive Performance as a part of a machine learning tool for sound-based emotion therapy and control"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Alexis Kirke"&lt;/span&gt;, &lt;span class="s2"&gt;"Eduardo Miranda"&lt;/span&gt;, &lt;span class="s2"&gt;"Slawomir Nasuto"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"the 9th Intl Symp on Computer Music Modeling and Retrieval"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131982, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"lopez2010real"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2010, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Real-Time Emotion-Driven Music Engine"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Alex Lopez"&lt;/span&gt;, &lt;span class="s2"&gt;"Antonio Oliveira"&lt;/span&gt;, &lt;span class="s2"&gt;"Amilcar Cardoso"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"the 9th Intl Symp on Computer Music Modeling and Retrieval"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131983, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"oliveira2008affective"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2008, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Affective-driven music production: selection and transformation of music"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Antonio Oliveira"&lt;/span&gt;, &lt;span class="s2"&gt;"Amilcar Cardoso"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"ARTECH"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131984, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"oliveira2008modeling"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2008, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Modeling affective content of music: A knowledge base approach"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Antonio Oliveira"&lt;/span&gt;, &lt;span class="s2"&gt;"Amilcar Cardoso"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Sound and Music Computing Conference"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131985, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"livingstone2007controlling"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2007, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Controlling musical emotionality: an affective computational architecture for influencing musical emotions"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Steven R. Livingstone"&lt;/span&gt;, &lt;span class="s2"&gt;"Ralf Mühlberger"&lt;/span&gt;, &lt;span class="s2"&gt;"Andrew Brown"&lt;/span&gt;, &lt;span class="s2"&gt;"Andrew Loch"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Digital Creativity"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131986, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"livingstone2005dynamic"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2005, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Dynamic Response: Real-Time Adaptation for Music Emotion"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"teven R. Livingstone"&lt;/span&gt;, &lt;span class="s2"&gt;"Andrew Brown"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Creativity &amp;amp; Cognition Studios Press"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131987, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"oliveira2009automatic"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2009, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Automatic manipulation of music to express desired emotions"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Antonio Oliveira"&lt;/span&gt;, &lt;span class="s2"&gt;"Amilcar Cardoso"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Proceedings of the 6th Sound and Music Computing Conference"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131969, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"williams2015affect"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 2015, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"Investigating affect in algorithmic composition systems"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Duncan Williams"&lt;/span&gt;, &lt;span class="s2"&gt;"Alexis Kirke"&lt;/span&gt;, &lt;span class="s2"&gt;"Eduardo R Miranda"&lt;/span&gt;, &lt;span class="s2"&gt;"Etienne Roesch"&lt;/span&gt;, &lt;span class="s2"&gt;"Ian Daly"&lt;/span&gt;, &lt;span class="s2"&gt;"Slawomir Nasuto"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"Psychology of Music"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex
 &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: 844424930131988, &lt;span class="s2"&gt;"label"&lt;/span&gt;: &lt;span class="s2"&gt;"Article"&lt;/span&gt;, &lt;span class="s2"&gt;"properties"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;: &lt;span class="s2"&gt;"russell1980circumplex"&lt;/span&gt;, &lt;span class="s2"&gt;"year"&lt;/span&gt;: 1980, &lt;span class="s2"&gt;"title"&lt;/span&gt;: &lt;span class="s2"&gt;"A circumplex model of affect"&lt;/span&gt;, &lt;span class="s2"&gt;"author"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"James Russel"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;, &lt;span class="s2"&gt;"publisher"&lt;/span&gt;: &lt;span class="s2"&gt;"American Psychological Association"&lt;/span&gt;&lt;span class="o"&gt;}}&lt;/span&gt;::vertex


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To visualize and analyze the graph we built, we need to configure the connection with the database. We use &lt;code&gt;nvm&lt;/code&gt; to start the AGE Viewer at &lt;code&gt;localhost:3000&lt;/code&gt;, and this step must be executed within the &lt;code&gt;age-viewer&lt;/code&gt; directory:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;cd &lt;/span&gt;age-viewer
npm run setup
npm run start


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;When opening the page, provide the URL where the AGE Viewer is running, the port number of the database, database name, and the username and password for the database. Below is an example of the configuration. Then click on the "Connect" button.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

Connect URL: localhost

Connect Port: 5432

Database Name: papersdb

User Name: postgres

Password: 12345


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;At the top of the page, there is a field to define queries. We will retrieve the data of the vertices and edges, and then we can visualize the graph we built. After specifying the query, click on the play button "Run Query" next to the editing field.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
MATCH &lt;span class="o"&gt;(&lt;/span&gt;a&lt;span class="o"&gt;)&lt;/span&gt;
OPTIONAL MATCH &lt;span class="o"&gt;(&lt;/span&gt;a&lt;span class="o"&gt;)&lt;/span&gt;-[e]-&amp;gt;&lt;span class="o"&gt;(&lt;/span&gt;b&lt;span class="o"&gt;)&lt;/span&gt;
RETURN a, e, b
&lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;a agtype, e agtype, b agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, the system will return the graph with all vertices and edges. We can see in Figure 1 that all papers have connections, indicating that they have at least one citation made by a related research source.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkgpzynzrm6scie43sfc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzkgpzynzrm6scie43sfc.png" alt="Figure 1 - Citation graph. Elaborated by author and generated with AGE Viewer."&gt;&lt;/a&gt;&lt;br&gt;Figure 1 - Citation graph. Elaborated by author and generated with AGE Viewer.
  &lt;/p&gt;

&lt;p&gt;In addition to displaying the graph, we can explore other queries to perform different types of analysis. For instance, We can check for self-citation, filter articles by author names, and detect circular citations, among other things. However, for today's purposes, we will stop here and save more complex analyses for a future post!&lt;/p&gt;

&lt;h2&gt;
  
  
  Errata
&lt;/h2&gt;

&lt;p&gt;My intention is to provide access to technology information through reliable sources. If you have found any incorrect information, please let your contribution in the comments below 😊.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/talhahahae/installing-apache-age-viewer-5dm3"&gt;Installing apache age-viewer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-4-creating-a-citation-graph-with-postgresql-apache-age-211j"&gt;How an RDBMS works #4: Creating a citation graph with PostgreSQL + Apache AGE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-lessons-from-the-internals-of-postgresql-1-45i4"&gt;How an RDBMS works #1: Lessons from “The Internals of PostgreSQL”&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/" rel="noopener noreferrer"&gt;https://age.apache.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache AGE Github: &lt;a href="https://github.com/apache/age" rel="noopener noreferrer"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache AGE Viewer GitHub: &lt;a href="https://github.com/apache/age-viewer" rel="noopener noreferrer"&gt;https://github.com/apache/age-viewer&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>ageviewer</category>
      <category>graphdatabase</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How an RDBMS works #4: Creating a citation graph with PostgreSQL + Apache AGE</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Sun, 30 Apr 2023 01:14:27 +0000</pubDate>
      <link>https://dev.to/carlasanches/how-an-rdbms-works-4-creating-a-citation-graph-with-postgresql-apache-age-211j</link>
      <guid>https://dev.to/carlasanches/how-an-rdbms-works-4-creating-a-citation-graph-with-postgresql-apache-age-211j</guid>
      <description>&lt;p&gt;In the &lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-database-life-cycle-overview-2gb4"&gt;previous post&lt;/a&gt;, I presented an example of an academic article database to explain the process of analyzing database requirements. Today, we'll take a more practical approach and explore this example by creating an academic paper database in PostgreSQL and a citation graph using Apache AGE. The queries for building this database are available in &lt;a href="https://gist.github.com/carlasanches/c46246e2d9ae9c1e88878970537f9df8"&gt;this GitHub gist&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What are graphs?
&lt;/h2&gt;

&lt;p&gt;A graph G = (V, E) is a data structure composed of a set of vertices (V) and a set of edges (E) (Vilas Boas, 2016). We can represent a graph as shown in Figure 1. The letters from 'a' to 'e' represent the vertices, and the edges are the lines that connect them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ERBAk2TU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7xrlfh3y3ufq6bthffgr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ERBAk2TU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7xrlfh3y3ufq6bthffgr.png" alt="Representation of a graph formed by 5 vertices and 7 edges." width="560" height="520"&gt;&lt;/a&gt;&lt;br&gt;Figure 1 - Representation of a graph formed by five vertices and seven edges. Adapted from Vilas Boas (2016).
  &lt;/p&gt;

&lt;p&gt;In the example of our database, each vertex represents an academic paper. The relationship between these papers is "cited by" since an article references (or cites) other articles. An edge represents a relationship.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Requirements
&lt;/h2&gt;

&lt;p&gt;To follow this tutorial, you need to install PostgreSQL and Apache AGE. Below is a list of tutorials to install these programs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://dev.to/carlasanches/easy-guide-to-install-and-configure-postgresql-with-apache-age-on-windows-n6p"&gt;PostgreSQL with Apache AGE installation on Windows with WSL&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/markgomer/installing-apache-age-with-docker-on-windows-e22"&gt;Installing Apache AGE with Docker on Windows&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/carlasanches/step-by-step-guide-to-install-apache-age-and-postgresql-via-package-management-on-ubuntu-259l"&gt;PostgreSQL with Apache AGE installation on Ubuntu&lt;/a&gt;;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/maruf13/installation-of-postgresql-age-on-mac-4gc9"&gt;Easy Installation of PostgreSQL, AGE &amp;amp; Age-viewer on Mac&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this tutorial, I created the database using PostgreSQL 13 and Apache AGE 1.3.0. At the time of this post, Apache AGE supports only PostgreSQL 11, 12, and 13. The operating system used is Ubuntu 22.04 LTS.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Building the database
&lt;/h2&gt;

&lt;p&gt;Before we begin building the database, let's list some properties of scientific papers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Title;&lt;/li&gt;
&lt;li&gt;Author(s);&lt;/li&gt;
&lt;li&gt;Year of publication;&lt;/li&gt;
&lt;li&gt;Publication venue.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As defined in Section 1, the relationship between two papers can be defined as "cited by" or "cites" for simplicity. Since one paper cites another, we can represent this relationship as shown in Figure 2.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ys99_KfW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7qf9zv7htn0slcpt7ktt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ys99_KfW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7qf9zv7htn0slcpt7ktt.png" alt="Figure 2 - Relationship between two papers. Elaborated by author." width="560" height="80"&gt;&lt;/a&gt;&lt;br&gt;Figure 2 - Relationship between two papers. Elaborated by author.
  &lt;/p&gt;

&lt;p&gt;Now we can create the database. Assuming that PostgreSQL has just been installed, the following commands will start the PostgreSQL service and call the command-line interface:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service postgresql start
&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres psql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once in the interface, we create a database named &lt;code&gt;papersdb&lt;/code&gt; and connect to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;create database papersdb&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="se"&gt;\c&lt;/span&gt; papersdb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To use the Apache AGE extension, it is necessary to install it on the server and load it for each session. And to simplify queries, we add &lt;code&gt;ag_catalog&lt;/code&gt; to the &lt;code&gt;search_path&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;CREATE EXTENSION age&lt;span class="p"&gt;;&lt;/span&gt;
LOAD &lt;span class="s1"&gt;'age'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
SET search_path &lt;span class="o"&gt;=&lt;/span&gt; ag_catalog, &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;, public&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we create a graph called &lt;code&gt;citation_graph&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM create_graph&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We now create some entries for the academic papers, which contain the properties defined at the beginning of this section. We will also define an ID to make it easier to connect the edges between each paper. The &lt;code&gt;id&lt;/code&gt; structure is according to the last name of the first author, publication year, and the beginning of the publication title, as in the example &lt;code&gt;oliveira2009automatic&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'williams2015affect'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Investigating affect in algorithmic composition systems'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'Psychology of Music'&lt;/span&gt;,year: 2015, author:[&lt;span class="s1"&gt;'Duncan Williams'&lt;/span&gt;, &lt;span class="s1"&gt;'Alexis Kirke'&lt;/span&gt;, &lt;span class="s1"&gt;'Eduardo R Miranda'&lt;/span&gt;, &lt;span class="s1"&gt;'Etienne Roesch'&lt;/span&gt;, &lt;span class="s1"&gt;'Ian Daly'&lt;/span&gt;, &lt;span class="s1"&gt;'Slawomir Nasuto'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'williams2013towards'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Towards affective algorithmic composition'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'University of Jyväskylä, Department of Music'&lt;/span&gt;, year: 2013, author:[&lt;span class="s1"&gt;'Duncan Williams'&lt;/span&gt;, &lt;span class="s1"&gt;'Alexis Kirke'&lt;/span&gt;, &lt;span class="s1"&gt;'Eduardo R Miranda'&lt;/span&gt;, &lt;span class="s1"&gt;'Etienne Roesch'&lt;/span&gt;, &lt;span class="s1"&gt;'Slawomir Nasuto'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'schubert1999measurement'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Measurement and Time Series Analysis of Emotion in Music'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'University of New South Wales. Music &amp;amp; Music Education'&lt;/span&gt;, year: 1999, author:[&lt;span class="s1"&gt;'Emery Schubert'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'scherer2004which'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Which Emotions Can be Induced by Music? What Are the Underlying Mechanisms? And How Can We Measure Them?'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'Journal of New Music Research'&lt;/span&gt;, year: 2004, author:[&lt;span class="s1"&gt;'Klaus R. Scherer'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;                          
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'gabrielsson2001emotion'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Emotion perceived and emotion felt: Same or different?'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'Musicae Scientiae'&lt;/span&gt;, year: 2001, author:[&lt;span class="s1"&gt;'Alf Gabrielsson'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'scherer2001emotional'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Emotional effects of music: Production rules'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'Oxford University Press'&lt;/span&gt;, year: 2001, author:[&lt;span class="s1"&gt;'Klaus Scherer'&lt;/span&gt;, &lt;span class="s1"&gt;'Marcel Zentner'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'juslin2001communicating'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Communicating emotion in music performance: A review and a theoretical framework'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'Oxford University Press'&lt;/span&gt;, year: 2001, author:[&lt;span class="s1"&gt;'Patrik Juslin'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'williams2015dynamic'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Dynamic Game Soundtrack Generation in Response to a Continuously Varying Emotional Trajectory'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'Audio Engineering Society Conference: 56th International Conference: Audio for Games'&lt;/span&gt;, year: 2015, author:[&lt;span class="s1"&gt;'Duncan Williams'&lt;/span&gt;, &lt;span class="s1"&gt;'Alexis Kirke'&lt;/span&gt;, &lt;span class="s1"&gt;'Joel Eaton'&lt;/span&gt;, &lt;span class="s1"&gt;'Eduardo Miranda'&lt;/span&gt;, &lt;span class="s1"&gt;'Ian Daly'&lt;/span&gt;, &lt;span class="s1"&gt;'James Hallowell'&lt;/span&gt;, &lt;span class="s1"&gt;'Etienne Roesch'&lt;/span&gt;, &lt;span class="s1"&gt;'Faustina Hwang'&lt;/span&gt;, &lt;span class="s1"&gt;'Slawomir Nasuto'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;            
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'williams2015investigating'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Investigating Perceived Emotional Correlates of Rhythmic Density in Algorithmic Music Composition'&lt;/span&gt;, publisher: &lt;span class="s1"&gt;'Association for Computing Machinery'&lt;/span&gt;, year: 2015, author:[&lt;span class="s1"&gt;'Duncan Williams'&lt;/span&gt;, &lt;span class="s1"&gt;'Alexis Kirke'&lt;/span&gt;, &lt;span class="s1"&gt;'Joel Eaton'&lt;/span&gt;, &lt;span class="s1"&gt;'Eduardo Miranda'&lt;/span&gt;, &lt;span class="s1"&gt;'Ian Daly'&lt;/span&gt;, &lt;span class="s1"&gt;'James Hallowell'&lt;/span&gt;, &lt;span class="s1"&gt;'James Weaver'&lt;/span&gt;, &lt;span class="s1"&gt;'Asad Malik'&lt;/span&gt;, &lt;span class="s1"&gt;'Etienne Roesch'&lt;/span&gt;, &lt;span class="s1"&gt;'Faustina Hwang'&lt;/span&gt;, &lt;span class="s1"&gt;'Slawomir Nasuto'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'daly2015towards'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Towards human-computer music interaction: Evaluation of an affectively-driven music generator via galvanic skin response measures'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'2015 7th Computer Science and Electronic Engineering Conference (CEEC)'&lt;/span&gt;, year: 2015, author:[&lt;span class="s1"&gt;'Duncan Williams'&lt;/span&gt;, &lt;span class="s1"&gt;'Alexis Kirke'&lt;/span&gt;, &lt;span class="s1"&gt;'Eduardo Miranda'&lt;/span&gt;, &lt;span class="s1"&gt;'Ian Daly'&lt;/span&gt;, &lt;span class="s1"&gt;'Faustina Hwang'&lt;/span&gt;, &lt;span class="s1"&gt;'Slawomir Nasuto'&lt;/span&gt;, &lt;span class="s1"&gt;'Asad Malik'&lt;/span&gt;, &lt;span class="s1"&gt;'James Weaver'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'kirke2013artificial'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Artificial affective listening towards a machine learning tool for sound-based emotion therapy and control'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'Proceedings of the Sound and Music Computing Conference'&lt;/span&gt;, year: 2013, author:[&lt;span class="s1"&gt;'Alexis Kirke'&lt;/span&gt;, &lt;span class="s1"&gt;'Eduardo Miranda'&lt;/span&gt;, &lt;span class="s1"&gt;'Slawomir Nasuto'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'kirke2012learningto'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Learning to Make Feelings: Expressive Performance as a part of a machine learning tool for sound-based emotion therapy and control'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'the 9th Intl Symp on Computer Music Modeling and Retrieval'&lt;/span&gt;, year: 2012, author:[&lt;span class="s1"&gt;'Alexis Kirke'&lt;/span&gt;, &lt;span class="s1"&gt;'Eduardo Miranda'&lt;/span&gt;, &lt;span class="s1"&gt;'Slawomir Nasuto'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'lopez2010real'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Real-Time Emotion-Driven Music Engine'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'the 9th Intl Symp on Computer Music Modeling and Retrieval'&lt;/span&gt;, year: 2010, author:[&lt;span class="s1"&gt;'Alex Lopez'&lt;/span&gt;, &lt;span class="s1"&gt;'Antonio Oliveira'&lt;/span&gt;, &lt;span class="s1"&gt;'Amilcar Cardoso'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'oliveira2008affective'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Affective-driven music production: selection and transformation of music'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'ARTECH'&lt;/span&gt;, year: 2008, author:[&lt;span class="s1"&gt;'Antonio Oliveira'&lt;/span&gt;, &lt;span class="s1"&gt;'Amilcar Cardoso'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'oliveira2008modeling'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Modeling affective content of music: A knowledge base approach'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'Sound and Music Computing Conference'&lt;/span&gt;, year: 2008, author:[&lt;span class="s1"&gt;'Antonio Oliveira'&lt;/span&gt;, &lt;span class="s1"&gt;'Amilcar Cardoso'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'livingstone2007controlling'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Controlling musical emotionality: an affective computational architecture for influencing musical emotions'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'Digital Creativity'&lt;/span&gt;, year: 2007, author:[&lt;span class="s1"&gt;'Steven R. Livingstone'&lt;/span&gt;, &lt;span class="s1"&gt;'Ralf Mühlberger'&lt;/span&gt;, &lt;span class="s1"&gt;'Andrew Brown'&lt;/span&gt;, &lt;span class="s1"&gt;'Andrew Loch'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'livingstone2005dynamic'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Dynamic Response: Real-Time Adaptation for Music Emotion'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'Creativity &amp;amp; Cognition Studios Press'&lt;/span&gt;, year: 2005, author:[&lt;span class="s1"&gt;'Steven R. Livingstone'&lt;/span&gt;,&lt;span class="s1"&gt;'Andrew Brown'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'oliveira2009automatic'&lt;/span&gt;, title: &lt;span class="s1"&gt;'Automatic manipulation of music to express desired emotions'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'Proceedings of the 6th Sound and Music Computing Conference'&lt;/span&gt;, year: 2009, author:[&lt;span class="s1"&gt;'Antonio Oliveira'&lt;/span&gt;, &lt;span class="s1"&gt;'Amilcar Cardoso'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt;        
CREATE &lt;span class="o"&gt;(&lt;/span&gt;v:Article &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt;: &lt;span class="s1"&gt;'russell1980circumplex'&lt;/span&gt;, title: &lt;span class="s1"&gt;'A circumplex model of affect'&lt;/span&gt;,  publisher: &lt;span class="s1"&gt;'American Psychological Association'&lt;/span&gt;, year: 1980, author:[&lt;span class="s1"&gt;'James Russel'&lt;/span&gt;&lt;span class="o"&gt;]})&lt;/span&gt;
RETURN v &lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;v agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we define the relationships between articles based on the citations found within each one. We can use the &lt;code&gt;id&lt;/code&gt; to retrieve the vertices and connect them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM cypher &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'citation_graph'&lt;/span&gt;, &lt;span class="nv"&gt;$$&lt;/span&gt; 
MATCH &lt;span class="o"&gt;(&lt;/span&gt;a:Article&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="o"&gt;(&lt;/span&gt;b:Article&lt;span class="o"&gt;)&lt;/span&gt;
WHERE a.id &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'williams2015affect'&lt;/span&gt; and b.id &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'williams2013towards'&lt;/span&gt;
CREATE &lt;span class="o"&gt;(&lt;/span&gt;a&lt;span class="o"&gt;)&lt;/span&gt;-[e:CITES]-&amp;gt;&lt;span class="o"&gt;(&lt;/span&gt;b&lt;span class="o"&gt;)&lt;/span&gt;
RETURN e                 
&lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; as &lt;span class="o"&gt;(&lt;/span&gt;e agtype&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To avoid making this post too long, I will not repeat all the queries at this step. Unlike the entries with the information of the papers, which is only one for each paper, the relationships can be "one to many." &lt;a href="https://gist.github.com/carlasanches/c46246e2d9ae9c1e88878970537f9df8"&gt;This is the link to the GitHub gist&lt;/a&gt; containing all the queries to create the relationships between the papers. You can copy and paste on your PostgreSQL CLI to run the queries. With the definition of all edges, we have finished building our citation graph, presented in Figure 3:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mb0feVtQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8hfvcyzsneyu63j7z644.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mb0feVtQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8hfvcyzsneyu63j7z644.png" alt="Figure 3 - Citation graph. Developed by the author and generated with AGE Viewer." width="800" height="487"&gt;&lt;/a&gt;&lt;br&gt;Figure 3 - Citation graph. Elaborated by author and generated with AGE Viewer.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  4. Conclusions
&lt;/h2&gt;

&lt;p&gt;In this article, we have learned what graphs are and how to build a graph database using the PostgreSQL extension Apache AGE. In the next post, I will show you how to use the AGE Viewer to display the graph illustrated in Figure 3.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Errata
&lt;/h2&gt;

&lt;p&gt;My intention is to provide access to technology information through reliable sources. If you have found any incorrect information, please let your contribution in the comments below 😊.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Related Articles
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/m4rcxs/collaborate-to-innovate-how-a-social-network-can-help-you-find-your-dream-pair-programming-team-cbf"&gt;Collaborate to Innovate: How a Social Network Can Help You Find Your Dream Pair Programming Team&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/matheusfarias03/create-a-word-guessing-game-with-apache-age-1j21"&gt;Create a Word Guessing Game With Apache AGE&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/carlasanches/step-by-step-guide-to-install-apache-age-and-postgresql-via-package-management-on-ubuntu-259l"&gt;Step-by-Step Guide to Install PostgreSQL via Package Management for Apache AGE on Ubuntu&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/carlasanches/easy-guide-to-install-and-configure-postgresql-with-apache-age-on-windows-n6p"&gt;Easy guide to install and configure PostgreSQL with Apache AGE on Windows&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/markgomer/installing-apache-age-with-docker-on-windows-e22"&gt;Installing Apache AGE with Docker on Windows&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/maruf13/installation-of-postgresql-age-on-mac-4gc9"&gt;Easy Installation of PostgreSQL, AGE &amp;amp; Age-viewer on Mac&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. References
&lt;/h2&gt;

&lt;p&gt;Vilas Boas, Matheus Guedes. Graph Theory Class Notes - Basic Concepts on Graphs - Definitions and Theorems. Federal University of Ouro Preto. 2016. Unpublished.&lt;/p&gt;

&lt;p&gt;Banner designed by &lt;a href="https://www.freepik.com/"&gt;Freepik&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/"&gt;https://age.apache.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache AGE Github: &lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>graph</category>
    </item>
    <item>
      <title>Step-by-Step Guide to Install PostgreSQL via Package Management for Apache AGE on Ubuntu</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Wed, 26 Apr 2023 00:56:12 +0000</pubDate>
      <link>https://dev.to/carlasanches/step-by-step-guide-to-install-apache-age-and-postgresql-via-package-management-on-ubuntu-259l</link>
      <guid>https://dev.to/carlasanches/step-by-step-guide-to-install-apache-age-and-postgresql-via-package-management-on-ubuntu-259l</guid>
      <description>&lt;p&gt;PostgreSQL is a robust and reliable open-source relational database that supports ACID and is highly scalable, making it one of the most popular choices for data storage. With Apache AGE, it's possible to query and analyze graph data in PostgreSQL using the OpenCypher technology in conjunction with SQL. For this tutorial, I am using Ubuntu 22.04 LTS and will provide a step-by-step guide to install the new version of Apache AGE 1.3.0 for PostgreSQL 13. If you're curious to know what the main features of this version are, you can check out &lt;a href="https://dev.to/wendellana/apache-age-13-release-for-postgresql-13-4081"&gt;this article&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;To install Apache AGE on Ubuntu, you need the following libraries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;build-essential libreadline-dev zlib1g-dev flex bison
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  PostgreSQL Installation
&lt;/h2&gt;

&lt;p&gt;To create your graph database with Apache AGE, you need PostgreSQL. Currently, the versions supported are 11, 12, and 13. You can obtain any of these versions from the Ubuntu package manager. You need to install both the &lt;code&gt;postgresql&lt;/code&gt; library and the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;postgresql-13 postgresql-server-dev-13
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, export the environment variable &lt;code&gt;PATH&lt;/code&gt; to the executable and PostgreSQL configuration directories and &lt;code&gt;PGDATA&lt;/code&gt; environment variable to the database data storage directory. When we install through the package manager, the files are installed by default in &lt;code&gt;/usr/lib/postgresql/{version}&lt;/code&gt;, where &lt;code&gt;{version}&lt;/code&gt; is the installed PostgreSQL version. In this case, it is version 13.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/lib/postgresql/13/bin:&lt;span class="nv"&gt;$PATH&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PGDATA&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/lib/postgresql/13/bin/data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Apache AGE
&lt;/h2&gt;

&lt;p&gt;To install Apache AGE, &lt;a href="https://github.com/apache/age/releases"&gt;download a compatible release&lt;/a&gt; with your version of PostgreSQL or clone the repository and switch to the branch compatible with your version of PostgreSQL. In this case, we will install version 1.3.0 for PostgreSQL 13:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/apache/age.git
git checkout release/PG13/1.3.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To proceed with the installation, export the &lt;code&gt;PG_CONFIG&lt;/code&gt; variable to &lt;code&gt;pg_config&lt;/code&gt; directory or run the &lt;code&gt;make&lt;/code&gt; command passing the variable as an argument:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;make &lt;span class="nv"&gt;PG_CONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/lib/postgresql/13/bin/pg_config &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also export the variable to the same directory and then proceed with the installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PG_CONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/lib/postgresql/13/bin/pg_config
&lt;span class="nb"&gt;sudo &lt;/span&gt;make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;pg_config&lt;/code&gt; is a utility that contains installation information about PostgreSQL, such as the version installed. When running &lt;code&gt;pg_config&lt;/code&gt; for the current installation, the terminal returns the following information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;BINDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/lib/postgresql/13/bin
DOCDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/share/doc/postgresql-doc-13
HTMLDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/share/doc/postgresql-doc-13
INCLUDEDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/include/postgresql
PKGINCLUDEDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/include/postgresql
INCLUDEDIR-SERVER &lt;span class="o"&gt;=&lt;/span&gt; /usr/include/postgresql/13/server
LIBDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/lib/x86_64-linux-gnu
PKGLIBDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/lib/postgresql/13/lib
LOCALEDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/share/locale
MANDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/share/postgresql/13/man
SHAREDIR &lt;span class="o"&gt;=&lt;/span&gt; /usr/share/postgresql/13
SYSCONFDIR &lt;span class="o"&gt;=&lt;/span&gt; /etc/postgresql-common
PGXS &lt;span class="o"&gt;=&lt;/span&gt; /usr/lib/postgresql/13/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="s1"&gt;'--build=x86_64-linux-gnu'&lt;/span&gt; &lt;span class="s1"&gt;'--prefix=/usr'&lt;/span&gt; &lt;span class="s1"&gt;'--includedir=${prefix}/include'&lt;/span&gt; &lt;span class="s1"&gt;'--mandir=${prefix}/share/man'&lt;/span&gt; &lt;span class="s1"&gt;'--infodir=${prefix}/share/info'&lt;/span&gt; &lt;span class="s1"&gt;'--sysconfdir=/etc'&lt;/span&gt; &lt;span class="s1"&gt;'--localstatedir=/var'&lt;/span&gt; &lt;span class="s1"&gt;'--disable-option-checking'&lt;/span&gt; &lt;span class="s1"&gt;'--disable-silent-rules'&lt;/span&gt; &lt;span class="s1"&gt;'--libdir=${prefix}/lib/x86_64-linux-gnu'&lt;/span&gt; &lt;span class="s1"&gt;'--runstatedir=/run'&lt;/span&gt; &lt;span class="s1"&gt;'--disable-maintainer-mode'&lt;/span&gt; &lt;span class="s1"&gt;'--disable-dependency-tracking'&lt;/span&gt; &lt;span class="s1"&gt;'--with-tcl'&lt;/span&gt; &lt;span class="s1"&gt;'--with-perl'&lt;/span&gt; &lt;span class="s1"&gt;'--with-python'&lt;/span&gt; &lt;span class="s1"&gt;'--with-pam'&lt;/span&gt; &lt;span class="s1"&gt;'--with-openssl'&lt;/span&gt; &lt;span class="s1"&gt;'--with-libxml'&lt;/span&gt; &lt;span class="s1"&gt;'--with-libxslt'&lt;/span&gt; &lt;span class="s1"&gt;'--mandir=/usr/share/postgresql/13/man'&lt;/span&gt; &lt;span class="s1"&gt;'--docdir=/usr/share/doc/postgresql-doc-13'&lt;/span&gt; &lt;span class="s1"&gt;'--sysconfdir=/etc/postgresql-common'&lt;/span&gt; &lt;span class="s1"&gt;'--datarootdir=/usr/share/'&lt;/span&gt; &lt;span class="s1"&gt;'--datadir=/usr/share/postgresql/13'&lt;/span&gt; &lt;span class="s1"&gt;'--bindir=/usr/lib/postgresql/13/bin'&lt;/span&gt; &lt;span class="s1"&gt;'--libdir=/usr/lib/x86_64-linux-gnu/'&lt;/span&gt; &lt;span class="s1"&gt;'--libexecdir=/usr/lib/postgresql/'&lt;/span&gt; &lt;span class="s1"&gt;'--includedir=/usr/include/postgresql/'&lt;/span&gt; &lt;span class="s1"&gt;'--with-extra-version= (Ubuntu 13.10-1.pgdg22.04+1)'&lt;/span&gt; &lt;span class="s1"&gt;'--enable-nls'&lt;/span&gt; &lt;span class="s1"&gt;'--enable-thread-safety'&lt;/span&gt; &lt;span class="s1"&gt;'--enable-debug'&lt;/span&gt; &lt;span class="s1"&gt;'--enable-dtrace'&lt;/span&gt; &lt;span class="s1"&gt;'--disable-rpath'&lt;/span&gt; &lt;span class="s1"&gt;'--with-uuid=e2fs'&lt;/span&gt; &lt;span class="s1"&gt;'--with-gnu-ld'&lt;/span&gt; &lt;span class="s1"&gt;'--with-gssapi'&lt;/span&gt; &lt;span class="s1"&gt;'--with-ldap'&lt;/span&gt; &lt;span class="s1"&gt;'--with-pgport=5432'&lt;/span&gt; &lt;span class="s1"&gt;'--with-system-tzdata=/usr/share/zoneinfo'&lt;/span&gt; &lt;span class="s1"&gt;'AWK=mawk'&lt;/span&gt; &lt;span class="s1"&gt;'MKDIR_P=/bin/mkdir -p'&lt;/span&gt; &lt;span class="s1"&gt;'PROVE=/usr/bin/prove'&lt;/span&gt; &lt;span class="s1"&gt;'PYTHON=/usr/bin/python3'&lt;/span&gt; &lt;span class="s1"&gt;'TAR=/bin/tar'&lt;/span&gt; &lt;span class="s1"&gt;'XSLTPROC=xsltproc --nonet'&lt;/span&gt; &lt;span class="s1"&gt;'CFLAGS=-g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer'&lt;/span&gt; &lt;span class="s1"&gt;'LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -Wl,-z,now'&lt;/span&gt; &lt;span class="s1"&gt;'--enable-tap-tests'&lt;/span&gt; &lt;span class="s1"&gt;'--with-icu'&lt;/span&gt; &lt;span class="s1"&gt;'--with-llvm'&lt;/span&gt; &lt;span class="s1"&gt;'LLVM_CONFIG=/usr/bin/llvm-config-14'&lt;/span&gt; &lt;span class="s1"&gt;'CLANG=/usr/bin/clang-14'&lt;/span&gt; &lt;span class="s1"&gt;'--with-systemd'&lt;/span&gt; &lt;span class="s1"&gt;'--with-selinux'&lt;/span&gt; &lt;span class="s1"&gt;'build_alias=x86_64-linux-gnu'&lt;/span&gt; &lt;span class="s1"&gt;'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'&lt;/span&gt; &lt;span class="s1"&gt;'CXXFLAGS=-g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security'&lt;/span&gt;
CC &lt;span class="o"&gt;=&lt;/span&gt; gcc
CPPFLAGS &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;-Wdate-time&lt;/span&gt; &lt;span class="nt"&gt;-D_FORTIFY_SOURCE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2 &lt;span class="nt"&gt;-D_GNU_SOURCE&lt;/span&gt; &lt;span class="nt"&gt;-I&lt;/span&gt;/usr/include/libxml2
CFLAGS &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;-Wall&lt;/span&gt; &lt;span class="nt"&gt;-Wmissing-prototypes&lt;/span&gt; &lt;span class="nt"&gt;-Wpointer-arith&lt;/span&gt; &lt;span class="nt"&gt;-Wdeclaration-after-statement&lt;/span&gt; &lt;span class="nt"&gt;-Werror&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;vla &lt;span class="nt"&gt;-Wendif-labels&lt;/span&gt; &lt;span class="nt"&gt;-Wmissing-format-attribute&lt;/span&gt; &lt;span class="nt"&gt;-Wimplicit-fallthrough&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3 &lt;span class="nt"&gt;-Wformat-security&lt;/span&gt; &lt;span class="nt"&gt;-fno-strict-aliasing&lt;/span&gt; &lt;span class="nt"&gt;-fwrapv&lt;/span&gt; &lt;span class="nt"&gt;-fexcess-precision&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;standard &lt;span class="nt"&gt;-Wno-format-truncation&lt;/span&gt; &lt;span class="nt"&gt;-Wno-stringop-truncation&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="nt"&gt;-O2&lt;/span&gt; &lt;span class="nt"&gt;-flto&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;auto &lt;span class="nt"&gt;-ffat-lto-objects&lt;/span&gt; &lt;span class="nt"&gt;-flto&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;auto &lt;span class="nt"&gt;-ffat-lto-objects&lt;/span&gt; &lt;span class="nt"&gt;-fstack-protector-strong&lt;/span&gt; &lt;span class="nt"&gt;-Wformat&lt;/span&gt; &lt;span class="nt"&gt;-Werror&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;format-security &lt;span class="nt"&gt;-fno-omit-frame-pointer&lt;/span&gt;
CFLAGS_SL &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;-fPIC&lt;/span&gt;
LDFLAGS &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;-Wl&lt;/span&gt;,-Bsymbolic-functions &lt;span class="nt"&gt;-flto&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;auto &lt;span class="nt"&gt;-ffat-lto-objects&lt;/span&gt; &lt;span class="nt"&gt;-flto&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;auto &lt;span class="nt"&gt;-Wl&lt;/span&gt;,-z,relro &lt;span class="nt"&gt;-Wl&lt;/span&gt;,-z,now &lt;span class="nt"&gt;-L&lt;/span&gt;/usr/lib/llvm-14/lib &lt;span class="nt"&gt;-Wl&lt;/span&gt;,--as-needed
LDFLAGS_EX &lt;span class="o"&gt;=&lt;/span&gt; 
LDFLAGS_SL &lt;span class="o"&gt;=&lt;/span&gt; 
LIBS &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;-lpgcommon&lt;/span&gt; &lt;span class="nt"&gt;-lpgport&lt;/span&gt; &lt;span class="nt"&gt;-lselinux&lt;/span&gt; &lt;span class="nt"&gt;-lxslt&lt;/span&gt; &lt;span class="nt"&gt;-lxml2&lt;/span&gt; &lt;span class="nt"&gt;-lpam&lt;/span&gt; &lt;span class="nt"&gt;-lssl&lt;/span&gt; &lt;span class="nt"&gt;-lcrypto&lt;/span&gt; &lt;span class="nt"&gt;-lgssapi_krb5&lt;/span&gt; &lt;span class="nt"&gt;-lz&lt;/span&gt; &lt;span class="nt"&gt;-lreadline&lt;/span&gt; &lt;span class="nt"&gt;-lm&lt;/span&gt; 
VERSION &lt;span class="o"&gt;=&lt;/span&gt; PostgreSQL 13.10 &lt;span class="o"&gt;(&lt;/span&gt;Ubuntu 13.10-1.pgdg22.04+1&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To verify if the installation is correct, run the regression tests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nv"&gt;PG_CONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/src/lib/postgresql/13/bin/pg_config installcheck
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Se todos passarem, o console vai retornar a seguinte frase: &lt;code&gt;All 24 tests passed&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the Installation
&lt;/h2&gt;

&lt;p&gt;Let's test our installation by creating a graph in a database with the default user &lt;code&gt;postgres&lt;/code&gt;. Start the PostgreSQL service and check the status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;service postgresql start
service postgresql status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything is correct, a similar message will appear in the terminal indicating that the service is active:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded &lt;span class="o"&gt;(&lt;/span&gt;/lib/systemd/system/postgresql.service&lt;span class="p"&gt;;&lt;/span&gt; enabled&lt;span class="p"&gt;;&lt;/span&gt; vendor &lt;span class="nb"&gt;pr&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
     Active: active &lt;span class="o"&gt;(&lt;/span&gt;exited&lt;span class="o"&gt;)&lt;/span&gt; since Tue 2023-04-25 19:34:59 &lt;span class="nt"&gt;-03&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 41min ago
   Main PID: 9761 &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;exited, &lt;span class="nv"&gt;status&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0/SUCCESS&lt;span class="o"&gt;)&lt;/span&gt;
        CPU: 1ms

abr 25 19:34:59 carla-linux systemd[1]: Starting PostgreSQL RDBMS...
abr 25 19:34:59 carla-linux systemd[1]: Finished PostgreSQL RDBMS.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now start the command-line tool:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres psql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the following command to install the extension on the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;CREATE EXTENSION age&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Load the extension for each AGE connection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;LOAD &lt;span class="s1"&gt;'age'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the following command to create a graph:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM ag_catalog.create_graph&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'new_graph'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To simplify queries, add &lt;code&gt;ag_catalog&lt;/code&gt; to your &lt;code&gt;search_path&lt;/code&gt; with &lt;code&gt;SET search_path = ag_catalog, "$user", public;&lt;/code&gt;. In this case, you could use the following command to create the graph:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM create_graph&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'new_graph'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything is correct, the console will return:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;NOTICE:  graph &lt;span class="s2"&gt;"new_graph"&lt;/span&gt; has been created
 create_graph 
&lt;span class="nt"&gt;--------------&lt;/span&gt;

&lt;span class="o"&gt;(&lt;/span&gt;1 row&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we have seen how to install PostgreSQL via package manager and use it with Apache AGE. If you want to learn more about this project, visit &lt;a href="https://age.apache.org/"&gt;https://age.apache.org/&lt;/a&gt;. If you want to know how to contribute, visit &lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;. All kinds of contributions are very welcome ❤️.&lt;/p&gt;

&lt;h2&gt;
  
  
  Errata
&lt;/h2&gt;

&lt;p&gt;My intention is to provide access to technology information through reliable sources. If you have found any incorrect information, please let your contribution in the comments below 😊.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Articles
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/carlasanches/easy-guide-to-install-and-configure-postgresql-with-apache-age-on-windows-n6p"&gt;Easy guide to install and configure PostgreSQL with Apache AGE on Windows&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/wendellana/apache-age-13-release-for-postgresql-13-4081"&gt;Apache AGE 1.3 Release for PostgreSQL 13&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/maruf13/installation-of-postgresql-age-on-mac-4gc9"&gt;Easy Installation of PostgreSQL, AGE &amp;amp; Age-viewer on Mac&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/talhahahae/installing-apache-age-viewer-5dm3"&gt;Installing apache age-viewer&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;Apache AGE. Apache AGE Documentation - Setup. 2023. Available at &lt;a href="https://age.apache.org/age-manual/master/intro/setup.html"&gt;https://age.apache.org/age-manual/master/intro/setup.html&lt;/a&gt;. Accessed on 04/25/2023.&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How an RDBMS works #3: Database Life Cycle Overview</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Sat, 01 Apr 2023 16:30:52 +0000</pubDate>
      <link>https://dev.to/carlasanches/how-an-rdbms-works-database-life-cycle-overview-2gb4</link>
      <guid>https://dev.to/carlasanches/how-an-rdbms-works-database-life-cycle-overview-2gb4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Data available on the internet has been growing fast in recent years. Therefore, we have seen &lt;a href="https://dev.to/carlasanches/why-study-the-design-of-a-rdbms-4og8"&gt;the importance of studying the design of an RDBMS&lt;/a&gt;. In this post, you will discover how its life cycle works, having an overview of the stages from modeling to data storage. By understanding this operation, we can more closely examine each part of its architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Database Life Cycle
&lt;/h2&gt;

&lt;p&gt;The database life cycle consists of basic steps from the conceptual model to implementation for designing a database and maximizing its performance. This definition applies to relational databases, such as PostgreSQL. Other types, such as distributed databases, are beyond the scope of this article.&lt;/p&gt;

&lt;p&gt;The authors of the book "Physical Database Design: the database professional's guide to exploiting indexes, views, storage, and more" describe the database life cycle in four parts, as defined in Figure 1:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsiudzv4vm0nllt8pdbyv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsiudzv4vm0nllt8pdbyv.png" alt="Database life cycle."&gt;&lt;/a&gt;&lt;br&gt;Figure 1 - Database life cycle. Elaborated by author.
  &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Requirements Analysis
&lt;/h3&gt;

&lt;p&gt;To ensure that your database meets the needs of your business, it is essential to define which data will be stored, how they relate to each other, their characteristics, and additional important information. This process usually takes the form of an interview with those who produce and use this data.&lt;/p&gt;

&lt;p&gt;It's also at this stage that the choice of the right platform for implementation comes into play. So, suppose that we need to create a database to store articles for a research project. Each article has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Title;&lt;/li&gt;
&lt;li&gt;At least one author;&lt;/li&gt;
&lt;li&gt;Publication date;&lt;/li&gt;
&lt;li&gt;Publication location;&lt;/li&gt;
&lt;li&gt;The number of citations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each author and place of publication also have their characteristics and relationships, but to simplify the example, let's focus only on the articles. Their relationships are through citations. The articles must strongly correlate through them to ensure well-founded research. Therefore, we can say that articles cite (refer to) other articles. An excellent platform to implement this database is PostgreSQL. In addition to storing data securely and efficiently, we can use the &lt;a href="https://age.apache.org/" rel="noopener noreferrer"&gt;Apache AGE&lt;/a&gt; extension to visualize the citation graph and evaluate if the research is well-founded and if there are "loose" references without relationships, among other important information.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Logical Design
&lt;/h3&gt;

&lt;p&gt;In the logical design phase, all requirements transform into a model, which can be either Conceptual or Logical. The Conceptual model represents the data and its relationships in an abstract form, while the Logical model provides a more detailed and implementation-oriented representation. It is important to note, however, that the purpose of this text is not to detail each model but to present its role in the database design process.&lt;/p&gt;

&lt;p&gt;The logical design captures the reality of the user's world in terms of data elements and their relationships. In the example from the previous section, we would represent all the relationships between the articles in the form of a diagram. We will explore this example further in an upcoming post. The design aims to facilitate query programming and data updating. At this stage, the normalization of SQL tables already occurs. If you want to learn more about normalization, &lt;a href="https://learn.microsoft.com/en-us/office/troubleshoot/access/database-normalization-description" rel="noopener noreferrer"&gt;this article&lt;/a&gt; is a good example.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Physical design
&lt;/h3&gt;

&lt;p&gt;The focus of the physical design is on operating data with high efficiency. This stage involves defining methods for storing and accessing tables on disk. The goal is to maximize the database's performance. Therefore, it is essential to have a clear understanding of how the database system works. We can measure database performance in two ways: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Through the time it takes for the database to respond to a query or complete an update for a specific application; &lt;/li&gt;
&lt;li&gt;Through throughput, which is the number of transactions per second that the database system can handle in a specified period, considering all applications that use the database.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Physical resources that can cause delays when executing database applications include CPU, I/O (such as a disk), and Computer networks.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Implementation, Monitoring and Maintenance
&lt;/h3&gt;

&lt;p&gt;This is the final stage of the database system life cycle, where we create and maintain the database. We can briefly describe it as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation:&lt;/strong&gt; Creation of tables in the database using Data Definition Language (DDL) and updating, performing queries, and configuring indexes and constraints with Data Manipulation Language (DML). The SQL language encompasses both languages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example of DDL: &lt;code&gt;CREATE TABLE&lt;/code&gt; command;&lt;/li&gt;
&lt;li&gt;Example of DML: &lt;code&gt;SELECT&lt;/code&gt; command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Monitoring:&lt;/strong&gt; Monitoring the performance of the database. PostgreSQL implements the &lt;code&gt;EXPLAIN&lt;/code&gt; command (&lt;a href="https://www.interdb.jp/pg/index.html" rel="noopener noreferrer"&gt;Section 3.2&lt;/a&gt; of the book "The Internals of PostgreSQL”), which helps monitor the performance of a query by providing its cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintenance:&lt;/strong&gt; Modifications to the database to meet performance requirements and changes in user requirements, for example. In this phase, there are design adjustments, which continue the life cycle of the DBMS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we understood the importance of studying the resources and implementation of an RDBMS to ensure proper management of its life cycle. We also saw that this consists of a requirements analysis, logical design, physical design, implementation, monitoring, and maintenance. In the next post, I will apply some of these concepts by implementing the article database given as an example in the requirements analysis section, using PostgreSQL with Apache AGE for graph visualization. So, if you like to get your hands dirty, don't miss the next post!&lt;/p&gt;

&lt;h2&gt;
  
  
  Errata
&lt;/h2&gt;

&lt;p&gt;My intention is to provide access to technology information through reliable sources. If you have found any incorrect information, please let your contribution in the comments below 😊.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Articles
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-lessons-from-the-internals-of-postgresql-1-45i4"&gt;How an RDBMS works #1: Lessons from “The Internals of PostgreSQL”&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/carlasanches/why-study-the-design-of-a-rdbms-4og8"&gt;How an RDBMS works #2: Reasons to study its design&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/abhikmr2046/cost-estimation-in-postgresql-57ol"&gt;Cost Estimation In PostgreSQL&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/m4rcxs/collaborate-to-innovate-how-a-social-network-can-help-you-find-your-dream-pair-programming-team-cbf"&gt;Collaborate to Innovate: How a Social Network Can Help You Find Your Dream Pair Programming Team&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;Lightstone, Sam S., Toby J. Teorey, and Tom Nadeau. &lt;em&gt;Physical Database Design: the database professional's guide to exploiting indexes, views, storage, and more&lt;/em&gt;. Morgan Kaufmann, 2010.&lt;/p&gt;

&lt;p&gt;Microsoft. Description of the database normalization basics. 2023. Available at &lt;a href="https://learn.microsoft.com/en-us/office/troubleshoot/access/database-normalization-description" rel="noopener noreferrer"&gt;https://learn.microsoft.com/en-us/office/troubleshoot/access/database-normalization-description&lt;/a&gt;. Acessed on 03/31/2023.&lt;/p&gt;

&lt;p&gt;SUZUKI, Hironobu. The Internals of PostgreSQL for database administrators and system developers. Interdb. 2015. Available at &lt;a href="https://www.interdb.jp/pg/" rel="noopener noreferrer"&gt;https://www.interdb.jp/pg/&lt;/a&gt;. Acessed on 03/25/2023.&lt;/p&gt;

&lt;p&gt;Souza, Wander Inácio de. Database I Class Notes - Concepts and Architecture of Database Systems. Federal University of Ouro Preto. 2016. Unpublished.&lt;/p&gt;

&lt;p&gt;Banner designed by &lt;a href="https://www.freepik.com/" rel="noopener noreferrer"&gt;Freepik&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/" rel="noopener noreferrer"&gt;https://age.apache.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache AGE Github: &lt;a href="https://github.com/apache/age" rel="noopener noreferrer"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>rdbms</category>
      <category>postgres</category>
    </item>
    <item>
      <title>How an RDBMS works #2: Reasons to study its design</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Sat, 18 Mar 2023 23:17:29 +0000</pubDate>
      <link>https://dev.to/carlasanches/why-study-the-design-of-a-rdbms-4og8</link>
      <guid>https://dev.to/carlasanches/why-study-the-design-of-a-rdbms-4og8</guid>
      <description>&lt;p&gt;This is the second article of &lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-lessons-from-the-internals-of-postgresql-1-45i4"&gt;the series&lt;/a&gt; about the operation of a Relational Database Management System (RDBMS) based on PostgreSQL. After reading the book "Physical Database Design: the database professional's guide to exploiting indexes, views, storage, and more" by Lightstone, Teorey, and Nadeau (2010), I found it relevant to write about why understanding database design is very important.&lt;/p&gt;

&lt;p&gt;In a brief summary of what the authors bring as motivation, the volume of data in the world tends to grow exponentially. As the volume of data increases, so does the demand for more robust data structures to securely store data and return queries faster and faster.&lt;/p&gt;

&lt;p&gt;According to Andre (2023), the amount of data created daily on the internet is 1.134 trillion MB. Lately, this increase has been mainly due to the popularization of social media and streaming services. If in 2010 we were talking about petabytes, Figure 1 presents the estimate of data consumption in zettabytes since 2021, which is expected to double by 2024.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3GnY_sA6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aejl1ux5wnqcgdypbj3j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3GnY_sA6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aejl1ux5wnqcgdypbj3j.png" alt="Estimated data consumption from 2021 to 2024." width="800" height="762"&gt;&lt;/a&gt;&lt;br&gt;Figure 1 - Estimated data consumption from 2021 to 2024. Adapted from Andre (2023).
  &lt;/p&gt;

&lt;p&gt;In addition, new technologies are continuously emerging to help make sense of this data. For example, &lt;a href="https://bitnine.net/"&gt;Bitnine Global Inc.&lt;/a&gt; has &lt;a href="https://age.apache.org/"&gt;Apache AGE&lt;/a&gt; to provide graph data analysis for relational databases. &lt;a href="https://bitnine.net/g-fds/"&gt;G-FDS&lt;/a&gt; is a graph-based solution for fraud detection, and &lt;a href="https://bitnine.net/g-fds/"&gt;G-PAS&lt;/a&gt; focuses on predictive analysis for Big Data. There are other products and more new developments on the horizon! Therefore, understanding the foundation and needs of database structures is essential to deliver quality solutions. In the next post, I will discuss the life cycle of an RDBMS and explain the architecture of PostgreSQL in practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Errata
&lt;/h2&gt;

&lt;p&gt;My intention is to provide access to technology information through reliable sources. If you have found any incorrect information, please let your contribution in the comments below 😊.&lt;/p&gt;

&lt;h2&gt;
  
  
  Related Articles
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/carlasanches/how-an-rdbms-works-lessons-from-the-internals-of-postgresql-1-45i4"&gt;How an RDBMS works #1: Lessons from “The Internals of PostgreSQL”&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/matheusfarias03/apache-age-what-it-is-and-tutorials-2egh"&gt;Apache AGE : What it is and Tutorials&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/farakhshahid/what-is-apache-ager-2iee"&gt;What is Apache AGE®&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/adeelahmed2k01/exploring-the-postgres-internals-a-guide-for-database-admins-and-system-developers-part-1-509i"&gt;Exploring the Postgres Internals: A Guide for Database Admins and System Developers (Part 1)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;Lightstone, Sam S., Toby J. Teorey, and Tom Nadeau. &lt;em&gt;Physical Database Design: the database professional's guide to exploiting indexes, views, storage, and more&lt;/em&gt;. Morgan Kaufmann, 2010.&lt;/p&gt;

&lt;p&gt;Andre, Louie. 53 Important Statistics About How Much Data Is Created Every Day. Finances Online. 2023. Available at &lt;a href="https://financesonline.com/how-much-data-is-created-every-day/"&gt;https://financesonline.com/how-much-data-is-created-every-day/&lt;/a&gt;. Acessed on 03/15/2023.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/"&gt;https://age.apache.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache AGE Github: &lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>rdbms</category>
      <category>data</category>
    </item>
    <item>
      <title>How an RDBMS works #1: Lessons from “The Internals of PostgreSQL”</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Thu, 09 Mar 2023 04:01:16 +0000</pubDate>
      <link>https://dev.to/carlasanches/how-an-rdbms-works-lessons-from-the-internals-of-postgresql-1-45i4</link>
      <guid>https://dev.to/carlasanches/how-an-rdbms-works-lessons-from-the-internals-of-postgresql-1-45i4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hi! My name is Carla, and I am a software engineering intern at &lt;a href="https://bitnine.net/"&gt;Bitnine Global&lt;/a&gt;, where I work with the &lt;a href="https://age.apache.org/"&gt;Apache AGE&lt;/a&gt; team, developing the  plugin for graph search in &lt;a href="https://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt;. With this post, I am starting a series to talk about the architecture of database management systems using PostgreSQL as an example.&lt;/p&gt;

&lt;p&gt;To do this, I will use the book "The Internals of PostgreSQL" by Hironobu Suzuki as a basis. My goal is to simplify the language of the book so that the content is friendly to students who wish to understand how a Relational Database Management System (RDBMS) works and to present use cases so that the content is useful for database administrators too.&lt;/p&gt;

&lt;p&gt;In the future, I will talk more about Apache AGE. But if you're already curious, you can explore the &lt;a href="https://dev.to/search?q=%23apacheage"&gt;#apacheage&lt;/a&gt; hashtag here on &lt;a href="http://dev.to/"&gt;Dev.to&lt;/a&gt; to learn more. There are several community posts ranging from installation to use cases in real applications.&lt;/p&gt;

&lt;p&gt;PostgreSQL is an open-source project for a multipurpose relational database. In other words, you can store and manage various types of data for multiple applications. The system is complex and has several integrated subsystems, which will also be presented in this series of posts. Its main features are robustness, reliability, and scalability. These, among other characteristics, make it one of the most popular databases in the world.&lt;/p&gt;

&lt;h2&gt;
  
  
  Errata
&lt;/h2&gt;

&lt;p&gt;My intention is to provide access to technology information through reliable sources. If you have found any incorrect information, please let your contribution in the comments below 😊.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;SUZUKI, Hironobu. The Internals of PostgreSQL for database administrators and system developers. Interdb. 2015. Available at &lt;a href="https://www.interdb.jp/pg/"&gt;https://www.interdb.jp/pg/&lt;/a&gt;. Acessed on 03/08/2023.&lt;/p&gt;

&lt;p&gt;The PostgreSQL Global Development Group. PostgreSQL: The World's Most Advanced Open Source Relational Database. Available at &lt;a href="https://www.postgresql.org/"&gt;https://www.postgresql.org/&lt;/a&gt;. Acessed on 03/08/2023.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contribute to Apache AGE
&lt;/h2&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/"&gt;https://age.apache.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apache AGE Github: &lt;a href="https://github.com/apache/age"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>apacheage</category>
      <category>postgres</category>
      <category>rdbms</category>
    </item>
    <item>
      <title>Easy guide to install and configure PostgreSQL with Apache AGE on Windows</title>
      <dc:creator>Carla Sanches</dc:creator>
      <pubDate>Fri, 24 Feb 2023 16:45:01 +0000</pubDate>
      <link>https://dev.to/carlasanches/easy-guide-to-install-and-configure-postgresql-with-apache-age-on-windows-n6p</link>
      <guid>https://dev.to/carlasanches/easy-guide-to-install-and-configure-postgresql-with-apache-age-on-windows-n6p</guid>
      <description>&lt;h1&gt;
  
  
  What is PostgreSQL
&lt;/h1&gt;

&lt;p&gt;PostgreSQL is an open-source relational database system, created in 1986. The system uses SQL language and has several features for data storage. Its main characteristics are robustness, reliability, and scalability. Another important feature is its support for ACID properties (Atomicity, Consistency, Isolation, and Durability). This makes it one of the most popular databases in the world!&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Apache AGE
&lt;/h1&gt;

&lt;p&gt;Apache AGE is an extension for PostgreSQL that provides data querying in graphs. This is important because it enables the use of optimization and graph search algorithms for data analysis. The extension uses OpenCypher technology, which allows the use of Cypher language along with SQL to query the relational database using graphs.&lt;/p&gt;

&lt;h1&gt;
  
  
  How to configure PostgreSQL with Apache AGE on Windows
&lt;/h1&gt;

&lt;p&gt;Unfortunately, Apache AGE does not have a Windows installation yet. However, it is possible to use it by using Windows Subsystem for Linux (WSL). If you have not set it up on your machine yet, follow Step 1 to set it up. If you have already done it, you can skip to Step 2.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Setting up WSL
&lt;/h2&gt;

&lt;p&gt;To enable WSL, go to &lt;strong&gt;Control Panel &amp;gt; Programs and Features &amp;gt; Turn Windows features on or off&lt;/strong&gt; and check the option "Windows Subsystem for Linux". Then, restart your computer to apply the changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjx98sbkect2egafz29g2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjx98sbkect2egafz29g2.png" alt=" " width="800" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are using Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11, installing WSL will only require a single command. Open the command prompt or PowerShell as an administrator and enter the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wsl --install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will install Ubuntu by default. This will be the Linux distribution used throughout the rest of the tutorial. If you want to install another distribution or have a different version of Windows, consult the &lt;a href="https://learn.microsoft.com/en-us/windows/wsl/install" rel="noopener noreferrer"&gt;complete documentation here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can use the Linux terminal through the apps available in the Windows Store. Just search for the desired distribution and click &lt;em&gt;Install&lt;/em&gt;. In this tutorial, I'm using Ubuntu 20.04.5 LTS. When you open the app, it may take a few minutes to complete the installation. Then, a username and password will be requested. Keep the password in a safe place. It will be requested every time a command is run as an administrator with &lt;code&gt;sudo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6z54q0m7a4g6p355h8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm6z54q0m7a4g6p355h8x.png" alt=" " width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With WSL installed, it becomes easy to configure PostgreSQL and Apache AGE. Basically, just open the Ubuntu terminal and follow the same steps as the Linux configuration. The next steps teach how to do this configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Setting up PostgreSQL
&lt;/h2&gt;

&lt;p&gt;Currently, Apache AGE is only compatible with versions 11 and 12 of PostgreSQL. If you already have one of these versions installed on your machine, you can skip to Step 3, where I teach how to configure Apache AGE. If you don't have it, an easy way to install PostgreSQL 12 in a customized way is through the source code. To follow this tutorial, you need to have git and some PostgreSQL dependencies installed. You can install them through the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install git libreadline-dev zlib1g-dev bison flex build-essential    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a directory in your workspace and clone the repository.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;age_project
&lt;span class="nb"&gt;cd &lt;/span&gt;age_project
git clone https://git.postgresql.org/git/postgresql.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Access the &lt;code&gt;postgresql&lt;/code&gt; directory and switch to version 12.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;postgresql
git checkout REL_12_STABLE
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then, compile the code by passing the directory where the binaries will be installed.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./configure &lt;span class="nt"&gt;--prefix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/pgsql-12
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Compile the PostgreSQL code. The first time, all files will be compiled. This may take a little while.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After compilation, create the installation directory, add user permission to install by replacing [user] with your username and install PostgreSQL.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /usr/local/pgsql-12
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;user] /usr/local/pgsql-12
make &lt;span class="nb"&gt;install&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add the environment variables.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/pgsql-12/bin/:&lt;span class="nv"&gt;$PATH&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PGDATA&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/pgsql-12/bin/data
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Great! PostgreSQL is now installed. To test it, initialize the cluster with the following command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;initdb
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start the server.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pg_ctl start &lt;span class="nt"&gt;-l&lt;/span&gt; log
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, start PostgreSQL.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To exit and stop the server, type &lt;code&gt;\q&lt;/code&gt; and run the following command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pg_ctl stop &lt;span class="nt"&gt;-l&lt;/span&gt; log
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more details about the installation, you can check &lt;a href="https://www.postgresql.org/docs/12/installation.html" rel="noopener noreferrer"&gt;the official PostgreSQL documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Configuring Apache AGE
&lt;/h2&gt;

&lt;p&gt;You can also configure AGE through the source code using the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone the AGE repository inside the &lt;code&gt;age-project&lt;/code&gt; directory created in Step 2:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/apache/age.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Switch to the latest release. Currently, &lt;a href="https://github.com/apache/age/releases" rel="noopener noreferrer"&gt;the latest stable release&lt;/a&gt; is 1.1.0.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;age
git checkout release/PG12/1.1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the &lt;code&gt;PG_CONFIG&lt;/code&gt; environment variable.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;PG_CONFIG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/pgsql-12/bin/pg_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Finally, install the extension.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All set! To test the installation, create a database instance using steps 7-9 in Step 2 and use the following command to install AGE on the server:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE EXTENSION age;    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For each AGE connection, you must load the extension.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LOAD 'age';    
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If everything is correct, the system will return something similar to the following messages:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;psql (12.14)
Type "help" for help.

postgres=# CREATE EXTENSION age;
CREATE EXTENSION
postgres=# LOAD 'age';
LOAD
postgres=#
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For more details, you can consult &lt;a href="https://age.apache.org/age-manual/master/index.html" rel="noopener noreferrer"&gt;the official Apache AGE documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Related Articles
&lt;/h1&gt;

&lt;p&gt;Here are some articles from AGEDB community that may be useful for your first projects with Apache AGE:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/muneebkhan4/what-is-apache-age-1b0p"&gt;What is APACHE AGE?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/zahid07/exploring-the-functions-of-apache-age-a-comprehensive-guide-to-be-continued-1dg3"&gt;Exploring the Functions of Apache AGE: A Comprehensive Guide (To Be Continued)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/matheusfarias03/apache-age-tutorial-creating-graphs-nodes-and-edges-2mke"&gt;Apache AGE Tutorial - Creating Graphs, Nodes and Edges&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  References
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.postgresql.org/" rel="noopener noreferrer"&gt;PostgreSQL&lt;/a&gt;&lt;br&gt;
&lt;a href="https://age.apache.org/" rel="noopener noreferrer"&gt;Apache AGE&lt;/a&gt;&lt;br&gt;
&lt;a href="https://age.apache.org/age-manual/master/intro/setup.html" rel="noopener noreferrer"&gt;Setup — Apache AGE master documentation&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Contribute to Apache AGE
&lt;/h1&gt;

&lt;p&gt;Apache AGE website: &lt;a href="https://age.apache.org/" rel="noopener noreferrer"&gt;https://age.apache.org/&lt;/a&gt;&lt;br&gt;
Apache AGE Github: &lt;a href="https://github.com/apache/age" rel="noopener noreferrer"&gt;https://github.com/apache/age&lt;/a&gt;&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>discuss</category>
      <category>vibecoding</category>
      <category>metal</category>
    </item>
  </channel>
</rss>
