Index: /gs2-extensions/apache-jena/trunk/src/transform/pages/sparql.xsl
===================================================================
--- /gs2-extensions/apache-jena/trunk/src/transform/pages/sparql.xsl	(revision 37137)
+++ /gs2-extensions/apache-jena/trunk/src/transform/pages/sparql.xsl	(revision 37138)
@@ -14,7 +14,60 @@
 
 	<xsl:variable name="groupPath"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/></xsl:variable>
+
+	<xsl:variable name="siteURL"><xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'siteURL']" /></xsl:variable>
+	<xsl:variable name="sparqlEndpointProtocol">http</xsl:variable>
+
+	<xsl:variable name="fuseki3ServletProtocol">
+	  <xsl:value-of select="/page/pageResponse/interfaceOptions/option[@name = 'fuseki3_servlet_protocol']/@value"/>
+	</xsl:variable>
+	<xsl:variable name="fuseki3ServletDomain">
+	  <xsl:value-of select="/page/pageResponse/interfaceOptions/option[@name = 'fuseki3_servlet_domain']/@value"/>
+	</xsl:variable>
+	<xsl:variable name="fuseki3ServletOptPort">
+	  <xsl:value-of select="/page/pageResponse/interfaceOptions/option[@name = 'fuseki3_servlet_opt_port']/@value"/>
+	</xsl:variable>
+	<xsl:variable name="fuseki3ServletContext">
+	  <xsl:value-of select="/page/pageResponse/interfaceOptions/option[@name = 'fuseki3_servlet_context']/@value"/>
+	</xsl:variable>
+  
+
+	
+	<!-- Apache Jena Fuseki v3 -->
+
+	<!--
+	    <xsl:variable name="sparqlEndpointHostAndOptPort">localhost:4040</xsl:variable>
+	    <xsl:variable name="sparqlGraphBasePrefix">http://localhost:8383</xsl:variable>
+
+	    <xsl:variable name="sparqlEndpointPrefix1"></xsl:variable>
+	    <xsl:variable name="sparqlEndpointPrefix3"></xsl:variable>
+	    <xsl:variable name="sparqlEndpoint3">http://localhost:4040</xsl:variable>
+	    
+	    <xsl:variable name="graphURI"><xsl:value-of select="$sparqlGraphBasePrefix"/><xsl:value-of select="$siteURL"/><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/></xsl:variable>
+	-->
+
+	<!--
+	<xsl:variable name="sparqlEndpointHostAndOptPort">intermuse.sowemustthink.space</xsl:variable>
+	<xsl:variable name="sparqlGraphBasePrefix">https://intermuse.so-we-must-think.space</xsl:variable> < ! - - FULL_GREENSTONE_URL_PREFIX marker --> <!-- This marker can only appear ONCE in file, as it is processed by sed - - >
+
+	<xsl:variable name="sparqlEndpointPrefix1">/greenstone3-lod</xsl:variable>
+	<xsl:variable name="sparqlEndpointPrefix3">/greenstone3-lod3</xsl:variable>
+	<xsl:variable name="sparqlEndpoint3">https://intermuse.sowemustthink.space/greenstone3-lod3</xsl:variable>
+
+	<xsl:variable name="graphURI"><xsl:value-of select="$sparqlGraphBasePrefix"/><xsl:value-of select="$siteURL"/><xsl:value-of select="$site_name"/>-library/collection/<xsl:value-of select="$collName"/></xsl:variable>
+	-->
+
+
+	<xsl:variable name="sparqlEndpointHostAndOptPort"><xsl:value-of select="$fuseki3ServletDomain"/><xsl:if test="$fuseki3ServletOptPort != ''">:<xsl:value-of select="$fuseki3ServletOptPort"/></xsl:if></xsl:variable>
+	<xsl:variable name="sparqlGraphBasePrefix"><xsl:value-of select="$fuseki3ServletProtocol"/>://<xsl:value-of select="$fuseki3ServletDomain"/></xsl:variable> 
+	<xsl:variable name="sparqlEndpointPrefix3"><xsl:value-of select="$fuseki3ServletContext"/></xsl:variable>
+	<xsl:variable name="sparqlEndpoint3"><xsl:value-of select="$fuseki3ServletProtocol"/>://<xsl:value-of select="$fuseki3ServletDomain"/><xsl:value-of select="$sparqlEndpointPrefix3"/></xsl:variable>
+
+	<xsl:variable name="graphURI"><xsl:value-of select="$sparqlGraphBasePrefix"/><xsl:value-of select="$siteURL"/>/<xsl:value-of select="$servletContext"/>/<xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/></xsl:variable>
+
+	
+	
 	<!-- set page title -->
 	<xsl:template name="pageTitle">SPARQL Query</xsl:template>
-
+	
 	<!-- set page breadcrumbs -->
 	<xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/>
@@ -50,9 +103,12 @@
 
 	    <p>
-	      Using this page you can query the linked-data in the Greenstone3 <i>eurovision</i> triplestore
-	      graph using <a href="https://en.wikipedia.org/wiki/SPARQL">SPARQL</a> query syntax.
-	      The default query provided in the text box below is effectively issuing a query that
-	      returns everything stored (a bit like matching with the wildcard '*' that some text-based search
-	      systems have), limited to show just the first 500 entries that matched.
+	      Using this page you can query the linked-data in the
+	      Greenstone3 triplestore graph using
+	      <a href="https://en.wikipedia.org/wiki/SPARQL">SPARQL</a>
+	      query syntax.  The default query provided in the text
+	      box below is effectively issuing a query that returns
+	      everything stored (a bit like matching with the wildcard
+	      '*' that some text-based search systems have), limited
+	      to show just the first 500 entries that matched.
 	    </p>
 	    
@@ -85,11 +141,13 @@
 		  <li>
 		    <!-- endpoint -->
-		    <a href="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/greenstone/data" download="greenstone3-eurovision-lod.trig">Full Export in TriG Syntax</a>
+		    <a href="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/greenstone/data" download="greenstone3-{$collNameChecked}-lod.trig">Full Export in TriG Syntax</a>
 
 		  </li>
 		  <li>
 		    <!-- endpoint -->
-		    <a href="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/greenstone/data" download="greenstone3-eurovision-lod.ttl">Full Export in Turtle Syntax</a>
-//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/greenstone/data		    		    
+		    <a href="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/greenstone/data" download="greenstone3-{$collNameChecked}-lod.ttl">Full Export in Turtle Syntax</a>
+		    <!--
+			//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/greenstone/data		    		    
+		    -->
 		  </li>
 		</ul>
@@ -136,5 +194,4 @@
 </xsl:text>
 	      </textarea>
-	      
 	      <div style="display:none;">
 		<div>
@@ -154,7 +211,7 @@
 		    <option value=""></option>
 		    <!-- endpoint -->
-		    <option value="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix1}/xml-to-html.xsl">xml-to-html</option>
-		    <option value="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix1}/xml-to-html-links.xsl" selected="selected">xml-to-html-links</option>
-		    <option value="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix1}/xml-to-html-plain.xsl">xml-to-html-plain</option>
+		    <option value="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/xml-to-html.xsl">xml-to-html</option>
+		    <option value="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/xml-to-html-links.xsl" selected="selected">xml-to-html-links</option>
+		    <option value="//{$sparqlEndpointHostAndOptPort}{$sparqlEndpointPrefix3}/xml-to-html-plain.xsl">xml-to-html-plain</option>
 		  </select>
 		</div>
@@ -173,548 +230,5 @@
 	  </div>
 
-	  <div>
-	    <h2>Sample Queries</h2>
-
-	    <p>
-	      The sample queries provided below gradually increase in
-	      the query syntax complexity used.  They are intended
-	      primarily for illustrative purposes, to introduce a user
-	      unfamiliar to various aspects of SPARQL query syntax.
-	      Click on one of the <i>Load query above</i> buttons to load
-	      the relevant query syntax into the SPARQL Query textbox
-	      above, then press <i>Get Results</i> to initiate the
-	      query.
-	    </p>
-	      
-	    <div id="ssq-restrict-year" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-
-SELECT ?subject ?predicate ?object WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-    ?subject ?predicate ?object.
-    ?subject gsdlextracted:Year "2000".    
-  }
-}
-OFFSET 0 LIMIT 200
-</xsl:text>
-	    </div>
-
-	    <div id="ssq-restrict-year-then-filter" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-
-SELECT ?subject ?predicate ?object WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-    ?subject ?predicate ?object.
-    ?subject gsdlextracted:Year "2000".    
-
-    # The following removes a triple that stores JSON data that
-    # is voluminous but not very interesting to look at
-    FILTER (?predicate != gsdlextracted:JSON).
-  }
-}
-OFFSET 0 LIMIT 200
-</xsl:text>
-	    </div>
-	    
-
-	    <div id="ssq-restrict-country-and-year" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
-  
-SELECT ?subject ?predicate ?object WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-    ?subject ?predicate ?object
-
-    # The following removes a triple that stores JSON data that
-    # is voluminous but not very interesting to look at
-    FILTER (?predicate != gsdlextracted:JSON).
-
-    ?subject gsdlextracted:Year ?year.
-    ?subject gsdlextracted:Country ?country.    
-    FILTER (?country = "France").
-    FILTER (xsd:integer(?year) >= 1996 &amp;&amp; xsd:integer(?year) &lt;= 2000).
-
-  }
-}
-OFFSET 0 LIMIT 200
-</xsl:text>
-	    </div>
-
-
-	    
-	    <div id="ssq-esc-entrants" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
-PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
-
-SELECT ?esc_entrant_uri ?country ?year WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-    ?esc_entrant_uri dc:Relation.isPartOf &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;.
-
-    ?esc_entrant_uri gsdlextracted:Year ?year.
-    ?esc_entrant_uri gsdlextracted:Country ?country.    
-  }
-}
-ORDER BY ASC(?year) ?country
-</xsl:text>
-	    </div>
-
-	    <div id="ssq-esc-entrants-with-key" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
-PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
-PREFIX essentia: &lt;http://upf.edu/essentia#&gt;
-
-SELECT ?esc_entrant_uri ?country ?year ?musical_key ?scale ?strength_estimate WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-    ?esc_entrant_uri dc:Relation.isPartOf &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;.
-
-    ?esc_entrant_uri gsdlextracted:Year ?year.
-    ?esc_entrant_uri gsdlextracted:Country ?country.
-    ?esc_entrant_uri essentia:tonal_key_edma_key ?musical_key.
-    ?esc_entrant_uri essentia:tonal_key_edma_scale ?scale.
-    ?esc_entrant_uri essentia:tonal_key_edma_strength ?strength_estimate.
-  }
-}
-ORDER BY ASC(?year) ?country
-</xsl:text>
-	    </div>
-	    
-
-	    <div id="ssq-esc-winners-freq-count-scale" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
-PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
-PREFIX essentia: &lt;http://upf.edu/essentia#&gt;
-
-
-SELECT ?scale (STR(COUNT(?scale)) as ?number_in_scale) WHERE {
-#SELECT ?scale ?country ?year WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-     
-    ?esc_entrant_uri gsdlextracted:Place "1".
-    # ?esc_entrant_uri essentia:tonal_key_edma_key ?musical_key.
-    ?esc_entrant_uri essentia:tonal_key_edma_scale ?scale.
-
-    ?esc_entrant_uri gsdlextracted:Year ?year.
-    ?esc_entrant_uri gsdlextracted:Country ?country.    
-  }
-}
-GROUP BY ?scale
-ORDER BY DESC(?number_in_scale)
-</xsl:text>
-	    </div>
-
-	    
-	    <div id="ssq-jury-votes-totals-1975" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
-PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
-
-SELECT ?country ?year ?total WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-    ?esc_entrant_uri dc:Relation.isPartOf &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;.
-
-    ?esc_entrant_uri gsdlextracted:SingVotesTotal ?total.
-    BIND(xsd:integer(?total) AS ?total_int).
-    
-    ?esc_entrant_uri gsdlextracted:Year ?year
-      FILTER(xsd:integer(?year) = 1975).
-    ?esc_entrant_uri gsdlextracted:Country ?country.    
-  }
-}
-ORDER BY DESC(?total_int)
-</xsl:text>
-	    </div>
-
-	    
-	    <div id="ssq-jury-votes-1975" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
-PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
-
-SELECT ?country ?year ?jury_country ?jury_vote WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-    ?esc_entrant_uri dc:Relation.isPartOf &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;.
-
-    ?esc_entrant_uri ?gsdlextracted_jury_country_uri ?jury_vote.
-    BIND(STRENDS(str(?gsdlextracted_jury_country_uri),"-J") AS ?is_jury_vote)
-    FILTER (?is_jury_vote).
-    BIND(REPLACE(str(?gsdlextracted_jury_country_uri), ".*#(.*?)-J$", "$1") AS ?jury_country).
-
-    ?esc_entrant_uri gsdlextracted:Year ?year
-      FILTER(xsd:integer(?year) = 1975).
-    ?esc_entrant_uri gsdlextracted:Country ?country.
-
-      
-  }
-}
-ORDER BY ASC(?year) ?country  
-</xsl:text>
-	    </div>
-
-
-	    <div id="ssq-winning-totals" style="display: none;">
-<!-- -->
-<xsl:text>
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
-PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
-
-SELECT ?year ?country ?total_max WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-
-    { 
-      SELECT ?year (STR(MAX(?total_int_inner)) as ?total_max) WHERE {
-      
-        ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total.
-        BIND(xsd:integer(?total) AS ?total_int_inner).
-    
-        ?esc_entrant_uri gsdlextracted:Year ?year.
-      }
-      GROUP BY ?year
-     }
-
-    ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total_max.    
-    ?esc_entrant_uri gsdlextracted:Year ?year.
-    ?esc_entrant_uri gsdlextracted:Country ?country.
-
-    BIND(xsd:integer(?total_max) as ?total_int).    
-  }
-}
-ORDER BY DESC(?total_int)
-</xsl:text>
-	    </div>
-
-
-	    <div id="ssq-winning-freq-count" style="display: none;">
-<!-- -->
-<xsl:text>
-
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
-PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
-
-
-SELECT ?country (STR(COUNT(?country)) as ?number_of_vote_wins) WHERE {
-  GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-    { 
-      SELECT ?year (STR(MAX(?total_int)) as ?total_max) WHERE {      
-        ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total.
-        BIND(xsd:integer(?total) AS ?total_int).
-    
-        ?esc_entrant_uri gsdlextracted:Year ?year.
-      }
-      GROUP BY ?year
-    }
-
-    ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total_max.    
-    ?esc_entrant_uri gsdlextracted:Year ?year.
-    ?esc_entrant_uri gsdlextracted:Country ?country.    
-  }
-}
-GROUP BY ?country
-ORDER BY DESC(?number_of_vote_wins)
-</xsl:text>
-	    </div>
-
-
-
-	    <div id="ssq-from-winning-to-losing" style="display: none;">
-<!-- -->
-<xsl:text>
-	    
-PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
-PREFIX xsd:  &lt;http://www.w3.org/2001/XMLSchema#&gt;
-PREFIX dc:   &lt;http://purl.org/dc/elements/1.1/&gt;
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-
-SELECT (?country as ?Country) (?year AS ?WinningYear) (?total as ?WinningGrandTotal) (?next_year AS ?LosingYear) (?next_total as ?LosingGrandTotal) 		 
-WHERE {
-    GRAPH &lt;</xsl:text><xsl:value-of select="$graphURI"/><xsl:text>&gt;  {
-        ?esc_entrant_uri gsdlextracted:Country ?country.
-        ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total.
-
-	?esc_entrant_uri gsdlextracted:Place ?place.
-        BIND(xsd:integer(?place) AS ?place_int).	
-	FILTER(?place_int = 1).	
-
-	?esc_entrant_uri gsdlextracted:Year ?year.
-	BIND(xsd:integer(?year) AS ?year_int).
-	BIND(?year_int + 1 AS ?next_year_int).
-	BIND(str(?next_year_int) AS ?next_year).
-
-        ?next_esc_entrant_uri gsdlextracted:Country ?country.
-	?next_esc_entrant_uri gsdlextracted:Year ?next_year.
-	
-        ?next_esc_entrant_uri gsdlextracted:VoteGrandTotal ?next_total.
-
-        ?next_esc_entrant_uri gsdlextracted:ReverseFinishingPos ?rev_finishing_pos.
-        BIND(xsd:integer(?rev_finishing_pos) AS ?rev_finishing_pos_int).
-        FILTER(?rev_finishing_pos_int = 1).
-	
-	
-   }
-}
-ORDER BY ?country
-</xsl:text>
-	    </div>
-
-	    <div id="ssq-country-info" style="display: none;">
-<!-- 
-  Adapted from:
-     https://stackoverflow.com/questions/40069644/retrieve-information-about-all-european-countries
--->
-<xsl:text>
-
-PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
-
-PREFIX  dbo:  &lt;http://dbpedia.org/ontology/&gt;
-PREFIX  dbp:  &lt;http://dbpedia.org/property/&gt;
-PREFIX  dct:  &lt;http://purl.org/dc/terms/&gt;
-#PREFIX  geo:  &lt;http://www.opengis.net/ont/geosparql#&gt;
-
-PREFIX geo: &lt;http://www.w3.org/2003/01/geo/wgs84_pos#&gt;
-
-SELECT DISTINCT ?country_uri ?capital ?area ?populationTotal ?lat ?long
-     ?currency ?gdpPppPerCapita ?giniCoefficient WHERE {
-
-  SERVICE &lt;https://dbpedia.org/sparql&gt; {
-
-    ?db_country_uri dbo:capital ?db_capital.
-
-    BIND(?db_country_uri AS ?country_uri).
-    BIND(str(?db_country_uri) AS ?country_uri_str).
-    BIND(?db_capital AS ?capital).
-
-#    OPTIONAL {
-#      ?country_uri dbp:areaKm          ?area.          
-#      ?country_uri dbo:populationTotal ?populationTotal.
-#      ?country_uri geo:lat             ?lat.            
-#      ?country_uri geo:long            ?long.
-#    }
-
-    OPTIONAL { ?country_uri dbp:areaKm          ?area.            }
-    OPTIONAL { ?country_uri dbo:populationTotal ?populationTotal. }
-    OPTIONAL { ?capital     geo:lat             ?lat.             }
-    OPTIONAL { ?capital     geo:long            ?long.            }
-    
-    OPTIONAL { ?country_uri dbp:currencyCode    ?currency.        }
-    OPTIONAL { ?country_uri dbp:gdpPppPerCapita ?gdpPppPerCapita.  }
-
-    OPTIONAL { ?country_uri dbo:giniCoefficient ?giniCoefficient. }
-  }
-
-  ?esc_entrant_uri gsdlextracted:CountryDBURI ?country_uri_str.
-
-}
-ORDER BY ASC(?country_uri)  
-</xsl:text>
-	    </div>
-
-	  
-	    
-	    <ul class="ssq">
-	      <li>
-		<b>Year Restricted (raw data rows):</b><br />
-		<button type="button" class="load-ssq" id="load-ssq-restrict-year" onclick="ssq_load('ssq-restrict-year')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-restrict-year" onclick="ssq_execute()">Get Results</button><br />
-		<p>Similar to the default query (all results returned) but restricted to entries associated with the year 2000.</p>
-	      </li>
-
-	      <div id="raw-sparql-show-more" class="showmore">
-		<style>
-		  #showmore-button-raw-sparql-show-more { width: 260px; }
-		</style>
-		
-		<li>
-		  <b>Year Restricted (raw data rows) then filter out <i>gsdlextracted:JSON</i> entries:</b><br/>
-		  <button type="button" class="load-ssq" id="load-ssq-restrict-year-then-filter" onclick="ssq_load('ssq-restrict-year-then-filter')">Load query above</button>
-		  <button type="button" class="exec-ssq" id="exec-ssq-restrict-year-then-filter" onclick="ssq_execute()">Get Results</button><br/>
-		  <p>
-		    Similar to the previous query (restricted to results from 2000) but filtering out the voluminous, but not very interesting to look at,
-		    <i>gsdlextracted:JSON</i>.
-		  </p>
-		  <p>
-		    This field is formed by Greenstone at ingest-time: it represents all the metadata fields for a particular country
-		    stored in the JSON format.  It is a handy item for the Greenstone3 runtime-system to access, but in the context of viewing the output
-		    of SPARQL queries at HTML only serves to pollute the generated result set with large text items.
-		  </p>
-		</li>
-		
-		<li>
-		  <b>Country and Year Restricted (raw data rows):</b><br/>
-		  <button type="button" class="load-ssq" id="load-ssq-restrict-country-and-year" onclick="ssq_load('ssq-restrict-country-and-year')">Load query above</button>
-		  <button type="button" class="exec-ssq" id="exec-ssq-restrict-country-and-year" onclick="ssq_execute()">Get Results</button><br/>
-		  
-		  <p>Similar to the previous query, but restricted to entries about the country France, in the years 1996-2000.</p>
-		</li>
-	      </div>
-	      <gsf:script>
-		$('#raw-sparql-show-more').showMore({
-	          minheight: 0,
-	  	  buttontxtmore:"show further raw-data queries ...",
-		  buttontxtless:"... show less"
-	        });
-	      </gsf:script>	    
-
-	      <li>
-		<b>Eurovision Song Contest (ESC) entrants:</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-esc-entrants" onclick="ssq_load('ssq-esc-entrants')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-esc-entrants" onclick="ssq_execute()">Get Results</button><br/>
-		
-		<p>List all the entrants (country and year) sorted by year, then by country.</p>
-	      </li>
-
-	      <li>
-		<b>Eurovision Song Contest (ESC) entrants with (estimated) musical key:</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-esc-entrants-with-key" onclick="ssq_load('ssq-esc-entrants-with-key')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-esc-entrants-with-key" onclick="ssq_execute()">Get Results</button><br/>
-		
-		<p>
-		  Similar to the above query that list all the entrants (country and year) sorted by year, then by country, but also displays
-		  the estimated key signature of the song, which is pre-computed using the Essentia audio content analysis toolkit
-		  when the collection is built.
-		</p>
-	      </li>
-
-	      <li>
-		<b>Musical scale comparison of winning entries:</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-esc-winners-freq-count-scale" onclick="ssq_load('ssq-esc-winners-freq-count-scale')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-esc-winners-freq-count-scale" onclick="ssq_execute()">Get Results</button><br/>
-		
-		<p>
-		  Frequency count of the scale (major or minor) that
-		  winning songs were in.  The estimated musical scale
-		  of the song is an estimate, pre-computed using the
-		  Essentia audio content analysis toolkit when the
-		  collection is built.
-		</p>
-	      </li>
-
-	      	      
-	      <li>
-		<b>Voting Totals in 1975:</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-jury-votes-totals-1975" onclick="ssq_load('ssq-jury-votes-totals-1975')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-jury-votes-totals-1975" onclick="ssq_execute()">Get Results</button><br/>
-		
-		<p>In 1975 all voting was done exclusively by jury.  This query retrieves the
-		totals of this Single voting format, and orders them by that score.</p>
-	      </li>
-
-            
-	      
-	      <li>
-		<b>Jury Votes Cast by Country in 1975:</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-jury-votes-1975" onclick="ssq_load('ssq-jury-votes-1975')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-jury-votes-1975" onclick="ssq_execute()">Get Results</button><br/>
-		
-		<p>List all votes case in the 1975 competition.</p>
-	      </li>
-
-
-	      <li>
-		<b>Most points won:</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-winning-totals" onclick="ssq_load('ssq-winning-totals')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-winning-totals" onclick="ssq_execute()">Get Results</button><br/>
-		
-		<p>List the countries which won and their voting totals, sorted by total score.</p>
-	      </li>
-
-	      <li>
-		<b>Number of Times Countries Have Won:</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-winning-freq-count" onclick="ssq_load('ssq-winning-freq-count')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-winning-freq-count" onclick="ssq_execute()">Get Results</button><br/>
-
-		<p>
-		  The number of times a country has won Eurovision
-		  across the years.  The includes the years when only
-		  Juries voted (1956-2000) through to the introduction
-		  of Televotes, where a variety of forms have been
-		  used such as only Televotes, a pre-combined score
-		  based on Televotes and Jury votes, to (from 2016
-		  onwards) where the Jury and Tele votes are
-		  explicitly given individually per country, then
-		  combined.
-  
-		</p>
-		<p>
-		  This query works off the Voting Totals countries
-		  received, and so if you run the query you'll see
-		  that it computes (as of 2021) that France has won 6
-		  times, when the official record puts this at 5 for
-		  France.  This is due to a tie that occurred between
-		  Sweeden and France in the 1991 final, and how it was
-		  resolved.  From <a target="_blank"
-		  href="https://en.wikipedia.org/wiki/France_in_the_Eurovision_Song_Contest_1991"
-		  hrefXXXX="https://en.wikipedia.org/wiki/Le_Dernier_qui_a_parl%C3%A9...">Wikipedia</a>:
-		  âAfter the four-way tie at the 1969 contest, a
-		  tie-break system had been implemented, where a
-		  count-back on the number of top points awarded was
-		  used. Since both countries received four 12-points,
-		  but Sweden gaining five 10-points over France's two,
-		  Sweden was declared the winner with France coming
-		  second.â  
-		  
-		  
-		</p>
-	      </li>
-
-
-
-	      <li>
-		<b>From Hero to Zero!</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-from-winning-to-losing" onclick="ssq_load('ssq-from-winning-to-losing')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-from-winning-to-losing" onclick="ssq_execute()">Get Results</button><br/>
-
-		<p>
-		  List countries where, having won in one year, they
-		  have gone on to lose with the lowest score of the
-		  contest the following year.  Note this definition
-		  doesn't quite meet the given heading of <i>From Here
-		  to Zero</i>. There is in fact only one country, to
-		  date, where this has happened (nul-point the
-		  following year).  View the table to see who it is
-		  ...  then why not test out your SPARQL querying
-		  skills and see if you can modify the query used so
-		  it only returns the Hero to Zero case?
-		</p>
-	      </li>
-
-	      <li>
-		<b>Facts and Figures About Competing Countries:</b><br/>
-		<button type="button" class="load-ssq" id="load-ssq-country-info" onclick="ssq_load('ssq-country-info')">Load query above</button>
-		<button type="button" class="exec-ssq" id="exec-ssq-country-info" onclick="ssq_execute()">Get Results</button><br/>
-		
-		<p>
-		  Demographics about other related information about the countries the song contest entries are from.
-		  Query takes a bit longer to run than the previous ones.
-		</p>
-	      </li>
-	      
-	    </ul>
-
-	    <p>
-	      Looking for something a bit more visual?  Why not head over to our 
-	      <a href="{$library_name}/collection/{$collName}/page/sgvizler"><i>SGVizler page</i></a> and try the SPARQL-based visualization samples there.
-	    </p>
-	    
-	  </div>
+
 	</xsl:template>
 	
