source: main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/transform/dataviz/draw-bias-normalized.xsl@ 35046

Last change on this file since 35046 was 35046, checked in by davidb, 3 years ago

Addition of two extra viz examples

File size: 2.5 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8 extension-element-prefixes="java util"
9 exclude-result-prefixes="java util">
10
11 <xsl:template name="ssv-draw-bias-normalized">
12
13
14 <div id="ssv-draw-bias-normalized" style="display: none;">
15
16<!-- Determine if their is any bias in the position in the competition for where you perform in the lineup -->
17<xsl:text>
18PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
19PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
20PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
21PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
22
23SELECT ?draw_int ?normFreqCount WHERE {
24 SELECT ?draw_int (SUM(?is_winner) AS ?freqCount) (COUNT(?is_winner) AS ?maxPossibleFreqCount) (100.0 * ?freqCount/?maxPossibleFreqCount AS ?normFreqCount)
25 WHERE {
26 GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt; {
27 ?esc_entrant_uri dc:Relation.isPartOf &lt;http://127.0.0.1:8383/greenstone3/library/collection/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;.
28
29 ?esc_entrant_uri gsdlextracted:Country ?country.
30 ?esc_entrant_uri gsdlextracted:Draw ?draw.
31 ?esc_entrant_uri gsdlextracted:Place ?place.
32
33 BIND(xsd:integer(?draw) AS ?draw_int).
34 BIND(xsd:integer(?place) AS ?place_int).
35
36 BIND(IF(?place_int = 1,1,0) AS ?is_winner).
37 }
38 }
39 GROUP BY ?draw_int ORDER BY ASC(?draw_int)
40}
41ORDER BY ASC(?draw_int)
42</xsl:text>
43 </div>
44 <div id="ssv-draw-bias-normalized-chart" style="display: none;">
45<!-- -->
46<xsl:text>
47google.visualization.BarChart
48</xsl:text>
49 </div>
50 <div id="ssv-draw-bias-normalized-chart-options" style="display: none;">
51<!-- -->
52<xsl:text>
53title=Number times an entry has has won given their draw position in the performance lineup|legend.position=none|height=400|chartArea.height=340|fontSize=11
54</xsl:text>
55 </div>
56
57 <div id="ssv-draw-bias-normalized-div-style" style="display: none;">
58<!-- -->
59<xsl:text>
60width:900px; height:400px; margin-left: auto; margin-right: auto; overflow-y: hidden; overflow-x: hidden;
61</xsl:text>
62
63 </div>
64
65 </xsl:template>
66
67</xsl:stylesheet>
68
Note: See TracBrowser for help on using the repository browser.