8 Replies Latest reply on Feb 25, 2019 4:13 PM by Gianni Ceresa

    How to check Property Graph has been loaded into in-memory or not

    mohanr.k

      I configured pgx.conf file to connect to Property Graph database and load the properties into in-memory while starting the pgx server using start_server.bat. I hope my understanding is correct? Please correct me if I ma wrong.

       

      Now I want to know whether the data from property graph tables has been loaded into in-memory or not.

        • 1. Re: How to check Property Graph has been loaded into in-memory or not
          Gianni Ceresa

          Hi,

          Would you mind to post some details about your environment and versions?

          PGX exists in various versions, standalone or "embedded" with various products, so if you don't give more details it's quite difficult to guess exactly what's your environment.

           

          Based on the news of the day and the fact you mention "start_server.bat" I would bet you are using Oracle 18c XE on Windows freshly made available for download earlier today (or yesterday) ?

          • 2. Re: How to check Property Graph has been loaded into in-memory or not
            mohanr.k

            I am using latest PGX server. I am trying to do below

            1) Created Property Graph in oracle 18c and loaded data into property graph tables using flat files

            2) Installed PGX

            3) Configured pgx.conf and <graph_name>.json. Below is pgx.conf

            {

              "preload_graphs": [

                {

                  "path": "conf//TestData.json",

                  "name": "TestData"

                }

              ],

              "tmp_dir": "C:\\Temp"

            }

            Referred below urls

            https://docs.oracle.com/cd/E56133_01/latest/reference/config/index.html

            https://docs.oracle.com/cd/E56133_01/latest/reference/loader/index.html

            4)Now start PGX server using start_server.bat. With this I thought PGX will read above config files and load the graph into In-Memory for analysis. Please correct me if I am wrong

            5) Now using Cytoscape I want to connect to PGX In-Memory and run PGQL queries to analyze the graph data. As per my understanding this is called Remote mode

             

            I want to know how can I make sure that my graph data has been loaded to PGX In-memory. I hope this is clear

            • 3. Re: How to check Property Graph has been loaded into in-memory or not
              Gianni Ceresa

              3852905 wrote:

               

              I am using latest PGX server

              What version?

              Latest is 3.2.0, but I doubt you are using it. So give the full details of the version. There are many of them and all with little differences, therefore without a proper version it's quite hard to say something.

               

              Did you try loading the graph into the PGX shell to make sure the format of your graph config is valid?

              Is your TestData.json located in <pgx>\conf\conf\ ?

              Paths are relatives to the location of the conf file where you are defining the "preload_graphs", if your "TestData.json" is next to pgx.conf you need use something like: "path": "TestData.json" .

               

              More in general, you don't need to pre-load graphs at startup of PGX to use Cytoscape. When you connect from Cytoscape to PGX you generally load the graph you want there on-the-fly (just by selecting the graph name in the drop down showing all the graphs available in the DB you will connect to).

              • 4. Re: How to check Property Graph has been loaded into in-memory or not
                mohanr.k

                Thank you.

                 

                Sorry my PGX version is 3.1.0

                 

                Paths are relatives to the location of the conf file where you are defining the "preload_graphs", if your "TestData.json" is next to pgx.conf you need use something like: "path": "TestData.json"

                 

                Yes "TestData.json" is next to pgx.conf. Even I read about the relative path documentation. But some how PGX server that I am using is not behaving this way may be mine is not latest version. For example is I give as you mentioned ("path": "TestData.json") and if I start server from PGX bin directory like <PGX_HOME>\bin>start_server.bat. In this case it is throwing file not found exception and is looking for file in PGX_HOME>\bin directory. I am not sure its because of my PGX server version.

                 

                More in general, you don't need to pre-load graphs at startup of PGX to use Cytoscape. When you connect from Cytoscape to PGX you generally load the graph you want there on-the-fly (just by selecting the graph name in the drop down showing all the graphs available in the DB you will connect to).

                 

                Does this mean selected graph will be auto loaded to memory and queries run on the In-memory? If so how can I configure only selected properties to load? I believe pgx.conf and <graph_name>.json files are required for this and these files are read by pgx server at startup.

                 

                • 5. Re: How to check Property Graph has been loaded into in-memory or not
                  Gianni Ceresa

                  I believe 3.1.0 is the "most" recent one being GA for Windows.

                   

                  I must be honest: I have been using various PGX version (both in the DB and standalone) for quite some time but only on linux, therefore I can only hope there isn't a platform specific behaviour.

                  I remember that in some older versions things were working fine only if I first moved into the folder of PGX (your <PGX_HOME>, and from there run ./bin/start-server (on linux). That was the only way to not have weird messages because of wrong "relative" paths not properly defined etc.

                   

                  I didn't use Cytoscape recently (at least not with the Oracle plugin), as far as I remember it will load the whole graph in PGX, so it can be big based on your graph.

                  Would need to have a look at how it behave now, to see if things changed.

                  • 6. Re: How to check Property Graph has been loaded into in-memory or not
                    Gianni Ceresa

                    Re-configured Cytoscape and that's what I get:

                    In "Start from PGQL" you can enter properties you want to load for edges and vertices yourself by hand if you want.

                    When using "Start from nodes" it doesn't ask anything and all the properties can be retrieved when clicking on the button. I suspect they have been loaded in PGX, but I would need to dig into the server to find out what has been loaded and if it's querying properties from the DB on the fly or they come from PGX because all loaded.

                     

                    Still I can see why it's less practical for you than pre-load your graphs into PGX at start with the set of properties you want.

                     

                    Capture.PNG

                    • 7. Re: How to check Property Graph has been loaded into in-memory or not
                      mohanr.k

                      Thanks for the information.

                       

                      Below is for your information and not sure if you want this to be raised as bug

                      • I tried with PGX 3.2.0 in windows environment. Relative path is not working as described in documentation.
                      • I have to start server from PGX_HOME as >bin\start_server.bat and then configure the path as path:conf/TestData.json
                      • 8. Re: How to check Property Graph has been loaded into in-memory or not
                        Gianni Ceresa

                        Hi,

                        I was playing with PGX on Windows (you made me curious...) and I had no issue in loading a graph at start of the PGX server. The only difference with your usecase I guess is that I'm using full paths instead of relative.

                         

                        In my pgx.conf I have the following piece:

                        "preload_graphs" : [

                           {

                              "path" : "C:/Users/Gianni/Desktop/property_graph_3.1.5/data/electric-network/electric_graph.edge.json",

                              "name" : "electric_graph"

                           }

                        ]

                        After I start my PGX server (which has SSL disabled, authentication disabled and listen on port 7007.

                         

                        Last piece, check the graph was loaded.

                        I start a PGX shell connecting to my server by calling "bin\pgx.bat -b http://localhost:7007"

                        In the PGX shell I test the graph is loaded by entering:

                        g = session.getGraph("electric_graph")

                        And the shell tell me "==> PgxGraph[name=electric_graph,N=10916,E=10930,created=1551110389398]", which confirms the graph was loaded in memory already and accessible by other sessions.

                         

                        I'm using PGX 3.1.5, which you can get as a patch (search in MOS for "Patch 29396996: MEMORY LEAK IN PGX IN-MEMORY ANALYST").

                         

                        So going back at the original post, you can check the graph is loaded by starting a session connection to the PGX server and doing a session.getGraph("<graph name>")