Widget

SPARQLquery: Difference between revisions

mNo edit summary
 
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.