query-b570897df630fc7017bb66a0e0d450b5
New WDQS opportunitiesAfter a recent update WDQS became a new way to find incorrect sitelinks. This query:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?count ?name ?sitelink {
VALUES (?lang ?regex) {
#('cs' 'rozcestník|příjmení')
#('de' 'Begriffsklärung|Wegweiser')
#('en' 'disambiguation|name')
('vi' 'định hướng|đổi hướng')
} .
?item wdt:P31 wd:Q4167410; ^schema:about ?sitelink .
?sitelink schema:inLanguage ?lang; schema:name ?name .
FILTER ( STRENDS ( STR( ?name ), ')' ) ) .
FILTER ( !REGEX( STRBEFORE( STRAFTER( STR( ?name ), '(' ), ')' ), ?regex ) ) .
OPTIONAL { ?item wikibase:sitelinks ?count } .
} LIMIT 50
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?count"):::projected
v4("?item"):::projected
v3("?lang")
v1("?name"):::projected
v4("?regex")
v5("?sitelink"):::projected
c4(["wd:Q4167410"]):::iri
f0[["not regex(substring-before(substring-after(str(?name),'('),')'),?regex)"]]
f0 --> v1
f0 --> v4
f1[["ends-with(str(?name),')')"]]
f1 --> v1
bind2[/VALUES ?lang ?regex/]
bind2-->v3
bind2-->v4
bind20(["vi"])
bind20 --> bind2
bind21(["định hướng|đổi hướng"])
bind21 --> bind2
v4 --"wdt:P31"--> c4
v5 --"schema:about"--> v4
v5 --"schema:inLanguage"--> v3
v5 --"schema:name"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wikibase:sitelinks".-> v6
end