User:Daniel/Queries/LinkedWikiTest: Difference between revisions

From MaRDI portal
No edit summary
 
(8 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:
Line 72: Line 80:
}}
}}
{{Use_Sparql|Q20895}}
{{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 01: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
20:44:12 06/26/2024 -- Refresh -- Duration of query :0.081s -- CSV
publication_date work workLabel workUrl
20:44:12 06/26/2024 -- Refresh -- Duration of query :0.071s -- CSV
node nodeLabel nodeImage childNode childNodeLabel childNodeImage rgb
http://www.wikidata.org/entity/P138 named after   http://www.wikidata.org/entity/Q548184 Gregorio Ricci-Curbastro http://commons.wikimedia.org/wiki/Special:FilePath/Ricci%20Curbastro%20%28cropped%29.jpg EFFBD8
http://www.wikidata.org/entity/P138 named after   http://www.wikidata.org/entity/Q548184 Gregorio Ricci-Curbastro http://commons.wikimedia.org/wiki/Special:FilePath/Ricci%20Curbastro%20Signature.jpg EFFBD8
http://www.wikidata.org/entity/P61 discoverer or inventor   http://www.wikidata.org/entity/Q548184 Gregorio Ricci-Curbastro http://commons.wikimedia.org/wiki/Special:FilePath/Ricci%20Curbastro%20%28cropped%29.jpg EFFBD8
http://www.wikidata.org/entity/P61 discoverer or inventor   http://www.wikidata.org/entity/Q548184 Gregorio Ricci-Curbastro http://commons.wikimedia.org/wiki/Special:FilePath/Ricci%20Curbastro%20Signature.jpg EFFBD8
http://www.wikidata.org/entity/P31 instance of   http://www.wikidata.org/entity/Q1758924 tensor field   EFFBD8
http://www.wikidata.org/entity/P6104 maintained by WikiProject   http://www.wikidata.org/entity/Q8487137 WikiProject Mathematics   EFFBD8
http://www.wikidata.org/entity/Q1195879 Ricci curvature   http://www.wikidata.org/entity/P6104 maintained by WikiProject    
http://www.wikidata.org/entity/Q1195879 Ricci curvature   http://www.wikidata.org/entity/P31 instance of    
http://www.wikidata.org/entity/Q1195879 Ricci curvature   http://www.wikidata.org/entity/P61 discoverer or inventor    
http://www.wikidata.org/entity/Q1195879 Ricci curvature   http://www.wikidata.org/entity/P138 named after    
20:44:13 06/26/2024 -- Refresh -- Duration of query :0.075s -- CSV


Images

Hyperlinks