query-4c4822a3237c11f6e2241a95391b700c

rq turtle/ttl

Time and place of publicationMap of novels by publication year colored by period Т1: [1840-1859] blue, Т2: [1860-1879] orang, Т3: [1880-1899] green, Т4: [1900-1920] red

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#defaultView:Map
SELECT DISTINCT ?novel ?name ?pubplace ?pubyear ?coord ?layer ?image
WHERE {
  VALUES ?collection { wd:Q106936149 wd:Q109123373  }
  { ?novel wdt:P747 ?edition;
           wdt:P747 ?firsted.
    ?edition  wdt:P1433 ?collection.
    ?firsted wdt:P31 wd:Q10898227;
             wdt:P291 ?place. }
    ?place wdt:P625 ?coord.
  OPTIONAL {?firsted wdt:P577 ?dob.}
  OPTIONAL {?firsted  wdt:P18 ?image.}
  BIND(YEAR(?dob) AS ?pubyear)
  BIND(IF(?pubyear < 1839 , "-1840", IF(?pubyear < 1860 , "1840-1859", IF(?pubyear < 1880 , "1860-1879", IF(?pubyear < 1900 , "1880-1899", IF(?pubyear < 1921 , "1900-1920", "Post-1920"))))) AS ?layer)
  ?novel rdfs:label ?name.
  FILTER((LANG(?name)) = "sr")
  ?place rdfs:label ?pubplace.
  FILTER((LANG(?pubplace)) = "sr")
}
#sortiraj prema godini publikovanja
ORDER BY (?pubyear)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?collection") v9("?coord"):::projected v10("?dob") v6("?edition") v7("?firsted") v11("?image"):::projected v12("?layer"):::projected v3("?name"):::projected v5("?novel"):::projected v8("?place") v2("?pubplace"):::projected v12("?pubyear"):::projected c5(["wd:Q10898227"]):::iri f0[["?pubplace = 'sr'"]] f0 --> v2 f1[["?name = 'sr'"]] f1 --> v3 bind2[/VALUES ?collection/] bind2-->v4 bind20(["wd:Q106936149"]) bind20 --> bind2 bind21(["wd:Q109123373"]) bind21 --> bind2 v5 --"wdt:P747"--> v6 v5 --"wdt:P747"--> v7 v6 --"wdt:P1433"--> v4 v7 --"wdt:P31"--> c5 v7 --"wdt:P291"--> v8 v8 --"wdt:P625"--> v9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P577".-> v10 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P18".-> v11 end bind3[/"year-from-dateTime(?dob)"/] v10 --o bind3 bind3 --as--o v12 bind4[/"if(?pubyear < '1839^^xsd:integer','-1840',if(?pubyear < '1860^^xsd:integer','1840-1859',if(?pubyear < '1880^^xsd:integer','1860-1879',if(?pubyear < '1900^^xsd:integer','1880-1899',if(?pubyear < '1921^^xsd:integer','1900-1920','Post-1920')))))"/] v12 --o bind4 bind4 --as--o v12 v5 --"rdfs:label"--> v3 v8 --"rdfs:label"--> v2