Changes between Version 34 and Version 35 of Rules/PublicTransportGtfs


Ignore:
Timestamp:
2021-02-17T16:32:12+01:00 (5 years ago)
Author:
skyper
Comment:

Finally, get correct regex for route_id in CH

Legend:

Unmodified
Added
Removed
Modified
  • Rules/PublicTransportGtfs

    v34 v35  
    259259
    260260/* route_id, shape_id, trip_id */
     261/* FIXME: Split checks per feed instead of one global regex.
    261262/* FIXME: Get proper syntax as regex displayed. */
    262 *[gtfs:route_id      ][gtfs:route_id       !~                           /^[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[A-Z])?-j[1-9][0-9j]-[0-9]+(;[ ]?[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[A-Z])?-j[1-9][0-9j]-[0-9]+)*$/],
    263 *[gtfs:shape_id      ][gtfs:shape_id       !~                           /^[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR](;[ ]?[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR])*$/],
    264 *[gtfs:trip_id       ][gtfs:trip_id        !~ /^[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR](;[ ]?[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR])*$/],
    265 *[gtfs:trip_id:sample][gtfs:trip_id:sample !~ /^[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR](;[ ]?[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR])*$/] {
     263*[gtfs:route_id      ][gtfs:route_id       !~                           /^[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[0-9A-Z])?-j[1-9][0-9j]-[0-9]+(;[ ]?[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[0-9A-Z])?-j[1-9][0-9j]-[0-9]+)*$/],
     264*[gtfs:shape_id      ][gtfs:shape_id       !~                           /^[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[0-9A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR](;[ ]?[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[0-9A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR])*$/],
     265*[gtfs:trip_id       ][gtfs:trip_id        !~ /^[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[0-9A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR](;[ ]?[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[0-9A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR])*$/],
     266*[gtfs:trip_id:sample][gtfs:trip_id:sample !~ /^[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[0-9A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR](;[ ]?[1-9][0-9]{0,3}\.T[023A]\.[0-9]{1,2}-[A-Z]?[0-9]{1,3}[A-Z]?(-[0-9A-Z])?-j[1-9][0-9j]-[0-9]+\.[1-9][0-9]{0,2}\.[HR])*$/] {
    266267  throwError: tr("Value `{0}` for `{1}=*` does not match value syntax.", "{0.value}", "{0.key}");
    267268/*  throwError: tr("Value `{0}` for `{1}=*` does not match value syntax `{2}`.", "{0.value}", "{0.key}", "{1.value}"); */
     
    269270  set GtfsIdSyntax;
    270271  assertMatch:   "relation gtfs:route_id=7-342-j1j-1.H";
    271   assertNoMatch: "relation gtfs:route_id=7-342-j1j-1";
     272  assertNoMatch: "relation gtfs:route_id=92-731-2-j21-1";               /* CH */
     273  assertNoMatch: "relation gtfs:route_id=7-342-j1j-1";                  /* DE-BW-SBG */
    272274  assertNoMatch: "relation gtfs:route_id=7-342-j1j-1;7-342-j1j-5";
    273   assertNoMatch: "relation gtfs:route_id=90-742-B-j20-1";
    274   assertNoMatch: "relation gtfs:route_id=10-11-I-j20-1";
     275  assertNoMatch: "relation gtfs:route_id=90-742-B-j20-1";               /* DE-BW-SWEG */
     276  assertNoMatch: "relation gtfs:route_id=10-11-I-j20-1";                /* DE-BW-VAG */
    275277  assertMatch:   "relation gtfs:shape_id=11-4-I-j20-1.23.";
    276   assertNoMatch: "relation gtfs:shape_id=11-4-I-j20-1.23.H";
    277   assertNoMatch: "relation gtfs:shape_id=92-R01-F-j20-1.117.R";
    278   assertNoMatch: "relation gtfs:shape_id=0-S3-E-j20-2.1.R";
     278  assertNoMatch: "relation gtfs:shape_id=11-4-I-j20-1.23.H";            /* DE-BW-VAG */
     279  assertNoMatch: "relation gtfs:shape_id=92-R01-F-j20-1.117.R";         /* DE-SPNV */
     280  assertNoMatch: "relation gtfs:shape_id=0-S3-E-j20-2.1.R";             /* DE-BW-SWEG */
    279281  assertMatch:   "relation gtfs:trip_id=1108.T2.11-4-I-j20-1.10.";
    280   assertNoMatch: "relation gtfs:trip_id=1108.T2.11-4-I-j20-1.10.H";
    281   assertNoMatch: "relation gtfs:trip_id=29.T0.7-342-j1j-1.50.H";
    282   assertNoMatch: "relation gtfs:trip_id=2.TA.90-742-B-j20-1.4.R";
     282  assertNoMatch: "relation gtfs:trip_id=1108.T2.11-4-I-j20-1.10.H";     /* DE-BW-VAG */
     283  assertNoMatch: "relation gtfs:trip_id=29.T0.7-342-j1j-1.50.H";        /* DE-BW-SBG */
     284  assertNoMatch: "relation gtfs:trip_id=2.TA.90-742-B-j20-1.4.R";       /* DE-BW-SWEG */
    283285}
    284286/* gtfs:feed, *:guid, gtfs:release_date */