Skip to content

Commit

Permalink
Further improve IRI-or-CURIE and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Dec 18, 2023
1 parent 73b3b49 commit 3651ffd
Show file tree
Hide file tree
Showing 85 changed files with 87 additions and 3 deletions.
6 changes: 3 additions & 3 deletions registereditems/ogc-utils/iri-or-curie/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ description: IRI or CURIE
$defs:
IRI:
type: string
pattern: '^\w+:(\/?\/?)[^\s]+$'
pattern: '^\w+:/*([^:<>{}|\\^`"\s/]+[^<>{}|\\^`"\s]*(:[^:<>{}|\\^`"\s]+)?)?$'
CURIE:
type: string
pattern: '^[A-Za-z_][^\s:]*:.*$'
pattern: '^[A-Za-z_][^\s:/]*:[^:<>{}|\\^`"\s]*(\?[^<>{}|\\^`" ]*)?(#[^<>{}|\\^`"\s]*)?$'
LocalPart:
type: string
pattern: '^[^:<>\{\}\|\\\^`" ]*(\?[^<>\{\}\|\\\^`" ]*)?(#[^<>\{\}\|\\\^`" ]*)?$'
pattern: '^[^:<>{}|\\^`"\s]*(\?[^<>{}|\\^`"\s]*)?(#[^<>{}|\\^`"\s]*)?$'
Single:
anyOf:
- $ref: '#/$defs/IRI'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
" "
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"https://www.google com/test"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"not an IRI"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"file://foo"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test10.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test12.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test13.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test14.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test15.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar?q=1&r=2"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar/?q=1&r=2"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test17.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com#toto"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test18.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/#toto"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test19.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo#toto"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"ftp://ftp.is.co.za/rfc/rfc1808.txt"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test20.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar#toto"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar/#toto"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test22.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar?q=1&r=2#toto"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test23.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar/?q=1&r=2#toto"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test24.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/foo/bar/.././baz"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test25.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://a.example/AZazÀÖØöø˿ͰͽͿ῿"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test26.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://a.example/‌‍⁰↏Ⰰ⿯、퟿﨎﷏"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test27.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://a.example/ﷰ￯𐀀󯿽"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test28.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://a.example/?AZaz󰀀󿿽􀀀􏿽ÀÖØ"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test29.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://a.example/öø˿ͰͽͿ῿‌‍⁰↏Ⰰ"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.ietf.org/rfc/rfc2396.txt"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test30.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://a.example/⿯、퟿﨎﷏ﷰ￯𐀀󯿽"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test31.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"file:///foo/bar"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"mailto:user@host?subject=blah"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test33.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"dav:"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test34.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"about:"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test35.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test36.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test37.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://1.2.3.4/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test38.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com/stuff"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test39.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com/stuff/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"ldap://[2001:db8::7]/c=GB?objectClass?one"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test40.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com/hello%20world/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test41.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com?name=obi"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test42.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com?name=obi+wan&status=jedi"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test43.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com?onery"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test44.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com#bottom"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test45.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com/yelp.html#bottom"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test46.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"https://www.yahoo.com/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test47.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"ftp://www.yahoo.com/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test48.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"ftp://www.yahoo.com/hello"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test49.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com?name=%00%01"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"mailto:[email protected]"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test50.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yaho%6f.com"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test51.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com/hello%00world/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test52.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com/hello+world/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test53.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com?name=obi&"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test54.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com?name=obi&type="
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test55.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://www.yahoo.com/yelp.html#"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test56.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.org/aaa/bbb#ccc"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test57.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"mailto:[email protected]"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test58.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"mailto:[email protected]#frag"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test59.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"HTTP://EXAMPLE.ORG/AAA/BBB#CCC"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"news:comp.infosystems.www.servers.unix"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test60.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.org/aaa%2fbbb#ccc"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test61.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.org/aaa%2Fbbb#ccc"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test62.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/%2F"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test63.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/?%2F"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/#?%2F"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test65.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/aaa%2Fbbb"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test66.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.org:80/aaa/bbb#ccc"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test67.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.org:/aaa/bbb#ccc"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test68.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.org./aaa/bbb#ccc"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test69.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.123./aaa/bbb#ccc"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"tel:+1-816-555-1212"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test70.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.org"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test71.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test72.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://[1080:0:0:0:8:800:200C:417A]/index.html"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test73.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://[3ffe:2a00:100:7031::1]"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test74.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://[1080::8:800:200C:417A]/foo"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test75.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://[::192.9.5.5]/ipng"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test76.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://[::FFFF:129.144.52.38]:80/index.html"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test77.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://[2010:836B:4179::836B:4179]"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test78.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example/Andr&#567;"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test79.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"file:///C:/DEV/Haskell/lib/HXmlToolbox-3.01/examples/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"telnet://192.0.2.16:80/"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test80.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://a/?"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test81.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"http://example.com/?"
1 change: 1 addition & 0 deletions registereditems/ogc-utils/iri-or-curie/tests/test9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"urn:oasis:names:specification:docbook:dtd:xml:4.1.2"

0 comments on commit 3651ffd

Please sign in to comment.