[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Make wkt literal matching more lenient
Lucas Werkmeister (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/361204 ) Change subject: Make wkt literal matching more lenient .. Make wkt literal matching more lenient I haven’t been able to find a standard document on this (GeoSPARQL [1] only specifies that a geo:wktLiteral contains a WKT String according to ISO 191215-1, which is not freely available), but the http://linkedgeodata.org/sparql service (which is part of the federation whitelist) spells these literals all uppercase, i.e. POINT(1 2), so it seems that the Point should be matched case-insensitively. The same endpoint also contains other kinds of literals, e. g. LINESTRING, so we should also not assume that the regular expression will always match, and instead handle the non-matching case more gracefully. [1]: http://www.opengeospatial.org/standards/geosparql Change-Id: I7ceb1b94a68228ba94733ec86017218966b4f152 --- M wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui refs/changes/04/361204/1 diff --git a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js index 87218e8..e753556 100644 --- a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js +++ b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js @@ -292,9 +292,13 @@ return null; } - point = point.match( /Point\((.*)\)/ ).pop(); + var match = point.match( /Point\((.*)\)/i ); - return point.split( ' ' ); + if ( !match ) { + return null; + } + + return match.pop().split( ' ' ); }; /** -- To view, visit https://gerrit.wikimedia.org/r/361204 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7ceb1b94a68228ba94733ec86017218966b4f152 Gerrit-PatchSet: 1 Gerrit-Project: wikidata/query/gui Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikidata...gui[master]: Make wkt literal matching more lenient
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361204 ) Change subject: Make wkt literal matching more lenient .. Make wkt literal matching more lenient I haven’t been able to find a standard document on this (GeoSPARQL [1] only specifies that a geo:wktLiteral contains a WKT String according to ISO 191215-1, which is not freely available), but the http://linkedgeodata.org/sparql service (which is part of the federation whitelist) spells these literals all uppercase, i.e. POINT(1 2), so it seems that the Point should be matched case-insensitively. The same endpoint also contains other kinds of literals, e. g. LINESTRING, so we should also not assume that the regular expression will always match, and instead handle the non-matching case more gracefully. [1]: http://www.opengeospatial.org/standards/geosparql Change-Id: I7ceb1b94a68228ba94733ec86017218966b4f152 --- M wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Jonas Kress (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js index 87218e8..e753556 100644 --- a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js +++ b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js @@ -292,9 +292,13 @@ return null; } - point = point.match( /Point\((.*)\)/ ).pop(); + var match = point.match( /Point\((.*)\)/i ); - return point.split( ' ' ); + if ( !match ) { + return null; + } + + return match.pop().split( ' ' ); }; /** -- To view, visit https://gerrit.wikimedia.org/r/361204 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ceb1b94a68228ba94733ec86017218966b4f152 Gerrit-PatchSet: 1 Gerrit-Project: wikidata/query/gui Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) Gerrit-Reviewer: Jonas Kress (WMDE) Gerrit-Reviewer: Smalyshev Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits