Author: andy
Date: Sat Jul 19 22:37:13 2014
New Revision: 1611983
URL: http://svn.apache.org/r1611983
Log:
Fix to setting resolver in Query/Update parsing
Modified:
jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/query/QueryFactory.java
jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/update/UpdateFactory.java
Modified:
jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/query/QueryFactory.java
URL:
http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/query/QueryFactory.java?rev=1611983&r1=1611982&r2=1611983&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/query/QueryFactory.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/query/QueryFactory.java
Sat Jul 19 22:37:13 2014
@@ -129,15 +129,21 @@ public class QueryFactory
if ( query.getResolver() == null )
{
- IRIResolver resolver = null ;
- if ( baseURI != null ) {
- // Sort out the baseURI - if that fails, dump in a dummy one
and continue.
- try { resolver = IRIResolver.create(baseURI) ; }
- catch (Exception ex) {}
- if ( resolver == null )
- resolver =
IRIResolver.create("http://localhost/query/defaultBase#") ;
- query.setResolver(resolver) ;
+ IRIResolver resolver = null ;
+ try {
+ if ( baseURI != null ) {
+ // Sort out the baseURI - if that fails, dump in a dummy
one and continue.
+ resolver = IRIResolver.create(baseURI) ;
+ }
+ else {
+ resolver = IRIResolver.create() ;
+ }
}
+ catch (Exception ex) {}
+ if ( resolver == null )
+ resolver =
IRIResolver.create("http://localhost/query/defaultBase#") ;
+ query.setResolver(resolver) ;
+
}
return parser.parse(query, queryString) ;
}
Modified:
jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/update/UpdateFactory.java
URL:
http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/update/UpdateFactory.java?rev=1611983&r1=1611982&r2=1611983&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/update/UpdateFactory.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/update/UpdateFactory.java
Sat Jul 19 22:37:13 2014
@@ -127,15 +127,18 @@ public class UpdateFactory
if ( prologue.getResolver() == null )
{
- IRIResolver resolver = null ;
- if ( baseURI != null ) {
- // Sort out the baseURI - if that fails, dump in a dummy one
and continue.
- try { resolver = IRIResolver.create(baseURI) ; }
- catch (Exception ex) {}
- if ( resolver == null )
- resolver =
IRIResolver.create("http://localhost/update/defaultBase#") ;
- prologue.setResolver(resolver) ;
+ IRIResolver resolver = null ;
+ try {
+ if ( baseURI != null )
+ // Sort out the baseURI - if that fails, dump in a dummy
one and continue.
+ resolver = IRIResolver.create(baseURI) ;
+ else
+ resolver = IRIResolver.create() ;
}
+ catch (Exception ex) {}
+ if ( resolver == null )
+ resolver =
IRIResolver.create("http://localhost/update/defaultBase#") ;
+ prologue.setResolver(resolver) ;
}
return parser ;
}