Module:Witkacy table row/doc
This is custom Lua code used for generating the table in pl:Lista dzieł malarskich Stanisława Ignacego Witkiewicza.
The way to use this code is to:
- run the query below
- Fill a spreadsheet with
- A2=Q-code from above query
- B2=CONCATENATE("{{subst:User:Jarekt/witkacy row|",A2,"}}")
- C2=C1+1/490
- D2=ROUND(C2-0.5,0)
- use blank user page and add
{{subst:User:Jarekt/witkacy row|header}}
|}
to it. Than copy content of column B from the spreadsheet, 500 rows at a time, and paste into the table.
- the resulting table should have valid wikitekt ready for use on Polish Wikipedia
query
SELECT ?item WHERE {
?item wdt:P170 wd:Q381238 . # Witkacy as creator
MINUS{ ?item wdt:P31 wd:Q3658341 .} # no literary characters
MINUS{ ?item wdt:P31 wd:Q125191 .} # no photographs
optional{ ?item p:P528 [ pq:P972 wd:Q106425660; ps:P528 ?kdm] . }
optional{ ?item wdt:P156/wdt:P528 ?prev .}
optional{ ?item wdt:P155/wdt:P528 ?next .}
bind( if( bound(?kdm) && strStarts(str(?kdm), "I "), CONCAT(STR( ?kdm ), ".5"),
if( bound(?next), CONCAT(STR( ?next ), ".9"),
if( bound(?prev), CONCAT(STR( ?prev ), ".1"),
"Z") ) ) as ?kdmn ) .
OPTIONAL {
?item rdfs:label ?Len
FILTER((LANG(?Len)) = "en")
}
filter (?item!=wd:Q107095853)
} order by ?kdmn