query-fc38af907b29fe91865c0e3ddb9be9c7

rq turtle/ttl

Find title by volume, issue and page SELECT ?item (SUBSTR(?published1, 1, 10) as ?published) ?title ?volume ?issue ?pages WHERE {
?item wdt:P1433 wd:Q2003024 . # Taxon BIND("26" as ?volume) . #BIND("2-3" as ?issue) . BIND("326" as ?page) . BIND("1977" as ?year) . OPTIONAL {?item wdt:P577 ?published1} . OPTIONAL {?item wdt:P1476 ?title} .
?item wdt:P478 ?volume . ?item wdt:P433 ?issue . ?item wdt:P304 ?pages0 . BIND(REPLACE(?pages0, "-", "–") AS ?pages) BIND(if(contains(?pages, "–"), strbefore(?pages, "–"), ?pages) as ?startpage) BIND(if(contains(?pages, "–"), strafter(?pages, "–"), ?pages) as ?endpage) FILTER (xsd:integer(?page) >= xsd:integer(?startpage) && xsd:integer(?page) <= xsd:integer(?endpage)) FILTER (Year(?published1) = xsd:integer(?year)) } ORDER BY ASC(?published) ASC(xsd:integer(?issue)) ASC(xsd:integer(?startpage))

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
# Find title by volume, issue and page
SELECT ?item (SUBSTR(?published1, 1, 10) as ?published) ?title ?volume ?issue ?pages WHERE {  
  ?item wdt:P1433 wd:Q2003024 .  # Taxon
  BIND("26" as ?volume) .
  #BIND("2-3" as ?issue) .
  BIND("326" as ?page) .
  BIND("1977" as ?year) .
  OPTIONAL {?item wdt:P577 ?published1} .
  OPTIONAL {?item wdt:P1476 ?title} .  
  ?item wdt:P478 ?volume .
  ?item wdt:P433 ?issue .
  ?item wdt:P304 ?pages0 . 
  BIND(REPLACE(?pages0, "-", "–") AS ?pages)
  BIND(if(contains(?pages,  "–"), strbefore(?pages, "–"), ?pages) as ?startpage)
  BIND(if(contains(?pages,  "–"), strafter(?pages, "–"), ?pages) as ?endpage)
  FILTER (xsd:integer(?page) >= xsd:integer(?startpage) && xsd:integer(?page) <= xsd:integer(?endpage)) 
  FILTER (Year(?published1) = xsd:integer(?year)) 
}
ORDER BY ASC(?published) ASC(xsd:integer(?issue)) ASC(xsd:integer(?startpage))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v13("?endpage") v2("?issue"):::projected v8("?item"):::projected v10("?page") v12("?pages"):::projected v11("?pages0") v13("?published") v4("?published1"):::projected v13("?startpage") v10("?title"):::projected v9("?volume"):::projected v10("?year") c2(["wd:Q2003024"]):::iri f0[["year-from-dateTime(?published1) = http://www.w3.org/2001/XMLSchema#integer(?year)"]] f0 --> v4 f0 --> v10 f1[["http://www.w3.org/2001/XMLSchema#integer(?page) >= http://www.w3.org/2001/XMLSchema#integer(?startpage)http://www.w3.org/2001/XMLSchema#integer(?page) <= http://www.w3.org/2001/XMLSchema#integer(?endpage)"]] f1 --> v10 f1 --> v13 f1 --> v13 v8 --"wdt:P1433"--> c2 bind2[/"'26'"/] bind2 --as--o v9 bind3[/"'326'"/] bind3 --as--o v10 bind4[/"'1977'"/] bind4 --as--o v10 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v8 -."wdt:P577".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v8 -."wdt:P1476".-> v10 end v8 --"wdt:P478"--> v9 v8 --"wdt:P433"--> v2 v8 --"wdt:P304"--> v11 bind5[/"replace(?pages0,'-','–')"/] v11 --o bind5 bind5 --as--o v12 bind6[/"if(contains(?pages,'–'),substring-before(?pages,'–'),?pages)"/] v12 --o bind6 bind6 --as--o v13 bind7[/"if(contains(?pages,'–'),substring-after(?pages,'–'),?pages)"/] v12 --o bind7 bind7 --as--o v13 bind8[/"substring(?published1,'1^^xsd:integer','10^^xsd:integer')"/] v4 --o bind8 bind8 --as--o v13