Hello, This query works fine and get data i-e Questions, answers, choices
and their score. But when I want to include object property hasComplexity
(its values are 1,2,3,4,5) and try to order it, its not working. (The query
still get data but not in order).
While this works inside Protege and show questions in order:
SELECT *
WHERE { ?questions dd:hasCategory dd:CatPhysics ; dd:hasLevel dd:levEasy ;
dd:hasComplexity ?y} order by ?y


//This query is in Jena code: I copy here it in Jena syntax

 "SELECT  * " +
                " WHERE { "
               + "?Qs mo:Question ?QsDesc. "

                + "?QS mo:hasAnswers ?AnsQ. "
                + "?AnsQ mo:hasQuestion ?Qs. "
                + "?AnsQ mo:ChoiceOne ?ANSONE."
                + "?AnsQ mo:ChoiceTwo ?ANSWTWO."
                + "?AnsQ mo:ChoiceThree ?ANSWTHREE."
                + "?AnsQ mo:CorrChoice ?ANSCORR. "
               + "?Qs mo:hasCategory ?Cat. "
                + "?Cat mo:category ?CatName. "
                + "?Qs mo:hasLevel ?lev. "

               + "?lev mo:level ?LevName. "
               + "?Qs mo:hasScore ?point."
               + "?point mo:score ?Score. "

                 + "?Qs mo:hasComplexity ?l. "

                + "FILTER ( ?CatName ='"+ctg+"' ). "
                + "FILTER ( ?LevName ='"+lvl+"' ). "


           + "}"
                   + "ORDER BY  (?l) "
                + "";

Reply via email to