craigtrim / prolog_antlr

ANTLR for Prolog
0 stars 0 forks source link

Visual Enhancements to Generated Graph #9

Closed craigtrim closed 4 years ago

craigtrim commented 4 years ago

Consider a visual or color-based differentiation for Facts, Rules and Queries.

craigtrim commented 4 years ago

Also keeping in mind you aren't visualizing the execution of a program or the solutions to a program; just the static program as it was written.

craigtrim commented 4 years ago

Consider a layout like this: image

  1. Clauses (really, Facts) are displayed.
  2. A sub-boxed triple is displayed for each Fact (recursion may be required here if a fact is nested).
  3. The triples are also viewed outside sub-boxes to create a single graph but linked back to the sub-box. This will maintain the positioning of Facts to the relevant area of the single graph.

Another edit on the same visual: image

craigtrim commented 4 years ago

This is the prolog source being tested:

label(analysis_skill, "Analysis Skill").
label(business_analysis_skill, "Business Analysis Skill").

parent(analysis_skill, skill).
parent(business_analysis_skill, analysis_skill).

ancestor(X,Y):- 
    parent(X,Y).        /* someone is your ancestor if there are your parent */
ancestor(X,Y):- 
    parent(X,Z),        /* or somebody is your ancestor if they are the parent */
    ancestor(Z,Y).      /* of someone who is your ancestor */ 

This is the V1 graph prior to conversion

image

This is the dataframe

+----+--------------------------------------+-------------+-----------------------------------------------------------+--------------------------------------+
|    | UUID                                 | Type        | Text                                                      | Parent                               |
|----+--------------------------------------+-------------+-----------------------------------------------------------+--------------------------------------|
|  0 | e5e38502-a833-11ea-b198-acde48001122 | Clause      | label(analysis_skill,"Analysis Skill").                   |                                      |
|  1 | e5e387c8-a833-11ea-b198-acde48001122 | Compound    | label(analysis_skill,"Analysis Skill")                    | e5e38502-a833-11ea-b198-acde48001122 |
|  2 | e5e3885e-a833-11ea-b198-acde48001122 | Name        | label                                                     | e5e387c8-a833-11ea-b198-acde48001122 |
|  3 | e5e38a34-a833-11ea-b198-acde48001122 | Conjunction | analysis_skill|"Analysis Skill"                           | e5e387c8-a833-11ea-b198-acde48001122 |
|  4 | e5e38ab6-a833-11ea-b198-acde48001122 | Entity      | analysis_skill                                            | e5e38a34-a833-11ea-b198-acde48001122 |
|  5 | e5e38c3c-a833-11ea-b198-acde48001122 | String      | "Analysis Skill"                                          | e5e38a34-a833-11ea-b198-acde48001122 |
|  6 | e5e38df4-a833-11ea-b198-acde48001122 | Clause      | label(business_analysis_skill,"Business Analysis Skill"). |                                      |
|  7 | e5e38ef8-a833-11ea-b198-acde48001122 | Compound    | label(business_analysis_skill,"Business Analysis Skill")  | e5e38df4-a833-11ea-b198-acde48001122 |
|  8 | e5e3885e-a833-11ea-b198-acde48001122 | Name        | label                                                     | e5e38ef8-a833-11ea-b198-acde48001122 |
|  9 | e5e390ce-a833-11ea-b198-acde48001122 | Conjunction | business_analysis_skill|"Business Analysis Skill"         | e5e38ef8-a833-11ea-b198-acde48001122 |
| 10 | e5e3913c-a833-11ea-b198-acde48001122 | Entity      | business_analysis_skill                                   | e5e390ce-a833-11ea-b198-acde48001122 |
| 11 | e5e392a4-a833-11ea-b198-acde48001122 | String      | "Business Analysis Skill"                                 | e5e390ce-a833-11ea-b198-acde48001122 |
| 12 | e5e39452-a833-11ea-b198-acde48001122 | Clause      | parent(analysis_skill,skill).                             |                                      |
| 13 | e5e39556-a833-11ea-b198-acde48001122 | Compound    | parent(analysis_skill,skill)                              | e5e39452-a833-11ea-b198-acde48001122 |
| 14 | e5e395b0-a833-11ea-b198-acde48001122 | Name        | parent                                                    | e5e39556-a833-11ea-b198-acde48001122 |
| 15 | e5e39754-a833-11ea-b198-acde48001122 | Conjunction | analysis_skill|skill                                      | e5e39556-a833-11ea-b198-acde48001122 |
| 16 | e5e38ab6-a833-11ea-b198-acde48001122 | Entity      | analysis_skill                                            | e5e39754-a833-11ea-b198-acde48001122 |
| 17 | e5e398d0-a833-11ea-b198-acde48001122 | Entity      | skill                                                     | e5e39754-a833-11ea-b198-acde48001122 |
| 18 | e5e39aa6-a833-11ea-b198-acde48001122 | Clause      | parent(business_analysis_skill,analysis_skill).           |                                      |
| 19 | e5e39baa-a833-11ea-b198-acde48001122 | Compound    | parent(business_analysis_skill,analysis_skill)            | e5e39aa6-a833-11ea-b198-acde48001122 |
| 20 | e5e395b0-a833-11ea-b198-acde48001122 | Name        | parent                                                    | e5e39baa-a833-11ea-b198-acde48001122 |
| 21 | e5e39d76-a833-11ea-b198-acde48001122 | Conjunction | business_analysis_skill|analysis_skill                    | e5e39baa-a833-11ea-b198-acde48001122 |
| 22 | e5e3913c-a833-11ea-b198-acde48001122 | Entity      | business_analysis_skill                                   | e5e39d76-a833-11ea-b198-acde48001122 |
| 23 | e5e38ab6-a833-11ea-b198-acde48001122 | Entity      | analysis_skill                                            | e5e39d76-a833-11ea-b198-acde48001122 |
| 24 | e5e3a10e-a833-11ea-b198-acde48001122 | Clause      | ancestor(X,Y):-parent(X,Y).                               |                                      |
| 25 | e5e3a2b2-a833-11ea-b198-acde48001122 | Conditional | ancestor(X,Y)|parent(X,Y)                                 | e5e3a10e-a833-11ea-b198-acde48001122 |
| 26 | e5e3a398-a833-11ea-b198-acde48001122 | Compound    | ancestor(X,Y)                                             | e5e3a2b2-a833-11ea-b198-acde48001122 |
| 27 | e5e3a3f2-a833-11ea-b198-acde48001122 | Name        | ancestor                                                  | e5e3a398-a833-11ea-b198-acde48001122 |
| 28 | e5e3a55a-a833-11ea-b198-acde48001122 | Conjunction | X|Y                                                       | e5e3a398-a833-11ea-b198-acde48001122 |
| 29 | e5e3a5c8-a833-11ea-b198-acde48001122 | Variable    | X                                                         | e5e3a55a-a833-11ea-b198-acde48001122 |
| 30 | e5e3a6b8-a833-11ea-b198-acde48001122 | Variable    | Y                                                         | e5e3a55a-a833-11ea-b198-acde48001122 |
| 31 | e5e3a866-a833-11ea-b198-acde48001122 | Compound    | parent(X,Y)                                               | e5e3a2b2-a833-11ea-b198-acde48001122 |
| 32 | e5e395b0-a833-11ea-b198-acde48001122 | Name        | parent                                                    | e5e3a866-a833-11ea-b198-acde48001122 |
| 33 | e5e3a9f6-a833-11ea-b198-acde48001122 | Conjunction | X|Y                                                       | e5e3a866-a833-11ea-b198-acde48001122 |
| 34 | e5e3a5c8-a833-11ea-b198-acde48001122 | Variable    | X                                                         | e5e3a9f6-a833-11ea-b198-acde48001122 |
| 35 | e5e3a6b8-a833-11ea-b198-acde48001122 | Variable    | Y                                                         | e5e3a9f6-a833-11ea-b198-acde48001122 |
| 36 | e5e3adca-a833-11ea-b198-acde48001122 | Clause      | ancestor(X,Y):-parent(X,Z),ancestor(Z,Y).                 |                                      |
| 37 | e5e3b036-a833-11ea-b198-acde48001122 | Conditional | ancestor(X,Y)|parent(X,Z)|ancestor(Z,Y)                   | e5e3adca-a833-11ea-b198-acde48001122 |
| 38 | e5e3b11c-a833-11ea-b198-acde48001122 | Compound    | ancestor(X,Y)                                             | e5e3b036-a833-11ea-b198-acde48001122 |
| 39 | e5e3a3f2-a833-11ea-b198-acde48001122 | Name        | ancestor                                                  | e5e3b11c-a833-11ea-b198-acde48001122 |
| 40 | e5e3b2ac-a833-11ea-b198-acde48001122 | Conjunction | X|Y                                                       | e5e3b11c-a833-11ea-b198-acde48001122 |
| 41 | e5e3a5c8-a833-11ea-b198-acde48001122 | Variable    | X                                                         | e5e3b2ac-a833-11ea-b198-acde48001122 |
| 42 | e5e3a6b8-a833-11ea-b198-acde48001122 | Variable    | Y                                                         | e5e3b2ac-a833-11ea-b198-acde48001122 |
| 43 | e5e3b5f4-a833-11ea-b198-acde48001122 | Conjunction | parent(X,Z)|ancestor(Z,Y)                                 | e5e3b036-a833-11ea-b198-acde48001122 |
| 44 | e5e3b6da-a833-11ea-b198-acde48001122 | Compound    | parent(X,Z)                                               | e5e3b5f4-a833-11ea-b198-acde48001122 |
| 45 | e5e395b0-a833-11ea-b198-acde48001122 | Name        | parent                                                    | e5e3b6da-a833-11ea-b198-acde48001122 |
| 46 | e5e3b86a-a833-11ea-b198-acde48001122 | Conjunction | X|Z                                                       | e5e3b6da-a833-11ea-b198-acde48001122 |
| 47 | e5e3a5c8-a833-11ea-b198-acde48001122 | Variable    | X                                                         | e5e3b86a-a833-11ea-b198-acde48001122 |
| 48 | e5e3b978-a833-11ea-b198-acde48001122 | Variable    | Z                                                         | e5e3b86a-a833-11ea-b198-acde48001122 |
| 49 | e5e3bb26-a833-11ea-b198-acde48001122 | Compound    | ancestor(Z,Y)                                             | e5e3b5f4-a833-11ea-b198-acde48001122 |
| 50 | e5e3a3f2-a833-11ea-b198-acde48001122 | Name        | ancestor                                                  | e5e3bb26-a833-11ea-b198-acde48001122 |
| 51 | e5e3bcc0-a833-11ea-b198-acde48001122 | Conjunction | Z|Y                                                       | e5e3bb26-a833-11ea-b198-acde48001122 |
| 52 | e5e3b978-a833-11ea-b198-acde48001122 | Variable    | Z                                                         | e5e3bcc0-a833-11ea-b198-acde48001122 |
| 53 | e5e3a6b8-a833-11ea-b198-acde48001122 | Variable    | Y                                                         | e5e3bcc0-a833-11ea-b198-acde48001122 |
+----+--------------------------------------+-------------+-----------------------------------------------------------+--------------------------------------+

This is the JSON AST:

[
  {
    "uuid": "e5e38502-a833-11ea-b198-acde48001122",
    "type": "Clause",
    "text": "label(analysis_skill,\"Analysis Skill\").",
    "results": [
      {
        "uuid": "e5e387c8-a833-11ea-b198-acde48001122",
        "type": "Compound",
        "text": "label(analysis_skill,\"Analysis Skill\")",
        "results": [
          {
            "uuid": "e5e3885e-a833-11ea-b198-acde48001122",
            "type": "Name",
            "text": "label",
            "results": []
          },
          {
            "uuid": "e5e38a34-a833-11ea-b198-acde48001122",
            "type": "Conjunction",
            "text": "analysis_skill|\"Analysis Skill\"",
            "results": [
              {
                "uuid": "e5e38ab6-a833-11ea-b198-acde48001122",
                "type": "Entity",
                "text": "analysis_skill",
                "results": []
              },
              {
                "uuid": "e5e38c3c-a833-11ea-b198-acde48001122",
                "type": "String",
                "text": "\"Analysis Skill\"",
                "results": []
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "uuid": "e5e38df4-a833-11ea-b198-acde48001122",
    "type": "Clause",
    "text": "label(business_analysis_skill,\"Business Analysis Skill\").",
    "results": [
      {
        "uuid": "e5e38ef8-a833-11ea-b198-acde48001122",
        "type": "Compound",
        "text": "label(business_analysis_skill,\"Business Analysis Skill\")",
        "results": [
          {
            "uuid": "e5e3885e-a833-11ea-b198-acde48001122",
            "type": "Name",
            "text": "label",
            "results": []
          },
          {
            "uuid": "e5e390ce-a833-11ea-b198-acde48001122",
            "type": "Conjunction",
            "text": "business_analysis_skill|\"Business Analysis Skill\"",
            "results": [
              {
                "uuid": "e5e3913c-a833-11ea-b198-acde48001122",
                "type": "Entity",
                "text": "business_analysis_skill",
                "results": []
              },
              {
                "uuid": "e5e392a4-a833-11ea-b198-acde48001122",
                "type": "String",
                "text": "\"Business Analysis Skill\"",
                "results": []
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "uuid": "e5e39452-a833-11ea-b198-acde48001122",
    "type": "Clause",
    "text": "parent(analysis_skill,skill).",
    "results": [
      {
        "uuid": "e5e39556-a833-11ea-b198-acde48001122",
        "type": "Compound",
        "text": "parent(analysis_skill,skill)",
        "results": [
          {
            "uuid": "e5e395b0-a833-11ea-b198-acde48001122",
            "type": "Name",
            "text": "parent",
            "results": []
          },
          {
            "uuid": "e5e39754-a833-11ea-b198-acde48001122",
            "type": "Conjunction",
            "text": "analysis_skill|skill",
            "results": [
              {
                "uuid": "e5e38ab6-a833-11ea-b198-acde48001122",
                "type": "Entity",
                "text": "analysis_skill",
                "results": []
              },
              {
                "uuid": "e5e398d0-a833-11ea-b198-acde48001122",
                "type": "Entity",
                "text": "skill",
                "results": []
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "uuid": "e5e39aa6-a833-11ea-b198-acde48001122",
    "type": "Clause",
    "text": "parent(business_analysis_skill,analysis_skill).",
    "results": [
      {
        "uuid": "e5e39baa-a833-11ea-b198-acde48001122",
        "type": "Compound",
        "text": "parent(business_analysis_skill,analysis_skill)",
        "results": [
          {
            "uuid": "e5e395b0-a833-11ea-b198-acde48001122",
            "type": "Name",
            "text": "parent",
            "results": []
          },
          {
            "uuid": "e5e39d76-a833-11ea-b198-acde48001122",
            "type": "Conjunction",
            "text": "business_analysis_skill|analysis_skill",
            "results": [
              {
                "uuid": "e5e3913c-a833-11ea-b198-acde48001122",
                "type": "Entity",
                "text": "business_analysis_skill",
                "results": []
              },
              {
                "uuid": "e5e38ab6-a833-11ea-b198-acde48001122",
                "type": "Entity",
                "text": "analysis_skill",
                "results": []
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "uuid": "e5e3a10e-a833-11ea-b198-acde48001122",
    "type": "Clause",
    "text": "ancestor(X,Y):-parent(X,Y).",
    "results": [
      {
        "uuid": "e5e3a2b2-a833-11ea-b198-acde48001122",
        "type": "Conditional",
        "text": "ancestor(X,Y)|parent(X,Y)",
        "results": [
          {
            "uuid": "e5e3a398-a833-11ea-b198-acde48001122",
            "type": "Compound",
            "text": "ancestor(X,Y)",
            "results": [
              {
                "uuid": "e5e3a3f2-a833-11ea-b198-acde48001122",
                "type": "Name",
                "text": "ancestor",
                "results": []
              },
              {
                "uuid": "e5e3a55a-a833-11ea-b198-acde48001122",
                "type": "Conjunction",
                "text": "X|Y",
                "results": [
                  {
                    "uuid": "e5e3a5c8-a833-11ea-b198-acde48001122",
                    "type": "Variable",
                    "text": "X",
                    "results": []
                  },
                  {
                    "uuid": "e5e3a6b8-a833-11ea-b198-acde48001122",
                    "type": "Variable",
                    "text": "Y",
                    "results": []
                  }
                ]
              }
            ]
          },
          {
            "uuid": "e5e3a866-a833-11ea-b198-acde48001122",
            "type": "Compound",
            "text": "parent(X,Y)",
            "results": [
              {
                "uuid": "e5e395b0-a833-11ea-b198-acde48001122",
                "type": "Name",
                "text": "parent",
                "results": []
              },
              {
                "uuid": "e5e3a9f6-a833-11ea-b198-acde48001122",
                "type": "Conjunction",
                "text": "X|Y",
                "results": [
                  {
                    "uuid": "e5e3a5c8-a833-11ea-b198-acde48001122",
                    "type": "Variable",
                    "text": "X",
                    "results": []
                  },
                  {
                    "uuid": "e5e3a6b8-a833-11ea-b198-acde48001122",
                    "type": "Variable",
                    "text": "Y",
                    "results": []
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "uuid": "e5e3adca-a833-11ea-b198-acde48001122",
    "type": "Clause",
    "text": "ancestor(X,Y):-parent(X,Z),ancestor(Z,Y).",
    "results": [
      {
        "uuid": "e5e3b036-a833-11ea-b198-acde48001122",
        "type": "Conditional",
        "text": "ancestor(X,Y)|parent(X,Z)|ancestor(Z,Y)",
        "results": [
          {
            "uuid": "e5e3b11c-a833-11ea-b198-acde48001122",
            "type": "Compound",
            "text": "ancestor(X,Y)",
            "results": [
              {
                "uuid": "e5e3a3f2-a833-11ea-b198-acde48001122",
                "type": "Name",
                "text": "ancestor",
                "results": []
              },
              {
                "uuid": "e5e3b2ac-a833-11ea-b198-acde48001122",
                "type": "Conjunction",
                "text": "X|Y",
                "results": [
                  {
                    "uuid": "e5e3a5c8-a833-11ea-b198-acde48001122",
                    "type": "Variable",
                    "text": "X",
                    "results": []
                  },
                  {
                    "uuid": "e5e3a6b8-a833-11ea-b198-acde48001122",
                    "type": "Variable",
                    "text": "Y",
                    "results": []
                  }
                ]
              }
            ]
          },
          {
            "uuid": "e5e3b5f4-a833-11ea-b198-acde48001122",
            "type": "Conjunction",
            "text": "parent(X,Z)|ancestor(Z,Y)",
            "results": [
              {
                "uuid": "e5e3b6da-a833-11ea-b198-acde48001122",
                "type": "Compound",
                "text": "parent(X,Z)",
                "results": [
                  {
                    "uuid": "e5e395b0-a833-11ea-b198-acde48001122",
                    "type": "Name",
                    "text": "parent",
                    "results": []
                  },
                  {
                    "uuid": "e5e3b86a-a833-11ea-b198-acde48001122",
                    "type": "Conjunction",
                    "text": "X|Z",
                    "results": [
                      {
                        "uuid": "e5e3a5c8-a833-11ea-b198-acde48001122",
                        "type": "Variable",
                        "text": "X",
                        "results": []
                      },
                      {
                        "uuid": "e5e3b978-a833-11ea-b198-acde48001122",
                        "type": "Variable",
                        "text": "Z",
                        "results": []
                      }
                    ]
                  }
                ]
              },
              {
                "uuid": "e5e3bb26-a833-11ea-b198-acde48001122",
                "type": "Compound",
                "text": "ancestor(Z,Y)",
                "results": [
                  {
                    "uuid": "e5e3a3f2-a833-11ea-b198-acde48001122",
                    "type": "Name",
                    "text": "ancestor",
                    "results": []
                  },
                  {
                    "uuid": "e5e3bcc0-a833-11ea-b198-acde48001122",
                    "type": "Conjunction",
                    "text": "Z|Y",
                    "results": [
                      {
                        "uuid": "e5e3b978-a833-11ea-b198-acde48001122",
                        "type": "Variable",
                        "text": "Z",
                        "results": []
                      },
                      {
                        "uuid": "e5e3a6b8-a833-11ea-b198-acde48001122",
                        "type": "Variable",
                        "text": "Y",
                        "results": []
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
]
craigtrim commented 4 years ago

This is a mockup of the design I'd like to achieve:

image

Granted, I'll be using Graphviz instead of yED.

The general iteration should be simple - look for Facts that are represented as Compounds within the JSON AST, and use the Compound/Name as the predicate between two entities (could be either Conjuction/Atomic/String or Conjunction/Atomic/Name).

craigtrim commented 4 years ago

The intermediate output looks like this

[
  [
    {
      "Text": "analysis_skill",
      "Type": "Entity",
      "Predicate": "label",
      "UUID": "343751b4-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "\"Analysis Skill\"",
      "Type": "String",
      "Predicate": "label",
      "UUID": "34375312-a836-11ea-88c1-acde48001122"
    }
  ],
  [
    {
      "Text": "business_analysis_skill",
      "Type": "Entity",
      "Predicate": "label",
      "UUID": "34375c18-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "\"Business Analysis Skill\"",
      "Type": "String",
      "Predicate": "label",
      "UUID": "34375fb0-a836-11ea-88c1-acde48001122"
    }
  ],
  [
    {
      "Text": "analysis_skill",
      "Type": "Entity",
      "Predicate": "parent",
      "UUID": "343751b4-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "skill",
      "Type": "Entity",
      "Predicate": "parent",
      "UUID": "34376596-a836-11ea-88c1-acde48001122"
    }
  ],
  [
    {
      "Text": "business_analysis_skill",
      "Type": "Entity",
      "Predicate": "parent",
      "UUID": "34375c18-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "analysis_skill",
      "Type": "Entity",
      "Predicate": "parent",
      "UUID": "343751b4-a836-11ea-88c1-acde48001122"
    }
  ],
  [
    {
      "Text": "X",
      "Type": "Variable",
      "Predicate": "ancestor",
      "UUID": "3437707c-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "Y",
      "Type": "Variable",
      "Predicate": "ancestor",
      "UUID": "34377144-a836-11ea-88c1-acde48001122"
    }
  ],
  [
    {
      "Text": "X",
      "Type": "Variable",
      "Predicate": "parent",
      "UUID": "3437707c-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "Y",
      "Type": "Variable",
      "Predicate": "parent",
      "UUID": "34377144-a836-11ea-88c1-acde48001122"
    }
  ],
  [
    {
      "Text": "X",
      "Type": "Variable",
      "Predicate": "ancestor",
      "UUID": "3437707c-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "Y",
      "Type": "Variable",
      "Predicate": "ancestor",
      "UUID": "34377144-a836-11ea-88c1-acde48001122"
    }
  ],
  [
    {
      "Text": "X",
      "Type": "Variable",
      "Predicate": "parent",
      "UUID": "3437707c-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "Z",
      "Type": "Variable",
      "Predicate": "parent",
      "UUID": "34378972-a836-11ea-88c1-acde48001122"
    }
  ],
  [
    {
      "Text": "Z",
      "Type": "Variable",
      "Predicate": "ancestor",
      "UUID": "34378972-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "Y",
      "Type": "Variable",
      "Predicate": "ancestor",
      "UUID": "34377144-a836-11ea-88c1-acde48001122"
    }
  ]
]

Convention over Configuration here.

For a given snippet of JSON, such as

 [
    {
      "Text": "Z",
      "Type": "Variable",
      "Predicate": "ancestor",
      "UUID": "34378972-a836-11ea-88c1-acde48001122"
    },
    {
      "Text": "Y",
      "Type": "Variable",
      "Predicate": "ancestor",
      "UUID": "34377144-a836-11ea-88c1-acde48001122"
    }
  ]

The first element is the Subject and the second element is the Object.

craigtrim commented 4 years ago

This is the largely unstyled output from the prior example https://github.com/craigtrim/prolog_antlr/issues/9#issuecomment-640114990 -

image
craigtrim commented 4 years ago

Incrementally Improved Styling:

image
craigtrim commented 4 years ago

Doing the same thing but with sub-graphs

image
craigtrim commented 4 years ago

This is starting to look better:

image

The primary downside to this graph is that it does not show clusters if the nodes within the cluster are already present in other clusters. In the current example, ancestor(Z,Y) and parent(X,Y) are not shown as distinct clusters.

This is the updated JSON

[
  {
    "Compound": "label(analysis_skill,\"Analysis Skill\")",
    "Triple": [
      {
        "Text": "analysis_skill",
        "Type": "Entity",
        "Predicate": "label",
        "UUID": "4e0d0fce-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "\"Analysis Skill\"",
        "Type": "String",
        "Predicate": "label",
        "UUID": "4e0d16c2-a855-11ea-8708-acde48001122"
      }
    ]
  },
  {
    "Compound": "label(business_analysis_skill,\"Business Analysis Skill\")",
    "Triple": [
      {
        "Text": "business_analysis_skill",
        "Type": "Entity",
        "Predicate": "label",
        "UUID": "4e0d1c26-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "\"Business Analysis Skill\"",
        "Type": "String",
        "Predicate": "label",
        "UUID": "4e0d1d70-a855-11ea-8708-acde48001122"
      }
    ]
  },
  {
    "Compound": "parent(analysis_skill,skill)",
    "Triple": [
      {
        "Text": "analysis_skill",
        "Type": "Entity",
        "Predicate": "parent",
        "UUID": "4e0d0fce-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "skill",
        "Type": "Entity",
        "Predicate": "parent",
        "UUID": "4e0d2306-a855-11ea-8708-acde48001122"
      }
    ]
  },
  {
    "Compound": "parent(business_analysis_skill,analysis_skill)",
    "Triple": [
      {
        "Text": "business_analysis_skill",
        "Type": "Entity",
        "Predicate": "parent",
        "UUID": "4e0d1c26-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "analysis_skill",
        "Type": "Entity",
        "Predicate": "parent",
        "UUID": "4e0d0fce-a855-11ea-8708-acde48001122"
      }
    ]
  },
  {
    "Compound": "ancestor(X,Y)",
    "Triple": [
      {
        "Text": "X",
        "Type": "Variable",
        "Predicate": "ancestor",
        "UUID": "4e0d2eb4-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "Y",
        "Type": "Variable",
        "Predicate": "ancestor",
        "UUID": "4e0d2f86-a855-11ea-8708-acde48001122"
      }
    ]
  },
  {
    "Compound": "parent(X,Y)",
    "Triple": [
      {
        "Text": "X",
        "Type": "Variable",
        "Predicate": "parent",
        "UUID": "4e0d2eb4-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "Y",
        "Type": "Variable",
        "Predicate": "parent",
        "UUID": "4e0d2f86-a855-11ea-8708-acde48001122"
      }
    ]
  },
  {
    "Compound": "ancestor(X,Y)",
    "Triple": [
      {
        "Text": "X",
        "Type": "Variable",
        "Predicate": "ancestor",
        "UUID": "4e0d2eb4-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "Y",
        "Type": "Variable",
        "Predicate": "ancestor",
        "UUID": "4e0d2f86-a855-11ea-8708-acde48001122"
      }
    ]
  },
  {
    "Compound": "parent(X,Z)",
    "Triple": [
      {
        "Text": "X",
        "Type": "Variable",
        "Predicate": "parent",
        "UUID": "4e0d2eb4-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "Z",
        "Type": "Variable",
        "Predicate": "parent",
        "UUID": "4e0d405c-a855-11ea-8708-acde48001122"
      }
    ]
  },
  {
    "Compound": "ancestor(Z,Y)",
    "Triple": [
      {
        "Text": "Z",
        "Type": "Variable",
        "Predicate": "ancestor",
        "UUID": "4e0d405c-a855-11ea-8708-acde48001122"
      },
      {
        "Text": "Y",
        "Type": "Variable",
        "Predicate": "ancestor",
        "UUID": "4e0d2f86-a855-11ea-8708-acde48001122"
      }
    ]
  }
]
craigtrim commented 4 years ago

Needs some styling, but this is fairly close to the original concept:

image

Cluster edging is handled by matching variables, entities, or strings. For example, place an edge between any cluster with the Variable X.

Here's the generated Graphviz code

// Schema
digraph output {
    node [fontsize=8]
    graph [compound=True]
    subgraph Cluster0 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(skill,\"Skill\")"
        UUID_C487AE10_A874_11EA_BF10_ACDE48001122_Cluster0 [label=skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487AF82_A874_11EA_BF10_ACDE48001122_Cluster0 [label="\"Skill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487AE10_A874_11EA_BF10_ACDE48001122_Cluster0 -> UUID_C487AF82_A874_11EA_BF10_ACDE48001122_Cluster0 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    }
    subgraph Cluster1 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(analysis_skill,\"Analysis Skill\")"
        UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster1 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487B784_A874_11EA_BF10_ACDE48001122_Cluster1 [label="\"Analysis\nSkill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster1 -> UUID_C487B784_A874_11EA_BF10_ACDE48001122_Cluster1 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    }
    subgraph Cluster2 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(business_analysis_skill,\"Business Analysis Skill\")"
        UUID_C487BFD6_A874_11EA_BF10_ACDE48001122_Cluster2 [label=business_analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487C1E8_A874_11EA_BF10_ACDE48001122_Cluster2 [label="\"Business\nAnalysis Skill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487BFD6_A874_11EA_BF10_ACDE48001122_Cluster2 -> UUID_C487C1E8_A874_11EA_BF10_ACDE48001122_Cluster2 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    }
    subgraph Cluster3 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(analysis_skill,skill)"
        UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster3 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487AE10_A874_11EA_BF10_ACDE48001122_Cluster3 [label=skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster3 -> UUID_C487AE10_A874_11EA_BF10_ACDE48001122_Cluster3 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    }
    subgraph Cluster4 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(business_analysis_skill,analysis_skill)"
        UUID_C487BFD6_A874_11EA_BF10_ACDE48001122_Cluster4 [label=business_analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster4 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487BFD6_A874_11EA_BF10_ACDE48001122_Cluster4 -> UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster4 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    }
    subgraph Cluster5 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(X,Y)"
        UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster5 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster5 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster5 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster5 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    }
    subgraph Cluster6 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(X,Y)"
        UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster6 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster6 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster6 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster6 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    }
    subgraph Cluster7 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(X,Y)"
        UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster7 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster7 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster7 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster7 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    }
    subgraph Cluster8 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(X,Z)"
        UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster8 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487EA92_A874_11EA_BF10_ACDE48001122_Cluster8 [label=Z color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster8 -> UUID_C487EA92_A874_11EA_BF10_ACDE48001122_Cluster8 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    }
    subgraph Cluster9 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(Z,Y)"
        UUID_C487EA92_A874_11EA_BF10_ACDE48001122_Cluster9 [label=Z color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster9 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_C487EA92_A874_11EA_BF10_ACDE48001122_Cluster9 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster9 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    }
    UUID_C487AE10_A874_11EA_BF10_ACDE48001122 [label=skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487AF82_A874_11EA_BF10_ACDE48001122 [label="\"Skill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122 [label=analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487B784_A874_11EA_BF10_ACDE48001122 [label="\"Analysis\nSkill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487BFD6_A874_11EA_BF10_ACDE48001122 [label=business_analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487C1E8_A874_11EA_BF10_ACDE48001122 [label="\"Business\nAnalysis Skill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122 [label=analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487AE10_A874_11EA_BF10_ACDE48001122 [label=skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487BFD6_A874_11EA_BF10_ACDE48001122 [label=business_analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122 [label=analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487EA92_A874_11EA_BF10_ACDE48001122 [label=Z color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487EA92_A874_11EA_BF10_ACDE48001122 [label=Z color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_C487AE10_A874_11EA_BF10_ACDE48001122 -> UUID_C487AF82_A874_11EA_BF10_ACDE48001122 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122 -> UUID_C487B784_A874_11EA_BF10_ACDE48001122 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_C487BFD6_A874_11EA_BF10_ACDE48001122 -> UUID_C487C1E8_A874_11EA_BF10_ACDE48001122 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122 -> UUID_C487AE10_A874_11EA_BF10_ACDE48001122 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_C487BFD6_A874_11EA_BF10_ACDE48001122 -> UUID_C487B586_A874_11EA_BF10_ACDE48001122 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 -> UUID_C487EA92_A874_11EA_BF10_ACDE48001122 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_C487EA92_A874_11EA_BF10_ACDE48001122 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    UUID_C487AE10_A874_11EA_BF10_ACDE48001122_Cluster0 -> UUID_C487AE10_A874_11EA_BF10_ACDE48001122_Cluster3 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster3 ltail=Cluster0 style=dotted weight=2]
    UUID_C487AE10_A874_11EA_BF10_ACDE48001122 -> UUID_C487AE10_A874_11EA_BF10_ACDE48001122_Cluster0 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487AE10_A874_11EA_BF10_ACDE48001122 -> UUID_C487AE10_A874_11EA_BF10_ACDE48001122_Cluster3 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487AF82_A874_11EA_BF10_ACDE48001122 -> UUID_C487AF82_A874_11EA_BF10_ACDE48001122_Cluster0 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster1 -> UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster3 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster3 ltail=Cluster1 style=dotted weight=2]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster1 -> UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster4 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster4 ltail=Cluster1 style=dotted weight=2]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster3 -> UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster4 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster4 ltail=Cluster3 style=dotted weight=2]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122 -> UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster1 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122 -> UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster3 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487B586_A874_11EA_BF10_ACDE48001122 -> UUID_C487B586_A874_11EA_BF10_ACDE48001122_Cluster4 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487B784_A874_11EA_BF10_ACDE48001122 -> UUID_C487B784_A874_11EA_BF10_ACDE48001122_Cluster1 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487BFD6_A874_11EA_BF10_ACDE48001122_Cluster2 -> UUID_C487BFD6_A874_11EA_BF10_ACDE48001122_Cluster4 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster4 ltail=Cluster2 style=dotted weight=2]
    UUID_C487BFD6_A874_11EA_BF10_ACDE48001122 -> UUID_C487BFD6_A874_11EA_BF10_ACDE48001122_Cluster2 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487BFD6_A874_11EA_BF10_ACDE48001122 -> UUID_C487BFD6_A874_11EA_BF10_ACDE48001122_Cluster4 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487C1E8_A874_11EA_BF10_ACDE48001122 -> UUID_C487C1E8_A874_11EA_BF10_ACDE48001122_Cluster2 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster5 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster6 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster6 ltail=Cluster5 style=dotted weight=2]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster5 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster7 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster7 ltail=Cluster5 style=dotted weight=2]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster5 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster8 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster8 ltail=Cluster5 style=dotted weight=2]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster6 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster7 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster7 ltail=Cluster6 style=dotted weight=2]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster6 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster8 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster8 ltail=Cluster6 style=dotted weight=2]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster7 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster8 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster8 ltail=Cluster7 style=dotted weight=2]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster5 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster6 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster7 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487D49E_A874_11EA_BF10_ACDE48001122 -> UUID_C487D49E_A874_11EA_BF10_ACDE48001122_Cluster8 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster5 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster6 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster6 ltail=Cluster5 style=dotted weight=2]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster5 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster7 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster7 ltail=Cluster5 style=dotted weight=2]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster5 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster9 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster9 ltail=Cluster5 style=dotted weight=2]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster6 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster7 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster7 ltail=Cluster6 style=dotted weight=2]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster6 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster9 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster9 ltail=Cluster6 style=dotted weight=2]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster7 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster9 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster9 ltail=Cluster7 style=dotted weight=2]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster5 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster6 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster7 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487D57A_A874_11EA_BF10_ACDE48001122 -> UUID_C487D57A_A874_11EA_BF10_ACDE48001122_Cluster9 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487EA92_A874_11EA_BF10_ACDE48001122_Cluster8 -> UUID_C487EA92_A874_11EA_BF10_ACDE48001122_Cluster9 [label="" arrowhead=none color=4 colorscheme=greys9 fontsize=5 lhead=Cluster9 ltail=Cluster8 style=dotted weight=2]
    UUID_C487EA92_A874_11EA_BF10_ACDE48001122 -> UUID_C487EA92_A874_11EA_BF10_ACDE48001122_Cluster8 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_C487EA92_A874_11EA_BF10_ACDE48001122 -> UUID_C487EA92_A874_11EA_BF10_ACDE48001122_Cluster9 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
}

Note that graph [compound=True] has to be manually added to the graph, as I don't currently know the API code for this, and reference this solution: https://stackoverflow.com/questions/2012036/graphviz-how-to-connect-subgraphs. Only dot can be used to generate this code as fdp and other algorithms miss the clustering.

craigtrim commented 4 years ago

Here's the same graph without attempting to place edges between clusters:

image
// Schema
digraph output {
    node [fontsize=8]
    subgraph Cluster0 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(skill,\"Skill\")"
        UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122_Cluster0 [label=skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4A59A_A874_11EA_9DA4_ACDE48001122_Cluster0 [label="\"Skill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122_Cluster0 -> UUID_7CE4A59A_A874_11EA_9DA4_ACDE48001122_Cluster0 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    }
    subgraph Cluster1 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(analysis_skill,\"Analysis Skill\")"
        UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster1 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4AC5C_A874_11EA_9DA4_ACDE48001122_Cluster1 [label="\"Analysis\nSkill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster1 -> UUID_7CE4AC5C_A874_11EA_9DA4_ACDE48001122_Cluster1 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    }
    subgraph Cluster2 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(business_analysis_skill,\"Business Analysis Skill\")"
        UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122_Cluster2 [label=business_analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4B2EC_A874_11EA_9DA4_ACDE48001122_Cluster2 [label="\"Business\nAnalysis Skill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122_Cluster2 -> UUID_7CE4B2EC_A874_11EA_9DA4_ACDE48001122_Cluster2 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    }
    subgraph Cluster3 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(analysis_skill,skill)"
        UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster3 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122_Cluster3 [label=skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster3 -> UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122_Cluster3 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    }
    subgraph Cluster4 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(business_analysis_skill,analysis_skill)"
        UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122_Cluster4 [label=business_analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster4 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122_Cluster4 -> UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster4 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    }
    subgraph Cluster5 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(X,Y)"
        UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster5 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster5 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster5 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster5 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    }
    subgraph Cluster6 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(X,Y)"
        UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster6 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster6 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster6 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster6 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    }
    subgraph Cluster7 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(X,Y)"
        UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster7 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster7 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster7 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster7 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    }
    subgraph Cluster8 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(X,Z)"
        UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster8 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122_Cluster8 [label=Z color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster8 -> UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122_Cluster8 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    }
    subgraph Cluster9 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(Z,Y)"
        UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122_Cluster9 [label=Z color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster9 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122_Cluster9 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster9 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    }
    UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122 [label=skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4A59A_A874_11EA_9DA4_ACDE48001122 [label="\"Skill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 [label=analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4AC5C_A874_11EA_9DA4_ACDE48001122 [label="\"Analysis\nSkill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122 [label=business_analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4B2EC_A874_11EA_9DA4_ACDE48001122 [label="\"Business\nAnalysis Skill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 [label=analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122 [label=skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122 [label=business_analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 [label=analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122 [label=Z color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122 [label=Z color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4A59A_A874_11EA_9DA4_ACDE48001122 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4AC5C_A874_11EA_9DA4_ACDE48001122 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4B2EC_A874_11EA_9DA4_ACDE48001122 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122_Cluster0 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4A40A_A874_11EA_9DA4_ACDE48001122_Cluster3 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4A59A_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4A59A_A874_11EA_9DA4_ACDE48001122_Cluster0 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster1 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster3 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4AAEA_A874_11EA_9DA4_ACDE48001122_Cluster4 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4AC5C_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4AC5C_A874_11EA_9DA4_ACDE48001122_Cluster1 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122_Cluster2 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4B184_A874_11EA_9DA4_ACDE48001122_Cluster4 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4B2EC_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4B2EC_A874_11EA_9DA4_ACDE48001122_Cluster2 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster5 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster6 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster7 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C692_A874_11EA_9DA4_ACDE48001122_Cluster8 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster5 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster6 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster7 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4C782_A874_11EA_9DA4_ACDE48001122_Cluster9 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122_Cluster8 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
    UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122 -> UUID_7CE4DB0A_A874_11EA_9DA4_ACDE48001122_Cluster9 [label="" arrowhead=none color=3 colorscheme=greys9 fontsize=5 style=dotted weight=0.5]
}

In this case, it may be worth adding Rules parsing to extend edges between clusters. Then we can see these relationships:

craigtrim commented 4 years ago

To incorporate Clause elements as indicated by the prior comment, this will require parsing both

Clause/Conditional (Compound, Compound):

image

and

Clause/Conditional (Compound, Conjunction(Compound, Compound)):

image
craigtrim commented 4 years ago

This line of logic

graph.attr('graph', compound='True')

adds this in graphviz:

graph [compound=True]
craigtrim commented 4 years ago

This is the current graph state:

image

using

// Schema
digraph output {
    node [fontsize=8]
    graph [compound=True]
    UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7 [label=skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704C1A0_A9DD_11EA_95FF_3AF9D3E36CF7 [label="\"Skill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7 [label=analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704C70E_A9DD_11EA_95FF_3AF9D3E36CF7 [label="\"Analysis\nSkill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7 [label=business_analysis_skill color=8 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704CC72_A9DD_11EA_95FF_3AF9D3E36CF7 [label="\"Business\nAnalysis Skill\"" color=9 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7 [label=X color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7 [label=Y color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7 [label=Z color=7 colorscheme=blues9 fixedsize=true fontcolor=gray fontsize=8 shape=doublecircle]
    UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C1A0_A9DD_11EA_95FF_3AF9D3E36CF7 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C70E_A9DD_11EA_95FF_3AF9D3E36CF7 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704CC72_A9DD_11EA_95FF_3AF9D3E36CF7 [label=label arrowhead=vee arrowsize=0.5 color=3 colorscheme=bupu9 fontsize=8]
    UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7 [label=parent arrowhead=vee arrowsize=1.0 color=4 colorscheme=bupu9 fontsize=8 style=solid]
    UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7 [label=ancestor arrowhead=normal color=5 colorscheme=bupu9 fontsize=8 weight=1.5]
    UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster0 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704C1A0_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C1A0_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster0 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster0 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(skill,\"Skill\")"
        UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster0 [label=skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704C1A0_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster0 [label="\"Skill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster1 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704C70E_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C70E_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster1 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster1 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(analysis_skill,\"Analysis Skill\")"
        UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster1 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704C70E_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster1 [label="\"Analysis\nSkill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster2 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704CC72_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704CC72_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster2 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster2 {
        color=2 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="label(business_analysis_skill,\"Business Analysis Skill\")"
        UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster2 [label=business_analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704CC72_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster2 [label="\"Business\nAnalysis Skill\"" color=5 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster3 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster3 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster3 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(analysis_skill,skill)"
        UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster3 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704C060_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster3 [label=skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster4 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster4 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster4 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(business_analysis_skill,analysis_skill)"
        UUID_6704CB46_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster4 [label=business_analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704C5E2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster4 [label=analysis_skill color=4 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster5 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster5 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster5 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(X,Y)"
        UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster5 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster5 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster6 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster6 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster6 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(X,Y)"
        UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster6 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster6 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster7 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster7 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster7 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(X,Y)"
        UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster7 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster7 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster8 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster8 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster8 {
        color=3 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="parent(X,Z)"
        UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster8 [label=X color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster8 [label=Z color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster9 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7 -> UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster9 [label="" arrowhead=none color=1 colorscheme=greys9 fontsize=5 style=dotted weight=1]
    subgraph Cluster9 {
        color=1 colorscheme=orrd3 fontname=Helvetica fontsize=10 label="ancestor(Z,Y)"
        UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster9 [label=Z color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
        UUID_6704DD16_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster9 [label=Y color=3 colorscheme=blues9 fixedsize=true fontcolor=black fontsize=10 shape=doublecircle]
    }
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster5 -> UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster6 [label="ancestor(X,Y):-parent(X,Y)." arrowhead=normal color=8 colorscheme=greys9 fontsize=10 lhead=Cluster6 ltail=Cluster5 style=normal weight=2]
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster7 -> UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster8 [label="ancestor(X,Y):-parent(X,Z),ancestor(Z,Y)." arrowhead=normal color=8 colorscheme=greys9 fontsize=10 lhead=Cluster8 ltail=Cluster7 style=normal weight=2]
    UUID_6704DC44_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster7 -> UUID_6704EDE2_A9DD_11EA_95FF_3AF9D3E36CF7_Cluster9 [label="ancestor(X,Y):-parent(X,Z),ancestor(Z,Y)." arrowhead=normal color=8 colorscheme=greys9 fontsize=10 lhead=Cluster9 ltail=Cluster7 style=normal weight=2]
}

from

    label(skill, "Skill").
    label(analysis_skill, "Analysis Skill").
    label(business_analysis_skill, "Business Analysis Skill").

    parent(analysis_skill, skill).
    parent(business_analysis_skill, analysis_skill).

    ancestor(X,Y):- 
        parent(X,Y).        /* someone is your ancestor if there are your parent */
    ancestor(X,Y):- 
        parent(X,Z),        /* or somebody is your ancestor if they are the parent */
        ancestor(Z,Y).      /* of someone who is your ancestor */