query-2416888bd5de31c4723dd4c46d4ddecb

rq turtle/ttl

Will -main be faster ]reply[14:05, 4 September 2024 (UTC)) talk (VicarageIf I switch to -main, will it be faster, both by design and because of fewer requests? Happy to be a guinea pig! ]reply[18:33, 4 September 2024 (UTC)) talk (GLederrey (WMF) -main might be marginally faster, both because it is likely to have less requests (at least until everyone migrates to it) and less data. Response times are not what we are trying to optimising for, I suspect that performance improvements are going to be marginal. Also, we're going to move servers around once -main starts getting more traffic, so that load on the various servers equalize. We will keep an eye on performance, but since the query load will be different on each endpoint, comparison are not going to be easy. Thanks a lot for being a willing guinea pig! That is most helpful! Note that those endpoints are brand new, we might find a few bumps on the way. Please let us know if anything does not work as expected.times in seconds for a series of related runs old 13.37 18.74 7.17 61.01 105.88 -main 8.21 8.23 5.35 35.92 33.13 But -main returns 9591 items when the original returns 9608 in one area. Do you expect the results to be different? ]reply[13:13, 5 September 2024 (UTC)) talk (GLederrey (WMF) It all depends on the query. If the query does not depend on the scholarly graph, the results should be identical on the full or main graph. Could you share the query you are using in your tests?No scholarly stuff in this, but I'm afraid I can't do more debugging, as I'm off on holiday.

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?label ?item ?itemDescription ?extra ?modified WHERE {
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en,mul,fr,de,es,pt,pl,nl,cs". } 
  { SELECT DISTINCT ?item (GROUP_CONCAT(DISTINCT ?extralist; SEPARATOR = "#") AS ?extra) 
  (GROUP_CONCAT(DISTINCT ?officialnamelist; SEPARATOR = " / ") AS ?officialname) ?item_label ?modified WHERE { 
    SELECT DISTINCT ?item ?extralist ?officialnamelist ?item_label ?modified WHERE { 
?item wdt:P31/wdt:P279* wd:Q177597. # naval vessel 
MINUS { 
    {?item wdt:P31 wd:Q575727} # museum ship 
  UNION 
    {?item wdt:P366 wd:Q575727} 
} 
?item wdt:P137 ?navy. ?navy wdt:P17 wd:Q30. 
        ?item schema:dateModified ?modified . 
        FILTER(BOUND(?modified) && DATATYPE(?modified) = xsd:dateTime). 
        OPTIONAL {?item wdt:P1448 ?officialnamelist. FILTER (LANG(?officialnamelist) = "mul")} 
        ?item rdfs:label ?item_label. FILTER (LANG(?item_label) = "en") 
        OPTIONAL { 
                {?item wdt:P31  ?extra} # instance 
          UNION {?item wdt:P279 ?extra} # subclass 
          UNION {?item wdt:P17  ?extra} # country 
          UNION {?item wdt:P27  ?extra} # country of citizenship 
          UNION {?item wdt:P495 ?extra} # country of origin 
          UNION {?item wdt:P710 ?extra} # participant 
          UNION {?item wdt:P137 ?operator. ?operator wdt:P17 ?extra} # operator 
          ?extra rdfs:label ?extralist. FILTER (LANG(?extralist) = "en") 

        }  
      } 
      ORDER BY ASC(?item_label) ASC(?extralist) 
    } 
    GROUP BY ?item ?item_label ?modified 
    ORDER BY ASC(?item_label) 
  } 
  BIND(IF(?officialname = "",?item_label,?officialname) AS ?label) 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?extra"):::projected v2("?extralist") v5("?item"):::projected v1("?item_label") v10("?label"):::projected v3("?modified"):::projected v6("?navy") v9("?officialname") v4("?officialnamelist") v8("?operator") a1((" ")) c4(["en-GB,en,mul,fr,de,es,pt,pl,nl,cs"]):::literal c15(["wd:Q30"]):::iri c2(["bd:serviceParam"]):::iri c11(["wd:Q575727"]):::iri c10(["wd:Q177597"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end f0[["?item_label = 'en'"]] f0 --> v1 f1[["bound(?modified)?modified = 'xsd:dateTime'"]] f1 --> v3 v5 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c10 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P366"--> c11 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P31"--> c11 end union0r <== or ==> union0l end end v5 --"wdt:P137"--> v6 v6 --"wdt:P17"--> c15 v5 --"schema:dateModified"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."wdt:P1448".-> v4 end v5 --"rdfs:label"--> v1 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; subgraph union6[" Union "] subgraph union6l[" "] style union6l fill:#abf,stroke-dasharray: 3 3; v5 -."wdt:P137".-> v8 v8 --"wdt:P17"--> v9 end subgraph union6r[" "] style union6r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P710"--> v9 end union6r <== or ==> union6l end end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P495"--> v9 end union5r <== or ==> union5l end end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P27"--> v9 end union4r <== or ==> union4l end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P17"--> v9 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P279"--> v9 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P31"--> v9 end union1r <== or ==> union1l end v9 --"rdfs:label"--> v2 end bind5[/"?extralist"/] v2 --o bind5 bind5 --as--o v9 bind6[/"?officialnamelist"/] v4 --o bind6 bind6 --as--o v9 bind7[/"if(?officialname = '',?item_label,?officialname)"/] v9 --o bind7 v1 --o bind7 bind7 --as--o v10