query-e3fa88c36f876ba11894e22a367c18e3
Not all the newspaper is falls under major category as newspaper(Instance of newspaper) . some of them are in different categories like daily newspaper , weekly newspaper . Thus i have added those category(actually i should say this as sub-category of newspaper) in the code. QUERY - version 2:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?newspaper ?newspaperLabel ?link WHERE {
{?newspaper wdt:P31 wd:Q1331793} UNION
{?newspaper wdt:P31 wd:Q2138556} union
{?newspaper wdt:P31 wd:Q2305295}union
{?newspaper wdt:P31 wd:Q1110794}union
{?newspaper wdt:P31 wd:Q15265344}union
{?newspaper wdt:P31 wd:Q11032}union
{?newspaper wdt:P31 wd:Q1002697}.
?newspaper wdt:P17 wd:Q30.
?newspaper wdt:P856 ?link.
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,ar,be,bg,bn,ca,cs,da,de,el,en,es,et,fa,fi,he,hi,hu,hy,id,it,ja,jv,ko,nb,nl,eo,pa,pl,pt,ro,ru,sh,sk,sr,sv,sw,te,th,tr,uk,yue,vec,vi,zh" . }
FILTER(NOT EXISTS { ?newspaper wdt:P576 ?date. })}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?date")
v3("?link"):::projected
v1("?newspaper"):::projected
c16(["fr,ar,be,bg,bn,ca,cs,da,de,el,en,es,et,fa,fi,he,hi,hu,hy,id,it,ja,jv,ko,nb,nl,eo,pa,pl,pt,ro,ru,sh,sk,sr,sv,sw,te,th,tr,uk,yue,vec,vi,zh"]):::literal
c9(["wd:Q1002697"]):::iri
c6(["wd:Q1110794"]):::iri
c11(["wd:Q30"]):::iri
c5(["wd:Q2305295"]):::iri
c8(["wd:Q11032"]):::iri
c14(["bd:serviceParam"]):::iri
c4(["wd:Q2138556"]):::iri
c7(["wd:Q15265344"]):::iri
c3(["wd:Q1331793"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P576"--> e0v2
e0v2("?date"):::projected
e0v1("?newspaper"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"wdt:P576"--> v2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
subgraph union5[" Union "]
subgraph union5l[" "]
style union5l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c9
end
subgraph union5r[" "]
style union5r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c8
end
union5r <== or ==> union5l
end
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c7
end
union4r <== or ==> union4l
end
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c6
end
union3r <== or ==> union3l
end
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c5
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c4
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> c3
end
union0r <== or ==> union0l
end
v1 --"wdt:P17"--> c11
v1 --"wdt:P856"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end