{
 "openapi": "3.1.0",
 "info": {
  "title": "RISmax",
  "version": "1",
  "description": "Schnittstelle (JSON) zum österreichischen Rechtsinformationssystem (RIS), gebaut für KI-Agenten. Vorgehen bei der Recherche: /skill.md. Beschreibung in Textform: /docs.md."
 },
 "servers": [
  {
   "url": "https://rismax.at"
  }
 ],
 "paths": {
  "/search": {
   "get": {
    "operationId": "search",
    "summary": "Suche nach Wortlaut und Bedeutung in Gesetzen, Entscheidungen und Rechtssätzen",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "2-4 Schlüsselbegriffe in der Sprache des Gerichts; \"Phrasen\" in Anführungszeichen mit mode=bm25; +wort / a AND b muss, -wort / NOT wort darf nicht im Dokument vorkommen, auch -(a OR b) und +\"Phrase\" (je Dokument, jeder Modus); AND/OR/NOT nur in Großbuchstaben"
     },
     {
      "name": "mode",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "hybrid",
        "bm25",
        "vec"
       ],
       "default": "hybrid"
      }
     },
     {
      "name": "coll",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "durch Beistriche getrennt: Bundesnormen, Landesnormen, Vfgh, Vwgh, Justiz, Bvwg, AsylGH, Lvwg, Uvs, Verg, Dsk, Normenliste"
     },
     {
      "name": "type",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "durch Beistriche getrennt: t (Entscheidungstext), r (Rechtssatz), n (Gesetzesstelle), l (Normenliste)"
     },
     {
      "name": "court",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "z. B. OGH, OLG Wien"
     },
     {
      "name": "norm",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "nur Dokumente, deren RIS-Normzeile die Norm nennt, z. B. § 15c WGG, WGG, Art. 8 EMRK; Normzeilen gibt es nur bei RIS-Justiz (alle Rechtssätze, rund 4 % der Entscheidungstexte). Antwortfeld norm_filter {norm, resolved, docs, rs, texts, lines_total, lines, coverage}"
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "JJJJ oder JJJJ-MM-TT"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "JJJJ oder JJJJ-MM-TT"
     },
     {
      "name": "historic",
      "in": "query",
      "schema": {
       "type": "integer",
       "enum": [
        0,
        1
       ]
      }
     },
     {
      "name": "k",
      "in": "query",
      "schema": {
       "type": "integer",
       "maximum": 100,
       "default": 10
      }
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "prior",
      "in": "query",
      "schema": {
       "type": "number"
      },
      "description": "0 schaltet die Gewichtung nach Zitierhäufigkeit ab"
     },
     {
      "name": "sort",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "relevance",
        "date"
       ],
       "default": "relevance"
      },
      "description": "date: die 200 relevantesten Treffer, neueste zuerst"
     }
    ],
    "responses": {
     "200": {
      "description": "{hits: [{id, coll, dtype, gz, date, cite, rs, latest, text_id, cited, leading, snippet, pid, shared_by, also_in, origin}], total, refs, norm_filter, notes, mode, took_ms}"
     }
    }
   }
  },
  "/doc/{id}": {
   "get": {
    "operationId": "doc",
    "summary": "Volltext eines Dokuments (RIS-Dokumentnummer oder RS-Nummer), seitenweise nach Zeichen",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "section",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "durch Beistriche getrennt, z. B. spruch,rechtssatz,begruendung,beachte"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 8000
      }
     },
     {
      "name": "unique",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "1 = lange Absätze (ab 500 Zeichen) weglassen, die in mindestens 10 anderen Entscheidungen vorkommen (N = Schwelle); lohnt bei BVwG/LVwG/AsylGH"
     },
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Suche im Dokument: nur die Absätze, die alle Klauseln enthalten (Zeichenkette, Groß-/Kleinschreibung egal, \"Phrase\", a OR b), als matches: [{section, offset, text}]; limit = Zahl der Absätze (Standard 20)"
     }
    ],
    "responses": {
     "200": {
      "description": "{id, cite, ecli, meta, sections, text, next_offset, total_chars, ...}; bei Entscheidungstexten auf Seite 1 ohne section= auch rubrum: {first, n, lines, rows: [{label, text, sub?}], close}, der Kopfsatz in Felder zerlegt (jedes Feld ein wörtlicher Ausschnitt; fehlt, wenn der Satz nicht sicher zerlegbar ist)"
     }
    }
   }
  },
  "/gz": {
   "get": {
    "operationId": "gz",
    "summary": "Eine Entscheidung und ihre Rechtssätze nach Geschäftszahl, oder ein Rechtssatz nach RS-Nummer",
    "parameters": [
     {
      "name": "gz",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "z. B. Ra 2014/20/0017, 4 Ob 2/01, RS0041666"
     }
    ],
    "responses": {
     "200": {
      "description": "{gz, cited, docs: [...], applied_rs}"
     }
    }
   }
  },
  "/verify": {
   "get": {
    "operationId": "verify",
    "summary": "Bis zu 60 Dokumentnummern oder RS-Nummern auf einmal prüfen: Zitat, Datum, Geschäftszahl; unbekannte mit found: false",
    "parameters": [
     {
      "name": "ids",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "durch Beistriche getrennt, z. B. JWR_2016050118_20170627L09,RS0118780,NOR12018825"
     }
    ],
    "responses": {
     "200": {
      "description": "{total, missing, docs: [{id, cite, rs, gz, date, latest, ecli, text_id, contra_total, ...} | {id, found: false}]}"
     }
    }
   }
  },
  "/norm": {
   "get": {
    "operationId": "norm",
    "summary": "Eine Gesetzesstelle in der Fassung zu einem Stichtag, oder ihre Fassungsgeschichte",
    "parameters": [
     {
      "name": "law",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Abkürzung, Titel, Gesetzesnummer, Novelle oder ganzes Zitat (§ 21 Abs. 7 BFA-VG)"
     },
     {
      "name": "par",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "abs",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "at",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "history",
      "in": "query",
      "schema": {
       "type": "integer",
       "enum": [
        0,
        1
       ]
      }
     },
     {
      "name": "text",
      "in": "query",
      "schema": {
       "type": "integer",
       "enum": [
        0,
        1
       ]
      }
     },
     {
      "name": "land",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{id, cite, bgbl, ikra, akra, in_force, heading, text, note, versions, prev, next}; bei einer Novelle {amending_law, amended, articles, provisions: [{norm, id, absaetze: [{abs, text}]}]}"
     },
     "404": {
      "description": "{error, did_you_mean}"
     }
    }
   }
  },
  "/para/{pid}": {
   "get": {
    "operationId": "para",
    "summary": "Ein Absatz und die Dokumente, die ihn enthalten",
    "parameters": [
     {
      "name": "pid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "default": 20
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{pid, text, shared_by, docs}"
     }
    }
   }
  },
  "/stats": {
   "get": {
    "operationId": "stats",
    "summary": "Zahlen, Speicherverbrauch, Stand der Datenbank",
    "parameters": [
     {
      "name": "full",
      "in": "query",
      "schema": {
       "type": "integer",
       "enum": [
        0,
        1
       ]
      },
      "description": "1 = mit Ingest-Details (ingest)"
     }
    ],
    "responses": {
     "200": {
      "description": "{docs, paragraphs, vectors, rss_mb, built, ingest}"
     }
    }
   }
  },
  "/count": {
   "get": {
    "operationId": "count",
    "summary": "Zählt alle passenden Dokumente, gruppiert nach Jahr, Gericht, Sammlung, Dokumentart, Ergebnis oder Schutzstatus",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Suchsyntax: Wörter, \"Phrasen\", a OR b, (a OR b), -wort / NOT wort, -(a OR b); jede Klausel muss irgendwo im Dokument vorkommen (je Dokument, nicht je Absatz); AND/OR/NOT nur in Großbuchstaben"
     },
     {
      "name": "coll",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Sammlungen, durch Beistriche getrennt"
     },
     {
      "name": "type",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "t, r, n, l"
     },
     {
      "name": "court",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "z. B. OGH, BVwG"
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "JJJJ oder JJJJ-MM-TT"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "JJJJ oder JJJJ-MM-TT"
     },
     {
      "name": "by",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "ein oder zwei von year, court, coll, type, outcome, protection"
     },
     {
      "name": "outcome",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "stattgegeben, teilweise, abgewiesen, zurueckgewiesen, aufgehoben, eingestellt, abgelehnt, other (sonstiges)"
     },
     {
      "name": "protection",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "asylum (Asyl zuerkannt) | subsidiary (subsidiärer Schutz), BVwG/AsylGH"
     },
     {
      "name": "ex",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Beispiel-IDs je Gruppe (0-5, Standard 2, bei zwei Dimensionen 0)"
     },
     {
      "name": "exact",
      "in": "query",
      "schema": {
       "type": "integer",
       "enum": [
        0,
        1
       ]
      },
      "description": "1 = Wörter und Phrasen wie die RIS-Volltextsuche zählen (ganze Wörter, ohne Wortstamm; keine Platzhalter)"
     },
     {
      "name": "stats",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "penalty"
       ]
      },
      "description": "penalty = Geldstrafen aus dem Spruch je Gruppe: final_eur/orig_eur {n, p25, median, p75, mean}, reduced, raised, confirmed, lifted"
     },
     {
      "name": "top",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "höchstens so viele Gruppen (Standard 20)"
     }
    ],
    "responses": {
     "200": {
      "description": "{total, buckets: [{<dim>, n, ex, sub}], rest, capped, took_ms}"
     }
    }
   }
  },
  "/cited-by/{id}": {
   "get": {
    "operationId": "citedBy",
    "summary": "Dokumente, die eine Entscheidung (ID oder Geschäftszahl) oder einen Rechtssatz (RS-Nummer) zitieren, neueste zuerst",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "RIS-Dokumentnummer, Geschäftszahl oder RS-Nummer"
     },
     {
      "name": "k",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "ohne k: bis 30 zitierende Dokumente alle, sonst 10 mit next_offset; höchstens 100"
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "coll",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Sammlungen, durch Beistriche getrennt"
     },
     {
      "name": "type",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "t, r, n, l"
     },
     {
      "name": "court",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "z. B. OGH, BVwG"
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "JJJJ oder JJJJ-MM-TT"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "JJJJ oder JJJJ-MM-TT"
     },
     {
      "name": "sort",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "date (Datum) | cited (Zitierhäufigkeit)"
     },
     {
      "name": "markers",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "1 = nur Zitate mit Hinweis auf eine Abweichung"
     },
     {
      "name": "q",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "nur zitierende Dokumente mit diesen Begriffen (jeder Begriff ohne - ist Pflicht; OR und \"Phrasen\" wirken)"
     }
    ],
    "responses": {
     "200": {
      "description": "{target, total, passages, by_year, citing: [{cite, id, date, dtype, cited, pid, snippet, marker, pinpoint}], own_rs: [{rs, cite, id, origin}], own_rs_total, markers, next_offset}"
     }
    }
   }
  },
  "/cites/{id}": {
   "get": {
    "operationId": "cites",
    "summary": "Judikatur, die ein Dokument zitiert, in der Reihenfolge des Texts",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "RIS-Dokumentnummer oder Geschäftszahl"
     }
    ],
    "responses": {
     "200": {
      "description": "{cites: [{cite, id, dtype, cited, n, section, pid}], not_in_corpus}"
     }
    }
   }
  },
  "/leading": {
   "get": {
    "operationId": "leading",
    "summary": "Die meistzitierten Entscheidungen und Rechtssätze zu einer Norm",
    "parameters": [
     {
      "name": "law",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Zitat, z. B. § 1096 ABGB",
      "required": true
     },
     {
      "name": "coll",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "k",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "{leading: [{cite, id, cited, n, generic}], passages, rs_on_norm, rs_on_norm_total}"
     }
    }
   }
  },
  "/origin": {
   "get": {
    "operationId": "origin",
    "summary": "Erste Verwendung und Verbreitung eines Textbausteins",
    "parameters": [
     {
      "name": "text",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "mindestens 4 Wörter aus einem Absatz",
      "required": true
     },
     {
      "name": "variants",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "0 = fast gleichlautende Varianten weglassen"
     },
     {
      "name": "courts",
      "in": "query",
      "schema": {
       "type": "integer"
      },
      "description": "so viele Gerichte in by_court (nach Anzahl, Standard 6); 0 = alle"
     }
    ],
    "responses": {
     "200": {
      "description": "{docs_total, first, newest, by_court, by_type, by_year, match, paragraphs, variants}"
     }
    }
   }
  },
  "/norm/diff": {
   "get": {
    "operationId": "normDiff",
    "summary": "Wortgenauer Vergleich zweier Fassungen einer Gesetzesstelle",
    "parameters": [
     {
      "name": "law",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "wie bei /norm",
      "required": true
     },
     {
      "name": "abs",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Datum oder NOR-Dokumentnummer; Standard: die vorherige Fassung"
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Datum oder NOR-Dokumentnummer; Standard: heute"
     },
     {
      "name": "ctx",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "Wörter Kontext (6)"
     },
     {
      "name": "full",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "1: zusätzlich sides, beide Fassungen vollständig Absatz für Absatz, geänderte Wörter markiert"
     }
    ],
    "responses": {
     "200": {
      "description": "{from, to, same, amendments, changes: [{abs, kind, diff, new}], words, repealed, note, sides (full=1): [{abs, kind, old, new}]}"
     }
    }
   }
  }
 }
}
