You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Todd Detwiler <de...@u.washington.edu> on 2016/10/14 19:42:40 UTC

Selectbuilder

I'm having an issue with Selectbuilder which may be an issue with the 
parser itself, or perhaps I've just made a mistake. I am setting a 
variable in a select as follows:

> addVar("SUM(xsd:integer(?V3))", "?V3SUM")

which is throwing this exception:

> Exception in thread "main" org.apache.jena.query.QueryParseException: 
> Line 1, column 12: Unresolved prefixed name: xsd:integer
>     at 
> org.apache.jena.sparql.lang.ParserBase.throwParseException(ParserBase.java:521)
>     at 
> org.apache.jena.sparql.lang.ParserBase.resolvePName(ParserBase.java:286)
..

The prefix map contains the following:

> pm:{rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#, 
> xsd=http://www.w3.org/2001/XMLSchema#, 
> sdids_data=http://surveillance.mcgill.ca/km/SDIDS/sdids_data.ttl#, 
> rdfs=http://www.w3.org/2000/01/rdf-schema#, 
> cube=http://purl.org/linked-data/cube#}

So, the xsd prefix is defined, but the error seems to think that 
xsd:integer is all a prefix?

Any thoughts on this problem? Is my addVar call correct?

Thanks,
Todd Detwiler

-- 
Landon Todd Detwiler
Structural Informatics Group (SIG)
University of Washington

phone: 206-351-7721


Re: Selectbuilder

Posted by Claude Warren <cl...@xenei.com>.
You should be able to grab 3.1.1-SNAPSHOT and use that with 3.1.0

On Mon, Oct 17, 2016 at 7:54 PM, Todd Detwiler <de...@u.washington.edu> wrote:

> Thank you very much Claude. I see the ticket says that it has been fixed.
> I will grab the latest and give it a test.
> Cheers,
> Todd
>
> Landon Todd Detwiler
> Structural Informatics Group (SIG)
> University of Washington
>
> phone: 206-351-7721
>
> On 10/15/16 2:33 AM, Claude Warren wrote:
>
>> Opened defect  https://issues.apache.org/jira/browse/JENA-1246
>>
>> On Sat, Oct 15, 2016 at 10:10 AM, Claude Warren <cl...@xenei.com> wrote:
>>
>> On futher investigation there is a bug where by the defined prefixes are
>>> not passed to the select query when the expression is parsed from the
>>> string.  I will open the bug and submit a fix shortly.
>>>
>>> Claude
>>>
>>> On Fri, Oct 14, 2016 at 8:42 PM, Todd Detwiler <de...@u.washington.edu>
>>> wrote:
>>>
>>> I'm having an issue with Selectbuilder which may be an issue with the
>>>> parser itself, or perhaps I've just made a mistake. I am setting a
>>>> variable
>>>> in a select as follows:
>>>>
>>>> addVar("SUM(xsd:integer(?V3))", "?V3SUM")
>>>> which is throwing this exception:
>>>>
>>>> Exception in thread "main" org.apache.jena.query.QueryParseException:
>>>>
>>>>> Line 1, column 12: Unresolved prefixed name: xsd:integer
>>>>>      at org.apache.jena.sparql.lang.ParserBase.throwParseException(P
>>>>> arserBase.java:521)
>>>>>      at org.apache.jena.sparql.lang.ParserBase.resolvePName(ParserBa
>>>>> se.java:286)
>>>>>
>>>>> ..
>>>>
>>>> The prefix map contains the following:
>>>>
>>>> pm:{rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#, xsd=
>>>>
>>>>> http://www.w3.org/2001/XMLSchema#, sdids_data=http://surveillance
>>>>> .mcgill.ca/km/SDIDS/sdids_data.ttl#, rdfs=http://www.w3.org/2000/01
>>>>> /rdf-schema#, cube=http://purl.org/linked-data/cube#}
>>>>>
>>>>> So, the xsd prefix is defined, but the error seems to think that
>>>> xsd:integer is all a prefix?
>>>>
>>>> Any thoughts on this problem? Is my addVar call correct?
>>>>
>>>> Thanks,
>>>> Todd Detwiler
>>>>
>>>> --
>>>> Landon Todd Detwiler
>>>> Structural Informatics Group (SIG)
>>>> University of Washington
>>>>
>>>> phone: 206-351-7721
>>>>
>>>>
>>>>
>>> --
>>> I like: Like Like - The likeliest place on the web
>>> <http://like-like.xenei.com>
>>> LinkedIn: http://www.linkedin.com/in/claudewarren
>>>
>>>
>>
>>
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: Selectbuilder

Posted by Todd Detwiler <de...@u.washington.edu>.
Thank you very much Claude. I see the ticket says that it has been 
fixed. I will grab the latest and give it a test.
Cheers,
Todd

Landon Todd Detwiler
Structural Informatics Group (SIG)
University of Washington

phone: 206-351-7721

On 10/15/16 2:33 AM, Claude Warren wrote:
> Opened defect  https://issues.apache.org/jira/browse/JENA-1246
>
> On Sat, Oct 15, 2016 at 10:10 AM, Claude Warren <cl...@xenei.com> wrote:
>
>> On futher investigation there is a bug where by the defined prefixes are
>> not passed to the select query when the expression is parsed from the
>> string.  I will open the bug and submit a fix shortly.
>>
>> Claude
>>
>> On Fri, Oct 14, 2016 at 8:42 PM, Todd Detwiler <de...@u.washington.edu>
>> wrote:
>>
>>> I'm having an issue with Selectbuilder which may be an issue with the
>>> parser itself, or perhaps I've just made a mistake. I am setting a variable
>>> in a select as follows:
>>>
>>> addVar("SUM(xsd:integer(?V3))", "?V3SUM")
>>> which is throwing this exception:
>>>
>>> Exception in thread "main" org.apache.jena.query.QueryParseException:
>>>> Line 1, column 12: Unresolved prefixed name: xsd:integer
>>>>      at org.apache.jena.sparql.lang.ParserBase.throwParseException(P
>>>> arserBase.java:521)
>>>>      at org.apache.jena.sparql.lang.ParserBase.resolvePName(ParserBa
>>>> se.java:286)
>>>>
>>> ..
>>>
>>> The prefix map contains the following:
>>>
>>> pm:{rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#, xsd=
>>>> http://www.w3.org/2001/XMLSchema#, sdids_data=http://surveillance
>>>> .mcgill.ca/km/SDIDS/sdids_data.ttl#, rdfs=http://www.w3.org/2000/01
>>>> /rdf-schema#, cube=http://purl.org/linked-data/cube#}
>>>>
>>> So, the xsd prefix is defined, but the error seems to think that
>>> xsd:integer is all a prefix?
>>>
>>> Any thoughts on this problem? Is my addVar call correct?
>>>
>>> Thanks,
>>> Todd Detwiler
>>>
>>> --
>>> Landon Todd Detwiler
>>> Structural Informatics Group (SIG)
>>> University of Washington
>>>
>>> phone: 206-351-7721
>>>
>>>
>>
>> --
>> I like: Like Like - The likeliest place on the web
>> <http://like-like.xenei.com>
>> LinkedIn: http://www.linkedin.com/in/claudewarren
>>
>
>


Re: Selectbuilder

Posted by Claude Warren <cl...@xenei.com>.
Opened defect  https://issues.apache.org/jira/browse/JENA-1246

On Sat, Oct 15, 2016 at 10:10 AM, Claude Warren <cl...@xenei.com> wrote:

> On futher investigation there is a bug where by the defined prefixes are
> not passed to the select query when the expression is parsed from the
> string.  I will open the bug and submit a fix shortly.
>
> Claude
>
> On Fri, Oct 14, 2016 at 8:42 PM, Todd Detwiler <de...@u.washington.edu>
> wrote:
>
>> I'm having an issue with Selectbuilder which may be an issue with the
>> parser itself, or perhaps I've just made a mistake. I am setting a variable
>> in a select as follows:
>>
>> addVar("SUM(xsd:integer(?V3))", "?V3SUM")
>>>
>>
>> which is throwing this exception:
>>
>> Exception in thread "main" org.apache.jena.query.QueryParseException:
>>> Line 1, column 12: Unresolved prefixed name: xsd:integer
>>>     at org.apache.jena.sparql.lang.ParserBase.throwParseException(P
>>> arserBase.java:521)
>>>     at org.apache.jena.sparql.lang.ParserBase.resolvePName(ParserBa
>>> se.java:286)
>>>
>> ..
>>
>> The prefix map contains the following:
>>
>> pm:{rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#, xsd=
>>> http://www.w3.org/2001/XMLSchema#, sdids_data=http://surveillance
>>> .mcgill.ca/km/SDIDS/sdids_data.ttl#, rdfs=http://www.w3.org/2000/01
>>> /rdf-schema#, cube=http://purl.org/linked-data/cube#}
>>>
>>
>> So, the xsd prefix is defined, but the error seems to think that
>> xsd:integer is all a prefix?
>>
>> Any thoughts on this problem? Is my addVar call correct?
>>
>> Thanks,
>> Todd Detwiler
>>
>> --
>> Landon Todd Detwiler
>> Structural Informatics Group (SIG)
>> University of Washington
>>
>> phone: 206-351-7721
>>
>>
>
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren
>



-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: Selectbuilder

Posted by Claude Warren <cl...@xenei.com>.
On futher investigation there is a bug where by the defined prefixes are
not passed to the select query when the expression is parsed from the
string.  I will open the bug and submit a fix shortly.

Claude

On Fri, Oct 14, 2016 at 8:42 PM, Todd Detwiler <de...@u.washington.edu> wrote:

> I'm having an issue with Selectbuilder which may be an issue with the
> parser itself, or perhaps I've just made a mistake. I am setting a variable
> in a select as follows:
>
> addVar("SUM(xsd:integer(?V3))", "?V3SUM")
>>
>
> which is throwing this exception:
>
> Exception in thread "main" org.apache.jena.query.QueryParseException:
>> Line 1, column 12: Unresolved prefixed name: xsd:integer
>>     at org.apache.jena.sparql.lang.ParserBase.throwParseException(P
>> arserBase.java:521)
>>     at org.apache.jena.sparql.lang.ParserBase.resolvePName(ParserBa
>> se.java:286)
>>
> ..
>
> The prefix map contains the following:
>
> pm:{rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#, xsd=
>> http://www.w3.org/2001/XMLSchema#, sdids_data=http://surveillance
>> .mcgill.ca/km/SDIDS/sdids_data.ttl#, rdfs=http://www.w3.org/2000/01
>> /rdf-schema#, cube=http://purl.org/linked-data/cube#}
>>
>
> So, the xsd prefix is defined, but the error seems to think that
> xsd:integer is all a prefix?
>
> Any thoughts on this problem? Is my addVar call correct?
>
> Thanks,
> Todd Detwiler
>
> --
> Landon Todd Detwiler
> Structural Informatics Group (SIG)
> University of Washington
>
> phone: 206-351-7721
>
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: Selectbuilder

Posted by Claude Warren <cl...@xenei.com>.
Todd,

The QueryBuilder

addVar("SUM(xsd:integer(?V3))", "?V3SUM")

statement ends up executing

select SUM(xsd:integer(?V3))

in order to build the equivalent Expr.  It is the "select
SUM(xsd:integer(?V3))" that is causing the exception.

I don't have a deep enough background in SPARQL query intricacies to tell
you how to do it but I suspect that xsd:integer(?V3) is not the way to cast
?V3 to an integer during a SUM call.  Perhaps there are others here that
can help?

Claude




On Fri, Oct 14, 2016 at 8:42 PM, Todd Detwiler <de...@u.washington.edu> wrote:

> I'm having an issue with Selectbuilder which may be an issue with the
> parser itself, or perhaps I've just made a mistake. I am setting a variable
> in a select as follows:
>
> addVar("SUM(xsd:integer(?V3))", "?V3SUM")
>>
>
> which is throwing this exception:
>
> Exception in thread "main" org.apache.jena.query.QueryParseException:
>> Line 1, column 12: Unresolved prefixed name: xsd:integer
>>     at org.apache.jena.sparql.lang.ParserBase.throwParseException(P
>> arserBase.java:521)
>>     at org.apache.jena.sparql.lang.ParserBase.resolvePName(ParserBa
>> se.java:286)
>>
> ..
>
> The prefix map contains the following:
>
> pm:{rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#, xsd=
>> http://www.w3.org/2001/XMLSchema#, sdids_data=http://surveillance
>> .mcgill.ca/km/SDIDS/sdids_data.ttl#, rdfs=http://www.w3.org/2000/01
>> /rdf-schema#, cube=http://purl.org/linked-data/cube#}
>>
>
> So, the xsd prefix is defined, but the error seems to think that
> xsd:integer is all a prefix?
>
> Any thoughts on this problem? Is my addVar call correct?
>
> Thanks,
> Todd Detwiler
>
> --
> Landon Todd Detwiler
> Structural Informatics Group (SIG)
> University of Washington
>
> phone: 206-351-7721
>
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren