[28915] | 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 | <!-- use the 'main' layout -->
|
---|
| 11 | <!--<xsl:include href="layouts/main.xsl"/>-->
|
---|
| 12 |
|
---|
| 13 | <!-- set page title -->
|
---|
| 14 | <!--<xsl:template name="pageTitle"><gslib:collectionName/></xsl:template>-->
|
---|
| 15 |
|
---|
| 16 | <!-- set page breadcrumbs -->
|
---|
| 17 | <!--<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/></xsl:template>-->
|
---|
| 18 |
|
---|
| 19 | <xsl:variable name="coll_name"><gslib:collectionName/></xsl:variable>
|
---|
| 20 | <xsl:variable name="coll_name_short"><gslib:collectionNameShort/></xsl:variable>
|
---|
| 21 | <xsl:template name="overview">
|
---|
| 22 |
|
---|
[29429] | 23 | <link rel="stylesheet" type="text/css" href="sites/{$site_name}/transform/pages/style.css"/>
|
---|
[28915] | 24 | <link rel="stylesheet" type="text/css" href="sites/{$site_name}/js/jquery-ui-extra/turnstyle-block.css"/>
|
---|
| 25 |
|
---|
| 26 | <script type="text/javascript" src="https://www.google.com/jsapi"><xsl:text> </xsl:text></script>
|
---|
| 27 | <script type="text/javascript" src="http://beta.data2000.no/sgvizler/release/0.6/sgvizler.js"><xsl:text> </xsl:text></script>
|
---|
| 28 | <script type="text/javascript" src="sites/{$site_name}/js/von-sparql-script.js"><xsl:text> </xsl:text></script>
|
---|
| 29 | <script type="text/javascript" src="sites/{$site_name}/js/von-sparql-setup.js"><xsl:text> </xsl:text></script>
|
---|
| 30 | <script type="text/javascript" src="sites/{$site_name}/js/combobox.js"><xsl:text> </xsl:text></script>
|
---|
| 31 | <script type="text/javascript" src="sites/{$site_name}/js/jquery-ui-extra/turnstyle-block.js"><xsl:text> </xsl:text></script>
|
---|
| 32 |
|
---|
| 33 | <xsl:variable name="protocol" select="substring-before(/page/pageRequest/@baseURL,':')"/>
|
---|
| 34 | <xsl:variable name="baseURL" select="substring-after(/page/pageRequest/@baseURL,':')"/>
|
---|
| 35 | <xsl:variable name="domain" select="substring-before($baseURL,':')"/>
|
---|
| 36 | <xsl:variable name="endpointPath" select="concat($protocol,':',$domain,':3030/greenstone/query')"/>
|
---|
| 37 |
|
---|
[29429] | 38 | <div class="collectionName" >
|
---|
| 39 | <span>Collection Exploration (<xsl:value-of select="$coll_name_short"/>)</span>
|
---|
| 40 | </div>
|
---|
| 41 |
|
---|
[28915] | 42 | <div id="div_PredicateOverview" >
|
---|
| 43 | <div id="sgvzl_PredicateOverview"
|
---|
| 44 | data-sgvizler-endpoint="{$endpointPath}"
|
---|
| 45 | data-sgvizler-chart="google.visualization.Table"
|
---|
| 46 | data-sgvizler-loglevel="2"
|
---|
| 47 | data-sgvizler-chart-options="title=Predicate Overview|width=300"
|
---|
| 48 | >
|
---|
| 49 | <xsl:attribute name="data-sgvizler-query">
|
---|
| 50 |
|
---|
[29429] | 51 | PREFIX gsdl: <http://localhost:3030/greenstone/data/>
|
---|
[28915] | 52 | SELECT (?p as ?Predicate) (COUNT (?s) as ?Total)WHERE
|
---|
| 53 | {
|
---|
[29429] | 54 | GRAPH gsdl:<xsl:value-of select="$coll_name_short"/>{
|
---|
| 55 | ?s ?p ?o
|
---|
| 56 | }
|
---|
[28915] | 57 | }
|
---|
| 58 | GROUP BY ?p
|
---|
| 59 | ORDER BY DESC(?Total)
|
---|
| 60 | </xsl:attribute>
|
---|
| 61 | <xsl:comment>Filler</xsl:comment>
|
---|
| 62 | </div>
|
---|
| 63 | </div>
|
---|
| 64 |
|
---|
| 65 | <div id="searchContainer">
|
---|
| 66 | <div id="div_Selects">
|
---|
| 67 | <label for="sel_Predicate">Select Predicate:</label>
|
---|
| 68 | <select id="sel_Predicate">
|
---|
| 69 | <option value="None"></option>
|
---|
| 70 | </select>
|
---|
| 71 | <br/>
|
---|
| 72 | <input type="checkbox" id="cb_RefineSearch"/> <label for="cb_RefineSearch">Refine search to:</label>
|
---|
| 73 | <br/>
|
---|
| 74 | <div id="refineControls">
|
---|
| 75 | <table class="refineControls" id="table_refineControls">
|
---|
| 76 | <tr>
|
---|
| 77 | <td><label for="sel_RefineObject">Value:</label></td>
|
---|
| 78 | <td><select id="sel_RefineObject" enabled='false'>
|
---|
| 79 | <option value="None">Select predicate above</option>
|
---|
| 80 | </select>
|
---|
| 81 | </td>
|
---|
| 82 | </tr>
|
---|
| 83 | <tr>
|
---|
| 84 | <td>
|
---|
| 85 | <label for="sel_RefinePredicate">Visualize Predicate:</label>
|
---|
| 86 | </td>
|
---|
| 87 | <td>
|
---|
| 88 | <select id="sel_RefinePredicate" enabled='false'>
|
---|
| 89 | </select>
|
---|
| 90 | </td>
|
---|
| 91 | </tr>
|
---|
| 92 | </table>
|
---|
| 93 | </div>
|
---|
| 94 | </div>
|
---|
| 95 | <div id="searchControls">
|
---|
| 96 | <select id="sel_Limit">
|
---|
| 97 | <option value="None">No Limit</option>
|
---|
| 98 | <option value="10">10</option>
|
---|
| 99 | <option value="25">25</option>
|
---|
| 100 | <option value="50">50</option>
|
---|
| 101 | <option value="75">75</option>
|
---|
| 102 | <option value="100">100</option>
|
---|
| 103 | </select>
|
---|
| 104 | <select id="sel_ChartType">
|
---|
| 105 | <option value="google.visualization.Table">Table</option>
|
---|
| 106 | <option value="google.visualization.PieChart">Pie Chart</option>
|
---|
| 107 | <option value="google.visualization.BarChart">Bar Chart</option>
|
---|
| 108 | <option value="google.visualization.ImageSparkLine">Sparkline</option>
|
---|
| 109 | <option value="google.visualization.LineChart">Line Chart</option>
|
---|
| 110 | </select>
|
---|
| 111 | <button type="button" id="btn_ShowChart">Execute Query</button>
|
---|
| 112 | </div>
|
---|
| 113 | <!--
|
---|
| 114 | <div id="#div_autocomplete" style="width:300px;">
|
---|
| 115 | <input id="autocomplete" type="text"/>
|
---|
| 116 | </div> -->
|
---|
| 117 | </div>
|
---|
| 118 |
|
---|
| 119 | <div id="sparqlQuery-turnstyle">
|
---|
| 120 | <div>
|
---|
| 121 | Show Sparql query
|
---|
| 122 | </div>
|
---|
| 123 | <div id="queryContainer" class="documenttext" style="display:none;">
|
---|
| 124 | <span id="span_sparqlQuery"><xsl:comment>filler</xsl:comment></span>
|
---|
| 125 | </div>
|
---|
| 126 | </div>
|
---|
| 127 |
|
---|
| 128 | <div id="sgvzl_container" style="width:675px; height:400px; margin-top:10px; ">
|
---|
| 129 | </div>
|
---|
| 130 | <script type="text/javascript">
|
---|
| 131 | <xsl:text disable-output-escaping="yes">
|
---|
| 132 | <![CDATA[
|
---|
| 133 | var overviewSparqlQuery;
|
---|
| 134 |
|
---|
| 135 | function createOverviewQuery(){
|
---|
| 136 | overviewSparqlQuery = $('#sgvzl_PredicateOverview').attr("data-sgvizler-query");
|
---|
| 137 | }
|
---|
| 138 |
|
---|
| 139 | transformToTurnstyleBlock("sparqlQuery");
|
---|
| 140 |
|
---|
| 141 | function sgvizGo(){
|
---|
| 142 | sgvizler
|
---|
| 143 | .defaultEndpointOutputFormat('jsonp')
|
---|
| 144 | // Add prefixes used in examples:
|
---|
| 145 | .prefix('dc', "http://purl.org/dc/elements/1.1/")
|
---|
| 146 | .prefix('xsd', "http://www.w3.org/2001/XMLSchema#")
|
---|
| 147 |
|
---|
| 148 | // Draw all sgvizler containers on page:
|
---|
| 149 | .containerDrawAll();
|
---|
| 150 |
|
---|
| 151 | createOverviewQuery();
|
---|
| 152 |
|
---|
| 153 | //Load possible predicate values into selector
|
---|
| 154 | updatePredicateSelector();
|
---|
| 155 |
|
---|
| 156 | //Ensure search refinement elements are greyed
|
---|
| 157 | toggle_RefineSearch(0);
|
---|
| 158 | $('#cb_RefineSearch').prop('checked',false);
|
---|
| 159 | }
|
---|
| 160 |
|
---|
| 161 | google.load('visualization','1', {packages: ['corechart']});
|
---|
| 162 | google.setOnLoadCallback(sgvizGo);
|
---|
| 163 | window.onload=setupPage;
|
---|
| 164 | ]]>
|
---|
| 165 | </xsl:text>
|
---|
| 166 | </script>
|
---|
| 167 |
|
---|
| 168 | </xsl:template>
|
---|
| 169 | <!-- the page content -->
|
---|
| 170 | <xsl:template match="/page">
|
---|
| 171 |
|
---|
| 172 | <!--Display the description text of the current collection,
|
---|
| 173 | and if some services are available then create a list
|
---|
| 174 | of links for each service within a <ul id="servicelist"> element.-->
|
---|
| 175 | <gslib:collectionDescriptionTextAndServicesLinks/>
|
---|
| 176 |
|
---|
| 177 | <xsl:call-template name="overview"/>
|
---|
| 178 |
|
---|
| 179 | </xsl:template>
|
---|
| 180 |
|
---|
| 181 | </xsl:stylesheet>
|
---|
| 182 |
|
---|