Template

TablePreview: Difference between revisions

(created page)
 
m (added: Usage)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{{!}} class{{=}}"wikitable"
{{{!}} class{{=}}"wikitable"
!colspace{{=}}"2" {{!}} {{{pagetitle}}}
!colspan{{=}}"2" {{!}} '''{{{pagetitle}}}'''
{{!}}-
{{!}}-
{{!}} {{{desc}}} {{!}}{{!}} <iframe style="width: 70%; height: 20vh; border: none;" src="https://query.graphit.ur.de/embed.html#<!--{$code|escape:'url'}-->" referrerpolicy="origin" sandbox="allow-forms allow-scripts allow-same-origin allow-popups" ></iframe> {{!}}
{{!}} style{{=}}"width:20%; vertical-align:top; text-align:left; padding: 10px" {{!}} {{{desc}}}
{{!}} {{#widget:SmallSPARQLquery|code={{{code}}}}}
{{!}}-
{{!}}-
{{!}}}
{{!}}}
<noinclude>
== Usage ==
* '''pagetitle:''' A regular title or the [https://www.mediawiki.org/wiki/Help:Links#Internal_links internal link] to a page
* '''code:''' The SPARQL query
<pre style="background-color:#F5F5F5;">
{{TablePreview|pagetitle=[[Feature_Demo]]
|desc=
This page gives a couple of examples of what the graph can do.
|code=
#defaultView:Graph
PREFIX wd: <https://graphit.ur.de/entity/>
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
SELECT ?resource ?resourceLabel ?item ?itemLabel ?image WHERE {
  ?item wdt:P21 ?resource
  VALUES ?item {wd:Q108}
  OPTIONAL{ ?item wdt:P11 ?image.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}}
</pre>
</noinclude>

Latest revision as of 10:16, 9 October 2023

{{{pagetitle}}}
{{{desc}}}


Usage

  • pagetitle: A regular title or the internal link to a page
  • code: The SPARQL query


{{TablePreview|pagetitle=[[Feature_Demo]]
|desc=
This page gives a couple of examples of what the graph can do. 
|code=
#defaultView:Graph
PREFIX wd: <https://graphit.ur.de/entity/>
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
SELECT ?resource ?resourceLabel ?item ?itemLabel ?image WHERE {
  ?item wdt:P21 ?resource
  VALUES ?item {wd:Q108}
  OPTIONAL{ ?item wdt:P11 ?image.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}}