query-0bdb0a505ec55194d695c9f81b4cfe2b

rq turtle/ttl

TODO it can run in less than a second. The first query should be able to perform just as well. Can anybody help write a query using ?title_sv to be as fast as the second query? Then that is done, the real goal is to use the same methods to rewrite the query below where ?title_sv comes from a WMAPI search in svwiki. The search at svwiki only has 26 results, but the query always times out:

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?title ?title_sv ?article_sv ?item
WHERE 
{
  SERVICE wikibase:mwapi
  {
    bd:serviceParam wikibase:api "Search" .
    bd:serviceParam wikibase:endpoint "sv.wikipedia.org" .
    bd:serviceParam mwapi:srnamespace "0" .
    bd:serviceParam mwapi:srsearch 'deepcat:"Pargas (kommun)"' .
    ?title wikibase:apiOutput mwapi:title .
  }

  BIND (STRLANG(?title, "sv") AS ?title_sv)
  ?article_sv schema:name ?title_sv.
  ?article_sv schema:about ?item.
  ?article_sv schema:isPartOf <https://sv.wikipedia.org/>.
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?article_sv"):::projected v4("?item"):::projected v1("?title"):::projected v2("?title_sv"):::projected c10(["deepcat:"Pargas (kommun)""]):::literal c6(["sv.wikipedia.org"]):::literal c8(["0"]):::literal c2(["bd:serviceParam"]):::iri c4(["Search"]):::literal c12(["mwapi:title"]):::iri c16([https://sv.wikipedia.org/]):::iri subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c2 --"mwapi:api"--> c4 c2 --"mwapi:endpoint"--> c6 c2 --"mwapi:srnamespace"--> c8 c2 --"mwapi:srsearch"--> c10 v1 --"mwapi:apiOutput"--> c12 end bind0[/"STRLANG(?title,'sv')"/] v1 --o bind0 bind0 --as--o v2 v3 --"schema:name"--> v2 v3 --"schema:about"--> v4 v3 --"schema:isPartOf"--> c16