query-a37eea66d310d8502e6c3de6f87eb9cc
TODO
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 DISTINCT
?item ?itemLabel ?itemDescription ?wdimage # WHAT
?whatis ?whatisLabel # WHAT 2 (o ?type ?typeLabel o ?sport ?sportLabel)
?date ?Sdate ?Edate # WHEN
?country ?countryLabel ?coords ?where ?whereLabel # WHERE
?who ?whoLabel # WHO
?sitelinks # METADATA (number of internal references in wikidata)
?extra ?extraLabel # EXTRA WHAT (o ?edition ?editionLabel)
WHERE {
?item
wdt:P31 ?whatis; # que es?
wikibase:sitelinks ?sitelinks.
{ ?item wdt:P577 ?date; } # publication date
UNION
{ ?item wdt:P571 ?date; } # inception date
OPTIONAL {
{ ?item wdt:P17 ?country; } # country
UNION
{ ?item wdt:P495 ?country; } # country of origin
}
OPTIONAL {
?item wdt:P18 ?wdimage .
}
OPTIONAL {
{ ?item wdt:P61 ?who; } # descubridor o inventor
UNION
{ ?item wdt:P176 ?who; } # manufacturer
?who wdt:P31 ?extra. # Ver si es persona, organizaciĆ³n o quĆ© - Ejemplo: wd:Q5 para persona
}
OPTIONAL {
{ ?item wdt:P1071 ?where . } # location of creation
UNION
{ ?item wdt:P291 ?where . } # place of publication
?where wdt:P625 ?coords .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "es" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?coords"):::projected
v5("?country"):::projected
v4("?date"):::projected
v8("?extra"):::projected
v1("?item"):::projected
v3("?sitelinks"):::projected
v6("?wdimage"):::projected
v2("?whatis"):::projected
v9("?where"):::projected
v7("?who"):::projected
c16(["es"]):::literal
c14(["bd:serviceParam"]):::iri
v1 --"wdt:P31"--> v2
v1 --"wikibase:sitelinks"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P571"--> v4
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P577"--> v4
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v1 -."wdt:P495".-> v5
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P17"--> v5
end
union1r <== or ==> union1l
end
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
v1 -."wdt:P176".-> v7
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P61"--> v7
end
union2r <== or ==> union2l
end
v7 --"wdt:P31"--> v8
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
v1 -."wdt:P291".-> v9
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P1071"--> v9
end
union3r <== or ==> union3l
end
v9 --"wdt:P625"--> v10
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end