User:Daniel/Queries/LinkedWikiTest: Difference between revisions
From MaRDI portal
< User:Daniel | Queries
No edit summary |
|||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== About == | |||
This page assists in testing on-wiki query features.For background, see [https://linkedwiki.com/ LinkedWiki] and [https://en.wikipedia.org/wiki/Module:Wd Module:Wd]. | |||
== Map == | |||
{{#sparql: | {{#sparql: | ||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> | ||
Line 26: | Line 30: | ||
} | } | ||
|config=http://www.wikidata.org | |config=http://www.wikidata.org | ||
|chart=leaflet.visualization.Map | |||
}} | }} | ||
== Pie chart == | |||
{{#sparql:PREFIX item: <http://www.wikidata.org/wiki/Q> | {{#sparql:PREFIX item: <http://www.wikidata.org/wiki/Q> | ||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | ||
Line 51: | Line 57: | ||
| log=2 | | log=2 | ||
}} | }} | ||
== Tables == | |||
{{#sparql: | {{#sparql: | ||
PREFIX target1: <http://www.wikidata.org/entity/Q20895785> | PREFIX target1: <http://www.wikidata.org/entity/Q20895785> | ||
PREFIX target2: <http://www.wikidata.org/entity/ | PREFIX target2: <http://www.wikidata.org/entity/Q70357595> | ||
SELECT | SELECT | ||
Line 70: | Line 78: | ||
ORDER BY DESC(?publication_date) | ORDER BY DESC(?publication_date) | ||
|config=http://www.wikidata.org | |config=http://www.wikidata.org | ||
}} | |||
{{Use_Sparql|Q20895}} | |||
{{#sparql: | |||
# tool: scholia | |||
PREFIX target: <http://www.wikidata.org/entity/Q1195879> | |||
#defaultView:Graph | |||
SELECT ?node ?nodeLabel ?nodeImage ?childNode ?childNodeLabel ?childNodeImage ?rgb | |||
WITH { | |||
SELECT DISTINCT ?property WHERE { | |||
?property a wikibase:Property; | |||
wdt:P31 wd:Q18610173 ; | |||
wdt:P31 wd:Q26940804 . | |||
} | |||
} AS %properties | |||
WITH { | |||
SELECT DISTINCT ?node ?childNode WHERE { | |||
BIND(target: AS ?node) | |||
?node ?p ?i. | |||
?childNode ?x ?p. | |||
?childNode rdf:type wikibase:Property. | |||
FILTER(STRSTARTS(STR(?i), "http://www.wikidata.org/entity/Q")) | |||
FILTER(STRSTARTS(STR(?childNode), "http://www.wikidata.org/entity/P")) | |||
} | |||
LIMIT 5000 | |||
} AS %nodes | |||
WITH { | |||
SELECT DISTINCT ?childNode ?node ?rgb WHERE { | |||
BIND("EFFBD8" AS ?rgb) | |||
target: ?p ?childNode. | |||
?node ?x ?p. | |||
?node rdf:type wikibase:Property. | |||
FILTER(STRSTARTS(STR(?childNode), "http://www.wikidata.org/entity/Q")) | |||
} | |||
LIMIT 5000 | |||
} AS %childNodes | |||
WHERE { | |||
{ | |||
INCLUDE %nodes | |||
} | |||
UNION | |||
{ | |||
INCLUDE %childNodes | |||
} | |||
OPTIONAL { | |||
INCLUDE %properties | |||
?property wikibase:directClaim ?nodeclaim. | |||
?node ?nodeclaim ?nodeImage. | |||
} | |||
OPTIONAL { | |||
INCLUDE %properties | |||
?property wikibase:directClaim ?childNodeclaim. | |||
?childNode ?childNodeclaim ?childNodeImage. | |||
} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |||
} | |||
|config=http://www.wikidata.org | |||
}} | |||
== Images == | |||
{{#sparql:PREFIX bd: <http://www.bigdata.com/rdf#> | |||
PREFIX wd: <http://www.wikidata.org/entity/> | |||
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |||
PREFIX wikibase: <http://wikiba.se/ontology#> | |||
#defaultView:ImageGrid | |||
SELECT ?personLabel (SAMPLE(?image) as ?picture) ?Erdos | |||
WHERE { | |||
?person wdt:P485 wd:Q964035 . | |||
?person wdt:P18 ?image . | |||
?person wdt:P2021 ?Erdos | |||
SERVICE wikibase:label { | |||
bd:serviceParam wikibase:language "en" . | |||
} | |||
} | |||
GROUP BY ?personLabel ?Erdos | |||
order by ?Erdos | |||
LIMIT 3 | |||
| endpoint = https://query.wikidata.org/sparql | |||
| chart=bordercloud.visualization.DataTable | |||
| options=colstyle=col1_img_max-width:250px | |||
| log=2 | |||
}} | |||
== Hyperlinks == | |||
{{#sparql: | |||
PREFIX bd: <http://www.bigdata.com/rdf#> | |||
PREFIX wd: <http://www.wikidata.org/entity/> | |||
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |||
PREFIX wikibase: <http://wikiba.se/ontology#> | |||
SELECT | |||
?publication_date | |||
?html1 | |||
WHERE { | |||
?work wdt:P16 wd:Q676062 . | |||
OPTIONAL { | |||
?work wdt:P28 ?publication_datetime . | |||
BIND(xsd:date(?publication_datetime) AS ?publication_date) | |||
} | |||
?work rdfs:label ?label . | |||
FILTER (LANG(?label) = "en") | |||
BIND(CONCAT('<a href=\'', xsd:string(?work),'\'>',?label,'</a>') as ?html1) | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,da,de,es,fr,jp,nl,no,ru,sv,zh". } | |||
} | |||
ORDER BY DESC(?publication_date) | |||
LIMIT 5 | |||
| endpoint = https://query.wikidata.org/sparql | |||
| chart=bordercloud.visualization.DataTable | |||
| log=2 | |||
}} | }} |
Latest revision as of 00:37, 7 October 2023
About
This page assists in testing on-wiki query features.For background, see LinkedWiki and Module:Wd.
Map
Pie chart
Tables
publication_date | work | workLabel | workUrl |
---|---|---|---|
2024-01-01 | http://www.wikidata.org/entity/Q124254609 | Computational reproducibility of Jupyter notebooks from biomedical publications | /work/Q124254609 |
2022-04-04 | http://www.wikidata.org/entity/Q111507314 | WikiProject Clinical Trials for Wikidata | /work/Q111507314 |
2022-02-28 | http://www.wikidata.org/entity/Q111145762 | WikiProject Clinical Trials snapshot February 2022 | /work/Q111145762 |
2017-07-20 | http://www.wikidata.org/entity/Q33269085 | A multi-disciplinary perspective on emergent and future innovations in peer review | /work/Q33269085 |
2014-06-16 | http://www.wikidata.org/entity/Q22064488 | Enriched biodiversity data as a resource and service | /work/Q22064488 |
21:21:36 11/27/2024 -- Refresh -- Duration of query :0.057s -- CSV |
publication_date | work | workLabel | workUrl |
---|---|---|---|
21:21:36 11/27/2024 -- Refresh -- Duration of query :0.057s -- CSV |