Widget

SPARQLquery: Difference between revisions

m (debug)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<iframe style="width:100%; height:<!--{$height|default:50vh|escape:urlpathinfo}-->; border:3px solid #DBDEE6"  src="https://query.graphit.ur.de/embed.html#<!--{$code|escape:'url'}-->" referrerpolicy="origin" sandbox="allow-forms allow-scripts allow-same-origin allow-popups" ></iframe>
<iframe style="width:100%; height:<!--{$height|default:50vh|escape:urlpathinfo}-->; border:3px solid #FFFFFF"  src="https://query.graphit.ur.de/embed.html#<!--{$code|escape:'url'}-->" referrerpolicy="origin" sandbox="allow-forms allow-scripts allow-same-origin allow-popups" ></iframe>
<p class='sparqlcaption' style="background-color:#eaecf0; text-align:center; width:83vw; padding-top:3px"><!--{$caption|default:""|escape:html}--></p>
<p class='sparqlcaption' style="background-color:#eaecf0; text-align:center;"><!--{$caption|default:""|escape:html}--></p>


<noinclude>
<noinclude>
Line 7: Line 7:
* ''caption:'' The caption for the graph (will default to empty)
* ''caption:'' The caption for the graph (will default to empty)
* ''height:'' The height of the graph (will default to 50vh)
* ''height:'' The height of the graph (will default to 50vh)





Latest revision as of 14:42, 27 May 2024

<iframe style="width:100%; height:; border:3px solid #FFFFFF" src="https://query.graphit.ur.de/embed.html#" referrerpolicy="origin" sandbox="allow-forms allow-scripts allow-same-origin allow-popups" ></iframe>


Usage

  • code: The SPARQL code
  • caption: The caption for the graph (will default to empty)
  • height: The height of the graph (will default to 50vh)


{{#widget:SPARQLquery|code=
#defaultView:Graph
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
SELECT ?item ?itemLabel ?class ?classLabel ?image ?dependency ?dependencyLabel WHERE {
  ?item wdt:P1 ?dependency.
  ?item wdt:P2 ?class
  OPTIONAL{ ?item wdt:P9 ?image.}
  OPTIONAL{ ?class wdt:P9 ?image.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}|caption=The full dependency graph
}}

Note: Currently width not adjustable. Using the syntax below you get a good approximation, but you cant use 100% as a default value. Meaning that the width is not inline with the rest of the page.

 width:<!--{$width|default:83vw|escape:urlpathinfo}--> 

Will update if a solution is found.