You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Martynas Jusevičius <ma...@graphity.org> on 2013/09/13 13:35:29 UTC

Fuseki DatasetAdapter not escaping graph URI?

Hey,

I'm using DatasetAdapter to access a Graph Store. It seems to me
however that it is not properly escaping graph URI when building the
request URI.

4.2 Indirect Graph Identification
(http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identification)
gives an example of "encoded graph URI". That is, graph URI

  http://localhost:8080/graphs/2013%20Danfoss%20MPHE.xlsx

should appear as

  .../store?graph=http://localhost:8080/graphs/2013%2520Danfoss%2520MPHE.xlsx

in the request URI. However I cannot see that DatasetAdapter is doing
such escaping (it was easier to find the code on GrepCode than on
Apache):
http://grepcode.com/file/repo1.maven.org$maven2@org.apache.jena$jena-fuseki@0.2.4@org$apache$jena$fuseki$http$DatasetAdapter.java

This results in 400 Bad Request if graph URI has special characters
like in this case. Can we call this a bug?

Martynas
graphityhq.com

Re: Fuseki DatasetAdapter not escaping graph URI?

Posted by Andy Seaborne <an...@apache.org>.
On 14/09/13 14:29, Martynas Jusevičius wrote:
> Ok, I found it and the new target(Node name) method seems to do the trick:
> https://svn.apache.org/repos/asf/jena/trunk/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java

I finally got round to putting it in the right place.  Dataset accessors 
started as a way of driving some tests in Fuseki, then started getting 
used as client code, where being it the server codebase was illogical. 
So it moved to ARQ; there was migration support in 0.2.6 and 0.2.7.

	Andy

>
> On Sat, Sep 14, 2013 at 1:49 PM, Martynas Jusevičius
> <ma...@graphity.org> wrote:
>> Sorry about the version! I'm using Fuseki 0.2.3.
>>
>> If there was a fix in this area, where can I find the new code? The
>> Fuseki trunk does not appear to have "http" package any longer:
>> https://svn.apache.org/repos/asf/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/
>>
>> Martynas
>>
>> On Sat, Sep 14, 2013 at 2:53 AM, Rob Vesse <rv...@yarcdata.com> wrote:
>>> Andy
>>>
>>> Grepcode URLs actually have the version information in them, this appears
>>> to be Fuseki 0.2.4 (at least that is what Martynas has linked to) though
>>> it doesn't necessarily mean that is the version he is using
>>>
>>> Rob
>>>
>>>
>>>
>>> On 9/13/13 11:11 AM, "Andy Seaborne" <an...@apache.org> wrote:
>>>
>>>> Version?  IIRC there was a fix around here not so long ago.
>>>>
>>>> On 13/09/13 12:41, Martynas Jusevičius wrote:
>>>>> This is probably the correct encoded value (including slashes etc):
>>>>> http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx
>>>>
>>>> http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx
>>>>
>>>> I agree ... and so does the code :-) because I have just C&P that string
>>> >from a debugger onto the dev codebase.
>>>>
>>>> It uses the rules for URI component encoding (if I got them right).
>>>>
>>>>> On Fri, Sep 13, 2013 at 1:35 PM, Martynas Jusevičius
>>>>> <ma...@graphity.org> wrote:
>>>>>> Hey,
>>>>>>
>>>>>> I'm using DatasetAdapter to access a Graph Store. It seems to me
>>>>>> however that it is not properly escaping graph URI when building the
>>>>>> request URI.
>>>>
>>>> What did you get?
>>>>
>>>>>>
>>>>>> 4.2 Indirect Graph Identification
>>>>>>
>>>>>> (http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identific
>>>>>> ation)
>>>>>> gives an example of "encoded graph URI". That is, graph URI
>>>>>>
>>>>>>     http://localhost:8080/graphs/2013%20Danfoss%20MPHE.xlsx
>>>>>>
>>>>>> should appear as
>>>>>>
>>>>>>
>>>>>> .../store?graph=http://localhost:8080/graphs/2013%2520Danfoss%2520MPHE.x
>>>>>> lsx
>>>>>>
>>>>>> in the request URI. However I cannot see that DatasetAdapter is doing
>>>>>> such escaping
>>>>
>>>> DatasetGraphAccessorHTTP.target()
>>>>
>>>>>> (it was easier to find the code on GrepCode than on
>>>>>> Apache):
>>>>>>
>>>>>> http://grepcode.com/file/repo1.maven.org$maven2@org.apache.jena$jena-fus
>>>>>> eki@0.2.4@org$apache$jena$fuseki$http$DatasetAdapter.java
>>>>>>
>>>>>> This results in 400 Bad Request if graph URI has special characters
>>>>>> like in this case. Can we call this a bug?
>>>>>>
>>>>>> Martynas
>>>>>> graphityhq.com
>>>>
>>>>
>>>>        Andy
>>>>
>>>


Re: Fuseki DatasetAdapter not escaping graph URI?

Posted by Martynas Jusevičius <ma...@graphity.org>.
Ok, I found it and the new target(Node name) method seems to do the trick:
https://svn.apache.org/repos/asf/jena/trunk/jena-arq/src/main/java/org/apache/jena/web/DatasetGraphAccessorHTTP.java

On Sat, Sep 14, 2013 at 1:49 PM, Martynas Jusevičius
<ma...@graphity.org> wrote:
> Sorry about the version! I'm using Fuseki 0.2.3.
>
> If there was a fix in this area, where can I find the new code? The
> Fuseki trunk does not appear to have "http" package any longer:
> https://svn.apache.org/repos/asf/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/
>
> Martynas
>
> On Sat, Sep 14, 2013 at 2:53 AM, Rob Vesse <rv...@yarcdata.com> wrote:
>> Andy
>>
>> Grepcode URLs actually have the version information in them, this appears
>> to be Fuseki 0.2.4 (at least that is what Martynas has linked to) though
>> it doesn't necessarily mean that is the version he is using
>>
>> Rob
>>
>>
>>
>> On 9/13/13 11:11 AM, "Andy Seaborne" <an...@apache.org> wrote:
>>
>>>Version?  IIRC there was a fix around here not so long ago.
>>>
>>>On 13/09/13 12:41, Martynas Jusevičius wrote:
>>>> This is probably the correct encoded value (including slashes etc):
>>>> http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx
>>>
>>>http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx
>>>
>>>I agree ... and so does the code :-) because I have just C&P that string
>>>from a debugger onto the dev codebase.
>>>
>>>It uses the rules for URI component encoding (if I got them right).
>>>
>>>> On Fri, Sep 13, 2013 at 1:35 PM, Martynas Jusevičius
>>>> <ma...@graphity.org> wrote:
>>>>> Hey,
>>>>>
>>>>> I'm using DatasetAdapter to access a Graph Store. It seems to me
>>>>> however that it is not properly escaping graph URI when building the
>>>>> request URI.
>>>
>>>What did you get?
>>>
>>>>>
>>>>> 4.2 Indirect Graph Identification
>>>>>
>>>>>(http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identific
>>>>>ation)
>>>>> gives an example of "encoded graph URI". That is, graph URI
>>>>>
>>>>>    http://localhost:8080/graphs/2013%20Danfoss%20MPHE.xlsx
>>>>>
>>>>> should appear as
>>>>>
>>>>>
>>>>>.../store?graph=http://localhost:8080/graphs/2013%2520Danfoss%2520MPHE.x
>>>>>lsx
>>>>>
>>>>> in the request URI. However I cannot see that DatasetAdapter is doing
>>>>> such escaping
>>>
>>>DatasetGraphAccessorHTTP.target()
>>>
>>>>> (it was easier to find the code on GrepCode than on
>>>>> Apache):
>>>>>
>>>>>http://grepcode.com/file/repo1.maven.org$maven2@org.apache.jena$jena-fus
>>>>>eki@0.2.4@org$apache$jena$fuseki$http$DatasetAdapter.java
>>>>>
>>>>> This results in 400 Bad Request if graph URI has special characters
>>>>> like in this case. Can we call this a bug?
>>>>>
>>>>> Martynas
>>>>> graphityhq.com
>>>
>>>
>>>       Andy
>>>
>>

Re: Fuseki DatasetAdapter not escaping graph URI?

Posted by Martynas Jusevičius <ma...@graphity.org>.
Sorry about the version! I'm using Fuseki 0.2.3.

If there was a fix in this area, where can I find the new code? The
Fuseki trunk does not appear to have "http" package any longer:
https://svn.apache.org/repos/asf/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/

Martynas

On Sat, Sep 14, 2013 at 2:53 AM, Rob Vesse <rv...@yarcdata.com> wrote:
> Andy
>
> Grepcode URLs actually have the version information in them, this appears
> to be Fuseki 0.2.4 (at least that is what Martynas has linked to) though
> it doesn't necessarily mean that is the version he is using
>
> Rob
>
>
>
> On 9/13/13 11:11 AM, "Andy Seaborne" <an...@apache.org> wrote:
>
>>Version?  IIRC there was a fix around here not so long ago.
>>
>>On 13/09/13 12:41, Martynas Jusevičius wrote:
>>> This is probably the correct encoded value (including slashes etc):
>>> http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx
>>
>>http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx
>>
>>I agree ... and so does the code :-) because I have just C&P that string
>>from a debugger onto the dev codebase.
>>
>>It uses the rules for URI component encoding (if I got them right).
>>
>>> On Fri, Sep 13, 2013 at 1:35 PM, Martynas Jusevičius
>>> <ma...@graphity.org> wrote:
>>>> Hey,
>>>>
>>>> I'm using DatasetAdapter to access a Graph Store. It seems to me
>>>> however that it is not properly escaping graph URI when building the
>>>> request URI.
>>
>>What did you get?
>>
>>>>
>>>> 4.2 Indirect Graph Identification
>>>>
>>>>(http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identific
>>>>ation)
>>>> gives an example of "encoded graph URI". That is, graph URI
>>>>
>>>>    http://localhost:8080/graphs/2013%20Danfoss%20MPHE.xlsx
>>>>
>>>> should appear as
>>>>
>>>>
>>>>.../store?graph=http://localhost:8080/graphs/2013%2520Danfoss%2520MPHE.x
>>>>lsx
>>>>
>>>> in the request URI. However I cannot see that DatasetAdapter is doing
>>>> such escaping
>>
>>DatasetGraphAccessorHTTP.target()
>>
>>>> (it was easier to find the code on GrepCode than on
>>>> Apache):
>>>>
>>>>http://grepcode.com/file/repo1.maven.org$maven2@org.apache.jena$jena-fus
>>>>eki@0.2.4@org$apache$jena$fuseki$http$DatasetAdapter.java
>>>>
>>>> This results in 400 Bad Request if graph URI has special characters
>>>> like in this case. Can we call this a bug?
>>>>
>>>> Martynas
>>>> graphityhq.com
>>
>>
>>       Andy
>>
>

Re: Fuseki DatasetAdapter not escaping graph URI?

Posted by Rob Vesse <rv...@yarcdata.com>.
Andy

Grepcode URLs actually have the version information in them, this appears
to be Fuseki 0.2.4 (at least that is what Martynas has linked to) though
it doesn't necessarily mean that is the version he is using

Rob



On 9/13/13 11:11 AM, "Andy Seaborne" <an...@apache.org> wrote:

>Version?  IIRC there was a fix around here not so long ago.
>
>On 13/09/13 12:41, Martynas Jusevičius wrote:
>> This is probably the correct encoded value (including slashes etc):
>> http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx
>
>http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx
>
>I agree ... and so does the code :-) because I have just C&P that string
>from a debugger onto the dev codebase.
>
>It uses the rules for URI component encoding (if I got them right).
>
>> On Fri, Sep 13, 2013 at 1:35 PM, Martynas Jusevičius
>> <ma...@graphity.org> wrote:
>>> Hey,
>>>
>>> I'm using DatasetAdapter to access a Graph Store. It seems to me
>>> however that it is not properly escaping graph URI when building the
>>> request URI.
>
>What did you get?
>
>>>
>>> 4.2 Indirect Graph Identification
>>> 
>>>(http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identific
>>>ation)
>>> gives an example of "encoded graph URI". That is, graph URI
>>>
>>>    http://localhost:8080/graphs/2013%20Danfoss%20MPHE.xlsx
>>>
>>> should appear as
>>>
>>>    
>>>.../store?graph=http://localhost:8080/graphs/2013%2520Danfoss%2520MPHE.x
>>>lsx
>>>
>>> in the request URI. However I cannot see that DatasetAdapter is doing
>>> such escaping
>
>DatasetGraphAccessorHTTP.target()
>
>>> (it was easier to find the code on GrepCode than on
>>> Apache):
>>> 
>>>http://grepcode.com/file/repo1.maven.org$maven2@org.apache.jena$jena-fus
>>>eki@0.2.4@org$apache$jena$fuseki$http$DatasetAdapter.java
>>>
>>> This results in 400 Bad Request if graph URI has special characters
>>> like in this case. Can we call this a bug?
>>>
>>> Martynas
>>> graphityhq.com
>
>
>	Andy
>


Re: Fuseki DatasetAdapter not escaping graph URI?

Posted by Andy Seaborne <an...@apache.org>.
Version?  IIRC there was a fix around here not so long ago.

On 13/09/13 12:41, Martynas Jusevičius wrote:
> This is probably the correct encoded value (including slashes etc):
> http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx

http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx

I agree ... and so does the code :-) because I have just C&P that string 
from a debugger onto the dev codebase.

It uses the rules for URI component encoding (if I got them right).

> On Fri, Sep 13, 2013 at 1:35 PM, Martynas Jusevičius
> <ma...@graphity.org> wrote:
>> Hey,
>>
>> I'm using DatasetAdapter to access a Graph Store. It seems to me
>> however that it is not properly escaping graph URI when building the
>> request URI.

What did you get?

>>
>> 4.2 Indirect Graph Identification
>> (http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identification)
>> gives an example of "encoded graph URI". That is, graph URI
>>
>>    http://localhost:8080/graphs/2013%20Danfoss%20MPHE.xlsx
>>
>> should appear as
>>
>>    .../store?graph=http://localhost:8080/graphs/2013%2520Danfoss%2520MPHE.xlsx
>>
>> in the request URI. However I cannot see that DatasetAdapter is doing
>> such escaping

DatasetGraphAccessorHTTP.target()

>> (it was easier to find the code on GrepCode than on
>> Apache):
>> http://grepcode.com/file/repo1.maven.org$maven2@org.apache.jena$jena-fuseki@0.2.4@org$apache$jena$fuseki$http$DatasetAdapter.java
>>
>> This results in 400 Bad Request if graph URI has special characters
>> like in this case. Can we call this a bug?
>>
>> Martynas
>> graphityhq.com


	Andy


Re: Fuseki DatasetAdapter not escaping graph URI?

Posted by Martynas Jusevičius <ma...@graphity.org>.
This is probably the correct encoded value (including slashes etc):
http%3A%2F%2Flocalhost%3A8080%2Fgraphs%2F2013%2520Danfoss%2520MPHE.xlsx

On Fri, Sep 13, 2013 at 1:35 PM, Martynas Jusevičius
<ma...@graphity.org> wrote:
> Hey,
>
> I'm using DatasetAdapter to access a Graph Store. It seems to me
> however that it is not properly escaping graph URI when building the
> request URI.
>
> 4.2 Indirect Graph Identification
> (http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identification)
> gives an example of "encoded graph URI". That is, graph URI
>
>   http://localhost:8080/graphs/2013%20Danfoss%20MPHE.xlsx
>
> should appear as
>
>   .../store?graph=http://localhost:8080/graphs/2013%2520Danfoss%2520MPHE.xlsx
>
> in the request URI. However I cannot see that DatasetAdapter is doing
> such escaping (it was easier to find the code on GrepCode than on
> Apache):
> http://grepcode.com/file/repo1.maven.org$maven2@org.apache.jena$jena-fuseki@0.2.4@org$apache$jena$fuseki$http$DatasetAdapter.java
>
> This results in 400 Bad Request if graph URI has special characters
> like in this case. Can we call this a bug?
>
> Martynas
> graphityhq.com