query-f40d6bc76ba30613b56eed234ff965ce
rq turtle/ttl
Sem referencias
SELECT ?itemLabel ?item ?rank ?ref ?refLabel
WHERE {
?item wdt:P166 ?rank .
{ ?rank wdt:P361 wd:Q93932 . } UNION #militar torre espada
{ ?rank wdt:P361 wd:Q11696769 . } UNION #militar cristo
{ ?rank wdt:P361 wd:Q23657078 . } UNION #militar avis
{ ?rank wdt:P361 wd:Q1515829 . } UNION #militar santiago
{ ?rank wdt:P361 wd:Q2083850 . } UNION #imperio
{ ?rank wdt:P361 wd:Q743230 . } UNION #liberdade
{ ?rank wdt:P361 wd:Q93488 . } UNION #infante
{ ?rank wdt:P361 wd:Q639335 . } UNION #Merito
{ ?rank wdt:P361 wd:Q495686 . } UNION #Public Instruction
{ ?rank wdt:P361 wd:Q2029023 . } UNION #Merito empresarial
{ ?rank wdt:P361 wd:Q10341302 . } UNION #torre espada
{ ?rank wdt:P361 wd:Q840941 . } UNION #cristo
{ ?rank wdt:P361 wd:Q639358 . } UNION #avis
{ ?rank wdt:P361 wd:Q67041645 . } UNION #santiago
{ ?rank wdt:P361 wd:Q16142399 . } UNION #duas bandas
{ ?rank wdt:P361 wd:Q347377 . } UNION #tres bandas
{ ?rank wdt:P361 wd:Q1604729 . } UNION #vila vico
{ ?rank wdt:P361 wd:Q1228761 . } UNION #isabel
{ ?rank wdt:P361 wd:Q1696581 . } #miguel ala
MINUS {
?item p:P166 ?statement.
?statement ps:P166 ?rank.
?statement prov:wasDerivedFrom ?refnode.
{ ?refnode pr:P854 ?ref. } UNION
{ ?refnode pr:P143 ?ref. } UNION
{ ?refnode pr:P4656 ?ref. } UNION
{ ?refnode pr:P248 ?ref. }
}
FILTER (SUBSTR(str(?ref), 1 , 40) = "http://www.ordens.presidencia.pt/?idc=15") .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?itemLabel
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Sem referencias
SELECT ?itemLabel ?item ?rank ?ref ?refLabel
WHERE {
?item wdt:P166 ?rank .
{ ?rank wdt:P361 wd:Q93932 . } UNION #militar torre espada
{ ?rank wdt:P361 wd:Q11696769 . } UNION #militar cristo
{ ?rank wdt:P361 wd:Q23657078 . } UNION #militar avis
{ ?rank wdt:P361 wd:Q1515829 . } UNION #militar santiago
{ ?rank wdt:P361 wd:Q2083850 . } UNION #imperio
{ ?rank wdt:P361 wd:Q743230 . } UNION #liberdade
{ ?rank wdt:P361 wd:Q93488 . } UNION #infante
{ ?rank wdt:P361 wd:Q639335 . } UNION #Merito
{ ?rank wdt:P361 wd:Q495686 . } UNION #Public Instruction
{ ?rank wdt:P361 wd:Q2029023 . } UNION #Merito empresarial
{ ?rank wdt:P361 wd:Q10341302 . } UNION #torre espada
{ ?rank wdt:P361 wd:Q840941 . } UNION #cristo
{ ?rank wdt:P361 wd:Q639358 . } UNION #avis
{ ?rank wdt:P361 wd:Q67041645 . } UNION #santiago
{ ?rank wdt:P361 wd:Q16142399 . } UNION #duas bandas
{ ?rank wdt:P361 wd:Q347377 . } UNION #tres bandas
{ ?rank wdt:P361 wd:Q1604729 . } UNION #vila vico
{ ?rank wdt:P361 wd:Q1228761 . } UNION #isabel
{ ?rank wdt:P361 wd:Q1696581 . } #miguel ala
MINUS {
?item p:P166 ?statement.
?statement ps:P166 ?rank.
?statement prov:wasDerivedFrom ?refnode.
{ ?refnode pr:P854 ?ref. } UNION
{ ?refnode pr:P143 ?ref. } UNION
{ ?refnode pr:P4656 ?ref. } UNION
{ ?refnode pr:P248 ?ref. }
}
# FILTER (SUBSTR(str(?ref), 1 , 40) = "http://www.ordens.presidencia.pt/?idc=15") .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?itemLabel"):::projected
v3("?rank"):::projected
v6("?ref"):::projected
v5("?refnode")
v4("?statement")
c5(["wd:Q23657078"]):::iri
c8(["wd:Q743230"]):::iri
c7(["wd:Q2083850"]):::iri
c17(["wd:Q16142399"]):::iri
c6(["wd:Q1515829"]):::iri
c30(["bd:serviceParam"]):::iri
c20(["wd:Q1228761"]):::iri
c4(["wd:Q11696769"]):::iri
c19(["wd:Q1604729"]):::iri
c15(["wd:Q639358"]):::iri
c10(["wd:Q639335"]):::iri
c11(["wd:Q495686"]):::iri
c16(["wd:Q67041645"]):::iri
c9(["wd:Q93488"]):::iri
c18(["wd:Q347377"]):::iri
c21(["wd:Q1696581"]):::iri
c32(["en"]):::literal
c12(["wd:Q2029023"]):::iri
c13(["wd:Q10341302"]):::iri
c14(["wd:Q840941"]):::iri
c3(["wd:Q93932"]):::iri
v2 --"p:direct/P166"--> v3
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;
subgraph union6[" Union "]
subgraph union6l[" "]
style union6l fill:#abf,stroke-dasharray: 3 3;
subgraph union7[" Union "]
subgraph union7l[" "]
style union7l fill:#abf,stroke-dasharray: 3 3;
subgraph union8[" Union "]
subgraph union8l[" "]
style union8l fill:#abf,stroke-dasharray: 3 3;
subgraph union9[" Union "]
subgraph union9l[" "]
style union9l fill:#abf,stroke-dasharray: 3 3;
subgraph union10[" Union "]
subgraph union10l[" "]
style union10l fill:#abf,stroke-dasharray: 3 3;
subgraph union11[" Union "]
subgraph union11l[" "]
style union11l fill:#abf,stroke-dasharray: 3 3;
subgraph union12[" Union "]
subgraph union12l[" "]
style union12l fill:#abf,stroke-dasharray: 3 3;
subgraph union13[" Union "]
subgraph union13l[" "]
style union13l fill:#abf,stroke-dasharray: 3 3;
subgraph union14[" Union "]
subgraph union14l[" "]
style union14l fill:#abf,stroke-dasharray: 3 3;
subgraph union15[" Union "]
subgraph union15l[" "]
style union15l fill:#abf,stroke-dasharray: 3 3;
subgraph union16[" Union "]
subgraph union16l[" "]
style union16l fill:#abf,stroke-dasharray: 3 3;
subgraph union17[" Union "]
subgraph union17l[" "]
style union17l fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c21
end
subgraph union17r[" "]
style union17r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c20
end
union17r <== or ==> union17l
end
end
subgraph union16r[" "]
style union16r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c19
end
union16r <== or ==> union16l
end
end
subgraph union15r[" "]
style union15r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c18
end
union15r <== or ==> union15l
end
end
subgraph union14r[" "]
style union14r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c17
end
union14r <== or ==> union14l
end
end
subgraph union13r[" "]
style union13r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c16
end
union13r <== or ==> union13l
end
end
subgraph union12r[" "]
style union12r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c15
end
union12r <== or ==> union12l
end
end
subgraph union11r[" "]
style union11r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c14
end
union11r <== or ==> union11l
end
end
subgraph union10r[" "]
style union10r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c13
end
union10r <== or ==> union10l
end
end
subgraph union9r[" "]
style union9r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c12
end
union9r <== or ==> union9l
end
end
subgraph union8r[" "]
style union8r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c11
end
union8r <== or ==> union8l
end
end
subgraph union7r[" "]
style union7r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c10
end
union7r <== or ==> union7l
end
end
subgraph union6r[" "]
style union6r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c9
end
union6r <== or ==> union6l
end
end
subgraph union5r[" "]
style union5r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c8
end
union5r <== or ==> union5l
end
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c7
end
union4r <== or ==> union4l
end
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c6
end
union3r <== or ==> union3l
end
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c5
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c4
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:direct/P361"--> c3
end
union0r <== or ==> union0l
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:P166"--> v4
v4 --"p:statement/P166"--> v3
v4 --"prov:wasDerivedFrom"--> v5
subgraph union18[" Union "]
subgraph union18l[" "]
style union18l fill:#abf,stroke-dasharray: 3 3;
subgraph union19[" Union "]
subgraph union19l[" "]
style union19l fill:#abf,stroke-dasharray: 3 3;
subgraph union20[" Union "]
subgraph union20l[" "]
style union20l fill:#abf,stroke-dasharray: 3 3;
v5 --"p:reference/P248"--> v6
end
subgraph union20r[" "]
style union20r fill:#abf,stroke-dasharray: 3 3;
v5 --"p:reference/P4656"--> v6
end
union20r <== or ==> union20l
end
end
subgraph union19r[" "]
style union19r fill:#abf,stroke-dasharray: 3 3;
v5 --"p:reference/P143"--> v6
end
union19r <== or ==> union19l
end
end
subgraph union18r[" "]
style union18r fill:#abf,stroke-dasharray: 3 3;
v5 --"p:reference/P854"--> v6
end
union18r <== or ==> union18l
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c30 --"wikibase:language"--> c32
end