Difference between revisions of "Template:DatasetValue"

From Open Energy Information

(Force rebuild.)
m (Modified template description to match current standard.)
 
Line 1: Line 1:
<noinclude>This is the '''DatasetValue''' template.  It is used to fetch a single value from an RDF-ready OpenEI dataset. It should be called in the following format:
+
<noinclude>This is the '''{{PAGENAME}}''' template.  It is used to fetch a single value from an RDF-ready OpenEI dataset. It is used in the [[Template:Country|Country Profile template]].
<pre>
+
 
{{DatasetValue
 
|id=
 
|subject=
 
|predicate=
 
|aggregateFn=
 
}}
 
</pre>
 
Edit the page to see the template text.
 
  
======Properties======
+
=====Properties=====
* id (int) The Dataset's unique id.
+
* '''id''' - The Dataset's unique id (int)
* subject (var) The SPARQL subject.
+
* '''subject''' - The SPARQL subject (string, var like '?v')
* predicate (string) the SPARQL predicate. The following prefixes can be used in this field:
+
* '''predicate''' - The SPARQL predicate (string)  The following prefixes can be used in this field:
 
** dsnav:
 
** dsnav:
 
** dsprop:
 
** dsprop:
* aggregateFn (string) name of the aggregate function to call on the results. Example: 'max'.
+
* '''aggregateFn''' - The name of the aggregate function to call on the results. (string, example: 'max').
 +
 
  
======Example Usage======
+
=====Example Usage=====
 
<pre>
 
<pre>
 
{{DatasetValue
 
{{DatasetValue
Line 26: Line 19:
 
}}  
 
}}  
 
</pre>
 
</pre>
[[Category:Experimental Templates]]
+
[[Category:Experimental Templates]][[Category:Country Profile Templates]]
 
</noinclude><includeonly>{{#vardefine:select|{{#if:{{{aggregateFn|}}}|{{{aggregateFn}}}(?v)|?v}}}}{{#sparql:
 
</noinclude><includeonly>{{#vardefine:select|{{#if:{{{aggregateFn|}}}|{{{aggregateFn}}}(?v)|?v}}}}{{#sparql:
 
   PREFIX dsnav: <http://en.openei.org/lod/resource/ontology/nav/>
 
   PREFIX dsnav: <http://en.openei.org/lod/resource/ontology/nav/>

Latest revision as of 23:06, 5 April 2014

This is the DatasetValue template. It is used to fetch a single value from an RDF-ready OpenEI dataset. It is used in the Country Profile template.


Properties
  • id - The Dataset's unique id (int)
  • subject - The SPARQL subject (string, var like '?v')
  • predicate - The SPARQL predicate (string) The following prefixes can be used in this field:
    • dsnav:
    • dsprop:
  • aggregateFn - The name of the aggregate function to call on the results. (string, example: 'max').


Example Usage
{{DatasetValue
|id=452
|subject=Argentina
|predicate=dsprop:provedNaturalGasReserves
}}