Template

TablePreview: Difference between revisions

(test update)
m (added: Usage)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{{!}} class{{=}}"wikitable"
{{{!}} class{{=}}"wikitable"
!colspan{{=}}"2" {{!}} {{{pagetitle}}}
!colspan{{=}}"2" {{!}} '''{{{pagetitle}}}'''
{{!}}-
{{!}}-
{{!}} {{{desc}}}
{{!}} style{{=}}"width:20%; vertical-align:top; text-align:left; padding: 10px" {{!}} {{{desc}}}  
{{!}}# rowspan{{=}}"2" {{!}} {{#widget:SPARQLquery|code={{{code}}}}}
{{!}} {{#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". }
}
}}