Module talk:Constraints/SPARQL
Jump to navigation
Jump to search
Try it!
WDQS intergration[edit]
Constraints have just been integrated into WDQS: mw:Wikibase/Indexing/RDF_Dump_Format#Constraints. Matěj Suchánek (talk) 07:11, 31 July 2018 (UTC)
- Thanks for the note. Interesting. I "just" tried to query them ;)
BTW, I'd still keep the other queries.
--- Jura 07:32, 31 July 2018 (UTC) - Nice. It starts loading.
--- Jura 22:58, 31 July 2018 (UTC) - Any idea where this went? I can't even find the announcement on Project Chat any more. Currently there are still just 60050 wikibase:hasViolationForConstraint triples. Maybe the query should be removed from the templates in the meantime.
--- Jura 16:39, 18 August 2018 (UTC)- You mean Wikidata:Project chat/Archive/2018/08#You can now query the constraint violations with the Query Service? Matěj Suchánek (talk) 17:27, 18 August 2018 (UTC)
- Odd. How could I miss it. Looks like they gave up on it https://phabricator.wikimedia.org/T201147
--- Jura 17:37, 18 August 2018 (UTC) - Added a monitor at Help:Property constraints portal/numbers/WQS.
--- Jura 15:31, 19 August 2018 (UTC)
- Odd. How could I miss it. Looks like they gave up on it https://phabricator.wikimedia.org/T201147
- You mean Wikidata:Project chat/Archive/2018/08#You can now query the constraint violations with the Query Service? Matěj Suchánek (talk) 17:27, 18 August 2018 (UTC)
- @Matěj Suchánek: finally, it has about 0.5 million triples. I wonder how close it is to actually work? --- Jura 09:53, 13 March 2020 (UTC)
- The constraints exposed as RDF are not yet updated regularly. Added Phabricator ticket to track --Vladimir Alexiev (talk) 06:47, 13 September 2021 (UTC)
tweak queries to return offending value not offending statement[edit]
@Lockal, Matěj Suchánek, Tacsipacsi, Pasleim, Zolo, Jura1: (I posted this on Phabricator but the issue was closed as invalid, and I agree it's more appropriate to discuss it here).
- The SPARQL queries that expose constraint violations return the offending statement.
- But the statement URL is opaque: it's more useful to return the offending value (eg one can use it to generate a QS script to remove offending values).
Eg for P2088 Distinct Values, I think we should change SPARQL (new) to this:
# Note: before https://phabricator.wikimedia.org/T201150 is fixed, the result will only be partial
SELECT DISTINCT ?item ?itemLabel ?value WHERE {
?statement wikibase:hasViolationForConstraint wds:P2088-DD4CDCEA-B3F6-4F02-9CFB-4A9E312B73A8 .
?item p:P2088 ?statement .
?statement ps:P2088 ?value.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } .
}
Do you agree with such change? If so, I can make it at https://www.wikidata.org/wiki/Module:Constraints/SPARQL#L-768
--Vladimir Alexiev (talk) 06:52, 13 September 2021 (UTC)
- It's fine by me. But phab:T274982 is still open. --Matěj Suchánek (talk) 09:55, 13 September 2021 (UTC)
- @Vladimir Alexiev: Ok for me, as far as I'm concerned you can added improvements directly. Help:Property constraints portal/numbers/WQS is still quite low.
- Maybe @MusikAnimal: wants to added something, as they seem to prefer that only admins edit it. --- Jura 09:24, 14 September 2021 (UTC)
- I don't recall saying that? Wikidata:Requests for permissions/Bot/MusikBot II has been withdrawn. You can stop harassing me now. Thanks, — MusikAnimal talk 18:45, 14 September 2021 (UTC)
Type constraint with relation instance or subclass of (Q30208840)[edit]
Please check out this thread. Horcrux (talk) 12:08, 2 February 2024 (UTC)