1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
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 | extension-element-prefixes="java util"
|
---|
8 | exclude-result-prefixes="java util">
|
---|
9 |
|
---|
10 |
|
---|
11 | <xsl:template name="von-sparql-canvas">
|
---|
12 |
|
---|
13 | <link rel="stylesheet" type="text/css" href="sites/von-sparql/transform/pages/style.css"/>
|
---|
14 | <script type="text/javascript" src="https://www.google.com/jsapi"><xsl:text> </xsl:text></script>
|
---|
15 | <script>
|
---|
16 | <xsl:text disable-output-escaping="yes">google.load('visualization','1', {'packages':['corechart']});</xsl:text>
|
---|
17 | </script>
|
---|
18 | <script type="text/javascript" src="http://beta.data2000.no/sgvizler/release/0.6/sgvizler.js"><xsl:text> </xsl:text></script>
|
---|
19 |
|
---|
20 | <script type="text/javascript" src="ext/von-sparql/von-sparql-script.js"><xsl:text> </xsl:text></script>
|
---|
21 | <script type="text/javascript" src="ext/von-sparql/von-sparql-setup.js"><xsl:text> </xsl:text></script>
|
---|
22 | <script type="text/javascript" src="ext/von-sparql/combobox.js"><xsl:text> </xsl:text></script>
|
---|
23 |
|
---|
24 | <xsl:variable name="protocol" select="substring-before(/page/pageRequest/@baseURL,':')"/>
|
---|
25 | <xsl:variable name="baseURL" select="substring-after(/page/pageRequest/@baseURL,':')"/>
|
---|
26 | <xsl:variable name="domain" select="substring-before($baseURL,':')"/>
|
---|
27 | <xsl:variable name="endpointPath" select="concat($protocol,':',$domain,':3030/greenstone/query')"/>
|
---|
28 |
|
---|
29 |
|
---|
30 | <div id="div_PredicateOverview" style="height:270px" width="auto">
|
---|
31 | <div id="sgvzl_PredicateOverview"
|
---|
32 | data-sgvizler-endpoint="{$endpointPath}"
|
---|
33 | data-sgvizler-chart="google.visualization.Table"
|
---|
34 | data-sgvizler-loglevel="2"
|
---|
35 | data-sgvizler-chart-options="title=Predicate Overview"
|
---|
36 | style="width:550px;"
|
---|
37 | >
|
---|
38 | <xsl:attribute name="data-sgvizler-query">
|
---|
39 |
|
---|
40 | SELECT (?p as ?Predicate)(COUNT (?hts) as ?Hathi) (COUNT (?nzs) as ?NZ)((?NZ + ?Hathi) as ?Total)WHERE
|
---|
41 | {
|
---|
42 | {
|
---|
43 | ?hts <http://purl.org/dc/elements/1.1/Relation.isPartOf> <http://localhost:8989/greenstone3/library/collection/hathitrust-tab>;
|
---|
44 | ?p ?o
|
---|
45 | }
|
---|
46 | UNION
|
---|
47 | {
|
---|
48 | ?nzs <http://purl.org/dc/elements/1.1/Relation.isPartOf> <http://localhost:8989/greenstone3/library/collection/nz-natlib-cat>;
|
---|
49 | ?p ?o
|
---|
50 | }
|
---|
51 | }
|
---|
52 | GROUP BY ?p
|
---|
53 | ORDER BY DESC(?Predicate)
|
---|
54 |
|
---|
55 | </xsl:attribute>
|
---|
56 | <xsl:comment>Filler</xsl:comment>
|
---|
57 | </div>
|
---|
58 | <div id="queryContainer">
|
---|
59 | <span>SPARQL Query:</span>
|
---|
60 | <br/>
|
---|
61 | <span id="span_sparqlQuery"
|
---|
62 | style="font-size:10pt;">
|
---|
63 | <xsl:comment>Filler</xsl:comment>
|
---|
64 | </span>
|
---|
65 | </div>
|
---|
66 | </div>
|
---|
67 | <div id="searchContainer">
|
---|
68 | <div id="searchControls">
|
---|
69 | <label for="sel_Predicate">View Predicate:</label>
|
---|
70 | <select id="sel_Predicate">
|
---|
71 | <option value="None"></option>
|
---|
72 | </select>
|
---|
73 | <br/>
|
---|
74 | <input type="checkbox" id="cb_RefineSearch"/> <label for="cb_RefineSearch">Refine search to:</label>
|
---|
75 | <br/>
|
---|
76 | <div id="refineControls">
|
---|
77 | <label for="sel_RefineObject">?o</label>
|
---|
78 | <select id="sel_RefineObject" enabled='false'>
|
---|
79 | <option value="None">Select predicate above</option>
|
---|
80 | </select>
|
---|
81 | <br/>
|
---|
82 | <label for="sel_RefinePredicate">?p</label>
|
---|
83 | <select id="sel_RefinePredicate" enabled='false'>
|
---|
84 | <option value="None">Select ?o above</option>
|
---|
85 | </select>
|
---|
86 | </div>
|
---|
87 |
|
---|
88 | <select id="sel_Limit">
|
---|
89 | <option value="None">No Limit</option>
|
---|
90 | <option value="10">10</option>
|
---|
91 | <option value="25">25</option>
|
---|
92 | <option value="50">50</option>
|
---|
93 | <option value="75">75</option>
|
---|
94 | <option value="100">100</option>
|
---|
95 | </select>
|
---|
96 | <select id="sel_ChartType">
|
---|
97 | <option value="google.visualization.Table">Table</option>
|
---|
98 | <option value="google.visualization.PieChart">Pie Chart</option>
|
---|
99 | <option value="google.visualization.BarChart">Bar Chart</option>
|
---|
100 | <option value="google.visualization.ImageSparkLine">Sparkline</option>
|
---|
101 | </select>
|
---|
102 | <button type="button" id="btn_ShowChart">Execute Query</button>
|
---|
103 | <button type="button" id="btn_ShowQuery">Show SPARQL Query</button>
|
---|
104 | </div>
|
---|
105 | <div id="selectDataset">
|
---|
106 | <span>Search Datasets:</span>
|
---|
107 | <br/>
|
---|
108 | <input type="radio" name="radio_Dataset" value="all"/>All<br/>
|
---|
109 | <input type="radio" name="radio_Dataset" value="nz_natlib_cat"/>NZ National Library Catalogue<br/>
|
---|
110 | <input type="radio" name="radio_Dataset" value="hathitrust_tab"/>Hathi Trust<br/>
|
---|
111 | </div>
|
---|
112 | </div>
|
---|
113 | <script type="text/javascript">
|
---|
114 | <xsl:text disable-output-escaping="yes">
|
---|
115 | var overviewSparqlQuery;
|
---|
116 | function createOverviewQuery()
|
---|
117 | {
|
---|
118 | overviewSparqlQuery = $('#sgvzl_PredicateOverview').attr("data-sgvizler-query");
|
---|
119 | }
|
---|
120 |
|
---|
121 | google.load('visualization','1', {packages: ['imagechart']});
|
---|
122 |
|
---|
123 | $(document).ready(
|
---|
124 | function (){
|
---|
125 | sgvizler
|
---|
126 | .defaultEndpointOutputFormat('jsonp')
|
---|
127 | // Add prefixes used in examples:
|
---|
128 | .prefix('dc', "http://purl.org/dc/elements/1.1/")
|
---|
129 | .prefix('xsd', "http://www.w3.org/2001/XMLSchema#")
|
---|
130 |
|
---|
131 | // Draw all sgvizler containers on page:
|
---|
132 | .containerDrawAll();
|
---|
133 |
|
---|
134 | createOverviewQuery();
|
---|
135 |
|
---|
136 | //Load possible predicate values into selector
|
---|
137 | updatePredicateSelector();
|
---|
138 |
|
---|
139 | //Ensure search refinement elements are greyed
|
---|
140 | toggle_RefineSearch(0);
|
---|
141 | $('#cb_RefineSearch').prop('checked',false);
|
---|
142 | }
|
---|
143 | );
|
---|
144 |
|
---|
145 | window.onload=setupPage;
|
---|
146 | </xsl:text>
|
---|
147 | </script>
|
---|
148 |
|
---|
149 | <div id="sgvzl_container"
|
---|
150 | style="width:auto; height:400px; margin-top:10px; ">
|
---|
151 | </div>
|
---|
152 | </xsl:template>
|
---|
153 |
|
---|
154 |
|
---|
155 | <!-- the page content -->
|
---|
156 | <xsl:template match="/page/pageResponse">
|
---|
157 |
|
---|
158 | <div id="quickSearch">
|
---|
159 | <gslib:crossCollectionQuickSearchForm/>
|
---|
160 | </div>
|
---|
161 |
|
---|
162 | <h2><gslib:selectACollectionTextBar/></h2>
|
---|
163 |
|
---|
164 | <div id="collectionLinks">
|
---|
165 | <xsl:if test="count(collectionList/collection) = 0">
|
---|
166 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home.no_collections')"/>
|
---|
167 | <br/>
|
---|
168 | </xsl:if>
|
---|
169 | <xsl:for-each select="collectionList/collection">
|
---|
170 | <gslib:collectionLinkWithImage/>
|
---|
171 | </xsl:for-each>
|
---|
172 | <br class="clear"/>
|
---|
173 | </div>
|
---|
174 |
|
---|
175 | <xsl:call-template name="von-sparql-canvas"/>
|
---|
176 |
|
---|
177 | <gslib:serviceClusterList/>
|
---|
178 |
|
---|
179 | <xsl:for-each select="serviceList/service[@type='query']">
|
---|
180 | <gslib:serviceLink/><br/>
|
---|
181 | </xsl:for-each>
|
---|
182 |
|
---|
183 | <xsl:for-each select="serviceList/service[@type='authen']">
|
---|
184 | <gslib:authenticationLink/><br/><br/>
|
---|
185 | <gslib:registerLink/><br/>
|
---|
186 | </xsl:for-each>
|
---|
187 |
|
---|
188 | </xsl:template>
|
---|
189 |
|
---|
190 | </xsl:stylesheet>
|
---|
191 |
|
---|
192 |
|
---|