{
  "context": [],
  "subType": "select",
  "where": {
    "type": "pattern",
    "subType": "group",
    "patterns": [
      {
        "type": "pattern",
        "subType": "bgp",
        "triples": [
          {
            "type": "triple",
            "subject": {
              "type": "term",
              "subType": "variable",
              "value": "s",
              "loc": {
                "sourceLocationType": "source",
                "start": 18,
                "end": 20
              }
            },
            "predicate": {
              "type": "term",
              "subType": "variable",
              "value": "p",
              "loc": {
                "sourceLocationType": "source",
                "start": 21,
                "end": 23
              }
            },
            "object": {
              "type": "term",
              "subType": "variable",
              "value": "o",
              "loc": {
                "sourceLocationType": "source",
                "start": 24,
                "end": 26
              }
            },
            "loc": {
              "sourceLocationType": "source",
              "start": 18,
              "end": 26
            }
          }
        ],
        "loc": {
          "sourceLocationType": "source",
          "start": 18,
          "end": 26
        }
      }
    ],
    "loc": {
      "sourceLocationType": "source",
      "start": 16,
      "end": 28
    }
  },
  "solutionModifiers": {
    "group": {
      "type": "solutionModifier",
      "subType": "group",
      "groupings": [
        {
          "type": "term",
          "subType": "variable",
          "value": "s",
          "loc": {
            "sourceLocationType": "source",
            "start": 38,
            "end": 40
          }
        }
      ],
      "loc": {
        "sourceLocationType": "source",
        "start": 29,
        "end": 40
      }
    },
    "having": {
      "type": "solutionModifier",
      "subType": "having",
      "having": [
        {
          "type": "term",
          "subType": "variable",
          "value": "s",
          "loc": {
            "sourceLocationType": "source",
            "start": 48,
            "end": 52
          }
        },
        {
          "type": "term",
          "subType": "literal",
          "value": "a",
          "loc": {
            "sourceLocationType": "source",
            "start": 53,
            "end": 58
          }
        },
        {
          "type": "expression",
          "subType": "operation",
          "operator": "!",
          "args": [
            {
              "type": "expression",
              "subType": "operation",
              "operator": ">",
              "args": [
                {
                  "type": "expression",
                  "subType": "aggregate",
                  "aggregation": "count",
                  "distinct": false,
                  "loc": {
                    "sourceLocationType": "source",
                    "start": 62,
                    "end": 71
                  },
                  "expression": [
                    {
                      "type": "term",
                      "subType": "variable",
                      "value": "o",
                      "loc": {
                        "sourceLocationType": "source",
                        "start": 68,
                        "end": 70
                      }
                    }
                  ]
                },
                {
                  "type": "term",
                  "subType": "literal",
                  "value": "1",
                  "langOrIri": {
                    "type": "term",
                    "subType": "namedNode",
                    "value": "http://www.w3.org/2001/XMLSchema#integer",
                    "loc": {
                      "sourceLocationType": "noMaterialize"
                    }
                  },
                  "loc": {
                    "sourceLocationType": "source",
                    "start": 74,
                    "end": 75
                  }
                }
              ],
              "loc": {
                "sourceLocationType": "source",
                "start": 61,
                "end": 76
              }
            }
          ],
          "loc": {
            "sourceLocationType": "source",
            "start": 59,
            "end": 77
          }
        },
        {
          "type": "expression",
          "subType": "operation",
          "operator": "uminus",
          "args": [
            {
              "type": "expression",
              "subType": "aggregate",
              "aggregation": "count",
              "distinct": false,
              "loc": {
                "sourceLocationType": "source",
                "start": 80,
                "end": 89
              },
              "expression": [
                {
                  "type": "term",
                  "subType": "variable",
                  "value": "o",
                  "loc": {
                    "sourceLocationType": "source",
                    "start": 86,
                    "end": 88
                  }
                }
              ]
            }
          ],
          "loc": {
            "sourceLocationType": "source",
            "start": 78,
            "end": 90
          }
        },
        {
          "type": "expression",
          "subType": "operation",
          "operator": "+",
          "args": [
            {
              "type": "expression",
              "subType": "aggregate",
              "aggregation": "count",
              "distinct": false,
              "loc": {
                "sourceLocationType": "source",
                "start": 92,
                "end": 101
              },
              "expression": [
                {
                  "type": "term",
                  "subType": "variable",
                  "value": "o",
                  "loc": {
                    "sourceLocationType": "source",
                    "start": 98,
                    "end": 100
                  }
                }
              ]
            },
            {
              "type": "term",
              "subType": "literal",
              "value": "1",
              "langOrIri": {
                "type": "term",
                "subType": "namedNode",
                "value": "http://www.w3.org/2001/XMLSchema#integer",
                "loc": {
                  "sourceLocationType": "noMaterialize"
                }
              },
              "loc": {
                "sourceLocationType": "source",
                "start": 104,
                "end": 105
              }
            }
          ],
          "loc": {
            "sourceLocationType": "source",
            "start": 91,
            "end": 106
          }
        }
      ],
      "loc": {
        "sourceLocationType": "source",
        "start": 41,
        "end": 106
      }
    }
  },
  "datasets": {
    "type": "datasetClauses",
    "clauses": [],
    "loc": {
      "sourceLocationType": "noMaterialize"
    }
  },
  "variables": [
    {
      "type": "term",
      "subType": "variable",
      "value": "s",
      "loc": {
        "sourceLocationType": "source",
        "start": 7,
        "end": 9
      }
    }
  ],
  "loc": {
    "sourceLocationType": "inlinedSource",
    "newSource": "SELECT ?s WHERE { ?s ?p ?o } GROUP BY ?s HAVING (?s) (\"a\") (!(COUNT(?o) > 1)) (-COUNT(?o)) (COUNT(?o) + 1)\n",
    "start": 0,
    "end": 9007199254740991,
    "loc": {
      "sourceLocationType": "source",
      "start": 0,
      "end": 106
    },
    "startOnNew": 0,
    "endOnNew": 106
  },
  "type": "query"
}
