PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
PREFIX tp: <http://test1.aql-testdata/>
PREFIX tt: <http://test1.aql-testdata/types/>
SELECT *
WHERE {
  ?a a tt:person .
  OPTIONAL {
    ?a ?d ?e
    OPTIONAL {
      ?e ?f ?g
    }
  }
  OPTIONAL {
    ?e ?f ?h
  }
}
LIMIT 1
