Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Property Graph in Oracle Database: A Polyglot Solution

Property Graph in Oracle Database: A Polyglot Solution

Property Graph databases are a different way to “tell” a story through connections between objects instead of the typical tables and columns approach of relational databases. Oracle Database 12cR2 introduced support for Property Graph and didn’t stop at a simple support: they made Property Graph a polyglot solution accessible by almost any language. SQL, Java, Groovy, Python, REST api, Apache Zeppelin, Cytoscape - you name it. Property Graph can do them all. One tool speaking many languages. We will show you how powerful it is to use Property Graph in the Oracle Database with the various languages and tools.
(2019 version)

Gianni Ceresa

March 21, 2019
Tweet

More Decks by Gianni Ceresa

Other Decks in Technology

Transcript

  1. Vertex
    edge
    Graph Database
    (also called node)

    View full-size slide

  2. edge
    edge label
    edge properties
    edge ID
    directed edge
    vertex (node)
    vertex
    properties
    vertex ID
    a vertex can
    have a label

    View full-size slide

  3. Scalable and Persistent Storage
    Graph Data Access Layer API
    Graph Analytics
    In-memory Analytic Engine
    Blueprints & SolrCloud / Lucene
    Property Graph Support on
    Files, Apache HBase, Oracle NoSQL or Oracle DB 12.2+
    REST Web Service
    Python, Perl, PHP, Ruby,
    Javascript, …
    Java APIs
    Java APIs/JDBC/SQL/PLSQL
    Cytoscape Plug-in
    R Integration (OAAgraph)
    Spark integration
    SQL*Plus, …
    PGX

    View full-size slide
















  4. View full-size slide



  5. BEGIN
    OPG_APIS.CREATE_PG('sa607', 4, 8, '');
    END;

    View full-size slide

  6. There is a new column “VL”
    added in PGX 3.1.1 only

    View full-size slide










  7. View full-size slide





  8. View full-size slide















  9. View full-size slide





  10. Doesn’t support loading a
    graph from DB !!!

    Will support loading from DB

    View full-size slide

  11. GraalVM will make this part useless thanks to its polyglot feature
    • Python will have direct access to Java objects and methods

    View full-size slide

  12. WITH properties AS (
    SELECT DISTINCT k, t, 'Vertex' AS kind
    FROM sa607vt$
    UNION ALL
    SELECT DISTINCT k, t, 'Edge' AS kind
    FROM sa607ge$
    )
    ,cfg AS (
    SELECT '.add' || kind || 'Property("' || k || '",PropertyTypeClass.'
    || CASE WHEN t = 1 THEN 'STRING' WHEN t = 3 THEN 'FLOAT' WHEN t = 5
    THEN 'DATE' WHEN t = 6 THEN 'BOOLEAN' END
    || ')' AS prop
    FROM properties
    ) SELECT LISTAGG(prop,'') WITHIN GROUP(ORDER BY prop) FROM cfg;

    View full-size slide







  13. View full-size slide






  14. Oracle XE 18c gives you graphs for free!
    Feel free to get in touch for any question or more
    examples of graphs in Zeppelin or Jupyter

    View full-size slide






  15. View full-size slide