You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by neha gupta <ne...@gmail.com> on 2016/09/28 10:52:27 UTC

filter error in query

SELECT  *" +
                " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal  ?goal
. ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins<?goal )  ";

Is this syntax correct because it gives me error:* Encountered " "filter"
"filter "" at line 1, column 265.*

Re: filter error in query

Posted by Andy Seaborne <an...@apache.org>.

On 29/09/16 13:07, neha gupta wrote:
> Thank you Lorenz, yes I am really enjoying learning Jena and also enjoying
> this supportive group.
> However, still I did not receive any guidance from my earlier question.
>
> *how can we add/sum  data property values (newly entered) with previous
> ones?*

See the thread for the first time you asked this around 2016-09-11.

"Calculating numeric values of Data property in Ontology"

>
>
> On Thu, Sep 29, 2016 at 4:10 AM, Lorenz Buehmann <
> buehmann@informatik.uni-leipzig.de> wrote:
>
>> Ok, happy to hear that it works now. Although it would be interesting to
>> know what "random changes" you did. Nevertheless, have fun in using Jena.
>>
>>
>> On 29.09.2016 12:34, neha gupta wrote:
>>> I am sorry Lorenz for late reply. It gives me the now the integer
>> number. I
>>> do not know even now how, but I made some random changes to the code and
>> it
>>> shows me the result now.
>>>
>>> Kind regards
>>>
>>> On Thu, Sep 29, 2016 at 12:33 AM, Lorenz B. <
>>> buehmann@informatik.uni-leipzig.de> wrote:
>>>
>>>> Obviously not, otherwise you wouldn't get a parse exception?! You can't
>>>> have a filter outside of the query. See SPARQL specs and/or tutorials.
>>>>
>>>> And that's what we already told you in the other thread.
>>>>
>>>> You know, it's really strange that you do not answer our questions. So
>>>> again, how can you get the exception with the literals given that your
>>>> query does not compile and thus you can't get to the point where
>>>> literals would have been parsed to Java objects?
>>>>
>>>>> SELECT  *" +
>>>>>                 " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal
>>>> ?goal
>>>>> . ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins<?goal )  ";
>>>>>
>>>>> Is this syntax correct because it gives me error:* Encountered "
>> "filter"
>>>>> "filter "" at line 1, column 265.*
>>>>>
>>>> --
>>>> Lorenz B�hmann
>>>> AKSW group, University of Leipzig
>>>> Group: http://aksw.org - semantic web research center
>>>>
>>>>
>>
>>
>

Re: filter error in query

Posted by neha gupta <ne...@gmail.com>.
Thank you Lorenz, yes I am really enjoying learning Jena and also enjoying
this supportive group.
However, still I did not receive any guidance from my earlier question.

*how can we add/sum  data property values (newly entered) with previous
ones?*


On Thu, Sep 29, 2016 at 4:10 AM, Lorenz Buehmann <
buehmann@informatik.uni-leipzig.de> wrote:

> Ok, happy to hear that it works now. Although it would be interesting to
> know what "random changes" you did. Nevertheless, have fun in using Jena.
>
>
> On 29.09.2016 12:34, neha gupta wrote:
> > I am sorry Lorenz for late reply. It gives me the now the integer
> number. I
> > do not know even now how, but I made some random changes to the code and
> it
> > shows me the result now.
> >
> > Kind regards
> >
> > On Thu, Sep 29, 2016 at 12:33 AM, Lorenz B. <
> > buehmann@informatik.uni-leipzig.de> wrote:
> >
> >> Obviously not, otherwise you wouldn't get a parse exception?! You can't
> >> have a filter outside of the query. See SPARQL specs and/or tutorials.
> >>
> >> And that's what we already told you in the other thread.
> >>
> >> You know, it's really strange that you do not answer our questions. So
> >> again, how can you get the exception with the literals given that your
> >> query does not compile and thus you can't get to the point where
> >> literals would have been parsed to Java objects?
> >>
> >>> SELECT  *" +
> >>>                 " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal
> >> ?goal
> >>> . ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins<?goal )  ";
> >>>
> >>> Is this syntax correct because it gives me error:* Encountered "
> "filter"
> >>> "filter "" at line 1, column 265.*
> >>>
> >> --
> >> Lorenz Bühmann
> >> AKSW group, University of Leipzig
> >> Group: http://aksw.org - semantic web research center
> >>
> >>
>
>

Re: filter error in query

Posted by Lorenz Buehmann <bu...@informatik.uni-leipzig.de>.
Ok, happy to hear that it works now. Although it would be interesting to
know what "random changes" you did. Nevertheless, have fun in using Jena.


On 29.09.2016 12:34, neha gupta wrote:
> I am sorry Lorenz for late reply. It gives me the now the integer number. I
> do not know even now how, but I made some random changes to the code and it
> shows me the result now.
>
> Kind regards
>
> On Thu, Sep 29, 2016 at 12:33 AM, Lorenz B. <
> buehmann@informatik.uni-leipzig.de> wrote:
>
>> Obviously not, otherwise you wouldn't get a parse exception?! You can't
>> have a filter outside of the query. See SPARQL specs and/or tutorials.
>>
>> And that's what we already told you in the other thread.
>>
>> You know, it's really strange that you do not answer our questions. So
>> again, how can you get the exception with the literals given that your
>> query does not compile and thus you can't get to the point where
>> literals would have been parsed to Java objects?
>>
>>> SELECT  *" +
>>>                 " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal
>> ?goal
>>> . ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins<?goal )  ";
>>>
>>> Is this syntax correct because it gives me error:* Encountered " "filter"
>>> "filter "" at line 1, column 265.*
>>>
>> --
>> Lorenz B�hmann
>> AKSW group, University of Leipzig
>> Group: http://aksw.org - semantic web research center
>>
>>


Re: filter error in query

Posted by neha gupta <ne...@gmail.com>.
I am sorry Lorenz for late reply. It gives me the now the integer number. I
do not know even now how, but I made some random changes to the code and it
shows me the result now.

Kind regards

On Thu, Sep 29, 2016 at 12:33 AM, Lorenz B. <
buehmann@informatik.uni-leipzig.de> wrote:

> Obviously not, otherwise you wouldn't get a parse exception?! You can't
> have a filter outside of the query. See SPARQL specs and/or tutorials.
>
> And that's what we already told you in the other thread.
>
> You know, it's really strange that you do not answer our questions. So
> again, how can you get the exception with the literals given that your
> query does not compile and thus you can't get to the point where
> literals would have been parsed to Java objects?
>
> > SELECT  *" +
> >                 " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal
> ?goal
> > . ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins<?goal )  ";
> >
> > Is this syntax correct because it gives me error:* Encountered " "filter"
> > "filter "" at line 1, column 265.*
> >
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>
>

Re: filter error in query

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
Obviously not, otherwise you wouldn't get a parse exception?! You can't
have a filter outside of the query. See SPARQL specs and/or tutorials.

And that's what we already told you in the other thread.

You know, it's really strange that you do not answer our questions. So
again, how can you get the exception with the literals given that your
query does not compile and thus you can't get to the point where
literals would have been parsed to Java objects?

> SELECT  *" +
>                 " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal  ?goal
> . ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins<?goal )  ";
>
> Is this syntax correct because it gives me error:* Encountered " "filter"
> "filter "" at line 1, column 265.*
>
-- 
Lorenz B�hmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: filter error in query

Posted by Andy Seaborne <an...@apache.org>.

On 28/09/16 11:52, neha gupta wrote:
> SELECT  *" +
>                 " WHERE {  ?x rdf:type  ont:Team . ?x ont:team_goal  ?goal
> . ?x ont:team_wins ?wins}  filter(?goal>10 && ?wins<?goal )  ";
>
> Is this syntax correct because it gives me error:* Encountered " "filter"
> "filter "" at line 1, column 265.*
>

No - it is not correct.

 > line 1, column 265.

So add some newlines to help you see where the error is.

And the example you quote is not 265 chars long so you have only shown 
us part of the query.

Look at SPARQL query examples on the web of in the spec and you will see 
what you have done wrong.

Please -
   ** Complete
   ** Minimal
   ** Verifiable
   ** Example

	Andy