{
  "type": "project",
  "input": {
    "type": "join",
    "input": [
      {
        "type": "project",
        "input": {
          "type": "extend",
          "input": {
            "type": "group",
            "input": {
              "type": "bgp",
              "patterns": [
                {
                  "type": "pattern",
                  "termType": "Quad",
                  "subject": {
                    "termType": "Variable",
                    "value": "x"
                  },
                  "predicate": {
                    "termType": "NamedNode",
                    "value": "http://www.example.org/schema#p"
                  },
                  "object": {
                    "termType": "Variable",
                    "value": "y"
                  },
                  "graph": {
                    "termType": "DefaultGraph",
                    "value": ""
                  }
                }
              ]
            },
            "variables": [],
            "aggregates": [
              {
                "type": "expression",
                "subType": "aggregate",
                "aggregator": "max",
                "expression": {
                  "type": "expression",
                  "subType": "term",
                  "term": {
                    "termType": "Variable",
                    "value": "y"
                  }
                },
                "distinct": false,
                "variable": {
                  "termType": "Variable",
                  "value": "var0"
                }
              }
            ]
          },
          "variable": {
            "termType": "Variable",
            "value": "max"
          },
          "expression": {
            "type": "expression",
            "subType": "term",
            "term": {
              "termType": "Variable",
              "value": "var0"
            }
          }
        },
        "variables": [
          {
            "termType": "Variable",
            "value": "max"
          }
        ]
      },
      {
        "type": "bgp",
        "patterns": [
          {
            "type": "pattern",
            "termType": "Quad",
            "subject": {
              "termType": "Variable",
              "value": "x"
            },
            "predicate": {
              "termType": "NamedNode",
              "value": "http://www.example.org/schema#p"
            },
            "object": {
              "termType": "Variable",
              "value": "max"
            },
            "graph": {
              "termType": "DefaultGraph",
              "value": ""
            }
          }
        ]
      }
    ]
  },
  "variables": [
    {
      "termType": "Variable",
      "value": "x"
    },
    {
      "termType": "Variable",
      "value": "max"
    }
  ]
}
