 	(optional :s [lpref :gender] :gender)  \.
 	(optional :gender [:rdfs :label] :gen)  \. 
 	:s [lpref :token] :token  \.))
-        (order-by :lex (desc :num) :pers (desc :gen))))
+        (order-by :lex (desc :num) :pers (desc :gen)))
 
 (defn home []
   (layout/common [:h1 "PDGM Display"]

                 [:hr]
                 (form-to [:post "/pdgm"]
                          [:p "Language:" (text-field "language")]
                          [:p "LangAbbrev:" (text-field "labbrev")]
                          [:p "Value String:" (text-field "valstring")]
                           (submit-button "Get pdgm"))
                          [:hr]))

(defroutes home-routes
  (GET "/" [] (home))
  (POST "/pdgm" [language labbrev valstring] 
       ;; send SPARQL over HTTP request
       (let [req (http/get aama
                           {:query-params

       (let [pquery (sparql/pdgmquery language labbrev valstring)]
         [:p pquery]))

;;(def values (split valstring #","))



(defquery pdgm-qry [language lpref valstring]
        (select :lex :num :pers :gen :token)
        (where (graph [:aamag language]
        :s [lpref :pos] [lpref :Verb]  \.
	:s [:aamas :lang] [:aama (capitalize language)]  \.
	:s [:aamas :lang] :lang  \.
	:lang [:rdfs :label] :langLabel  \.
        ;;(doseq [value values]
        ;;  :s (str ":Q" value) [lpref value] \.
        ;;  (str ":Q" value) [:rdfs :label] value  \.)
        (optional :s [:aamas :lexeme] :lex)  \. 
	(optional :s [lpref :number] :number)  \.
	(optional :number [:rdfs :label] :num)  \. 
