User:Jarekt/Witkacy queries
Jump to navigation
Jump to search
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
Try it!
KDM+dates[edit]
SELECT ?item (YEAR(?date) as ?year) (MONTH(?date) as ?month) (DAY(?date) as ?day) ?dateprecision ?KDM WHERE {
?item wdt:P170 wd:Q381238 .
MINUS{ ?item wdt:P31 wd:Q3658341 .}
optional{
?item p:P571/psv:P571 ?timenode .
?timenode wikibase:timeValue ?date.
?timenode wikibase:timePrecision ?dateprecision.
}
optional{ ?item p:P528 [ pq:P972 wd:Q106425660; ps:P528 ?KDM] . }
}
order[edit]
SELECT ?item ?Len ?kdm ?kdmn 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
qid-KDM-img[edit]
SELECT ?item ?KDM ?img WHERE {
?item wdt:P170 wd:Q381238 .
?item p:P528 [ pq:P972 wd:Q106425660; ps:P528 ?KDM] .
optional{ ?item wdt:P18 ?img. }
} order by ?KDM
Prace Witkacego opublikowane w Przekroju[edit]
#defaultView:ImageGrid
SELECT ?item ?number ?data ?Lpl ?img WHERE {
?item wdt:P170 wd:Q381238 .
?item p:P1433 [ ps:P1433 wd:Q2114540; pq:P433 ?number ; pq:P577 ?data] .
OPTIONAL {
?item rdfs:label ?Lpl
FILTER((LANG(?Lpl)) = "pl")
}
optional{ ?item wdt:P18 ?img. }
} order by ?number
images[edit]
small images[edit]
# Federation with correlation - Get height and width for Commons images
# Run this from WCQS - https://commons-query.wikimedia.org/
SELECT ?item ?page ?image ?file ?width ?height
WHERE {
hint:Query hint:optimizer "None" .
SERVICE <https://query.wikidata.org/sparql> {
?item p:P1433 [ ps:P1433 wd:Q113870515; pq:P304 ?page_ ] ;
wdt:P18 ?image .
BIND(xsd:integer(?page_) as ?page) .
}
?file schema:url ?image ;
schema:height ?height ;
schema:width ?width .
}
ORDER BY (?width * ?height)
no images[edit]
SELECT ?item ?itemLabel ?date ?collectionLabel WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P571 ?date .
optional{ ?item wdt:P195 ?collection . }
MINUS{ ?item wdt:P31 wd:Q3658341 .} # no literary characters
MINUS{ ?item wdt:P18 ?img . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl,pl" }
}
items without images[edit]
SELECT ?item ?itemLabel ?date ?collectionLabel WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P571 ?date .
optional{ ?item wdt:P195 ?collection . }
MINUS{ ?item wdt:P31 wd:Q3658341 .} # no literary characters
MINUS{ ?item wdt:P18 ?img . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl,pl" }
}
museum pieces without image[edit]
SELECT ?item ?itemLabel ?collectionLabel ?id ?kdm WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P195 ?collection .
minus {?collection wdt:P31 wd:Q768717 }
optional{?item wdt:P217 ?id . }
optional{ ?item p:P528 [ pq:P972 wd:Q106425660; ps:P528 ?kdm] . }
MINUS{ ?item wdt:P18 [] . }
FILTER (!wikibase:isSomeValue(?collection))
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl,pl" }
} order by ?collection
missing fields[edit]
missing collection[edit]
SELECT ?item ?img ?KDM ?collection WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P18 ?img .
minus{ ?item wdt:P195 ?collection . }
minus{ ?item p:P528 [ pq:P972 wd:Q106425660; ps:P528 ?KDM] . }
} order by ?KDM
missing P31=pastel[edit]
SELECT ?item ?itemLabel ?img WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P186 wd:Q189085 .
?item wdt:P18 ?img .
MINUS{ ?item wdt:P31 wd:Q12043905 .}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}
missing en descriptions[edit]
SELECT ?item (YEAR(?date) as ?year) ?KDM ?itemDescription WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P186 wd:Q189085 .
?item wdt:P571 ?date .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
optional{ ?item p:P528 [ pq:P972 wd:Q106425660; ps:P528 ?KDM] . }
}
copyright status[edit]
SELECT ?item WHERE {
?item wdt:P170 wd:Q381238 .
MINUS{ ?item wdt:P31 wd:Q3658341 .}
#minus{ ?item wdt:P6216 wd:Q19652 }.
?item p:P6216 ?statement .
FILTER NOT EXISTS { ?statement pq:P1001 [] } # exclude if P1001 present
#FILTER NOT EXISTS { ?statement pq:P459 [] } # exclude if P459 present
}
other[edit]
signature with "|"[edit]
SELECT ?item ?ins WHERE {
?item wdt:P170 wd:Q381238.
?item wdt:P1684 ?ins .
FILTER (contains(str(?ins), "|" ))
}
genre[edit]
SELECT ?item ?genre ?itemLabel WHERE {
?item wdt:P170 wd:Q381238 .
optional{ ?item wdt:P136 ?genre . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
collection->location[edit]
SELECT ?item ?collection ?loc WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P195 ?collection .
minus{ ?item wdt:P276 ?loc . }
}
main subject[edit]
SELECT ?item ?itemLabel WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P136 wd:Q134307 .
minus {?item wdt:P921 ?depicts . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
copy main subject based on label[edit]
SELECT ?label ?subject1Label ?item2 ?subject1 WHERE {
?item1 wdt:P170 wd:Q381238 .
?item2 wdt:P170 wd:Q381238 .
?item1 wdt:P921 ?subject1 .
minus{ ?item2 wdt:P921 ?subject2 . }
?item1 rdfs:label ?label .
FILTER(LANG(?label) = 'pl') .
FILTER(?subject1 != wd:Q381238) .
?item2 rdfs:label ?label .
FILTER(LANG(?label) = 'pl') .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
Same KDM[edit]
SELECT ?item1 ?item2 ?id WHERE {
?item1 wdt:P170 wd:Q381238 .
?item2 wdt:P170 wd:Q381238 .
?item1 wdt:P528 ?id.
?item2 wdt:P528 ?id.
FILTER(?item1 != ?item2) .
FILTER(strlen(?id)<=6) .
}
publications with Witkacy artworks[edit]
SELECT ?pub ?pubLabel (count(?item) as ?count) WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P1433 ?pub.
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl" }
} group by ?pub ?pubLabel
order by ?count
osoby portretowane[edit]
SELECT ?person ?personLabel (count(?item) as ?count) WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P921 ?person.
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl" }
} group by ?person ?personLabel
order by desc(?count)
survey significant events[edit]
SELECT ?event ?eventLabel (count(?item) as ?count) (SAMPLE(?item) as ?sampleitem) WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P793 ?event .
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl,pl" }
} group by ?event ?eventLabel
bad significant events[edit]
SELECT ?item WHERE {
?item wdt:P170 wd:Q381238 .
?item p:P793 ?statement .
?statement pq:P585 ?date1.
?statement pq:P585 ?date2.
Filter (?date1 > ?date2).
}
SELECT ?item WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P793 wd:Q9209474 .
}
survey medium[edit]
SELECT ?med ?medLabel (count(?item) as ?count) (SAMPLE(?item) as ?sampleitem) WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P186 ?med .
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl,pl" }
} group by ?med ?medLabel
self-portraits / autoportrety[edit]
SELECT ?item ?KDM ?Lpl ?img WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P136 wd:Q192110 .
OPTIONAL {
?item rdfs:label ?Lpl
FILTER((LANG(?Lpl)) = "pl")
}
optional{ ?item p:P528 [ pq:P972 wd:Q106425660; ps:P528 ?KDM] . }
optional{ ?item wdt:P18 ?img. }
minus{ ?item wdt:P31 wd:Q125191 }
} order by ?KDM
auctions[edit]
auction houses[edit]
SELECT ?loc ?locLabel (count(?item) as ?count) (SAMPLE(?item) as ?sampleitem) WHERE {
?item wdt:P170 wd:Q381238 .
?item p:P793 ?statement .
?statement pq:P276 ?loc.
?statement ps:P793 wd:Q177923
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl,pl" }
} group by ?loc ?locLabel
order by desc(?count)
auction house images by url[edit]
SELECT ?item ?img WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P973 ?url .
?item wdt:P18 ?img .
FILTER (STRSTARTS(STR(?url), "https://www.sda.pl"))
}
auction house images by q-id[edit]
SELECT ?item ?img WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P18 ?img .
?item p:P793 ?statement .
?statement pq:P276 wd:Q503176.
}
catalog auction results[edit]
SELECT ?item ?img ?locLabel ?date ?price WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P18 ?img .
?item p:P793 ?statement .
?statement pq:P276 ?loc.
?statement pq:P585 ?date.
optional{?statement pq:P2284 ?price.}
optional{?statement pq:P4775 ?lot.}
?statement ps:P793 wd:Q177923
SERVICE wikibase:label { bd:serviceParam wikibase:language "pl,pl" }
} order by desc(?date)
most frequently auctioned artworks[edit]
SELECT ?item (count(?item) as ?count) (SAMPLE(?img) as ?sampleimg) WHERE {
?item wdt:P170 wd:Q381238 .
?item wdt:P18 ?img .
?item p:P793 ?statement .
?statement ps:P793 wd:Q177923
} group by ?item
order by desc(?count)
jak często są prace na aukcjach[edit]
SELECT ?count_auctions_per_artwork (count(?item) as ?count_artworks) WHERE {
{SELECT ?item (count(?item) as ?count_auctions_per_artwork) WHERE {
?item wdt:P170 wd:Q381238 .
?item p:P793/ps:P793 wd:Q177923
} group by ?item }
} group by ?count_auctions_per_artwork
order by ?count_auctions_per_artwork
mean price per year[edit]
SELECT ?year (round(AVG(?price)) as ?mean) WHERE {
?item wdt:P170 wd:Q381238 .
?item p:P793 ?statement .
?statement pq:P585 ?date.
?statement pq:P2284 ?price.
FILTER ( ! wikibase:isSomeValue(?price))
BIND ( YEAR(?date) as ?year).
} group by ?year
order by ?year