query-5e562e7c9f533084c95787675cb24fda

rq turtle/ttl

Propertiesedition or translation of (P629)full work available at URL (P953)publication date (P577)title (P1476)edition number (P393)

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?edition2 ?title ?year2 ?text2 ?this_is_no ?ota_has_no WHERE {
?edition1 wdt:P629 ?work; 
    wdt:P953 ?text1;
    wdt:P577 ?pubdate1.
FILTER CONTAINS(STR(?text1),"ota.ox.ac.uk") # OTA scan of work
BIND(YEAR(?pubdate1) as ?year) # publication year  
?edition2 wdt:P629 ?work; # edition of work
    wdt:P953 ?text2;
    wdt:P1476 ?title;
    wdt:P577 ?pubdate2.
FILTER( ?edition1 != ?edition2 ) # non-OTA scan of work
BIND(YEAR(?pubdate2) as ?year2) # publication year
#FILTER{ ?year1 > ?year2 }
OPTIONAL{ ?edition1 wdt:P393 ?ota_has_no } # edition number
OPTIONAL{ ?edition2 wdt:P393 ?this_is_no }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?edition1") v2("?edition2"):::projected v11("?ota_has_no"):::projected v5("?pubdate1") v9("?pubdate2") v3("?text1") v7("?text2"):::projected v12("?this_is_no"):::projected v8("?title"):::projected v4("?work") v6("?year") v10("?year2"):::projected f0[["?edition1 != ?edition2"]] f0 --> v1 f0 --> v2 f1[["contains(str(?text1),'ota.ox.ac.uk')"]] f1 --> v3 v1 --"wdt:P629"--> v4 v1 --"wdt:P953"--> v3 v1 --"wdt:P577"--> v5 bind2[/"year-from-dateTime(?pubdate1)"/] v5 --o bind2 bind2 --as--o v6 v2 --"wdt:P629"--> v4 v2 --"wdt:P953"--> v7 v2 --"wdt:P1476"--> v8 v2 --"wdt:P577"--> v9 bind3[/"year-from-dateTime(?pubdate2)"/] v9 --o bind3 bind3 --as--o v10 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P393".-> v11 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P393".-> v12 end