Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow slashes and semicola in query part of URL (DEV-3480) #910

Merged
merged 5 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dsp_tools/resources/schema/data.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<!-- data type for knora uri -->
<xs:simpleType name="knorauri_type">
<xs:restriction base="xs:string">
<xs:pattern value="([a-z][a-z0-9+.\-]*):(//([\w_.\-~:\[\]]+)(:\d{0,6})?)(/[\w_.\-~:%()]*)*(\?[\w_.,\-:%=*&amp;]+)*(#[\w_.\-~:/]*)?"/>
<xs:pattern value="([a-z][a-z0-9+.\-]*):(//([\w_.\-~:\[\]]+)(:\d{0,6})?)(/[\w_.\-~:%()]*)*(\?[\w_.,;/\-:%=*&amp;]+)*(#[\w_.\-~:/]*)?"/>
</xs:restriction>
</xs:simpleType>

Expand Down
2 changes: 1 addition & 1 deletion src/dsp_tools/utils/uri_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def is_uri(s: str) -> bool:
host = r"(?<host>[\w_.\-~:\[\]]+)"
port = r"(?<port>:\d{0,6})"
path = r"(?<path>/[\w_.\-~:%()]*)"
query = r"(?<query>\?[\w_.,\-:%=*&]+)"
query = r"(?<query>\?[\w_.,;/\-:%=*&]+)"
fragment = r"(?<fragment>#[\w_.\-~:/]*)"
m = regex.match(rf"{scheme}:(//{host}{port}?){path}*{query}*{fragment}?", s, flags=regex.UNICODE)
return m is not None
2 changes: 1 addition & 1 deletion testdata/excel2xml/excel2xml-expected-output.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</text-prop>
<uri-prop name=":hasIdentifier">
<uri permissions="prop-default">https://en.wiktionary.org/wiki/Ῥόδος</uri>
<uri permissions="prop-default">https://www.test-case.ch/</uri>
<uri permissions="prop-default">https://digiliblt.uniupo.it/xtf/view?docId=dlt000521/dlt000521.xml;query=De%20taxone;brand=default</uri>
<uri permissions="prop-default">https://reg-exr.com:3000</uri>
<uri permissions="prop-default">https://reg-exr.com:3000/path/to/file_(%C3%89).htm</uri>
</uri-prop>
Expand Down
2 changes: 1 addition & 1 deletion testdata/excel2xml/excel2xml-testdata.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id,restype,label,ark,iri,created,permissions,file,file permissions,prop name,prop type,prop list,1_value,1_encoding,1_permissions,1_comment,2_value,2_encoding,2_permissions,2_comment,3_value,3_encoding,3_permissions,3_comment,4_value,4_encoding,4_permissions,4_comment, ,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
person_0,:Person,Homer,,,1999-12-31T23:59:59.9999999+01:00,res-default,,,,,,,,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,:hasName,text-prop,,Homer,utf8,prop-default,,Ὅμηρος,utf8,prop-default,,??,utf8,prop-default,,-,utf8,prop-default,,,, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,:hasIdentifier,uri-prop,,https://en.wiktionary.org/wiki/Ῥόδος,,prop-default,,https://www.test-case.ch/,,prop-default,,https://reg-exr.com:3000,,prop-default,,https://reg-exr.com:3000/path/to/file_(%C3%89).htm,,prop-default,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,:hasIdentifier,uri-prop,,https://en.wiktionary.org/wiki/Ῥόδος,,prop-default,,https://digiliblt.uniupo.it/xtf/view?docId=dlt000521/dlt000521.xml;query=De%20taxone;brand=default,,prop-default,,https://reg-exr.com:3000,,prop-default,,https://reg-exr.com:3000/path/to/file_(%C3%89).htm,,prop-default,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,:hasExternalLink,uri-prop,,"https://reg-exr.com:3000/path/to/file#fragment,fragment",,prop-default,,https://reg-exr.com:3000/path/to/file?query=test,,prop-default,,https://reg-exr.com:3000/path/to/file?query=test#fragment,,prop-default,,https://reg-exr.com/path/to/file?query=test#fragment,,prop-default,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,:hasAnotherLink,uri-prop,,http://www.168.1.1.0/path,,prop-default,,http://www.168.1.1.0:4200/path,,prop-default,,http://[2001:0db8:0000:0000:0000:8a2e:0370:7334]:4200/path,,prop-default,,https://en.wikipedia.org/wiki/Haiku#/media/File:Basho_Horohoroto.jpg,,prop-default,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,:hasThirdLink,uri-prop,,http://datypic.com/prod.html#shirt,,prop-default,,https://www.findagrave.com/memorial/171722836/krikor-madenician?_gl=1*100n0s5*_ga*NzIzMDQxNjc2LjE2Mjg2MDk1OTQ.*_ga_4QT8FMEX30*MTY1Mjc5OTI4OC4xNC4xLjE2NTI4MDA2MDQuMA..,,prop-default,,https://markarslan.org/ArmenianImmigrants/Public-ViewDetail-ArmenianImmigrants-Main.php?submit=View&Staging=&SourcePage=Public-ViewSummary-ArmenianImmigrants-Main-ByDestinationDate&SelectDestinationYear=1907&SelectLastNameStd=all&argument1=PLIN-29NOV1907-3-73-0018,,prop-default,,http://markarslan.org/ArmenianImmigrants/Public-ViewDetail-ArmenianImmigrants-Main.php?submit=View&Staging=&SourcePage=Public-ViewSummary-ArmenianImmigrants-Main-ByDestinationDate&SelectDestinationYear=1907&SelectLastNameStd=all&argument1=CRTH-12JAN1907-3-%404-0016,,prop-default,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Expand Down
Binary file modified testdata/excel2xml/excel2xml-testdata.xls
Binary file not shown.
Binary file modified testdata/excel2xml/excel2xml-testdata.xlsx
Binary file not shown.
1 change: 1 addition & 0 deletions testdata/xml-data/test-data-systematic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
<uri permissions="prop-restricted">https://www.ancestry.com/discoveryui-content/view/47577828:60525?ssrc=pt&amp;tid=109007397&amp;pid=410070328478</uri>
<uri permissions="prop-restricted">https://geohack.toolforge.org/geohack.php?pagename=Adige&amp;params=45_8_59_N_12_19_13_E_type:river</uri>
<uri permissions="prop-restricted">https://www.digitale-sammlungen.de/de/view/bsb00055375?page=,1</uri>
<uri permissions="prop-restricted">https://digiliblt.uniupo.it/xtf/view?docId=dlt000521/dlt000521.xml;query=De%20taxone;brand=default</uri>
</uri-prop>
<date-prop name=":hasDate">
<date>JULIAN:BCE:0700:BCE:0600</date>
Expand Down