[Mulgara-svn] r847 - branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value

pag at mulgara.org pag at mulgara.org
Thu Apr 24 17:55:09 UTC 2008


Author: pag
Date: 2008-04-24 10:55:08 -0700 (Thu, 24 Apr 2008)
New Revision: 847

Modified:
   branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/ExternalFn.java
   branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/LangFn.java
   branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/Var.java
Log:
Guarded isLiteral() so it is available outside of a context. If outside of a context, it is presumed to be true.

Modified: branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/ExternalFn.java
===================================================================
--- branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/ExternalFn.java	2008-04-24 17:35:02 UTC (rev 846)
+++ branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/ExternalFn.java	2008-04-24 17:55:08 UTC (rev 847)
@@ -96,9 +96,18 @@
   /** @see org.mulgara.query.filter.RDFTerm#isIRI() */
   public boolean isIRI() throws QueryException { return resolve().isIRI(); }
 
-  /** @see org.mulgara.query.filter.RDFTerm#isLiteral() */
-  public boolean isLiteral() throws QueryException { return resolve().isLiteral(); }
+  /**
+   * {@inheritDoc}
+   * The operation of this method is depended on the context in which it was called.
+   * If it is called without a context owner, then this means it was called during
+   * Filter construction, and we want to indicate that it is valid to treat this as a literal.
+   * @return <code>true</code> if there is no context, or else it calls isLiteral on the resolved value.
+   */
+  public boolean isLiteral() throws QueryException {
+    return getContextOwner() == null ? true : resolve().isLiteral();
+  }
 
+
   /**
    * Resolve the value of the function.
    * @return The resolution of the function

Modified: branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/LangFn.java
===================================================================
--- branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/LangFn.java	2008-04-24 17:35:02 UTC (rev 846)
+++ branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/LangFn.java	2008-04-24 17:55:08 UTC (rev 847)
@@ -49,7 +49,7 @@
    * May be overridden.
    */
   public boolean isLiteral() throws QueryException {
-    return resolve().isLiteral();
+    return true;
   }
 
   /** @see org.mulgara.query.filter.AbstractFilterValue#isSimple() */

Modified: branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/Var.java
===================================================================
--- branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/Var.java	2008-04-24 17:35:02 UTC (rev 846)
+++ branches/mgr-61-sparql/src/jar/query/java/org/mulgara/query/filter/value/Var.java	2008-04-24 17:55:08 UTC (rev 847)
@@ -159,9 +159,15 @@
     return resolve().isIRI();
   }
 
-  /** {@inheritDoc} */
+  /**
+   * {@inheritDoc}
+   * The operation of this method is depended on the context in which it was called.
+   * If it is called without a context owner, then this means it was called during
+   * Filter construction, and we want to indicate that it is valid to treat this as a literal.
+   * @return <code>true</code> if there is no context, or else it calls isLiteral on the resolved value.
+   */
   public boolean isLiteral() throws QueryException {
-    return resolve().isLiteral();
+    return contextOwner == null ? true : resolve().isLiteral();
   }
 
   /** {@inheritDoc} */




More information about the Mulgara-svn mailing list