law_query
Eine deterministische LawQL-Abfrage über das CLIR einer Formalisierung: eine Frage an das Modell des Aktes selbst, nicht an einen Fall. Relationen: nodes(id,kind,package,package_name,path), edges(from,to,role), anchors(node,anchor,act,locator,path), labels(node,lang,text,status), fields(node,field,value,value_kind), rules(id,strength,head_predicate,head_polarity,head_variables,body_variables,body_predicates), norms(id,modality,goal_kind,condition_predicates), positions(norm,kind,bearer_type), windows(norm,kind,deadline), imports(package,imported,semantic_hash), links(from,to,kind: imports|alias|subtype|produces|reads|anchored), literals(node,context,predicate,polarity), variables(node,context,name,type), interpretations(id,predicate,role). Funktionen: anchor, labels, short, contains, overlaps, starts_with, ends_with, position, derivation; exists/not exists über eine gebundene Variable; nur Gleichheit und Mitgliedschaft, keine Arithmetik und keine Ordnungsvergleiche. Bereich: corpus nach package.name (zum Beispiel kz.corpus.labour_code, kein Dateiname) oder ein Glob; ohne corpus der gesamte Profilausschnitt; ein Bereich außerhalb des Profils ist leer (CORPUS_EMPTY). Beispiele: from r in rules where r.head_predicate == "urn:…#eligible" select r.id as producer, r.strength as strength, anchor(r.id) as anchors — wer erzeugt; from l in literals where l.predicate == "urn:…#eligible" select l.node as reader, l.context as context — wer liest; query eligible over "pkg" { for x: Person; where applicant(x); select eligible(x); } — Inferenz durch den Kern. Dies ist Orchestrierung über CLIR und Kern; neue juristische Semantik wird hier nicht implementiert. Statt Text eine Frage aus dem Katalog mit arguments: producers, readers, anchors-of, imports-of, links-of, type-step (die Parameter predicate/node/type sind URNs, pkg ein package.name oder ein Glob). Die strukturelle Antwort ist eine queryPage: resultHash des vollständigen queryResult, snapshot (Hash der Paketliste des Bereichs), rowCount, rows nach rowLimit (20, höchstens 5000) und rowOffset, next mit dem snapshot zur Fortsetzung; full: true liefert das vollständige queryResult, wenn der Bereich ein einzelnes Paket ist. Jede Zeile trägt ihre Provenienz (CLIR-Knoten); eine leere Antwort trägt den Explain-Trichter (emptyAt nennt die Klausel); Fehler tragen LDC-Qxxxx-Codes mit Hinweisen; ein zu breites Quellenprodukt wird vor der Ausführung abgelehnt (QUERY_TOO_BROAD), eine Fortsetzung auf einem anderen Schnappschuss als SNAPSHOT_CHANGED.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| case | No | the case for query-over; it replaces the case clause | |
| full | No | das vollständige queryResult statt einer Seite zurückgeben; nur wenn der Bereich ein einzelnes Paket ist | |
| limit | No | an explicit cap on eval() materialisations (it does NOT bound the rows — see rowLimit) | |
| query | No | inline LawQL | |
| corpus | No | der Bereich des Schnappschusses: ein package.name (zum Beispiel kz.corpus.labour_code) oder ein Glob über package.name; ohne corpus der gesamte Profilausschnitt | |
| engine | No | there is one engine — the core; the reference implementation is called by its own command | lawc |
| question | No | der Name einer Frage aus dem Katalog corpus/ql/questions (producers, readers, anchors-of, imports-of, links-of, type-step) oder eines Lints; anstelle von query | |
| rowLimit | No | how many rows in structuredContent (20; the budget may lower it) | |
| snapshot | No | der Schnappschuss-Hash aus next.snapshot der vorherigen Seite: eine Fortsetzung auf einem anderen Schnappschuss wird abgelehnt (SNAPSHOT_CHANGED) | |
| arguments | No | die Parameter der Frage: ein Objekt „Name → Zeichenkette“ (predicate, node, type — URNs; pkg — ein package.name oder ein Glob) | |
| rowOffset | No | ab welcher Zeile (0); die Fortsetzung kommt aus next zusammen mit snapshot; nur strukturelle Abfragen |