Template

Difference between revisions of "LexemeQueriesGenerator"

 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== New ==
+
<div id="lqg"></div>
<div id="qglexems"></div>
+
<noinclude>
 +
== Conditional loading ==
 +
This service is conditionally loaded on some specific pages only. To use this template into a page you must add that page's title into [[MediaWiki:Common.js]], in the right IF statement.
 +
* see usages: [[Special:WhatLinksHere/Template:{{PAGENAME}}]]
  
 +
== Dependencies ==
 +
* [[Template:{{PAGENAME}}]] — html hook for the form
 +
** [[MediaWiki:Common.js]] — conditionally loads the script when on the right page(s)
 +
*** [[MediaWiki:{{PAGENAME}}.js]] — main script
  
== Old ==
+
== Helpers ==
<link rel="stylesheet" href="https://maxcdn.boots_trapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
+
* Inspired by : https://sinaahmadi.github.io/SPARQLify/
<form>
+
* [https://jsfiddle.net/hugolpz/9jqg72u8/ Hackpad with OOUI]
  <div class="row">
+
* [[:mw:OOUI/Widgets/Selects and Options|OOUI Select and options widgets]]
    <div class="col">
+
* [https://doc.wikimedia.org/oojs-ui/master/demos/ OOJS/OOUI demo]
      <label for="lemma">Lemma</label>
 
      <input type="text" class="form-control" placeholder="lemma" id="lemma" maxlength="15" name="lemma" id="lemma" value="book">
 
    </div>
 
    <div class="col">
 
      <div class="form-group">
 
        <label for="source_language">Source language</label>
 
        <select class="form-control" id="source_language" name="source_language">
 
          <option value="en">English</option>
 
          <option value="fr">French</option>
 
          <option value="es">Spanish</option>
 
          <option value="pt">Portuguese</option>
 
          <option value="de">German</option>
 
          <option value="it">Italian</option>
 
        </select>
 
      </div>
 
    </div>
 
    <div class="col">
 
      <div class="form-group">
 
        <label for="part_of_speech_tag">Part-of-speech tag</label>
 
        <select class="form-control" id="part_of_speech_tag" name="part_of_speech_tag">
 
          <option>Noun</option>
 
          <option>Adjective</option>
 
          <option>Adverb</option>
 
          <option>Verb</option>
 
        </select>
 
      </div>
 
    </div>
 
  </div>
 
  
  <div class="row">
+
{{Technicals}}
    <div class="col">
+
</noinclude>
      <div class="form-group">
 
        <label for="information_categories">Information to retrieve (if available)</label>
 
        <select class="form-control" id="information_categories" name="information_categories">
 
          <option value="1">Just look it up!</option>
 
          <option value="2">Senses</option>
 
          <option value="3">Senses & Definitions</option>
 
          <option value="4">Senses, Deinitions & Examples</option>
 
        </select>
 
      </div>
 
    </div>
 
    <div class="col">
 
      <div class="form-group">
 
        <label for="translation_languages">Translation language (only with Wikidata)</label>
 
        <select class="form-control" id="translation_languages" name="translation_languages">
 
          <option value="null"></option>
 
          <option value="en">English</option>
 
          <option value="fr">French</option>
 
          <option value="es">Spanish</option>
 
          <option value="pt">Portuguese</option>
 
          <option value="de">German</option>
 
          <option value="it">Italian</option>
 
        </select>
 
      </div>
 
    </div>
 
  </div>
 
 
 
  <div class="form-group">
 
    <label for="exampleFormControlSelect2">Specify your target SPARQL endpoint: </label>
 
    <div class="form-check form-check-inline">
 
      <input class="form-check-input" type="radio" name="target_SPARQL" id="Wikidata" checked>
 
      <label class="form-check-label" for="Wikidata">Wikidata</label>
 
    </div>
 
    <div class="form-check form-check-inline">
 
      <input class="form-check-input" type="radio" name="target_SPARQL" id="Dbnary">
 
      <label class="form-check-label" for="Dbnary">Dbnary</label>
 
    </div>
 
    <div class="form-check form-check-inline">
 
      <input class="form-check-input" type="radio" name="target_SPARQL" id="lingualibre">
 
      <label class="form-check-label" for="lingualibre">LinguaLibre</label>
 
    </div>
 
  </div>
 
 
 
  <div class="form-group">
 
    <div class="row">
 
      <div class="col">
 
        <button type="button" class="btn btn-primary" onclick="generateQuery()" id="generate_query">Generate</button>
 
      </div>
 
      <div class="col">
 
        <div class="form-check">
 
          <input type="checkbox" class="form-check-input" id="limit_100" name="limit_100">
 
          <label class="form-check-label" for="limit_100">LIMIT 100 (for faster running)</label>
 
        </div>
 
      </div>
 
    </div>
 
  </div>
 
 
 
  <div class="form-group">
 
    <!-- <label for="generated_sparql_query">Generated SPARQL query</label> -->
 
    <textarea class="form-control bg-light" id="generated_sparql_query" rows="20" name="generated_sparql_query"></textarea>
 
  </div>
 
  <button type="button" class="btn btn-primary" id="run_query" onclick="runQuery()">Run the query!</button>
 
</form>
 

Latest revision as of 20:46, 28 December 2023

Conditional loading

This service is conditionally loaded on some specific pages only. To use this template into a page you must add that page's title into MediaWiki:Common.js, in the right IF statement.

Dependencies

Helpers

Lingua Libre technical helps
Template {{Speakers category}} • {{Recommended lists}} • {{To iso 639-2}} • {{To iso 639-3}} • {{Userbox-records}} • {{Bot steps}}
Audio files How to create a frequency list?Convert files formatsDenoise files with SoXRename and mass rename
Bots Help:BotsLinguaLibre:BotHelp:Log in to Lingua Libre with PywikibotLingua Libre Bot (gh) • OlafbotPamputtBotDragons Bot (gh)
MediaWiki MediaWiki: Help:Documentation opérationelle MediawikiHelp:Database structureHelp:CSSHelp:RenameHelp:OAuthLinguaLibre:User rights (rate limit) • Module:Lingua Libre record & {{Lingua Libre record}}JS scripts: MediaWiki:Common.jsLastAudios.jsSoundLibrary.jsItemsSugar.jsLexemeQueriesGenerator.js (pad) • Sparql2data.js (pad) • LanguagesGallery.js (pad) • Gadgets: Gadget-LinguaImporter.jsGadget-Demo.jsGadget-RecentNonAudio.js
Queries Help:APIsHelp:SPARQLSPARQL (intermediate) (stub) • SPARQL for lexemes (stub) • SPARQL for maintenanceLingualibre:Wikidata (stub) • Help:SPARQL (HAL)
Reuses Help:Download datasetsHelp:Embed audio in HTML
Unstable & tests Help:SPARQL/test
Categories Category:Technical reports