{
  "type": "project",
  "input": {
    "type": "join",
    "input": [
      {
        "type": "project",
        "input": {
          "type": "extend",
          "input": {
            "type": "join",
            "input": [
              {
                "type": "group",
                "input": {
                  "type": "bgp",
                  "patterns": [
                    {
                      "type": "pattern",
                      "termType": "Quad",
                      "subject": {
                        "termType": "Variable",
                        "value": "s"
                      },
                      "predicate": {
                        "termType": "Variable",
                        "value": "p"
                      },
                      "object": {
                        "termType": "Variable",
                        "value": "o"
                      },
                      "graph": {
                        "termType": "DefaultGraph",
                        "value": ""
                      }
                    }
                  ]
                },
                "variables": [
                  {
                    "termType": "Variable",
                    "value": "s"
                  }
                ],
                "aggregates": [
                  {
                    "type": "expression",
                    "subType": "aggregate",
                    "aggregator": "count",
                    "expression": {
                      "type": "expression",
                      "subType": "wildcard",
                      "wildcard": {
                        "type": "wildcard"
                      }
                    },
                    "distinct": false,
                    "variable": {
                      "termType": "Variable",
                      "value": "var0"
                    }
                  }
                ]
              },
              {
                "type": "values",
                "variables": [
                  {
                    "termType": "Variable",
                    "value": "s"
                  }
                ],
                "bindings": [
                  {
                    "s": {
                      "termType": "NamedNode",
                      "value": "http://example.org/a"
                    }
                  }
                ]
              }
            ]
          },
          "variable": {
            "termType": "Variable",
            "value": "count"
          },
          "expression": {
            "type": "expression",
            "subType": "term",
            "term": {
              "termType": "Variable",
              "value": "var0"
            }
          }
        },
        "variables": [
          {
            "termType": "Variable",
            "value": "s"
          },
          {
            "termType": "Variable",
            "value": "count"
          }
        ]
      },
      {
        "type": "bgp",
        "patterns": [
          {
            "type": "pattern",
            "termType": "Quad",
            "subject": {
              "termType": "Variable",
              "value": "s"
            },
            "predicate": {
              "termType": "Variable",
              "value": "q"
            },
            "object": {
              "termType": "Variable",
              "value": "z"
            },
            "graph": {
              "termType": "DefaultGraph",
              "value": ""
            }
          }
        ]
      }
    ]
  },
  "variables": [
    {
      "termType": "Variable",
      "value": "s"
    },
    {
      "termType": "Variable",
      "value": "count"
    },
    {
      "termType": "Variable",
      "value": "q"
    },
    {
      "termType": "Variable",
      "value": "z"
    }
  ]
}
