{
  "type": "construct",
  "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": "values",
        "variables": [
          {
            "termType": "Variable",
            "value": "s"
          },
          {
            "termType": "Variable",
            "value": "rank"
          }
        ],
        "bindings": [
          {
            "s": {
              "termType": "NamedNode",
              "value": "http://example.org/a"
            },
            "rank": {
              "termType": "Literal",
              "value": "1",
              "datatype": {
                "termType": "NamedNode",
                "value": "http://www.w3.org/2001/XMLSchema#integer"
              }
            }
          }
        ]
      }
    ]
  },
  "template": [
    {
      "type": "pattern",
      "termType": "Quad",
      "subject": {
        "termType": "Variable",
        "value": "s"
      },
      "predicate": {
        "termType": "NamedNode",
        "value": "http://example.org/rank"
      },
      "object": {
        "termType": "Variable",
        "value": "rank"
      },
      "graph": {
        "termType": "DefaultGraph",
        "value": ""
      }
    }
  ]
}
