parse first paragraph of wuchergesetz
This commit is contained in:
parent
62b0e1e69d
commit
3fa97cca34
16
Cargo.lock
generated
16
Cargo.lock
generated
@ -168,12 +168,22 @@ dependencies = [
|
||||
name = "risp"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"roxmltree",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"time",
|
||||
"ureq",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "roxmltree"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "862340e351ce1b271a378ec53f304a5558f7db87f3769dc655a8f6ecbb68b302"
|
||||
dependencies = [
|
||||
"xmlparser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.21.8"
|
||||
@ -435,3 +445,9 @@ name = "windows_x86_64_msvc"
|
||||
version = "0.48.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||
|
||||
[[package]]
|
||||
name = "xmlparser"
|
||||
version = "0.13.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4"
|
||||
|
@ -10,3 +10,4 @@ ureq = "2.8"
|
||||
time = { version = "0.3", features = [ "formatting" ] }
|
||||
serde = { version = "1.0", features = [ "derive" ] }
|
||||
serde_json = "1.0"
|
||||
roxmltree = "0.18"
|
||||
|
@ -34,3 +34,7 @@ RISolve
|
||||
- Subsection ("Absatz")
|
||||
- Item ("Ziffer")
|
||||
- Heading-{1,2,3,...}
|
||||
|
||||
|
||||
# "Scripts"
|
||||
- Retrieve overview law: `curl -X POST "https://data.bka.gv.at/ris/api/v2.6/Bundesrecht" -H "Content-Type: application/x-www-form-urlencoded" -d "Applikation=BrKons" -d "Gesetzesnummer=10001899" -d "DokumenteProSeite=OneHundred" -d "Seitennummer=1" -d "Fassung.FassungVom=2023-11-03" | jq . > law.json`
|
||||
|
1
data/par/wucher1.xml
Normal file
1
data/par/wucher1.xml
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><risdok stylesheet="RISJudikaturXML2XHTML11.xsl" h-version="4.1.5_31.05.2023" h-creator="PWRIVIE44.BR2RIS.BR2RISConverter_14.09.2023_09:29:42" h-created="14. September 2023, 09:30:09" xmlns="http://www.bka.gv.at"><metadaten /><nutzdaten><abschnitt nr="1" typ="ns" paperf="h" endnhier="true"><kzinhalt typ="p"><absatz typ="kz" halign="j"><tab align="z" position="212.6" leader="o" /><tab align="r" position="425.25" leader="o" />Bundesrecht konsolidiert</absatz></kzinhalt><kzinhalt typ="f"><absatz typ="kz" halign="j"><tab align="z" position="212.6" leader="o" /><tab align="r" position="425.25" leader="o" />Bundesrecht konsolidiert</absatz></kzinhalt><fzinhalt typ="p"><absatz typ="fz" halign="j">www.ris.bka.gv.at<tab align="z" position="212.6" leader="o" /><tab align="r" position="425.25" leader="o" />Seite <feld code="+PAGE++%5c*+MERGEFORMAT+"><span>2</span></feld> von <feld code="+NUMPAGES++%5c*+MERGEFORMAT+"><span>2</span></feld></absatz></fzinhalt><fzinhalt typ="f"><absatz typ="fz" halign="j">www.ris.bka.gv.at<tab align="z" position="212.6" leader="o" /><tab align="r" position="425.25" leader="o" />Seite <feld code="+PAGE++%5c*+MERGEFORMAT+"><span>1</span></feld> von <feld code="+NUMPAGES++%5c*+MERGEFORMAT+"><span>1</span></feld></absatz></fzinhalt><ueberschrift typ="titel" halign="j">Kurztitel</ueberschrift><absatz typ="erltext" ct="kurztitel" halign="j">Wuchergesetz 1949</absatz><ueberschrift typ="titel" halign="j">Kundmachungsorgan</ueberschrift><absatz typ="erltext" ct="kundmachungsorgan" halign="j">BGBl. Nr. 271/1949</absatz><ueberschrift typ="titel" halign="j">Typ</ueberschrift><absatz typ="erltext" ct="typ" halign="j">BG</absatz><ueberschrift typ="titel" halign="j">§/Artikel/Anlage</ueberschrift><absatz typ="erltext" ct="artikel_anlage" halign="j">§ 1</absatz><ueberschrift typ="titel" halign="j">Inkrafttretensdatum</ueberschrift><absatz typ="erltext" ct="ikra" halign="j">17.12.1949</absatz><ueberschrift typ="titel" halign="j">Index</ueberschrift><absatz typ="erltext" ct="index" halign="j">20/06 Konsumentenschutz</absatz><ueberschrift typ="titel" halign="j">Text</ueberschrift><ueberschrift typ="para" ct="text" halign="c">Nichtigkeit eines wucherischen Vertrages.</ueberschrift><absatz typ="abs" ct="text" halign="j"><gldsym>§ 1.</gldsym> Ein Vertrag ist nichtig, wenn jemand den Leichtsinn, die Zwangslage, Verstandesschwäche, Unerfahrenheit oder Gemütsaufregung eines anderen dadurch ausbeutet, daß er sich oder einem Dritten für eine Leistung eine Gegenleistung versprechen oder gewähren läßt, deren Vermögenswert zu dem Werte seiner Leistung in auffallendem Mißverhältnis steht.</absatz><ueberschrift typ="titel" halign="j">Zuletzt aktualisiert am</ueberschrift><absatz typ="erltext" ct="geaendert" halign="j">14.09.2023</absatz><ueberschrift typ="titel" halign="j">Gesetzesnummer</ueberschrift><absatz typ="erltext" ct="gesnr" halign="j">10001899</absatz><ueberschrift typ="titel" halign="j">Dokumentnummer</ueberschrift><absatz typ="erltext" ct="doknr" halign="j">NOR12025172</absatz><ueberschrift typ="titel" halign="j">alte Dokumentnummer</ueberschrift><absatz typ="erltext" ct="adoknr" halign="j">N2194910332S</absatz></abschnitt></nutzdaten><layoutdaten paperf="7" paperh="841.95" paperw="595.35" margl="85.05" margr="85.05" margt="85.05" margb="85.05" headerd="28.35" footerd="65.2" gutter="0" gutterpos="0" deftab="35.4" /></risdok>
|
481
data/wucherg.json
Normal file
481
data/wucherg.json
Normal file
@ -0,0 +1,481 @@
|
||||
{
|
||||
"OgdSearchResult": {
|
||||
"OgdDocumentResults": {
|
||||
"Hits": {
|
||||
"@pageNumber": "1",
|
||||
"@pageSize": "100",
|
||||
"#text": "7"
|
||||
},
|
||||
"OgdDocumentReference": [
|
||||
{
|
||||
"Data": {
|
||||
"Metadaten": {
|
||||
"Technisch": {
|
||||
"ID": "NOR11001922",
|
||||
"Applikation": "BrKons",
|
||||
"Organ": "BKA (Bundeskanzleramt)",
|
||||
"ImportTimestamp": {
|
||||
"@xsi:nil": "true",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
||||
}
|
||||
},
|
||||
"Allgemein": {
|
||||
"Geaendert": "2023-09-14",
|
||||
"DokumentUrl": "https://www.ris.bka.gv.at/eli/bgbl/1949/271/P0/NOR11001922"
|
||||
},
|
||||
"Bundesrecht": {
|
||||
"Kurztitel": "Wuchergesetz 1949",
|
||||
"Titel": "Wuchergesetz 1949.<br/>StF: BGBl. Nr. 271/1949 (WV)",
|
||||
"Eli": "https://ris.bka.gv.at/eli/bgbl/1949/271/P0/NOR11001922",
|
||||
"BrKons": {
|
||||
"Kundmachungsorgan": "BGBl. Nr. 271/1949",
|
||||
"Typ": "BG",
|
||||
"Dokumenttyp": "Norm",
|
||||
"ArtikelParagraphAnlage": "§ 0",
|
||||
"Paragraphnummer": "0",
|
||||
"StammnormPublikationsorgan": "BGBl. Nr.",
|
||||
"StammnormBgblnummer": "271/1949",
|
||||
"Inkrafttretensdatum": "1949-12-17",
|
||||
"Indizes": {
|
||||
"item": "20/06 Konsumentenschutz"
|
||||
},
|
||||
"Aenderung": "BGBl. Nr. 160/1952 (NR: GP VI RV 609 AB 637 S. 95. BR: S. 77.)\r\nBGBl. Nr. 422/1974 (NR: GP XIII RV 850 AB 1236 S. 113. BR: S. 334.)\r\nBGBl. Nr. 140/1979 (NR: GP XIV RV 744 AB 1223 S. 122. BR: AB 2003 S. 385.)\r\nBGBl. I Nr. 191/1999 (BG) (1. BRBG) (NR: GP XX RV 1811 AB 2031 S. 179. BR: AB 6041 S. 657.)\r\nBGBl. I Nr. 98/2001 (NR: GP XXI RV 621 AB 704 S. 75. BR: 6398 AB 6424 S. 679.)",
|
||||
"Schlagworte": "e-rk3<br/>II. Strafgesetznovelle 1952 (BGBl. Nr. 160/1952), Strafrechtsanpassungsgesetz (BGBl. Nr. 422/1974), Konsumentenschutzgesetz — KSchG (BGBl. Nr. 140/1979), Erstes Bundesrechtsbereinigungsgesetz – 1. BRBG (BGBl. I Nr. 191/1999), 1. Euro-Umstellungsgesetz – Bund, 2. Euro-Justiz-Begleitgesetz – 2. Euro-JuBeG (BGBl. I Nr. 98/2001)",
|
||||
"Gesetzesnummer": "10001899",
|
||||
"AlteDokumentnummer": "N2194914885P",
|
||||
"GesamteRechtsvorschriftUrl": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10001899"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Dokumentliste": {
|
||||
"ContentReference": {
|
||||
"ContentType": "MainDocument",
|
||||
"Name": "Hauptdokument",
|
||||
"Urls": {
|
||||
"ContentUrl": [
|
||||
{
|
||||
"DataType": "Xml",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR11001922/NOR11001922.xml"
|
||||
},
|
||||
{
|
||||
"DataType": "Html",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR11001922/NOR11001922.html"
|
||||
},
|
||||
{
|
||||
"DataType": "Pdf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR11001922/NOR11001922.pdf"
|
||||
},
|
||||
{
|
||||
"DataType": "Rtf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR11001922/NOR11001922.rtf"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Data": {
|
||||
"Metadaten": {
|
||||
"Technisch": {
|
||||
"ID": "NOR12025172",
|
||||
"Applikation": "BrKons",
|
||||
"Organ": "BKA (Bundeskanzleramt)",
|
||||
"ImportTimestamp": {
|
||||
"@xsi:nil": "true",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
||||
}
|
||||
},
|
||||
"Allgemein": {
|
||||
"Geaendert": "2023-09-14",
|
||||
"DokumentUrl": "https://www.ris.bka.gv.at/eli/bgbl/1949/271/P1/NOR12025172"
|
||||
},
|
||||
"Bundesrecht": {
|
||||
"Kurztitel": "Wuchergesetz 1949",
|
||||
"Eli": "https://ris.bka.gv.at/eli/bgbl/1949/271/P1/NOR12025172",
|
||||
"BrKons": {
|
||||
"Kundmachungsorgan": "BGBl. Nr. 271/1949",
|
||||
"Typ": "BG",
|
||||
"Dokumenttyp": "Paragraph",
|
||||
"ArtikelParagraphAnlage": "§ 1",
|
||||
"Paragraphnummer": "1",
|
||||
"StammnormPublikationsorgan": "BGBl. Nr.",
|
||||
"StammnormBgblnummer": "271/1949",
|
||||
"Inkrafttretensdatum": "1949-12-17",
|
||||
"Indizes": {
|
||||
"item": "20/06 Konsumentenschutz"
|
||||
},
|
||||
"Aenderung": "",
|
||||
"Gesetzesnummer": "10001899",
|
||||
"AlteDokumentnummer": "N2194910332S",
|
||||
"GesamteRechtsvorschriftUrl": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10001899"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Dokumentliste": {
|
||||
"ContentReference": {
|
||||
"ContentType": "MainDocument",
|
||||
"Name": "Hauptdokument",
|
||||
"Urls": {
|
||||
"ContentUrl": [
|
||||
{
|
||||
"DataType": "Xml",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025172/NOR12025172.xml"
|
||||
},
|
||||
{
|
||||
"DataType": "Html",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025172/NOR12025172.html"
|
||||
},
|
||||
{
|
||||
"DataType": "Pdf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025172/NOR12025172.pdf"
|
||||
},
|
||||
{
|
||||
"DataType": "Rtf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025172/NOR12025172.rtf"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Data": {
|
||||
"Metadaten": {
|
||||
"Technisch": {
|
||||
"ID": "NOR40022184",
|
||||
"Applikation": "BrKons",
|
||||
"Organ": "BKA (Bundeskanzleramt)",
|
||||
"ImportTimestamp": {
|
||||
"@xsi:nil": "true",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
||||
}
|
||||
},
|
||||
"Allgemein": {
|
||||
"Geaendert": "2023-09-14",
|
||||
"DokumentUrl": "https://www.ris.bka.gv.at/eli/bgbl/1949/271/P7/NOR40022184"
|
||||
},
|
||||
"Bundesrecht": {
|
||||
"Kurztitel": "Wuchergesetz 1949",
|
||||
"Eli": "https://ris.bka.gv.at/eli/bgbl/1949/271/P7/NOR40022184",
|
||||
"BrKons": {
|
||||
"Kundmachungsorgan": "BGBl. Nr. 271/1949 zuletzt geändert durch BGBl. I Nr. 98/2001 ",
|
||||
"Typ": "BG",
|
||||
"Dokumenttyp": "Paragraph",
|
||||
"ArtikelParagraphAnlage": "§ 7",
|
||||
"Paragraphnummer": "7",
|
||||
"StammnormPublikationsorgan": "BGBl. Nr.",
|
||||
"StammnormBgblnummer": "271/1949",
|
||||
"NovellenPublikationsorgan": "BGBl. I Nr.",
|
||||
"NovellenBgblnummer": "98/2001",
|
||||
"NovellenBeziehung": "zuletzt geändert durch",
|
||||
"Inkrafttretensdatum": "2002-01-01",
|
||||
"Indizes": {
|
||||
"item": "20/06 Konsumentenschutz"
|
||||
},
|
||||
"Aenderung": "",
|
||||
"Gesetzesnummer": "10001899",
|
||||
"GesamteRechtsvorschriftUrl": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10001899"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Dokumentliste": {
|
||||
"ContentReference": {
|
||||
"ContentType": "MainDocument",
|
||||
"Name": "Hauptdokument",
|
||||
"Urls": {
|
||||
"ContentUrl": [
|
||||
{
|
||||
"DataType": "Xml",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR40022184/NOR40022184.xml"
|
||||
},
|
||||
{
|
||||
"DataType": "Html",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR40022184/NOR40022184.html"
|
||||
},
|
||||
{
|
||||
"DataType": "Pdf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR40022184/NOR40022184.pdf"
|
||||
},
|
||||
{
|
||||
"DataType": "Rtf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR40022184/NOR40022184.rtf"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Data": {
|
||||
"Metadaten": {
|
||||
"Technisch": {
|
||||
"ID": "NOR12025179",
|
||||
"Applikation": "BrKons",
|
||||
"Organ": "BKA (Bundeskanzleramt)",
|
||||
"ImportTimestamp": {
|
||||
"@xsi:nil": "true",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
||||
}
|
||||
},
|
||||
"Allgemein": {
|
||||
"Geaendert": "2023-09-14",
|
||||
"DokumentUrl": "https://www.ris.bka.gv.at/eli/bgbl/1949/271/P8/NOR12025179"
|
||||
},
|
||||
"Bundesrecht": {
|
||||
"Kurztitel": "Wuchergesetz 1949",
|
||||
"Eli": "https://ris.bka.gv.at/eli/bgbl/1949/271/P8/NOR12025179",
|
||||
"BrKons": {
|
||||
"Kundmachungsorgan": "BGBl. Nr. 271/1949",
|
||||
"Typ": "BG",
|
||||
"Dokumenttyp": "Paragraph",
|
||||
"ArtikelParagraphAnlage": "§ 8",
|
||||
"Paragraphnummer": "8",
|
||||
"StammnormPublikationsorgan": "BGBl. Nr.",
|
||||
"StammnormBgblnummer": "271/1949",
|
||||
"Inkrafttretensdatum": "1949-12-17",
|
||||
"Indizes": {
|
||||
"item": "20/06 Konsumentenschutz"
|
||||
},
|
||||
"Aenderung": "",
|
||||
"Anmerkung": "Strafbarkeit nach §§ 154 und 155 StGB, BGBl. Nr. 60/1974.<br/>",
|
||||
"Gesetzesnummer": "10001899",
|
||||
"AlteDokumentnummer": "N2194910339S",
|
||||
"GesamteRechtsvorschriftUrl": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10001899"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Dokumentliste": {
|
||||
"ContentReference": {
|
||||
"ContentType": "MainDocument",
|
||||
"Name": "Hauptdokument",
|
||||
"Urls": {
|
||||
"ContentUrl": [
|
||||
{
|
||||
"DataType": "Xml",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025179/NOR12025179.xml"
|
||||
},
|
||||
{
|
||||
"DataType": "Html",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025179/NOR12025179.html"
|
||||
},
|
||||
{
|
||||
"DataType": "Pdf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025179/NOR12025179.pdf"
|
||||
},
|
||||
{
|
||||
"DataType": "Rtf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025179/NOR12025179.rtf"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Data": {
|
||||
"Metadaten": {
|
||||
"Technisch": {
|
||||
"ID": "NOR12025180",
|
||||
"Applikation": "BrKons",
|
||||
"Organ": "BKA (Bundeskanzleramt)",
|
||||
"ImportTimestamp": {
|
||||
"@xsi:nil": "true",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
||||
}
|
||||
},
|
||||
"Allgemein": {
|
||||
"Geaendert": "2023-09-14",
|
||||
"DokumentUrl": "https://www.ris.bka.gv.at/eli/bgbl/1949/271/P9/NOR12025180"
|
||||
},
|
||||
"Bundesrecht": {
|
||||
"Kurztitel": "Wuchergesetz 1949",
|
||||
"Eli": "https://ris.bka.gv.at/eli/bgbl/1949/271/P9/NOR12025180",
|
||||
"BrKons": {
|
||||
"Kundmachungsorgan": "BGBl. Nr. 271/1949",
|
||||
"Typ": "BG",
|
||||
"Dokumenttyp": "Paragraph",
|
||||
"ArtikelParagraphAnlage": "§ 9",
|
||||
"Paragraphnummer": "9",
|
||||
"StammnormPublikationsorgan": "BGBl. Nr.",
|
||||
"StammnormBgblnummer": "271/1949",
|
||||
"Inkrafttretensdatum": "1949-12-17",
|
||||
"Indizes": {
|
||||
"item": "20/06 Konsumentenschutz"
|
||||
},
|
||||
"Aenderung": "",
|
||||
"Gesetzesnummer": "10001899",
|
||||
"AlteDokumentnummer": "N2194910340S",
|
||||
"GesamteRechtsvorschriftUrl": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10001899"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Dokumentliste": {
|
||||
"ContentReference": {
|
||||
"ContentType": "MainDocument",
|
||||
"Name": "Hauptdokument",
|
||||
"Urls": {
|
||||
"ContentUrl": [
|
||||
{
|
||||
"DataType": "Xml",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025180/NOR12025180.xml"
|
||||
},
|
||||
{
|
||||
"DataType": "Html",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025180/NOR12025180.html"
|
||||
},
|
||||
{
|
||||
"DataType": "Pdf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025180/NOR12025180.pdf"
|
||||
},
|
||||
{
|
||||
"DataType": "Rtf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025180/NOR12025180.rtf"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Data": {
|
||||
"Metadaten": {
|
||||
"Technisch": {
|
||||
"ID": "NOR12025181",
|
||||
"Applikation": "BrKons",
|
||||
"Organ": "BKA (Bundeskanzleramt)",
|
||||
"ImportTimestamp": {
|
||||
"@xsi:nil": "true",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
||||
}
|
||||
},
|
||||
"Allgemein": {
|
||||
"Geaendert": "2023-09-14",
|
||||
"DokumentUrl": "https://www.ris.bka.gv.at/eli/bgbl/1949/271/P10/NOR12025181"
|
||||
},
|
||||
"Bundesrecht": {
|
||||
"Kurztitel": "Wuchergesetz 1949",
|
||||
"Eli": "https://ris.bka.gv.at/eli/bgbl/1949/271/P10/NOR12025181",
|
||||
"BrKons": {
|
||||
"Kundmachungsorgan": "BGBl. Nr. 271/1949",
|
||||
"Typ": "BG",
|
||||
"Dokumenttyp": "Paragraph",
|
||||
"ArtikelParagraphAnlage": "§ 10",
|
||||
"Paragraphnummer": "10",
|
||||
"StammnormPublikationsorgan": "BGBl. Nr.",
|
||||
"StammnormBgblnummer": "271/1949",
|
||||
"Inkrafttretensdatum": "1949-12-17",
|
||||
"Indizes": {
|
||||
"item": "20/06 Konsumentenschutz"
|
||||
},
|
||||
"Aenderung": "",
|
||||
"Gesetzesnummer": "10001899",
|
||||
"AlteDokumentnummer": "N2194910341S",
|
||||
"GesamteRechtsvorschriftUrl": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10001899"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Dokumentliste": {
|
||||
"ContentReference": {
|
||||
"ContentType": "MainDocument",
|
||||
"Name": "Hauptdokument",
|
||||
"Urls": {
|
||||
"ContentUrl": [
|
||||
{
|
||||
"DataType": "Xml",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025181/NOR12025181.xml"
|
||||
},
|
||||
{
|
||||
"DataType": "Html",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025181/NOR12025181.html"
|
||||
},
|
||||
{
|
||||
"DataType": "Pdf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025181/NOR12025181.pdf"
|
||||
},
|
||||
{
|
||||
"DataType": "Rtf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025181/NOR12025181.rtf"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Data": {
|
||||
"Metadaten": {
|
||||
"Technisch": {
|
||||
"ID": "NOR12025182",
|
||||
"Applikation": "BrKons",
|
||||
"Organ": "BKA (Bundeskanzleramt)",
|
||||
"ImportTimestamp": {
|
||||
"@xsi:nil": "true",
|
||||
"@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
||||
}
|
||||
},
|
||||
"Allgemein": {
|
||||
"Geaendert": "2023-09-14",
|
||||
"DokumentUrl": "https://www.ris.bka.gv.at/eli/bgbl/1949/271/P11/NOR12025182"
|
||||
},
|
||||
"Bundesrecht": {
|
||||
"Kurztitel": "Wuchergesetz 1949",
|
||||
"Eli": "https://ris.bka.gv.at/eli/bgbl/1949/271/P11/NOR12025182",
|
||||
"BrKons": {
|
||||
"Kundmachungsorgan": "BGBl. Nr. 271/1949",
|
||||
"Typ": "BG",
|
||||
"Dokumenttyp": "Paragraph",
|
||||
"ArtikelParagraphAnlage": "§ 11",
|
||||
"Paragraphnummer": "11",
|
||||
"StammnormPublikationsorgan": "BGBl. Nr.",
|
||||
"StammnormBgblnummer": "271/1949",
|
||||
"Inkrafttretensdatum": "1949-12-17",
|
||||
"Indizes": {
|
||||
"item": "20/06 Konsumentenschutz"
|
||||
},
|
||||
"Aenderung": "",
|
||||
"Schlagworte": "dRGBl. I S 581/1941, StGBl. Nr. 235/1945, RGBl. Nr. 47/1881",
|
||||
"Gesetzesnummer": "10001899",
|
||||
"AlteDokumentnummer": "N2194910342S",
|
||||
"GesamteRechtsvorschriftUrl": "https://www.ris.bka.gv.at/GeltendeFassung.wxe?Abfrage=Bundesnormen&Gesetzesnummer=10001899"
|
||||
}
|
||||
}
|
||||
},
|
||||
"Dokumentliste": {
|
||||
"ContentReference": {
|
||||
"ContentType": "MainDocument",
|
||||
"Name": "Hauptdokument",
|
||||
"Urls": {
|
||||
"ContentUrl": [
|
||||
{
|
||||
"DataType": "Xml",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025182/NOR12025182.xml"
|
||||
},
|
||||
{
|
||||
"DataType": "Html",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025182/NOR12025182.html"
|
||||
},
|
||||
{
|
||||
"DataType": "Pdf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025182/NOR12025182.pdf"
|
||||
},
|
||||
{
|
||||
"DataType": "Rtf",
|
||||
"Url": "https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025182/NOR12025182.rtf"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
12
src/main.rs
12
src/main.rs
@ -1,7 +1,9 @@
|
||||
use std::io;
|
||||
|
||||
mod law;
|
||||
mod par;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Error {
|
||||
msg: String,
|
||||
}
|
||||
@ -27,7 +29,15 @@ impl From<serde_json::Error> for Error {
|
||||
}
|
||||
}
|
||||
}
|
||||
impl From<roxmltree::Error> for Error {
|
||||
fn from(value: roxmltree::Error) -> Self {
|
||||
Self {
|
||||
msg: value.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
law::parse(10001905);
|
||||
//law::parse(10001905);
|
||||
par::parse("https://www.ris.bka.gv.at/Dokumente/Bundesnormen/NOR12025172/NOR12025172.xml");
|
||||
}
|
||||
|
14
src/par/mod.rs
Normal file
14
src/par/mod.rs
Normal file
@ -0,0 +1,14 @@
|
||||
mod parser;
|
||||
|
||||
use crate::{par::parser::Risdok, Error};
|
||||
|
||||
fn fetch_page(url: &str) -> Result<String, Error> {
|
||||
Ok(ureq::get(url).call()?.into_string()?)
|
||||
}
|
||||
|
||||
pub(crate) fn parse(url: &str) -> Result<(), Error> {
|
||||
let xml = fetch_page(url)?;
|
||||
let risdok = Risdok::from_str(&xml)?;
|
||||
|
||||
Ok(())
|
||||
}
|
286
src/par/parser.rs
Normal file
286
src/par/parser.rs
Normal file
@ -0,0 +1,286 @@
|
||||
use roxmltree::Node;
|
||||
|
||||
use crate::Error;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Risdok {
|
||||
metadaten: Metadaten,
|
||||
nutzdaten: Nutzdaten,
|
||||
layoutdaten: Layoutdaten,
|
||||
}
|
||||
|
||||
impl Risdok {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "risdok");
|
||||
|
||||
let mut c = n.children();
|
||||
|
||||
let ret = Self {
|
||||
metadaten: Metadaten::parse(c.next().unwrap()),
|
||||
nutzdaten: Nutzdaten::parse(c.next().unwrap()),
|
||||
layoutdaten: Layoutdaten::parse(c.next().unwrap()),
|
||||
};
|
||||
|
||||
assert_eq!(c.next(), None);
|
||||
|
||||
ret
|
||||
}
|
||||
|
||||
pub(crate) fn from_str(xml: &str) -> Result<Self, Error> {
|
||||
let doc = roxmltree::Document::parse(&xml)?;
|
||||
let root = doc.root();
|
||||
assert_eq!(root.children().into_iter().count(), 1);
|
||||
Ok(Self::parse(root.children().next().unwrap()))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Metadaten;
|
||||
impl Metadaten {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "metadaten");
|
||||
|
||||
assert_eq!(n.children().next(), None);
|
||||
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Nutzdaten {
|
||||
abschnitt: Abschnitt,
|
||||
}
|
||||
impl Nutzdaten {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "nutzdaten");
|
||||
|
||||
let mut c = n.children();
|
||||
let ret = Self {
|
||||
abschnitt: Abschnitt::parse(c.next().unwrap()),
|
||||
};
|
||||
|
||||
assert_eq!(c.next(), None);
|
||||
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Abschnitt {
|
||||
ueberschriftPara: Option<UeberschriftPara>,
|
||||
absatz: AbsatzAbs,
|
||||
}
|
||||
impl Abschnitt {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "abschnitt");
|
||||
|
||||
let mut c = n.children().peekable();
|
||||
|
||||
Kzinhalt::parse(c.next().unwrap());
|
||||
Kzinhalt::parse(c.next().unwrap());
|
||||
Fzinhalt::parse(c.next().unwrap());
|
||||
Fzinhalt::parse(c.next().unwrap());
|
||||
|
||||
// Skip all UeberschriftTitle and Absatz
|
||||
loop {
|
||||
match c.peek() {
|
||||
Some(child) => {
|
||||
if UeberschriftTitle::test(child) {
|
||||
c.next();
|
||||
continue;
|
||||
}
|
||||
if Absatz::test(child) {
|
||||
c.next();
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
|
||||
let mut ueberschriftPara = None;
|
||||
if let Some(child) = c.peek() {
|
||||
if UeberschriftPara::test(child) {
|
||||
ueberschriftPara = Some(UeberschriftPara::parse(c.next().unwrap()))
|
||||
}
|
||||
}
|
||||
|
||||
let absatz = AbsatzAbs::parse(c.next().unwrap());
|
||||
|
||||
// Skip all UeberschriftTitle and Absatz
|
||||
loop {
|
||||
match c.peek() {
|
||||
Some(child) => {
|
||||
if UeberschriftTitle::test(child) {
|
||||
c.next();
|
||||
continue;
|
||||
}
|
||||
if Absatz::test(child) {
|
||||
c.next();
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
|
||||
assert_eq!(c.next(), None);
|
||||
|
||||
Self {
|
||||
ueberschriftPara,
|
||||
absatz,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct AbsatzAbs {
|
||||
gldsym: String,
|
||||
content: String,
|
||||
}
|
||||
impl AbsatzAbs {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "absatz");
|
||||
assert_eq!(n.attribute("typ").unwrap(), "abs");
|
||||
|
||||
let mut c = n.children();
|
||||
|
||||
let ret = Self {
|
||||
gldsym: Leaf::parse(c.next().unwrap(), "gldsym".into()).replace("\u{a0}", " "),
|
||||
content: c.next().unwrap().text().unwrap().trim().into(),
|
||||
};
|
||||
|
||||
assert_eq!(c.next(), None);
|
||||
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Leaf {
|
||||
content: String,
|
||||
}
|
||||
impl Leaf {
|
||||
pub(crate) fn parse(n: Node, name: String) -> String {
|
||||
assert!(n.tag_name().name() == name);
|
||||
|
||||
assert_eq!(n.children().into_iter().count(), 1);
|
||||
|
||||
n.text().unwrap().into()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Absatz {
|
||||
content: String,
|
||||
}
|
||||
impl Absatz {
|
||||
pub(crate) fn test(n: &Node) -> bool {
|
||||
n.tag_name().name() == "absatz"
|
||||
}
|
||||
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "absatz");
|
||||
|
||||
Self {
|
||||
content: n.text().unwrap().into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct UeberschriftPara {
|
||||
content: String,
|
||||
}
|
||||
impl UeberschriftPara {
|
||||
pub(crate) fn test(n: &Node) -> bool {
|
||||
n.tag_name().name() == "ueberschrift" && n.attribute("typ").unwrap() == "para"
|
||||
}
|
||||
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "ueberschrift");
|
||||
|
||||
assert_eq!(n.attribute("typ").unwrap(), "para");
|
||||
Self {
|
||||
content: n.text().unwrap().into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct UeberschriftTitle;
|
||||
impl UeberschriftTitle {
|
||||
fn test(n: &Node) -> bool {
|
||||
n.tag_name().name() == "ueberschrift" && n.attribute("typ").unwrap() == "titel"
|
||||
}
|
||||
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "ueberschrift");
|
||||
|
||||
assert_eq!(n.attribute("typ").unwrap(), "titel");
|
||||
//TODO parse if necessary
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Kzinhalt;
|
||||
impl Kzinhalt {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "kzinhalt");
|
||||
//TODO parse if necessary
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Fzinhalt;
|
||||
impl Fzinhalt {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "fzinhalt");
|
||||
//TODO parse if necessary
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub(crate) struct Layoutdaten;
|
||||
impl Layoutdaten {
|
||||
pub(crate) fn parse(n: Node) -> Self {
|
||||
assert!(n.tag_name().name() == "layoutdaten");
|
||||
|
||||
assert_eq!(n.children().next(), None);
|
||||
|
||||
Self {}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::{fs::File, io::Read};
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn deserialize_wucher1_success() {
|
||||
let mut file = File::open("data/par/wucher1.xml").unwrap();
|
||||
let mut xml = String::new();
|
||||
file.read_to_string(&mut xml).unwrap();
|
||||
|
||||
let risdok = Risdok::from_str(&xml);
|
||||
if risdok.is_err() {
|
||||
println!("{:#?}", risdok.as_ref().err());
|
||||
}
|
||||
assert!(risdok.is_ok());
|
||||
|
||||
let abschnitt = risdok.unwrap().nutzdaten.abschnitt;
|
||||
|
||||
assert_eq!(
|
||||
abschnitt.ueberschriftPara.unwrap().content,
|
||||
"Nichtigkeit eines wucherischen Vertrages."
|
||||
);
|
||||
assert_eq!(abschnitt.absatz, AbsatzAbs {gldsym: "§ 1.".into(), content: "Ein Vertrag ist nichtig, wenn jemand den Leichtsinn, die Zwangslage, Verstandesschwäche, Unerfahrenheit oder Gemütsaufregung eines anderen dadurch ausbeutet, daß er sich oder einem Dritten für eine Leistung eine Gegenleistung versprechen oder gewähren läßt, deren Vermögenswert zu dem Werte seiner Leistung in auffallendem Mißverhältnis steht.".into()});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user