[Mulgara-dev] Fw: URI escaped things don't work...

Paul Gearon gearon at ieee.org
Wed Mar 19 21:37:28 UTC 2008


Hi Bill,

Yes, my suggestion was the wrong way to fix it, but it had the
advantage of working for you quickly, and also telling me that the
problem was really what I said it was.

On the other hand, your patch looks like the Correct Thing, so thank you.  :-)

Paul

On Wed, Mar 19, 2008 at 1:50 PM, William Mills <wmills_92105 at yahoo.com> wrote:
> The following patch to the trunk appears to resolve the URI escaping problem.
>
>  frustration 11:47:54 ~/mulgara/svn/trunk/src/jar/itql/java/org/mulgara/itql $ svn diff
>  Index: URIUtil.java
>  ===================================================================
>  --- URIUtil.java        (revision 677)
>  +++ URIUtil.java        (working copy)
>  @@ -39,7 +39,7 @@
>          // Attempt qname-to-URI substitution for aliased namespace prefixes
>          URI mapping = aliasMap.get(uri.getScheme());
>          if (mapping != null) {
>  -          uri = new URI(mapping + uri.getSchemeSpecificPart());
>  +          uri = new URI(mapping + uri.getRawSchemeSpecificPart());
>          }
>        }
>        return uri;
>
>
>
>
>  ----- Original Message ----
>  From: Paul Gearon <gearon at ieee.org>
>  To: Mulgara Developers <mulgara-dev at mulgara.org>
>  Sent: Wednesday, March 19, 2008 9:30:05 AM
>  Subject: Re: [Mulgara-dev] Fw: URI escaped things don't work...
>
>  I don't have the same version of the program that you do, but I can
>  see that it's just re-throwing a URISyntaxException.  Evidently the
>  parser is passing the characters through decoded.  I'd rather not
>  stuff with the parser, but if you're not afraid of a recompile, do you
>  want to go to the toURI method and try running the string through
>  URLEncoder?
>
>  Regards,
>  Paul
>
>  On Mar 19, 2008, at 12:27 AM, William Mills wrote:
>  > Built the current tip of tree (as of a few days ago) and get the
>  > following exception/log trace
>  >
>  > 380 [main] DEBUG org.mulgara.itql.TqlInterpreter  - Resolving
>  > librange:build%7B1-3%7D.msg.corp.yahoo.com to a RDF node
>  > Exception in thread "main" java.lang.Error: Bad URI syntax in
>  > resource: java.net.URISyntaxException: Illegal character in fragment
>  > at index 75: http://frustration.corp.yahoo.com/mulgara/rolesdb/primitives/librange#build
>  > {1-3}.msg.corp.yahoo.com
>  >        at org.mulgara.itql.URIUtil.convertToURI(URIUtil.java:47)
>  >
>  > Dunno if a current reference is more useful.
>  >
>  > -bill
>  >
>  > ----- Original Message ----
>  > From: Paul Gearon <gearon at ieee.org>
>  > To: Mulgara Developers <mulgara-dev at mulgara.org>
>  > Sent: Tuesday, March 18, 2008 8:56:25 AM
>  > Subject: Re: [Mulgara-dev] Fw: URI escaped things don't work...
>  >
>  >
>  > On Mar 17, 2008, at 10:59 PM, William Mills wrote:
>  >
>  >> OK, so I found that XML escaping works, so the following succeeds:
>  >>
>  >>   insert <librange:build&x7B;
>  >> 1-3&x7D;.msg.corp.yahoo.com><atom:expandsto>
>  >> 'build1.msg.corp.yahoo.com' into<frustration:rolesdb> ;
>  >>
>  >> but it is unfortunately escaped on the way out when using the SOAP
>  >> interface (this is the expected icky behavior).
>  >>
>  >> Why allow XML escaping on URIs and not URI escaping?
>  >
>  > RDF has a historical relationship with XML.  Most RDF is (or was)
>  > expected to go through XML, and certainly the guy who designed the
>  > query language had XML in mind every step of the way (he even had a
>  > half-built XML form of the language).
>  >
>  > As for not permitting URI escaping.... I have no idea. What error do
>  > you get when you try it?  Maybe it's just a simple tweak to fix it?
>  >
>  > Paul
>  >
>  >> ----- Forwarded Message ----
>  >> From: William Mills <wmills_92105 at yahoo.com>
>  >> To: Mulgara Dev <mulgara-dev at mulgara.org>
>  >> Sent: Monday, March 17, 2008 8:38:21 PM
>  >> Subject: URI escaped things don't work...
>  >>
>  >> I am encountering a problem with properly (I think) URI escaped
>  >> strings.  The following works as expected:;
>  >>
>  >>   insert <role:dev> <atom:contains> 'build{1-3}.msg.corp.yahoo.com'
>  >> into <frustration:rolesdb> ;
>  >>
>  >> But neither of the following work:
>  >>
>  >>   insert <librange:build%7B1-3%7D.msg.corp.yahoo.com>
>  >> <atom:expandsto> 'build1.msg.corp.yahoo.com' into
>  >> <frustration:rolesdb> ;
>  >>
>  >>   insert <librange:build{1-3}.msg.corp.yahoo.com><atom:expandsto>
>  >> 'build1.msg.corp.yahoo.com' into<frustration:rolesdb> ;
>  >>
>  >> What's the deal?
>  >>
>  >> thanks,
>  >>
>  >> -bill
>  >>
>  >>
>  >>
>  >>
>  >>
>  >> _______________________________________________
>  >> Mulgara-dev mailing list
>  >> Mulgara-dev at mulgara.org
>  >> http://mulgara.org/mailman/listinfo/mulgara-dev
>  >
>  > _______________________________________________
>  > Mulgara-dev mailing list
>  > Mulgara-dev at mulgara.org
>  > http://mulgara.org/mailman/listinfo/mulgara-dev
>  >
>  >
>  >
>  > _______________________________________________
>  > Mulgara-dev mailing list
>  > Mulgara-dev at mulgara.org
>  > http://mulgara.org/mailman/listinfo/mulgara-dev
>
>  _______________________________________________
>  Mulgara-dev mailing list
>  Mulgara-dev at mulgara.org
>  http://mulgara.org/mailman/listinfo/mulgara-dev
>
>
>
>  _______________________________________________
>  Mulgara-dev mailing list
>  Mulgara-dev at mulgara.org
>  http://mulgara.org/mailman/listinfo/mulgara-dev
>



More information about the Mulgara-dev mailing list