With a FormAppearance you define the dialog between the user and the LDT. You will use a Form appearance whenever you want to use a parameterized query (for example: a search form).

Form appearance

Tweaking the appearance

The appearance of each row can be changed with the elmo:fragment statement:

To use a Form appearance, you create a relationship between a representation and the form. Whenever the main representation is used, the LDT checks if the mandatory parameters are present. If not, the form will be shown: elmo:queryForm stage:some_form.

Example

@prefix elmo: <http://bp4mc2.org/elmo/def#>.
@prefix xhtml: <http://www.w3.org/1999/xhtml/vocab#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix stage: <http://localhost:8080/stage#>. 
stage:search a elmo:Representation;
	elmo:url-pattern "/query/search$";
	elmo:queryForm stage:search_form;
	elmo:contains stage:search_classes;
	elmo:query '''
		select *
		where {
			?item rdf:type <@TYPE@>.
			?item rdfs:label ?item_label.
			FILTER (regex(?item,"@TERM@","i"))
		}
	'''
.
stage:search_form a elmo:Form;
	elmo:fragment [
		elmo:applies-to "term";
		rdfs:label "Zoekterm"@nl;
		rdfs:label "Search term"@en;
		elmo:constraint elmo:MandatoryConstraint;
		elmo:index "1";
	];
	elmo:fragment [
		elmo:applies-to "type";
		rdfs:label "Klasse"@nl;
		rdfs:label "Class"@en;
		elmo:valuesFrom stage:search_classes;
		elmo:constraint elmo:MandatoryConstraint;
		elmo:index "2";
	];
	elmo:fragment [
		elmo:appearance elmo:SubmitAppearance;
		rdfs:label "Search"@en;
		rdfs:label "Zoeken"@nl;
		elmo:index "3";
	]
.
stage:search_classes a elmo:Part;
	elmo:appearance elmo:HiddenAppearance;
	elmo:query '''
		construct {?class rdfs:label ?label}
		where {
			select *
			where {
				?class a ?type.
				?class rdfs:label ?label.
				FILTER(?type=owl:Class || ?type=rdfs:Class)
			}
			limit 100
		}
	''';
.