PREFIX gesli: <https://gesli.example/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?sequence ?nodeName ?nextNodeName ?deadlineName
WHERE {
  ?node a ?nodeType ;
        gesli:nodeSequence ?sequence ;
        rdfs:label ?nodeName .

  OPTIONAL {
    ?node gesli:nextNode ?nextNode .
    ?nextNode rdfs:label ?nextNodeName .
  }

  OPTIONAL {
    ?node gesli:deadlineName ?deadlineName .
  }
}
ORDER BY ?sequence
