Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P35183
check_T312256.sh
Active
Public
Actions
Authored by
Deniz_WMDE
on Sep 29 2022, 3:33 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F35540060: check_T312256.sh
Sep 29 2022, 3:33 PM
2022-09-29 15:33:15 (UTC+0)
Subscribers
None
#!/bin/bash
# A small test to see if a wikibase.cloud wiki is affected by this problem https://phabricator.wikimedia.org/T312256
# based on https://github.com/wbstack/mediawiki/pull/275#issuecomment-1231626832
#
# input parameter: wiki url
#
# no output means the query didn't find any problematic values
set
-euo pipefail
WIKI
=
"
$1
"
RESULT
=
$(
curl -s
"https://
$WIKI
/query/sparql?query=SELECT%20%3Fitem%20WHERE%20%7B%0A%20%20%3Fproperty%20wikibase%3ApropertyType%20%3Chttp%3A%2F%2Fwikiba.se%2Fontology%23Quantity%3E%20.%0A%20%20%3Fproperty%20wikibase%3AdirectClaim%20%3FdirectProperty%20.%0A%20%20%3Fitem%20%3FdirectProperty%20%3Fo%20.%0A%20%20%3Fvaluenode%20%20%20%20%20wikibase%3AquantityUnit%20%20%20%20%20%3Funit.%0A%20%20FILTER(CONTAINS(STR(%3Funit)%2C%20%22.wiki.opencura.com%22))%0A%7D%20LIMIT%2010"
)
CHECK
=
$(
echo
"
$RESULT
"
|
grep
"<binding name='item'>"
)
if
[[
! -z
"
$CHECK
"
]]
;
then
echo
"
$WIKI
is affected"
fi
Event Timeline
Deniz_WMDE
created this paste.
Sep 29 2022, 3:33 PM
2022-09-29 15:33:15 (UTC+0)
Log In to Comment