Page MenuHomePhabricator

Add API to return violations in TTL (turtle) format
Closed, ResolvedPublic

Description

We should add API which will return RDF (probably TTL) data in the following format:

wds:Q43$66E13CA3-37CB-4B14-9F53-311D9C91D822 wikibase:hasViolationForConstraint wds:P17$a02094d5-46fc-bb86-81d1-21cfea688dfe .
wds:q43$43124bad-4210-425f-5a0f-56e86c922055 wikibase:hasViolationForConstraint wds:P17$f2713cbe-499d-36e8-0a3a-c275a356b659 .

etc. etc. for each constraint violation. The left side is the statement violating the constraint, the right side is the statement on property that defines the constraint.

So far the easiest way seems to be to add action API, e.g.: https://wikidata-constraints.wmflabs.org/index.php/Item:Q5?action=constraintsrdf

Details

Related Gerrit Patches:
mediawiki/extensions/WikibaseQualityConstraints : masterExport constraint check results to RDF

Event Timeline

Lucas_Werkmeister_WMDE triaged this task as Medium priority.May 15 2018, 2:07 PM
Lucas_Werkmeister_WMDE created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 15 2018, 2:07 PM
Smalyshev moved this task from Backlog to Doing on the User-Smalyshev board.May 18 2018, 12:35 PM
Smalyshev updated the task description. (Show Details)

Tricky part here may be that wbcheckconstraints is an API module, and make it return TTL may be non-trivial. We could of course wrap it inside JSON but that looks just wrong. Maybe we should use something like ?action=rdfConstraints instead?

Smalyshev updated the task description. (Show Details)May 19 2018, 12:24 PM
Smalyshev renamed this task from Add wbcheckconstraints parameter to return violations in TTL (turtle) format to Add API to return violations in TTL (turtle) format.May 19 2018, 12:27 PM
Smalyshev updated the task description. (Show Details)

Question: should we have different predicates for different types of violations, like mandatory, warning, etc.?

No, that can be inferred from the constraint statement itself (whether it has a “constraint status: mandatory constraint” or not).

Change 433964 had a related patch set uploaded (by Smalyshev; owner: Smalyshev):
[mediawiki/extensions/WikibaseQualityConstraints@master] [WIP] [DNM] Export constraint check results to RDF

https://gerrit.wikimedia.org/r/433964

Smalyshev moved this task from Doing to Next on the User-Smalyshev board.May 29 2018, 7:49 PM

The patch has DNM and WIP in it. Is it should stay in "needs review" column of MOM board?

I think the patch is a lot less WIP now – it still has one TODO as far as I recall (select output format), but apart from that I think it could be ready. Good enough to review at least, IMHO, and see what others think.

I'll update it soon, just didn't have time to look into it yet.

Change 433964 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Export constraint check results to RDF

https://gerrit.wikimedia.org/r/433964

This is very cool to find existing constraint violations! A great next step would be a service to test if a not yet existing statement would raise any violations! Is there a ticket for the constraint API to test not yet existing statements?

Lea_Lacroix_WMDE closed this task as Resolved.Jun 11 2018, 2:49 PM
Lea_Lacroix_WMDE moved this task from Test (Verification) to Done on the Wikidata-Campsite board.
Lea_Lacroix_WMDE added a subscriber: Lea_Lacroix_WMDE.

Closed on behalf of Lydia

Vvjjkkii renamed this task from Add API to return violations in TTL (turtle) format to 9wcaaaaaaa.Jul 1 2018, 1:10 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Lucas_Werkmeister_WMDE as the assignee of this task.
Vvjjkkii raised the priority of this task from Medium to High.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from 9wcaaaaaaa to Add API to return violations in TTL (turtle) format.Jul 2 2018, 5:18 AM
CommunityTechBot closed this task as Resolved.
CommunityTechBot lowered the priority of this task from High to Medium.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.