sqwrl:nth problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

sqwrl:nth problem

qing_tom
This post has NOT been accepted by the mailing list yet.
Dear everyone
I have built custom builtin gtbuiltinint:DTT2, and  for giving (xsd:double) ?r it can correctly return (xsd:int) ?rr with the save value of ?r. but when run the fllowing SQWRL statment, the exception:Exception in thread "main" org.swrlapi.sqwrl.exceptions.SQWRLException: error creating SQWRL query: expecting xsd:int argument for slicing operator sqwrl:nth is thrown.
I was confused that sqwrl:nth(1) can run correctly while sqwrl:nth(?rr) can not.
I am going to crazy.... please help!!!
thank all!!!

SQWRLResult findminw = queryEngine.runSQWRLQuery(
        "findminw","Maintainer(?p)^hasWorking(?p,?w)"
                + ".sqwrl:makeBag(?b,?w).sqwrl:min(?min,?b)^swrlb:lessThanOrEqual(?w,?min)"
                + "^sqwrl:size(?size,?b)^"
                + "swrlm:eval(?r, \"round((size-1) * rand()+1)\", ?size) ^"
                + "gtbuiltinint:DTT2(?rr,?r)"
                + "->sqwrl:select(?p,?w)^sqwrl:orderBy(?w)^sqwrl:nth(?rr)");
                findminw.next();
            System.out.println(findminw.getNamedIndividual(0));