Changeset 34972 for main


Ignore:
Timestamp:
2021-03-22T22:13:52+13:00 (3 years ago)
Author:
davidb
Message:

Expansion of web/CSS/JS utility; generalization of collection name in XSL files to be more portable

Location:
main/trunk/model-sites-dev/eurovision-lod/collect/eurovision
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/css/eurovision.css

    r34956 r34972  
    9696}
    9797       
     98
     99
     100.showmore-button {
     101  cursor: pointer;
     102  background-color: #999;
     103  color: white;
     104  /* text-transform: uppercase;  */
     105  text-align: center;
     106  /* padding: 7px 5px 5px 5px;  */
     107  /* margin-top: 5px; */
     108  padding: 4px 2px 2px 2px;
     109
     110  margin-bottom: 7px;
     111  width: 120px;
     112}
  • main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/transform/pages/about.xsl

    r34942 r34972  
    99    xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
    1010    xmlns:gslib="http://www.greenstone.org/skinning"
     11    xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"   
    1112    extension-element-prefixes="java util"
    1213    exclude-result-prefixes="java util">
     
    1415
    1516  <xsl:template name="coll-description">
    16         <div id="about-desc">
     17    <gsf:style src="sites/{$site_name}/collect/{$collName}/css/eurovision.css"/>   
     18    <gsf:script src="sites/{$site_name}/collect/{$collName}/js/jquery.show-more.js"/>
     19
     20      <div id="about-desc">
    1721      <h2>Introduction</h2>
    1822      <!--
     
    4448      </p>
    4549
    46       <p>       
    47         At Eurovision there is no division because wherever
    48         you come from Eurovision is home. The Eurovision song
    49         contest is widely known as a safe space for LGBTQIA+
    50         people and a platform for free expression. For example
    51         trans-woman
    52         <a href="https://en.wikipedia.org/wiki/Dana_International">Dana International</a>
    53         won as far back as 1998.
    54         There have been songs in many different languages over the
    55         years, although most are in English these days. This
    56         doesn't matter, however, because music is a language we all
    57         know how to speak.
    58       </p>
    59       <p>       
    60         In its latest incarnation, after
    61         all the performances are over, artists wait
    62         nervously as via the Internet the show's hosts visit each
    63         of the 40+ countries in turn collecting all points cast
    64         by the country appointed juries.  This includes
    65         the all important top score that can be cast, 12 points
    66         (douze points!), a double-increment up from the
    67         10 points awarded to the song a country ranks second,
    68         followed by 8, 7, 6 
 1 points awarded.
    69         Next comes the &quot;the popular vote&quot;
    70         where fans, still grouped by country, have
    71         the votes they cast by phone, SMS or the Eurovision app
    72         tallied and mapped into the same format of 12 points for 1st
    73         place, and so on.
    74         This all culminates in a new winner being crowned, with
    75         the competition usually being hosted the following year
    76         by that country.
    77       </p>
    78 
     50      <div id="about-show-more">
     51        <p>     
     52          At Eurovision there is no division because wherever
     53          you come from Eurovision is home. The Eurovision song
     54          contest is widely known as a safe space for LGBTQIA+
     55          people and a platform for free expression. For example
     56          trans-woman
     57          <a href="https://en.wikipedia.org/wiki/Dana_International">Dana International</a>
     58          won as far back as 1998.
     59          There have been songs in many different languages over the
     60          years, although most are in English these days. This
     61          doesn't matter, however, because music is a language we all
     62          know how to speak.
     63        </p>
     64        <p>     
     65          In its latest incarnation, after
     66          all the performances are over, artists wait
     67          nervously as via the Internet the show's hosts visit each
     68          of the 40+ countries in turn collecting all points cast
     69          by the country appointed juries.  This includes
     70          the all important top score that can be cast, 12 points
     71          (douze points!), a double-increment up from the
     72          10 points awarded to the song a country ranks second,
     73          followed by 8, 7, 6 
 1 points awarded.
     74          Next comes the &quot;the popular vote&quot;
     75          where fans, still grouped by country, have
     76          the votes they cast by phone, SMS or the Eurovision app
     77          tallied and mapped into the same format of 12 points for 1st
     78          place, and so on.
     79          This all culminates in a new winner being crowned, with
     80          the competition usually being hosted the following year
     81          by that country.
     82        </p>
     83      </div>
     84      <gsf:script>
     85        $('#about-show-more').showMore({
     86            minheight: 0,
     87        buttontxtmore:"show more ...",
     88        buttontxtless:"... show less"
     89          });
     90      </gsf:script>
     91
     92     
    7993      <h2>Features of this Website</h2>
    8094
     
    131145         
    132146                  //sgvizler.prefix('dc','http://purl.org/dc/elements/1.1/');
    133               //sgvizler.prefix('gsextracted','http://greenstone.org/gsextracted#');
     147              //sgvizler.prefix('gsdlextracted','http://greenstone.org/gsdlextracted#');
    134148
    135149
    136150          // Exaple triple
    137151          // "s": { "type": "uri" , "value": "http://127.0.0.1:8383/greenstone3/library/collection/eurovision/document/HASH0191e9cc7bfdf14743472257s10" } ,
    138           // "p": { "type": "uri" , "value": "gsextracted:Country" } ,
     152          // "p": { "type": "uri" , "value": "gsdlextracted:Country" } ,
    139153          // "o": { "type": "literal" , "value": "United Kingdom" }
    140154
     
    148162      </script>
    149163
    150 <!--
    151       <div id="sgvizler1-country-count"
    152            data-sgvizler-endpoint="//sowemustthink.space/greenstone3-lod/greenstone/query"         
    153            data-sgvizler-chart="google.visualization.PieChart"
    154            data-sgvizler-loglevel="2"
    155            data-sgvizler-chart-options="title=Number of Songs from each Country"
    156            style="width:650px; height:500px; margin-left: auto; margin-right: auto">
    157         <xsl:attribute name="data-sgvizler-query">
    158           PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
    159               SELECT (?country) (COUNT(?country) AS ?freqCount)
    160               WHERE {
    161                   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
    162                     ?s gsextracted:Country ?country
    163                   }
    164               }
    165               GROUP BY ?country ORDER BY asc(?country)
    166         </xsl:attribute>
    167         <xsl:text> Loading ...</xsl:text>
    168       </div>
    169 
    170 -->
    171164      <div id="sgvizler2-country-count"
    172            data-sgvizler-endpoint="//sowemustthink.space/greenstone3-lod/greenstone/query"
     165           data-sgvizler-endpoint="//sowemustthink.space/greenstone3-lod3/greenstone/query"
    173166           data-sgvizler-chart="google.visualization.BarChart"
    174167           data-sgvizler-chart-options="title=Number of Songs from each Country|legend.position=none|height=900|chartArea.height=840|fontSize=11"
     
    177170           <xsl:attribute name="data-sgvizler-query">
    178171         PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
    179          PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     172         PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    180173         SELECT (?country) (COUNT(?country) AS ?freqCount)       
    181174         WHERE {
    182            GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
    183                        ?s gsextracted:Country ?country
     175           GRAPH &lt;http://localhost:4040/greenstone/data/<xsl:value-of select="$collName"/>&gt;  {
     176                       ?s gsdlextracted:Country ?country
    184177           }
    185178         }
  • main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/transform/pages/sgvizler.xsl

    r34956 r34972  
    6666      <div class="page moreindent">
    6767        <form class="sgvizler-form" id="sample-sparql-query-form"
    68           action="/greenstone3-lod/greenstone/query" target="_blank"
     68          action="/greenstone3-lod3/greenstone/query" target="_blank"
    6969          method="GET" accept-charset="UTF-8">
    7070          <pre>data-sgvizler-query:</pre>
     
    7373<xsl:text>
    7474PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
    75 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     75PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    7676SELECT (?country) (COUNT(?country) AS ?freqCount)       
    7777WHERE {
    78     GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
    79         ?s gsextracted:Country ?country.
     78    GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
     79        ?s gsdlextracted:Country ?country.
    8080   }
    8181}
     
    8989<xsl:text>
    9090&lt;div id="sgvizler-div"
    91      data-sgvizler-endpoint="//sowemustthink.space/greenstone3-lod/greenstone/query"     
     91     data-sgvizler-endpoint="//sowemustthink.space/greenstone3-lod3/greenstone/query"     
    9292     data-sgvizler-chart="google.visualization.BarChart"
    9393     data-sgvizler-chart-options="title=Number of Songs from each Country (sorted by size)|legend.position=none|height=900|chartArea.height=840|fontSize=11"
     
    103103<!-- -->
    104104<xsl:text>
    105 //sowemustthink.space/greenstone3-lod/greenstone/query
     105//sowemustthink.space/greenstone3-lod3/greenstone/query
    106106</xsl:text>
    107107          </textarea>
     
    177177<xsl:text>
    178178PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
    179 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     179PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    180180SELECT (?country) (COUNT(?country) AS ?freqCount)       
    181181WHERE {
    182     GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
    183         ?s gsextracted:Country ?country.
    184         ?s gsextracted:Final "true"
     182    GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
     183        ?s gsdlextracted:Country ?country.
     184        ?s gsdlextracted:Final "true"
    185185   }
    186186}
  • main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/transform/pages/sparql.xsl

    r34960 r34972  
    5252
    5353        <p>
    54           Using this page you can query the linked-data in the Greenstone3 <i>eurovision</i> triple-store
     54          Using this page you can query the linked-data in the Greenstone3 <i>eurovision</i> triplestore
    5555          graph using <a href="https://en.wikipedia.org/wiki/SPARQL">SPARQL</a> query syntax.
    5656          The default query provided in the text box below is effectively issuing a query that
     
    6969         
    7070        </p>
     71
     72        <p>
     73          Alternatively, you might be interested in downloading the complete Triplestore in
     74          TriG syntax.  In which case,
     75          <a href="/greenstone3-lod3/greenstone/query" download="greenstone3-eurovision-lod.ttl">click here</a>
     76          to initiate the download.
     77        </p>
    7178       
    7279      </div>     
     
    8289
    8390      <div class="moreindent">
    84         <form id="sample-sparql-query-form" action="/greenstone3-lod/greenstone/query" target="_blank"
     91        <form id="sample-sparql-query-form" action="/greenstone3-lod3/greenstone/query" target="_blank"
    8592          method="GET" accept-charset="UTF-8">
    8693
     
    8895<!-- -->
    8996<xsl:text>
    90 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     97PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    9198
    9299SELECT ?subject ?predicate ?object WHERE {
    93   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
     100  GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
    94101    ?subject ?predicate ?object
    95102
    96103    # The following removed a triple that stores JSON data that
    97104    # is voluminous but not very interesting to look at
    98     FILTER (?predicate != gsextracted:JSON).
     105    FILTER (?predicate != gsdlextracted:JSON).
    99106  }
    100107}
     
    155162<!-- -->
    156163<xsl:text>
    157 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     164PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    158165
    159166SELECT ?subject ?predicate ?object WHERE {
    160   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
     167  GRAPH &lt;http://localhost:4040/greenstone/data/eurovision-dev&gt;  {
    161168    ?subject ?predicate ?object
    162169
    163170    # The following removed a triple that stores JSON data that
    164171    # is voluminous but not very interesting to look at
    165     FILTER (?predicate != gsextracted:JSON).
    166     ?subject gsextracted:Year "2000".   
     172    FILTER (?predicate != gsdlextracted:JSON).
     173    ?subject gsdlextracted:Year "2000".   
    167174  }
    168175}
     
    175182<!-- -->
    176183<xsl:text>
    177 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     184PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    178185PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
    179186 
    180187SELECT ?subject ?predicate ?object WHERE {
    181   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
     188  GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
    182189    ?subject ?predicate ?object
    183190
    184191    # The following removed a triple that stores JSON data that
    185192    # is voluminous but not very interesting to look at
    186     FILTER (?predicate != gsextracted:JSON).
    187 
    188     ?subject gsextracted:Year ?year.
    189     ?subject gsextracted:Country ?country.   
     193    FILTER (?predicate != gsdlextracted:JSON).
     194
     195    ?subject gsdlextracted:Year ?year.
     196    ?subject gsdlextracted:Country ?country.   
    190197    FILTER (?country = "France").
    191198    FILTER (xsd:integer(?year) >= 1996 &amp;&amp; xsd:integer(?year) &lt;= 2000).
     
    201208<!-- -->
    202209<xsl:text>
    203 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     210PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    204211PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
    205212PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
    206213
    207214SELECT ?esc_entrant_uri ?country ?year WHERE {
    208   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
     215  GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
    209216    ?esc_entrant_uri dc:Relation.isPartOf &lt;http://127.0.0.1:8383/greenstone3/library/collection/eurovision&gt;.
    210217
    211     ?esc_entrant_uri gsextracted:Year ?year.
    212     ?esc_entrant_uri gsextracted:Country ?country.   
     218    ?esc_entrant_uri gsdlextracted:Year ?year.
     219    ?esc_entrant_uri gsdlextracted:Country ?country.   
    213220  }
    214221}
     
    221228<!-- -->
    222229<xsl:text>
    223 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     230PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    224231PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
    225232PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
    226233
    227234SELECT ?country ?year ?total WHERE {
    228   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
     235  GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
    229236    ?esc_entrant_uri dc:Relation.isPartOf &lt;http://127.0.0.1:8383/greenstone3/library/collection/eurovision&gt;.
    230237
    231     ?esc_entrant_uri gsextracted:SingVotesTotal ?total.
     238    ?esc_entrant_uri gsdlextracted:SingVotesTotal ?total.
    232239    BIND(xsd:integer(?total) AS ?total_int).
    233240   
    234     ?esc_entrant_uri gsextracted:Year ?year
     241    ?esc_entrant_uri gsdlextracted:Year ?year
    235242      FILTER(xsd:integer(?year) = 1975).
    236     ?esc_entrant_uri gsextracted:Country ?country.   
     243    ?esc_entrant_uri gsdlextracted:Country ?country.   
    237244  }
    238245}
     
    245252<!-- -->
    246253<xsl:text>
    247 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     254PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    248255PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
    249256PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
    250257
    251258SELECT ?country ?year ?jury_country ?jury_vote WHERE {
    252   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
     259  GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
    253260    ?esc_entrant_uri dc:Relation.isPartOf &lt;http://127.0.0.1:8383/greenstone3/library/collection/eurovision&gt;.
    254261
    255     ?esc_entrant_uri ?gsextracted_jury_country_uri ?jury_vote.
    256     BIND(STRENDS(str(?gsextracted_jury_country_uri),"-J") AS ?is_jury_vote)
     262    ?esc_entrant_uri ?gsdlextracted_jury_country_uri ?jury_vote.
     263    BIND(STRENDS(str(?gsdlextracted_jury_country_uri),"-J") AS ?is_jury_vote)
    257264    FILTER (?is_jury_vote).
    258     BIND(REPLACE(str(?gsextracted_jury_country_uri), ".*#(.*?)-J$", "$1") AS ?jury_country).
    259 
    260     ?esc_entrant_uri gsextracted:Year ?year
     265    BIND(REPLACE(str(?gsdlextracted_jury_country_uri), ".*#(.*?)-J$", "$1") AS ?jury_country).
     266
     267    ?esc_entrant_uri gsdlextracted:Year ?year
    261268      FILTER(xsd:integer(?year) = 1975).
    262     ?esc_entrant_uri gsextracted:Country ?country.
     269    ?esc_entrant_uri gsdlextracted:Country ?country.
    263270
    264271     
     
    273280<!-- -->
    274281<xsl:text>
    275 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     282PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    276283PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
    277284PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
     
    279286
    280287SELECT ?year ?country ?total_max WHERE {
    281   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
     288  GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
    282289
    283290    {
    284291      SELECT ?year (STR(MAX(?total_int_inner)) as ?total_max) WHERE {
    285292     
    286         ?esc_entrant_uri gsextracted:VoteGrandTotal ?total.
     293        ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total.
    287294        BIND(xsd:integer(?total) AS ?total_int_inner).
    288295   
    289         ?esc_entrant_uri gsextracted:Year ?year.
     296        ?esc_entrant_uri gsdlextracted:Year ?year.
    290297      }
    291298      GROUP BY ?year
    292299     }
    293300
    294     ?esc_entrant_uri gsextracted:VoteGrandTotal ?total_max.   
    295     ?esc_entrant_uri gsextracted:Year ?year.
    296     ?esc_entrant_uri gsextracted:Country ?country.
     301    ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total_max.   
     302    ?esc_entrant_uri gsdlextracted:Year ?year.
     303    ?esc_entrant_uri gsdlextracted:Country ?country.
    297304
    298305    BIND(xsd:integer(?total_max) as ?total_int).   
     
    308315<xsl:text>
    309316
    310 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     317PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    311318PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
    312319PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
     
    314321
    315322SELECT ?country (STR(COUNT(?country)) as ?number_of_vote_wins) WHERE {
    316   GRAPH &lt;http://localhost:3030/greenstone/data/eurovision&gt;  {
     323  GRAPH &lt;http://localhost:4040/greenstone/data/</xsl:text><xsl:value-of select="$collName"/><xsl:text>&gt;  {
    317324
    318325
     
    321328
    322329     
    323         ?esc_entrant_uri gsextracted:VoteGrandTotal ?total.
     330        ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total.
    324331        BIND(xsd:integer(?total) AS ?total_int).
    325332   
    326         ?esc_entrant_uri gsextracted:Year ?year.
     333        ?esc_entrant_uri gsdlextracted:Year ?year.
    327334      }
    328335      GROUP BY ?year
    329336    }
    330337
    331     ?esc_entrant_uri gsextracted:VoteGrandTotal ?total_max.   
    332     ?esc_entrant_uri gsextracted:Year ?year.
    333     ?esc_entrant_uri gsextracted:Country ?country.   
     338    ?esc_entrant_uri gsdlextracted:VoteGrandTotal ?total_max.   
     339    ?esc_entrant_uri gsdlextracted:Year ?year.
     340    ?esc_entrant_uri gsdlextracted:Country ?country.   
    334341  }
    335342}
     
    349356<xsl:text>
    350357
    351 PREFIX gsextracted: &lt;http://greenstone.org/gsextracted#&gt;
     358PREFIX gsdlextracted: &lt;http://greenstone.org/gsdlextracted#&gt;
    352359
    353360PREFIX  dbo:  &lt;http://dbpedia.org/ontology/&gt;
     
    388395  }
    389396
    390   ?esc_entrant_uri gsextracted:CountryDBURI ?country_uri_str.
     397  ?esc_entrant_uri gsdlextracted:CountryDBURI ?country_uri_str.
    391398
    392399}
Note: See TracChangeset for help on using the changeset viewer.