<commit_before>{% extends "base.html" %}{% load humfrey_desc %}

{% block title %}SPARQL{% endblock %}

{% block body %}
  <article>
    <h1>SPARQL</h1>
    
    {% block sparql_results %}{% endblock %}

    <h2>Query</h2>

    <form method="get" action="{% url sparql %}">
      <table>
        <tbody>
          {{ form }}
        </tbody>
        <tfoot>
          <tr><td colspan="2" style="text-align:center; padding:1em">
            <input type="submit" value="Query"/>
          </tr></td>
        </tfoot>
      </table>
    </form>
    
    {% include "queries.html" %}
  
  </article>
{% endblock %}
<commit_msg>added ability to view common prefixes in the SPARQL endpoint.<commit_after>{% extends "base.html" %}{% load humfrey_desc %}

{% block title %}SPARQL{% endblock %}

{% block body %}
    <script type="text/javascript">
  	function changePrefixes()
		{
		if (document.getElementById('showprefixes').innerHTML != 'hide')
		{
			document.getElementById('prefixes').style.display = '';
			document.getElementById('showprefixes').innerHTML = 'hide';
		}else{
			document.getElementById('prefixes').style.display = 'none';
			document.getElementById('showprefixes').innerHTML = 'show';	
		}
		}
	
	</script>
  <article>
    <h1>SPARQL</h1>
    
    {% block sparql_results %}{% endblock %}

    <h2>Query</h2>

    <form method="get" action="{% url sparql %}">
      <table>
        <tbody>
			<tr><th>{{ form.query.label_tag }}:</th><td>{{ form.query.errors }}{{ form.query }}</td></tr>
			<tr><th>{{ form.format.label_tag }}:</th><td> {{ form.format.errors }}{{ form.format }}</td></tr>
			<tr><th>{{ form.common_prefixes.label_tag }}:</th>
			<td>{{ form.common_prefixes.errors }}{{ form.common_prefixes }} {{ form.common_prefixes.help_text }} 
				(<a id="showprefixes" onclick="changePrefixes(); return false;" href="">show</a>) </td></tr>
			<tr id="prefixes" style="display:none"><th>Common prefixes:</th>
			<td>
			<code>
				<table >
					<td>
						{% for prefix, URI in namespaces %}
							PREFIX {{prefix}}:<br/>
						{% endfor %}
					</td>
					<td>
						{% for prefix, URI in namespaces %}
							&lt;{{URI}}&gt;<br/>
						{% endfor %}
					</td></tr>
					
				</table>
			</code>
			</td></tr>
        </tbody>
        <tfoot>
          <tr><td colspan="2" style="text-align:center; padding:1em">
            <input type="submit" value="Query"/>
          </tr></td>
        </tfoot>
      </table>
    </form>
    
    {% include "queries.html" %}
  
  </article>
{% endblock %}
{'fraction_non_alphanumeric': 0.20747217806041335, 'fraction_numerical': 0.0047694753577106515, 'mean_word_length': 2.6584302325581395, 'pattern_counts': {'":': 0, '<': 80, '<?xml version=': 0, '>': 80, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2388805', 'n_tokens_mistral': 1007, 'n_tokens_neox': 853, 'n_words': 163}