kavanland
clone your own copy | download snapshot

Snapshots | iceberg

No images in this repository’s iceberg at this time

Inside this repository

forms.py
text/x-python

Download raw (487 bytes)

from django import forms
from textwrap import dedent
from aacore import NS


class ResourceForm(forms.Form):
    node = forms.CharField()


class SparqlForm(forms.Form):
    prefixes = []
    for key, value in NS.items():
        prefixes.append("PREFIX {0}:<{1}>".format(key, value))

    qs = dedent("""{0}

    SELECT DISTINCT ?s
    WHERE {{
        ?s dcterms:coverage "London" .
    }}""".format("\n".join(prefixes)))
    query = forms.CharField(widget=forms.Textarea, initial=qs)