query-5c537c7d51414534a3b6fbc28d4ee149

rq turtle/ttl

Directions and Opinions

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/>
SELECT ?item (SUBSTR(?published1, 1, 4) as ?published) ?title WHERE {  
  VALUES ?iczn {wd:Q6130489 wd:Q31205884 wd:Q15759939} . # Q6130489 = Smithsonian Miscellaneous Collections, Q31205884 = Opinions and declarations, Q15759939 = Bulletin of Zoological Nomenclature
  ?item wdt:P1433 ?iczn .  
  OPTIONAL {?item wdt:P577 ?published1} .
  OPTIONAL {?item wdt:P1476 ?title} . 
  OPTIONAL {?item wdt:P687 ?bhlPage} .   
  BIND(strbefore(?title, " ") as ?type)
  BIND(strafter(?title, " ") as ?tmp)
  BIND(strbefore(?tmp, " ") as ?number)
  BIND(replace(?number, "\\.", "") AS ?number)
  BIND(replace(?number, ":", "") AS ?number)
  BIND(replace(?number, ",", "") AS ?number)
  FILTER (xsd:string(?type) = "Opinion" || xsd:string(?type) = "Direction")
  FILTER (isNumeric(xsd:integer(?number)))
}
ORDER BY ASC(?type) ASC(xsd:integer(?number))

Query found at