fixtures.vala 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. /********************************************************************
  2. # Copyright 2016-2017 Daniel 'grindhold' Brendle
  3. #
  4. # This file is part of liboparl.
  5. #
  6. # liboparl is free software: you can redistribute it and/or
  7. # modify it under the terms of the GNU Lesser General Public License
  8. # as published by the Free Software Foundation, either
  9. # version 3 of the License, or (at your option) any later
  10. # version.
  11. #
  12. # liboparl is distributed in the hope that it will be
  13. # useful, but WITHOUT ANY WARRANTY; without even the implied
  14. # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. # PURPOSE. See the GNU Lesser General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Lesser General Public
  18. # License along with liboparl.
  19. # If not, see http://www.gnu.org/licenses/.
  20. *********************************************************************/
  21. using OParl;
  22. namespace OParlTest.Fixtures {
  23. public const string object_sane = """
  24. {
  25. "id": "https://oparl.example.org/",
  26. "type": "https://schema.oparl.org/1.0/System",
  27. "name": "Testsystem und so",
  28. "shortName": "Testsystem",
  29. "license": "CC-BY-SA",
  30. "created": "2016-01-01T13:12:22+00:00",
  31. "modified": "2016-05-23T21:18:29+00:00",
  32. "keyword": ["some","neat","object"],
  33. "web": "https://foobar.invalid",
  34. "deleted": false
  35. }
  36. """;
  37. public const string object_sane_vendor_attrs = """
  38. {
  39. "id": "https://oparl.example.org/",
  40. "type": "https://schema.oparl.org/1.0/System",
  41. "name": "Testsystem und so",
  42. "shortName": "Testsystem",
  43. "license": "CC-BY-SA",
  44. "created": "2016-01-01T13:12:22+00:00",
  45. "modified": "2016-05-23T21:18:29+00:00",
  46. "keyword": ["some","neat","object"],
  47. "web": "https://foobar.invalid",
  48. "deleted": false,
  49. "ris:state":"old",
  50. "ris:vendor":"somerisvendor"
  51. }
  52. """;
  53. public const string system_sane = """
  54. {
  55. "id": "https://oparl.example.org/",
  56. "type": "https://schema.oparl.org/1.0/System",
  57. "oparlVersion": "https://schema.oparl.org/1.0/",
  58. "body": "https://oparl.example.org/bodies",
  59. "name": "Beispiel-System",
  60. "contactEmail": "info@example.org",
  61. "contactName": "Allgemeiner OParl Kontakt",
  62. "website": "http://www.example.org/",
  63. "vendor": "http://example-software.com/",
  64. "product": "http://example-software.com/oparl-server/",
  65. "otherOparlVersions": ["https://oparl2.example.org/"]
  66. }
  67. """;
  68. public const string body_list_sane = """
  69. {
  70. "pagination": {
  71. "totalElements":1,
  72. "elementsPerPage":1,
  73. "currentPage":1,
  74. "totalPages":1
  75. },
  76. "data": [
  77. """+ body_sane +"""
  78. ],
  79. "links":{}
  80. }
  81. """;
  82. public const string legislative_term_sane_1 = """
  83. {
  84. "id": "https://oparl.example.org/term/21",
  85. "type": "https://schema.oparl.org/1.0/LegislativeTerm",
  86. "body": "https://oparl.example.org/body/0",
  87. "name": "21. Wahlperiode",
  88. "startDate": "2010-12-03",
  89. "endDate": "2013-12-03"
  90. }
  91. """;
  92. public const string legislative_term_sane_2 = """
  93. {
  94. "id": "https://oparl.example.org/term/22",
  95. "type": "https://schema.oparl.org/1.0/LegislativeTerm",
  96. "body": "https://oparl.example.org/body/0",
  97. "name": "21. Wahlperiode",
  98. "startDate": "2014-01-01T14:28:31.568+0000",
  99. "endDate": "2015-01-01T14:28:31.568+0000"
  100. }
  101. """;
  102. public const string body_sane = """
  103. {
  104. "id": "https://oparl.example.org/body/0",
  105. "type": "https://schema.oparl.org/1.0/Body",
  106. "system": "https://oparl.example.org/",
  107. "contactEmail": "ris@beispielstadt.de",
  108. "contactName": "RIS-Betreuung",
  109. "ags": "05315000",
  110. "rgs": "053150000000",
  111. "equivalent": [
  112. "http://d-nb.info/gnd/2015732-0",
  113. "http://dbpedia.org/resource/Cologne"
  114. ],
  115. "shortName": "Köln",
  116. "name": "Stadt Köln, kreisfreie Stadt",
  117. "website": "http://www.beispielstadt.de/",
  118. "license": "http://creativecommons.org/licenses/by/4.0/",
  119. "licenseValidSince": "2015-01-01T14:28:31.568+0000",
  120. "oparlSince": "2014-01-01T14:28:31.568+0000",
  121. "organization": "https://oparl.example.org/body/0/organizations/",
  122. "person": "https://oparl.example.org/body/0/people/",
  123. "meeting": "https://oparl.example.org/body/0/meetings/",
  124. "paper": "https://oparl.example.org/body/0/papers/",
  125. "legislativeTerm": [
  126. """ + legislative_term_sane_1 + """,
  127. """ + legislative_term_sane_2 + """
  128. ],
  129. "location": """+ location_sane +""",
  130. "classification": "Kreisfreie Stadt",
  131. "created": "2014-01-08T14:28:31.568+0100",
  132. "modified": "2014-01-08T14:28:31.568+0100"
  133. }
  134. """;
  135. public const string organization_sane = """
  136. {
  137. "id": "https://oparl.example.org/organization/0",
  138. "type": "https://schema.oparl.org/1.0/Organization",
  139. "body": "https://oparl.example.org/body/0",
  140. "name": "Ausschuss für Haushalt und Finanzen",
  141. "shortName": "Finanzausschuss",
  142. "startDate": "2012-07-17",
  143. "endDate": "2014-07-17",
  144. "organizationType": "Gremium",
  145. "location": """ + location_sane + """,
  146. "post": [
  147. "Vorsitzender",
  148. "1. Stellvertreter",
  149. "Mitglied"
  150. ],
  151. "meeting": "https://oparl.example.org/organization/0/meetings",
  152. "membership": [
  153. "https://oparl.example.org/membership/1"
  154. ],
  155. "classification": "Ausschuss",
  156. "keyword": [
  157. "finanzen",
  158. "haushalt"
  159. ],
  160. "created": "2012-07-16",
  161. "modified": "2012-08-16"
  162. }
  163. """;
  164. public const string organization_list_sane = """
  165. {
  166. "pagination": {
  167. "totalElements":1,
  168. "elementsPerPage":1,
  169. "currentPage":1,
  170. "totalPages":1
  171. },
  172. "data": [
  173. """+ organization_sane +"""
  174. ],
  175. "links":{}
  176. }
  177. """;
  178. public const string membership_sane_1 = """
  179. {
  180. "id": "https://oparl.example.org/membership/0",
  181. "type": "https://schema.oparl.org/1.0/Membership",
  182. "organization": "https://oparl.example.org/organization/0",
  183. "role": "Vorsitzende",
  184. "votingRight": true,
  185. "startDate": "2013-12-03"
  186. }
  187. """;
  188. public const string membership_sane_2 = """
  189. {
  190. "id": "https://oparl.example.org/membership/1",
  191. "type": "https://schema.oparl.org/1.0/Membership",
  192. "organization": "https://oparl.example.org/organization/0",
  193. "onBehalfOf": "https://oparl.example.org/organization/0",
  194. "role": "Sachkundige Bürgerin",
  195. "votingRight": false,
  196. "startDate": "2013-12-02",
  197. "endDate": "2014-07-27"
  198. }
  199. """;
  200. public const string person_sane = """
  201. {
  202. "id": "https://oparl.example.org/person/0",
  203. "type": "https://schema.oparl.org/1.0/Person",
  204. "body": "https://oparl.example.org/body/0",
  205. "name": "Prof. Dr. Max Mustermann",
  206. "familyName": "Mustermann",
  207. "givenName": "Max",
  208. "title": [
  209. "Prof.",
  210. "Dr."
  211. ],
  212. "formOfAddress": "Ratsfrau",
  213. "gender": "male",
  214. "email": ["max@mustermann.de"],
  215. "phone": ["+493012345678"],
  216. "status": [
  217. "Bezirksbürgermeister"
  218. ],
  219. "membership": [
  220. """ + membership_sane_1 + """,
  221. """ + membership_sane_2 + """
  222. ],
  223. "created": "2011-11-11T11:11:00+00:00",
  224. "modified": "2012-08-16T14:05:27+00:00"
  225. }
  226. """;
  227. public const string person_list_sane = """
  228. {
  229. "pagination": {
  230. "totalElements":1,
  231. "elementsPerPage":1,
  232. "currentPage":1,
  233. "totalPages":1
  234. },
  235. "data": [
  236. """ + person_sane + """
  237. ],
  238. "links":{}
  239. }
  240. """;
  241. public const string membership_sane = """
  242. {
  243. "id": "https://oparl.example.org/membership/1",
  244. "type": "https://schema.oparl.org/1.0/Membership",
  245. "organization": "https://oparl.example.org/organization/0",
  246. "onBehalfOf": "https://oparl.example.org/organization/0",
  247. "person": "https://oparl.example.org/person/0",
  248. "role": "Sachkundige Bürgerin",
  249. "votingRight": false,
  250. "startDate": "2013-12-02",
  251. "endDate": "2014-07-27"
  252. }
  253. """;
  254. public const string meeting_sane = """
  255. {
  256. "id": "https://oparl.example.org/meeting/0",
  257. "type": "https://schema.oparl.org/1.0/Meeting",
  258. "name": "4. Sitzung des Finanzausschusses",
  259. "cancelled": false,
  260. "start": "2013-01-04T08:00:00+00:00",
  261. "end": "2013-01-04T12:00:00+00:00",
  262. "location": """ + location_sane + """,
  263. "organization": [
  264. "https://oparl.example.org/organization/0"
  265. ],
  266. "participant": [
  267. "https://oparl.example.org/person/0"
  268. ],
  269. "invitation": """ + file_sane + """,
  270. "resultsProtocol": """ + file_sane + """,
  271. "verbatimProtocol": """ + file_sane + """,
  272. "auxiliaryFile": ["""+ file_sane + """],
  273. "agendaItem": ["""+ agenda_item_sane + """],
  274. "created": "2012-01-06T12:01:00+00:00",
  275. "modified": "2012-01-08T14:05:27+00:00"
  276. }
  277. """;
  278. public const string meeting_list_sane = """
  279. {
  280. "pagination": {
  281. "totalElements":1,
  282. "elementsPerPage":1,
  283. "currentPage":1,
  284. "totalPages":1
  285. },
  286. "data": [
  287. """ + meeting_sane + """
  288. ],
  289. "links":{}
  290. }
  291. """;
  292. public const string location_sane = """
  293. {
  294. "id": "https://oparl.example.org/location/0",
  295. "type": "https://schema.oparl.org/1.0/Location",
  296. "description": "Rathaus der Beispielstadt, Ratshausplatz 1, 12345 Beispielstadt",
  297. "streetAddress": "Rathausplatz 1",
  298. "room": "1337",
  299. "postalCode": "13337",
  300. "subLocality": "Beispielbezirk",
  301. "locality": "Beispielstadt",
  302. "bodies": [
  303. "https://oparl.example.org/body/0"
  304. ],
  305. "organizations": [
  306. "https://oparl.example.org/organization/0"
  307. ],
  308. "meetings": [
  309. "https://oparl.example.org/meeting/0"
  310. ],
  311. "papers": [
  312. "https://oparl.example.org/paper/0"
  313. ],
  314. "geojson": {
  315. "type": "Feature",
  316. "geometry": {
  317. "type": "Point",
  318. "coordinates": [
  319. 50.1234,
  320. 10.4321
  321. ]
  322. },
  323. "properties": {
  324. "name": "Rathausplatz"
  325. }
  326. }
  327. }
  328. """;
  329. public const string file_sane = """
  330. {
  331. "id": "https://oparl.example.org/file/0",
  332. "type": "https://schema.oparl.org/1.0/File",
  333. "name": "Nachtrags-Tagesordnung",
  334. "fileName": "nachtrag-TO.pdf",
  335. "mimeType": "application/pdf",
  336. "date": "2012-01-08",
  337. "sha1Checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
  338. "size": 82930,
  339. "accessUrl": "https://oparl.example.org/file/0.pdf",
  340. "downloadUrl": "https://oparl.example.org/file/download/0.pdf",
  341. "externalServiceUrl": "https://www.youtube.com/watch?v=MKp30C3MwVk",
  342. "masterFile" : "https://oparl.example.org/file/0",
  343. "derivativeFile" : ["https://oparl.example.org/file/0"],
  344. "fileLicense": "http://www.wtfpl.net/wp-content/uploads/2012/12/wtfpl-badge-1.png",
  345. "modified": "2012-01-08T14:05:27+00:00",
  346. "text": "blablatextblabla",
  347. "meeting": [ "https://oparl.example.org/meeting/0"],
  348. "agendaItem": [ "https://oparl.example.org/agendaitem/0"],
  349. "paper": [ "https://oparl.example.org/paper/0"]
  350. }
  351. """;
  352. public const string paper_sane = """
  353. {
  354. "id": "https://oparl.example.org/paper/0",
  355. "type": "https://schema.oparl.org/1.0/Paper",
  356. "body": "https://oparl.example.org/body/0",
  357. "name": "Antwort auf Anfrage 1200/2014",
  358. "reference": "1234/2014",
  359. "date": "2014-04-04",
  360. "paperType": "Beantwortung einer Anfrage",
  361. "relatedPaper": [
  362. "https://oparl.example.org/paper/0"
  363. ],
  364. "mainFile": {
  365. "id": "https://oparl.example.org/file/57737",
  366. "type": "https://schema.oparl.org/1.0/File",
  367. "name": "Anlage 1 zur Anfrage",
  368. "fileName": "anlage_1_zur_anfrage.pdf",
  369. "mimeType": "application/pdf",
  370. "date": "2013-01-04",
  371. "sha1Checksum": "d749751af44a32c818b9b1e1515251c67734f5d2",
  372. "size": 82930,
  373. "accessUrl": "https://oparl.example.org/file/57737.pdf",
  374. "downloadUrl": "https://oparl.example.org/file/download/57737.pdf",
  375. "license": "http://www.opendefinition.org/licenses/cc-by",
  376. "created": "2013-01-04T07:54:13+01:00",
  377. "modified": "2013-01-04T07:54:13+01:00"
  378. },
  379. "auxiliaryFile": [ """ + file_sane + """ ],
  380. "location": [
  381. {
  382. "id": "https://oparl.example.org/locations/0",
  383. "type": "https://schema.oparl.org/1.0/Location",
  384. "description": "Honschaftsstraße 312, Köln",
  385. "geometry": {
  386. "type": "Point",
  387. "coordinates": [
  388. 7.03291,
  389. 50.98249
  390. ]
  391. }
  392. }
  393. ],
  394. "originatorPerson": [
  395. "https://oparl.example.org/person/0"
  396. ],
  397. "originatorOrganization": [
  398. "https://oparl.example.org/organization/0"
  399. ],
  400. "consultation": [""" + consultation_sane + """],
  401. "underDirectionOf": [
  402. "https://oparl.example.org/organization/0"
  403. ],
  404. "created": "2013-01-08T12:05:27+00:00",
  405. "modified": "2013-01-08T12:05:27+00:00"
  406. }
  407. """;
  408. public const string paper_list_sane = """
  409. {
  410. "pagination": {
  411. "totalElements":1,
  412. "elementsPerPage":1,
  413. "currentPage":1,
  414. "totalPages":1
  415. },
  416. "data": [
  417. """+ paper_sane +"""
  418. ],
  419. "links":{}
  420. }
  421. """;
  422. public const string agenda_item_sane = """
  423. {
  424. "id": "https://oparl.example.org/agendaitem/0",
  425. "type": "https://schema.oparl.org/1.0/AgendaItem",
  426. "meeting": "https://oparl.example.org/meeting/0",
  427. "number": "10.1",
  428. "name": "Satzungsänderung für Ausschreibungen",
  429. "public": true,
  430. "consultation": "https://oparl.example.org/consultation/0",
  431. "result": "Geändert beschlossen",
  432. "resolutionText": "Der Beschluss weicht wie folgt vom Antrag ab: ...",
  433. "resolutionFile": """+ file_sane +""",
  434. "auxiliaryFile": ["""+ file_sane +"""],
  435. "start": "2012-02-06T12:01:00+00:00",
  436. "end": "2012-02-08T14:05:27+00:00",
  437. "created": "2012-01-06T12:01:00+00:00",
  438. "modified": "2012-08-16T14:05:27+00:00"
  439. }
  440. """;
  441. public const string consultation_sane = """
  442. {
  443. "id": "https://oparl.example.org/consultation/0",
  444. "type": "https://schema.oparl.org/1.0/Consultation",
  445. "agendaItem": "https://oparl.example.org/agendaitem/0",
  446. "meeting": "https://oparl.example.org/meeting/0",
  447. "organization": ["https://oparl.example.org/organization/0"],
  448. "authoritative": false,
  449. "role": "Beschlussfassung"
  450. }
  451. """;
  452. }