query-d26711cde97eef61ffe8573f578250c0

rq turtle/ttl

16:23, 1 January 2021 (UTC)) talk (Herzi Pinki (which I really want). Any hints on how to improve the performance? --(Q3391743)visual artist to (Q21148249)enameler It works for small sets of matches, but runs into timeout when e.g. changing from about the date queries.Wikidata:Request_a_query/Archive/2020/11#publications_from_a_particular_year_and_placeSee 20:18, 1 January 2021 (UTC)) talk (Herzi PinkiI was thinking that '&& regex(?firstnameLabel, ?firstnamePattern, "i") && regex(?lastnameLabel, ?lastnamePattern, "i")' will only evaluate the second condition, if and only if the first one evaluates to true. Is this correct (like in C)? -- ? This will be an ever growing problem as more and more data get put into wikidata.Wikidata does not scale wellYour last statement says: 18:52, 1 January 2021 (UTC)) talk (Dipsacus fullonum because there are too many (around 423900 distinct items) of these. --(Q3391743)visual artist : I would first filter for the least common initial in a new named subquery, and then for the other initial in another new named subquery, and then for the other conditions (years) in other subqueries. The goal would be to reduce the result set as fast as possible so you can avoid using time to process the last name and compare with the last name initial if first name doesn't match the first name initial, or inverse, and so on. But I doubt that timeout can be avoided even with the best possible optimization for Herzi Pinki@ 17:39, 1 January 2021 (UTC) Jura . --- hint:Prior hint:gearing "forward".After "?item wdt:P106/wdt:P279* wd:Q21148249" you might want to add 20:18, 1 January 2021 (UTC)) talk (Herzi PinkiThere is a tradeoff with artists still living. Who will not have a date of death. But date of birth should be optional too. --Possibly, year of death is more frequently available than date of birth. Some artists also have only work period specified. 20:18, 1 January 2021 (UTC)) talk (Herzi Pinkicommenting out '?firstname rdfs:label ?firstnameLabel' and the following (as ?firstnameLabel is predefined anyway), will be fast, but not return any result. I do not understand why this makes a difference, but it obviously does. --Instead of rdfs:label for the name, you might want to use the native label statement. : Herzi Pinki@

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT (COUNT(*) as ?count) 
{
    ?item wdt:P569 ?d1 ; wdt:P570 ?d2 . 

    FILTER( ?d1 < "1670-00-00"^^xsd:date
            && ?d2 > "1671-00-00"^^xsd:date )
    ?item wdt:P735 / wdt:P1705 ?nl0 . FILTER( REGEX(?nl0, "^J" ) )
    ?item wdt:P734 / wdt:P1705 ?nl1 . FILTER( REGEX(?nl1, "^B" ) )
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?count") v3("?d1") v4("?d2") v5("?item") v2("?nl0") v1("?nl1") a1((" ")) a2((" ")) f0[["regex(?nl1,'^B')"]] f0 --> v1 f1[["regex(?nl0,'^J')"]] f1 --> v2 f2[["?d1 < '1670-00-00^^xsd:date'?d2 > '1671-00-00^^xsd:date'"]] f2 --> v3 f2 --> v4 v5 --"wdt:P569"--> v3 v5 --"wdt:P570"--> v4 v5 --"wdt:P735"--> a1 a1 --"wdt:P1705"--> v2 v5 --"wdt:P734"--> a2 a2 --"wdt:P1705"--> v1 bind4[/"count(*)"/] bind4 --as--o v6