query-0532ec18ee0ea2d967429e4c40e6feb7
All PM20 subject categories with folders, which have no WD item with according subject code
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX zbwext: <http://zbw.eu/namespaces/zbw-extensions/>#
select distinct ?notation ?subject
where {
service <http://zbw.eu/beta/sparql/pm20/query> {
select distinct ?notation ?subject
where {
?subject skos:notation ?notation .
filter(exists {
?pm20 a zbwext:SubjectFolder ;
zbwext:subject ?subject .
})
}
}
bind(replace(?notation, ' ', '_') as ?subjectCode)
#
filter(not exists {
?item wdt:P8484 ?subjectCode .
})
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item")
v5("?notation"):::projected
v3("?pm20")
v4("?subject"):::projected
v6("?subjectCode")
c4([http://zbw.eu/namespaces/zbw-extensions/SubjectFolder]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P8484"--> e0v2
e0v1("?item"):::projected
e0v2("?subjectCode"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v6
v1 --"wdt:P8484"--> v6
subgraph s1["http://zbw.eu/beta/sparql/pm20/query"]
style s1 stroke-width:4px;
f1[[" "]]
subgraph f1e1["Exists Clause"]
e1v1 --"a"--> e1c2
e1v1 --http://zbw.eu/namespaces/zbw-extensions/subject--> e1v2
e1v1("?pm20"):::projected
e1v2("?subject"):::projected
e1c2([http://zbw.eu/namespaces/zbw-extensions/SubjectFolder]):::iri
end
f1--EXISTS--> f1e1
f1 --> v3
f1 --> c3
f1 --> c4
f1 --> c5
f1 --> v4
v3 --"a"--> c4
v3 --http://zbw.eu/namespaces/zbw-extensions/subject--> v4
v4 --"skos:notation"--> v5
end
bind2[/"replace(?notation,' ','_')"/]
v5 --o bind2
bind2 --as--o v6