[Mulgara-svn] r880 - trunk/src/jar/sparql-interpreter/java/org/mulgara/sparql

pag at mulgara.org pag at mulgara.org
Thu May 1 17:46:19 UTC 2008


Author: pag
Date: 2008-05-01 10:46:18 -0700 (Thu, 01 May 2008)
New Revision: 880

Modified:
   trunk/src/jar/sparql-interpreter/java/org/mulgara/sparql/FilterMapper.java
Log:
Handling a new exception from the TypedLiteral.newLiteral method

Modified: trunk/src/jar/sparql-interpreter/java/org/mulgara/sparql/FilterMapper.java
===================================================================
--- trunk/src/jar/sparql-interpreter/java/org/mulgara/sparql/FilterMapper.java	2008-05-01 17:42:27 UTC (rev 879)
+++ trunk/src/jar/sparql-interpreter/java/org/mulgara/sparql/FilterMapper.java	2008-05-01 17:46:18 UTC (rev 880)
@@ -53,6 +53,7 @@
 import org.mulgara.sparql.parser.cst.UnaryPlus;
 import org.mulgara.sparql.parser.cst.Variable;
 import org.mulgara.parser.MulgaraParserException;
+import org.mulgara.query.QueryException;
 import org.mulgara.query.filter.And;
 import org.mulgara.query.filter.BoundFn;
 import org.mulgara.query.filter.Filter;
@@ -309,8 +310,12 @@
 
   private static class RDFLiteralMap extends AbstractExprToFilter<RDFLiteral> {
     public Class<RDFLiteral> getMapType() { return RDFLiteral.class; }
-    public RDFTerm typedMap(RDFLiteral expr) {
-      if (expr.isTyped()) return TypedLiteral.newLiteral(expr.getValue(), expr.getDatatype().getUri(), null);
+    public RDFTerm typedMap(RDFLiteral expr) throws MulgaraParserException {
+      try {
+        if (expr.isTyped()) return TypedLiteral.newLiteral(expr.getValue(), expr.getDatatype().getUri(), null);
+      } catch (QueryException qe) {
+        throw new MulgaraParserException(qe.getMessage());
+      }
       if (expr.isLanguageCoded()) return new SimpleLiteral(expr.getValue(), expr.getLanguage());
       return new SimpleLiteral(expr.getValue());
     }




More information about the Mulgara-svn mailing list