"object property hasComplexity (its values are 1,2,3,4,5)"
-> why do you say it's an object property if the values are numerical?
Moreover, you compare two different queries and then say one works in
Protege, the other not. That is a totally useless statement. It should
be clear that you should compare the SAME queries
It remains open what kind of RDF term the complexity values
are...literals or resources
On 03.02.2017 16:18, Sidra shah wrote:
> 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) "
> + "";
>