Widget

SPARQLquery: Difference between revisions

m (adjust default)
 
(37 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div style="backgroundcolor:#eaecf0">
<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>
<iframe style="<!--weight|default:500|escape:urlpathinfo}-->; <!--{$height|default:500|escape:urlpathinfo}-->; border:3px solid #eaecf0"  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;"><!--{$caption|default:""|escape:html}--></p>
<p class='sparqlcaption' style="background-color:#eaecf0; text-align:center"><!--{$caption|default:""|escape:html}--></p>
 
<div>
<noinclude>
= 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)
 
 
 
<pre style="background-color:#F5F5F5">
{{#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
}}
</pre>
 
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.
<pre> width:<!--{$width|default:83vw|escape:urlpathinfo}--> </pre>
Will update if a solution is found.
 
</noinclude>

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.