[Mulgara-svn] r689 - in trunk/src/jar: query/java/org/mulgara/query resolver/java/org/mulgara/resolver resolver-filesystem/java/org/mulgara/resolver/filesystem resolver-lucene/java/org/mulgara/resolver/lucene resolver-nodetype/java/org/mulgara/resolver/nodetype resolver-prefix/java/org/mulgara/resolver/prefix resolver-relational/java/org/mulgara/resolver/relational resolver-spi/java/org/mulgara/content resolver-spi/java/org/mulgara/resolver/spi resolver-store/java/org/mulgara/resolver/store resolver-test/java/org/mulgara/resolver/test resolver-url/java/org/mulgara/resolver/url resolver-view/java/org/mulgara/resolver/view resolver-xsd/java/org/mulgara/resolver/xsd tuples/java/org/mulgara/store/tuples
andrae at mulgara.org
andrae at mulgara.org
Tue Mar 18 04:32:15 UTC 2008
Author: andrae
Date: 2008-03-17 21:32:14 -0700 (Mon, 17 Mar 2008)
New Revision: 689
Modified:
trunk/src/jar/query/java/org/mulgara/query/AbstractConstraintExpression.java
trunk/src/jar/query/java/org/mulgara/query/Constraint.java
trunk/src/jar/query/java/org/mulgara/query/ConstraintExpression.java
trunk/src/jar/query/java/org/mulgara/query/ConstraintFalse.java
trunk/src/jar/query/java/org/mulgara/query/ConstraintHaving.java
trunk/src/jar/query/java/org/mulgara/query/ConstraintImpl.java
trunk/src/jar/query/java/org/mulgara/query/ConstraintIs.java
trunk/src/jar/query/java/org/mulgara/query/ConstraintNegation.java
trunk/src/jar/query/java/org/mulgara/query/ConstraintTrue.java
trunk/src/jar/query/java/org/mulgara/query/GivenConstraint.java
trunk/src/jar/query/java/org/mulgara/query/LocalNode.java
trunk/src/jar/query/java/org/mulgara/query/SingleTransitiveConstraint.java
trunk/src/jar/query/java/org/mulgara/query/TransitiveConstraint.java
trunk/src/jar/query/java/org/mulgara/query/WalkConstraint.java
trunk/src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem/FileSystemResolver.java
trunk/src/jar/resolver-lucene/java/org/mulgara/resolver/lucene/LuceneResolver.java
trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype/NodeTypeResolver.java
trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/PrefixResolver.java
trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/TuplesWrapperResolution.java
trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalConstraint.java
trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalResolver.java
trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalTransformer.java
trunk/src/jar/resolver-spi/java/org/mulgara/content/ContentResolver.java
trunk/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ConjunctiveTransformer.java
trunk/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ConjunctiveTransformerUnitTest.java
trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreDuplicateResolution.java
trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreInverseResolution.java
trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreResolution.java
trunk/src/jar/resolver-test/java/org/mulgara/resolver/test/TestConstraint.java
trunk/src/jar/resolver-url/java/org/mulgara/resolver/url/URLResolver.java
trunk/src/jar/resolver-view/java/org/mulgara/resolver/view/ViewResolver.java
trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalConstraint.java
trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalTransformation.java
trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolver.java
trunk/src/jar/resolver/java/org/mulgara/resolver/CacheResolver.java
trunk/src/jar/resolver/java/org/mulgara/resolver/ConstraintOperations.java
trunk/src/jar/resolver/java/org/mulgara/resolver/DatabaseOperationContext.java
trunk/src/jar/resolver/java/org/mulgara/resolver/DirectTransitiveFunction.java
trunk/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java
trunk/src/jar/resolver/java/org/mulgara/resolver/WalkFunction.java
trunk/src/jar/tuples/java/org/mulgara/store/tuples/ConstrainedNegationTuples.java
Log:
Reverted checkin of filter code that wasn't intended for trunk/
Modified: trunk/src/jar/query/java/org/mulgara/query/AbstractConstraintExpression.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/AbstractConstraintExpression.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/AbstractConstraintExpression.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -29,8 +29,6 @@
import java.util.*;
-import org.mulgara.query.filter.Filter;
-
/**
* An expression whose leaves are {@link Constraint}s.
*
@@ -61,13 +59,14 @@
*/
static final long serialVersionUID = -8835851673635062642L;
- /** A set of all variables the compose the constraint. */
+ /**
+ * A set of all variables the compose the constraint.
+ */
protected Set<Variable> variables = null;
- /** The filter to use on resolutions */
- protected Filter filter = Filter.NULL;
-
- /** The operands. */
+ /**
+ * The operands.
+ */
protected ArrayList<ConstraintExpression> elements;
public boolean equals(Object o) {
@@ -80,20 +79,4 @@
return false;
}
}
-
- /**
- * Adds a filter to this constraint.
- * @param filter The filter for this constraint.
- */
- public void setFilter(Filter filter) {
- this.filter = filter;
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return filter;
- }
}
Modified: trunk/src/jar/query/java/org/mulgara/query/Constraint.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/Constraint.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/Constraint.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -38,6 +38,12 @@
* @author <a href="http://staff.pisoftware.com/david">David Makepeace</a>
* @author <a href="http://staff.pisoftware.com/pag">Paul Gearon</a>
*
+ * @version $Revision: 1.8 $
+ *
+ * @modified $Date: 2005/01/05 04:58:20 $ by $Author: newmana $
+ *
+ * @maintenanceAuthor $Author: newmana $
+ *
* @copyright ©2001-2004
* <a href="http://www.pisoftware.com/">Plugged In Software Pty Ltd</a>
*
@@ -55,21 +61,23 @@
/**
* Get a constraint element by index.
+ *
* @param index The constraint element to retrieve, from 0 to 3.
* @return The constraint element referred to by index.
*/
public ConstraintElement getElement(int index);
/**
- * Get the graph element of this constraint.
+ * Get the model element of this constraint.
*/
- public ConstraintElement getGraph();
+ public ConstraintElement getModel();
/**
* Returns true if there is are repeating constraint elements.
+ *
* For example, <code>$s $p $s</code>.
+ *
* @return true if there is are repeating constraint elements
*/
public boolean isRepeating();
-
}
Modified: trunk/src/jar/query/java/org/mulgara/query/ConstraintExpression.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/ConstraintExpression.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/ConstraintExpression.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -31,8 +31,6 @@
import java.io.Serializable;
-import org.mulgara.query.filter.Filter;
-
/**
* An expression whose leaves are {@link Constraint}s.
*
@@ -68,17 +66,4 @@
* @return A set containing all variable constraints.
*/
public Set<Variable> getVariables();
-
- /**
- * Sets a filter on this constraint.
- * @param filter A filter to reduce the resolution of this constraint.
- */
- public void setFilter(Filter filter);
-
- /**
- * Retrieve filter for this constraint.
- * @return The filter that is used for this constraint.
- */
- public Filter getFilter();
-
}
Modified: trunk/src/jar/query/java/org/mulgara/query/ConstraintFalse.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/ConstraintFalse.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/ConstraintFalse.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -29,8 +29,6 @@
import java.util.*;
-import org.mulgara.query.filter.Filter;
-
/**
* A constraint expression with zero rows.
*
@@ -144,20 +142,4 @@
public String toString() {
return "no";
}
-
- /**
- * Sets the filter for this constraint. Since this constraint returns nothing, then this is irrelevant.
- * @param filter Ignored.
- */
- public void setFilter(Filter filter) {
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return Filter.NULL;
- }
-
}
Modified: trunk/src/jar/query/java/org/mulgara/query/ConstraintHaving.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/ConstraintHaving.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/ConstraintHaving.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -103,7 +103,7 @@
}
- public ConstraintElement getGraph() {
+ public ConstraintElement getModel() {
return element[3];
}
Modified: trunk/src/jar/query/java/org/mulgara/query/ConstraintImpl.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/ConstraintImpl.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/ConstraintImpl.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -159,7 +159,7 @@
}
- public ConstraintElement getGraph() {
+ public ConstraintElement getModel() {
return element[3];
}
Modified: trunk/src/jar/query/java/org/mulgara/query/ConstraintIs.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/ConstraintIs.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/ConstraintIs.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -148,7 +148,7 @@
element = null;
}
- public ConstraintElement getGraph() {
+ public ConstraintElement getModel() {
return element[3];
}
Modified: trunk/src/jar/query/java/org/mulgara/query/ConstraintNegation.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/ConstraintNegation.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/ConstraintNegation.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -31,8 +31,6 @@
import java.util.*;
-import org.mulgara.query.filter.Filter;
-
// Third party packages
// import org.apache.log4j.Logger;
@@ -70,12 +68,11 @@
*/
private static final long serialVersionUID = 9147228997817064907L;
- /** The negated expression. */
+ /**
+ * The negated expression.
+ */
private Constraint constraint;
- /** The filter to use on resolutions */
- protected Filter filter = Filter.NULL;
-
//
// Constructor
//
@@ -114,8 +111,8 @@
return constraint.getElement(index);
}
- public ConstraintElement getGraph() {
- return constraint.getGraph();
+ public ConstraintElement getModel() {
+ return constraint.getModel();
}
@@ -185,21 +182,4 @@
return returnValue;
}
-
- /**
- * Adds a filter to this constraint.
- * @param filter The filter for this constraint.
- */
- public void setFilter(Filter filter) {
- this.filter = filter;
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return filter;
- }
-
}
Modified: trunk/src/jar/query/java/org/mulgara/query/ConstraintTrue.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/ConstraintTrue.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/ConstraintTrue.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -29,8 +29,6 @@
import java.util.*;
-import org.mulgara.query.filter.Filter;
-
/**
* A constraint expression with zero columns and one row.
*
@@ -142,20 +140,4 @@
public String toString() {
return "yes";
}
-
- /**
- * Sets the filter for this constraint. Since this constraint returns nothing, then this is irrelevant.
- * @param filter Ignored.
- */
- public void setFilter(Filter filter) {
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return Filter.NULL;
- }
-
}
Modified: trunk/src/jar/query/java/org/mulgara/query/GivenConstraint.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/GivenConstraint.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/GivenConstraint.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -27,16 +27,24 @@
package org.mulgara.query;
-import org.mulgara.query.filter.Filter;
+import java.util.Set;
-
/**
* An abstract class to be used by implementations of GIVEN clauses.
*
* @created 2004-08-03
+ *
* @author Andrew Newman
+ *
+ * @version $Revision: 1.9 $
+ *
+ * @modified $Date: 2005/05/29 08:32:40 $ by $Author: raboczi $
+ *
+ * @maintenanceAuthor $Author: raboczi $
+ *
* @copyright ©2004
* <a href="http://www.pisoftware.com/">Plugged In Software Pty Ltd</a>
+ *
* @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
*/
public abstract class GivenConstraint implements Constraint {
@@ -48,24 +56,4 @@
* deleted.
*/
static final long serialVersionUID = 965560040170826878L;
-
- /** The filter to use on resolutions */
- protected Filter filter = Filter.NULL;
-
- /**
- * Adds a filter to this constraint.
- * @param filter The filter for this constraint.
- */
- public void setFilter(Filter filter) {
- this.filter = filter;
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return filter;
- }
-
}
Modified: trunk/src/jar/query/java/org/mulgara/query/LocalNode.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/LocalNode.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/LocalNode.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -49,7 +49,7 @@
*
* @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
*/
-public class LocalNode implements Comparable<LocalNode>, Value {
+public class LocalNode implements Comparable, Value {
/**
* The <var>value</var> property.
@@ -101,13 +101,22 @@
/**
* Nodes compare based on their node number.
*
- * @param ln the object to compare against.
+ * @param object the object to compare against.
* @return RETURNED VALUE TO DO
* @throws IllegalArgumentException if the object is not the correct type.
*/
- public int compareTo(LocalNode ln) throws IllegalArgumentException {
- long ov = ln.getValue();
- return (ov == value) ? 0 : ( (ov < value) ? ( -1) : 1);
+ public int compareTo(Object object) throws IllegalArgumentException {
+
+ if (object instanceof LocalNode) {
+
+ long ov = ( (LocalNode) object).getValue();
+
+ return (ov == value) ? 0 : ( (ov < value) ? ( -1) : 1);
+ }
+ else {
+
+ throw new IllegalArgumentException("Can't compare to " + object);
+ }
}
//
Modified: trunk/src/jar/query/java/org/mulgara/query/SingleTransitiveConstraint.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/SingleTransitiveConstraint.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/SingleTransitiveConstraint.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -32,8 +32,6 @@
// Java 2 standard packages
import java.util.*;
-import org.mulgara.query.filter.Filter;
-
// Third party packages
// import org.apache.log4j.Logger;
@@ -73,13 +71,14 @@
// /** Logger. */
// private final static Logger logger = Logger.getLogger(Constraint.class);
- /** The filter to use on resolutions */
- protected Filter filter = Filter.NULL;
-
- /** The constraint containing the transitive predicate. */
+ /**
+ * The constraint containing the transitive predicate.
+ */
private final Constraint transConstraint;
- /** The anchor to be applied if this anchor is to be used for a chain. */
+ /**
+ * The anchor to be applied if this anchor is to be used for a chain.
+ */
private final boolean anchored;
/**
@@ -189,8 +188,8 @@
return transConstraint.getElement(index);
}
- public ConstraintElement getGraph() {
- return transConstraint.getGraph();
+ public ConstraintElement getModel() {
+ return transConstraint.getModel();
}
/**
@@ -209,20 +208,4 @@
}
return buffer.toString();
}
-
- /**
- * Adds a filter to this constraint.
- * @param filter The filter for this constraint.
- */
- public void setFilter(Filter filter) {
- this.filter = filter;
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return filter;
- }
}
Modified: trunk/src/jar/query/java/org/mulgara/query/TransitiveConstraint.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/TransitiveConstraint.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/TransitiveConstraint.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -32,8 +32,6 @@
// Java 2 standard packages
import java.util.*;
-import org.mulgara.query.filter.Filter;
-
// Third party packages
// import org.apache.log4j.Logger;
@@ -73,15 +71,16 @@
// /** Logger. */
// private final static Logger logger = Logger.getLogger(Constraint.class);
- /** The constraint containing the anchored transitive predicate. */
+ /**
+ * The constraint containing the anchored transitive predicate.
+ */
private final Constraint anchoredConstraint;
- /** The constraint containing the unanchored transitive predicate. */
+ /**
+ * The constraint containing the unanchored transitive predicate.
+ */
private final Constraint unanchoredConstraint;
- /** The filter to use on resolutions */
- protected Filter filter = Filter.NULL;
-
/**
* Constructor.
*
@@ -190,8 +189,8 @@
return unanchoredConstraint.getElement(index);
}
- public ConstraintElement getGraph() {
- return unanchoredConstraint.getGraph();
+ public ConstraintElement getModel() {
+ return unanchoredConstraint.getModel();
}
/**
@@ -209,20 +208,4 @@
buffer.append("]");
return buffer.toString();
}
-
- /**
- * Adds a filter to this constraint.
- * @param filter The filter for this constraint.
- */
- public void setFilter(Filter filter) {
- this.filter = filter;
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return filter;
- }
}
Modified: trunk/src/jar/query/java/org/mulgara/query/WalkConstraint.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/WalkConstraint.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/query/java/org/mulgara/query/WalkConstraint.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -32,8 +32,6 @@
// Java 2 standard packages
import java.util.*;
-import org.mulgara.query.filter.Filter;
-
// Third party packages
// import org.apache.log4j.Logger;
@@ -72,15 +70,16 @@
// /** Logger. */
// private final static Logger logger = Logger.getLogger(Constraint.class);
- /** The constraint containing the anchored constraint. */
+ /**
+ * The constraint containing the anchored constraint.
+ */
private final Constraint anchoredConstraint;
- /** The constraint containing the unanchored constraint. */
+ /**
+ * The constraint containing the unanchored constraint.
+ */
private final Constraint unanchoredConstraint;
- /** The filter to use on resolutions */
- protected Filter filter = Filter.NULL;
-
/**
* Constructor.
*
@@ -163,8 +162,8 @@
return unanchoredConstraint.getElement(index);
}
- public ConstraintElement getGraph() {
- return unanchoredConstraint.getGraph();
+ public ConstraintElement getModel() {
+ return unanchoredConstraint.getModel();
}
/**
@@ -222,20 +221,4 @@
buffer.append("]");
return buffer.toString();
}
-
- /**
- * Adds a filter to this constraint.
- * @param filter The filter for this constraint.
- */
- public void setFilter(Filter filter) {
- this.filter = filter;
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return filter;
- }
}
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/CacheResolver.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/CacheResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/CacheResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -140,14 +140,14 @@
if (constraint == null) {
throw new IllegalArgumentException("Null \"constraint\" parameter");
}
- if (!(constraint.getGraph() instanceof LocalNode)) {
+ if (!(constraint.getModel() instanceof LocalNode)) {
throw new QueryException(
"Unable to resolve constraint with unbound model: " + constraint
);
}
- assert constraint.getGraph() instanceof LocalNode;
+ assert constraint.getModel() instanceof LocalNode;
- LocalNode modelLocalNode = (LocalNode)constraint.getGraph();
+ LocalNode modelLocalNode = (LocalNode)constraint.getModel();
// Obtain the resolver against the cached version
Resolver temporaryResolver;
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/ConstraintOperations.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/ConstraintOperations.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/ConstraintOperations.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -268,7 +268,7 @@
return ConstraintFactory.newConstraint(replace(bindings, constraint.getElement(0)),
replace(bindings, constraint.getElement(1)),
replace(bindings, constraint.getElement(2)),
- replace(bindings, constraint.getGraph()));
+ replace(bindings, constraint.getModel()));
}
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/DatabaseOperationContext.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/DatabaseOperationContext.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/DatabaseOperationContext.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -619,7 +619,7 @@
throw new IllegalArgumentException("Null \"constraint\" parameter");
}
- ConstraintElement modelElem = constraint.getGraph();
+ ConstraintElement modelElem = constraint.getModel();
if (modelElem instanceof Variable) {
return resolveVariableModel(constraint);
} else if (modelElem instanceof LocalNode) {
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/DirectTransitiveFunction.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/DirectTransitiveFunction.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/DirectTransitiveFunction.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -166,7 +166,7 @@
variable,
predConstraint.getElement(1),
tmpVariable,
- predConstraint.getGraph());
+ predConstraint.getModel());
} else {
// forward anchor [anchor predicate $x]
value = new Long(session.lookup((Node)predConstraint.getElement(0)));
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -178,14 +178,14 @@
*/
public Tuples resolve(ModelResource modelResource, Constraint constraint) throws QueryException
{
- assert modelResource != null || !constraint.getGraph().equals(Variable.FROM);
+ assert modelResource != null || !constraint.getModel().equals(Variable.FROM);
assert constraint != null;
// Delegate constraint resolution back to the database session
try {
Constraint localized = ConstraintOperations.localize(this, constraint);
- if (localized.getGraph().equals(Variable.FROM)) {
+ if (localized.getModel().equals(Variable.FROM)) {
localized = ConstraintOperations.rewriteConstraintModel(
localize(new URIReferenceImpl(modelResource.getURI())), localized);
}
Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/WalkFunction.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/WalkFunction.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/WalkFunction.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -192,7 +192,7 @@
// build the constraint with the temporary variable name
openConstraint = new ConstraintImpl(anchoredConstraintVariable,
anchoredConstraint.getElement(1), tmpVariable,
- anchoredConstraint.getGraph());
+ anchoredConstraint.getModel());
// set up the final result built from the second constraint
inferredResult = new LiteralTuples(new Variable[] {
(Variable) predConstraint.getUnanchoredConstraint().getElement(2),
@@ -214,7 +214,7 @@
// build the constraint with the temporary variable name
openConstraint = new ConstraintImpl(tmpVariable,
anchoredConstraint.getElement(1), anchoredConstraintVariable,
- anchoredConstraint.getGraph());
+ anchoredConstraint.getModel());
// set up the final result built from the second constraint
inferredResult = new LiteralTuples(new Variable[] {
Modified: trunk/src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem/FileSystemResolver.java
===================================================================
--- trunk/src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem/FileSystemResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem/FileSystemResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -338,7 +338,7 @@
}
// Obtain the model of the constraint
- ConstraintElement modelElem = constraint.getGraph();
+ ConstraintElement modelElem = constraint.getModel();
// Verify our model node is a local node
if (!(modelElem instanceof LocalNode)) {
Modified: trunk/src/jar/resolver-lucene/java/org/mulgara/resolver/lucene/LuceneResolver.java
===================================================================
--- trunk/src/jar/resolver-lucene/java/org/mulgara/resolver/lucene/LuceneResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-lucene/java/org/mulgara/resolver/lucene/LuceneResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -321,7 +321,7 @@
logger.debug("Resolve " + constraint);
}
- ConstraintElement modelElement = constraint.getGraph();
+ ConstraintElement modelElement = constraint.getModel();
if (modelElement instanceof Variable) {
logger.warn("Ignoring solutions for " + constraint);
return new EmptyResolution(constraint, false);
Modified: trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype/NodeTypeResolver.java
===================================================================
--- trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype/NodeTypeResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype/NodeTypeResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -30,18 +30,24 @@
package org.mulgara.resolver.nodetype;
// Java 2 standard packages
+import java.io.*;
import java.net.*;
import java.util.*;
import javax.transaction.xa.XAResource;
// Third party packages
import org.apache.log4j.Logger;
+import org.jrdf.graph.*;
// Locally written packages
import org.mulgara.query.*;
+import org.mulgara.resolver.*;
import org.mulgara.resolver.spi.*;
+import org.mulgara.server.Session;
+import org.mulgara.server.SessionFactory;
import org.mulgara.store.stringpool.SPObject;
import org.mulgara.store.stringpool.StringPoolException;
+import org.mulgara.store.tuples.LiteralTuples;
import org.mulgara.store.tuples.Tuples;
import org.mulgara.store.tuples.TuplesOperations;
@@ -65,9 +71,15 @@
/** The session that this resolver is associated with. */
private final ResolverSession resolverSession;
+ /** A map of servers to sessions. This acts as a cache, and also so we may close the sessions. */
+ private Map sessions;
+
/** The URI of the type describing node type models. */
private URI modelTypeURI;
+ /** The node for the type describing node type models. */
+ private long modelType;
+
/** The preallocated local node representing the rdf:type property. */
private long rdfType;
@@ -113,9 +125,11 @@
// Initialize fields
this.resolverSession = resolverSession;
this.modelTypeURI = modelTypeURI;
+ this.modelType = modelType;
this.rdfType = rdfType;
this.rdfsLiteral = rdfsLiteral;
this.mulgaraUriReference = mulgaraUriReference;
+ sessions = new Hashtable();
}
//
@@ -206,7 +220,7 @@
if (constraint == null) {
throw new IllegalArgumentException("Null \"constraint\" parameter");
}
- if (!(constraint.getGraph() instanceof LocalNode)) {
+ if (!(constraint.getModel() instanceof LocalNode)) {
logger.warn("Ignoring solutions for non-local model " + constraint);
return new EmptyResolution(constraint, false);
}
@@ -245,6 +259,9 @@
Tuples tuples;
if (node instanceof Variable) {
+ // extract the variable from the constraint
+ Variable variable = (Variable)node;
+
// select the type being extracted from the string pool
if (type == rdfsLiteral) {
// literals currently fall into 2 categories: typed and untyped
Modified: trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/PrefixResolver.java
===================================================================
--- trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/PrefixResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/PrefixResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -13,7 +13,9 @@
package org.mulgara.resolver.prefix;
// Java 2 standard packages
+import java.io.*;
import java.net.*;
+import java.util.*;
import javax.transaction.xa.XAResource;
// Third party packages
@@ -22,12 +24,16 @@
// Locally written packages
import org.mulgara.query.*;
+import org.mulgara.resolver.*;
import org.mulgara.resolver.spi.*;
+import org.mulgara.server.Session;
+import org.mulgara.server.SessionFactory;
import org.mulgara.store.stringpool.SPObject;
import org.mulgara.store.stringpool.SPObjectFactory;
import org.mulgara.store.stringpool.SPURI;
import org.mulgara.store.stringpool.StringPoolException;
import org.mulgara.store.stringpool.xa.SPObjectFactoryImpl;
+import org.mulgara.store.tuples.LiteralTuples;
import org.mulgara.store.tuples.Tuples;
import org.mulgara.store.tuples.TuplesOperations;
@@ -49,6 +55,9 @@
/** The session that this resolver is associated with. */
private final ResolverSession resolverSession;
+ /** A map of servers to sessions. This acts as a cache, and also so we may close the sessions. */
+ private Map sessions;
+
/** The URI of the type describing node type models. */
private URI modelTypeURI;
@@ -87,6 +96,7 @@
this.resolverSession = resolverSession;
this.modelTypeURI = modelTypeURI;
this.mulgaraPrefix = mulgaraPrefix;
+ sessions = new Hashtable();
}
//
@@ -178,7 +188,7 @@
throw new IllegalArgumentException("Null \"constraint\" parameter");
}
- if (!(constraint.getGraph() instanceof LocalNode)) {
+ if (!(constraint.getModel() instanceof LocalNode)) {
logger.warn("Ignoring solutions for " + constraint);
return new EmptyResolution(constraint, false);
}
@@ -231,7 +241,8 @@
Tuples tuples;
if (node instanceof Variable) {
- // Bind a query on a range in the String pool to the variable
+ // extract the variable from the constraint
+ Variable variable = (Variable)node;
// convert the prefix into a string pool object
SPObjectFactory spoFact = SPObjectFactoryImpl.getInstance();
Modified: trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/TuplesWrapperResolution.java
===================================================================
--- trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/TuplesWrapperResolution.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/TuplesWrapperResolution.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -20,6 +20,7 @@
// Locally written packages
import org.mulgara.query.*;
+import org.mulgara.resolver.*;
import org.mulgara.resolver.spi.*;
import org.mulgara.store.tuples.Annotation;
import org.mulgara.store.tuples.RowComparator;
@@ -42,8 +43,8 @@
*
* This is named after the class.
*/
- @SuppressWarnings("unused")
- private static final Logger logger = Logger.getLogger(TuplesWrapperResolution.class.getName());
+ private static final Logger logger =
+ Logger.getLogger(TuplesWrapperResolution.class.getName());
/** The constraint. */
private final Constraint constraint;
@@ -253,7 +254,7 @@
* Be aware that the tuples returned from this method are not cloned, and should
* be considered immutable.
*/
- public List<Tuples> getOperands() {
+ public List getOperands() {
return tuples.getOperands();
}
@@ -350,7 +351,7 @@
/**
* Copied from AbstractTuples
*/
- public Annotation getAnnotation(Class<?> annotationClass) throws TuplesException {
+ public Annotation getAnnotation(Class annotationClass) throws TuplesException {
return null;
}
}
Modified: trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalConstraint.java
===================================================================
--- trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalConstraint.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalConstraint.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -61,7 +61,6 @@
import org.mulgara.query.ConstraintImpl;
import org.mulgara.query.Value;
import org.mulgara.query.Variable;
-import org.mulgara.query.filter.Filter;
import org.mulgara.query.rdf.URIReferenceImpl;
import org.mulgara.resolver.spi.QueryEvaluationContext;
@@ -106,8 +105,6 @@
private Set<Variable> variables;
private static final URIReference rdftype;
-
- private Filter filter = Filter.NULL;
static {
try {
@@ -166,8 +163,8 @@
public void preliminaries(Constraint constraint) {
if (model == null) {
- model = constraint.getGraph();
- } else if (!model.equals(constraint.getGraph())) {
+ model = constraint.getModel();
+ } else if (!model.equals(constraint.getModel())) {
throw new IllegalStateException("Can't combine relational constraints against different models");
}
@@ -183,7 +180,7 @@
return list != null ? list : new ArrayList<Constraint>();
}
- public ConstraintElement getGraph() {
+ public ConstraintElement getModel() {
return model;
}
@@ -249,12 +246,4 @@
public String toString() {
return "RC{" + variables + "} | " + rdfTypeConstraints + " # " + predConstraints;
}
-
- public Filter getFilter() {
- return filter;
- }
-
- public void setFilter(Filter filter) {
- this.filter = filter;
- }
}
Modified: trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalResolver.java
===================================================================
--- trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -246,7 +246,7 @@
}
// Obtain the model of the constraint
- ConstraintElement modelElem = constraint.getGraph();
+ ConstraintElement modelElem = constraint.getModel();
// Verify our model node is a local node
if (!(modelElem instanceof LocalNode)) {
Modified: trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalTransformer.java
===================================================================
--- trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalTransformer.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-relational/java/org/mulgara/resolver/relational/RelationalTransformer.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -100,7 +100,7 @@
public ConstraintExpression transformMatch(SymbolicTransformationContext context, ConstraintImpl c) throws SymbolicTransformationException {
try {
- ConstraintElement ce = c.getGraph();
+ ConstraintElement ce = c.getModel();
if (ce instanceof URIReference) {
URIReference cu = (URIReference)ce;
URI constraintModelType = context.mapToModelTypeURI(cu.getURI());
@@ -125,10 +125,10 @@
ConstraintExpression arg = (ConstraintExpression)args.next();
if (arg instanceof RelationalConstraint) {
RelationalConstraint rc = (RelationalConstraint)arg;
- List rcArgs = (List)relationalArgs.get(rc.getGraph());
+ List rcArgs = (List)relationalArgs.get(rc.getModel());
if (rcArgs == null) {
rcArgs = new ArrayList();
- relationalArgs.put(rc.getGraph(), rcArgs);
+ relationalArgs.put(rc.getModel(), rcArgs);
}
rcArgs.add(rc);
} else {
Modified: trunk/src/jar/resolver-spi/java/org/mulgara/content/ContentResolver.java
===================================================================
--- trunk/src/jar/resolver-spi/java/org/mulgara/content/ContentResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-spi/java/org/mulgara/content/ContentResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -209,7 +209,7 @@
if (constraint == null) {
throw new IllegalArgumentException("constraint null");
}
- else if (!(constraint.getGraph() instanceof LocalNode)) {
+ else if (!(constraint.getModel() instanceof LocalNode)) {
throw new QueryException("Constraint model can't be variable");
}
@@ -217,7 +217,7 @@
URIReference modelURIReference;
long modelNode;
try {
- modelNode = ((LocalNode) constraint.getGraph()).getValue();
+ modelNode = ((LocalNode) constraint.getModel()).getValue();
Node node = resolverSession.globalize(modelNode);
if (!(node instanceof URIReference)) {
Modified: trunk/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ConjunctiveTransformer.java
===================================================================
--- trunk/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ConjunctiveTransformer.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ConjunctiveTransformer.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -225,7 +225,7 @@
private void accumulateConstraint(ConstraintImpl arg) throws SymbolicTransformationException {
try {
- ConstraintElement model = arg.getGraph();
+ ConstraintElement model = arg.getModel();
if (model instanceof URIReference) {
URIReference cu = (URIReference)model;
URI constraintModelType = context.mapToModelTypeURI(cu.getURI());
Modified: trunk/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ConjunctiveTransformerUnitTest.java
===================================================================
--- trunk/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ConjunctiveTransformerUnitTest.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ConjunctiveTransformerUnitTest.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -60,7 +60,6 @@
import org.mulgara.query.ConstraintOperation;
import org.mulgara.query.QueryException;
import org.mulgara.query.Variable;
-import org.mulgara.query.filter.Filter;
import org.mulgara.query.rdf.URIReferenceImpl;
import org.mulgara.util.NVPair;
@@ -626,12 +625,5 @@
public String toString() {
return "[TC:" + id + "]";
}
-
- public void setFilter(Filter filter) {
- }
-
- public Filter getFilter() {
- return Filter.NULL;
- }
}
}
Modified: trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreDuplicateResolution.java
===================================================================
--- trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreDuplicateResolution.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreDuplicateResolution.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -183,7 +183,7 @@
long subject = toGraphTuplesIndex(constraint.getElement(0));
long predicate = toGraphTuplesIndex(constraint.getElement(1));
long object = toGraphTuplesIndex(constraint.getElement(2));
- long meta = toGraphTuplesIndex(constraint.getGraph());
+ long meta = toGraphTuplesIndex(constraint.getModel());
// Return the tuples using the s, p, o hints.
baseTuples = store.findTuples(subject, predicate, object, meta);
Modified: trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreInverseResolution.java
===================================================================
--- trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreInverseResolution.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreInverseResolution.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -172,7 +172,7 @@
subject = toGraphTuplesIndex(constraint.getElement(0));
predicate = toGraphTuplesIndex(constraint.getElement(1));
object = toGraphTuplesIndex(constraint.getElement(2));
- metanode = toGraphTuplesIndex(constraint.getGraph());
+ metanode = toGraphTuplesIndex(constraint.getModel());
allFixedConstraints = (subject != NodePool.NONE) &&
(predicate != NodePool.NONE) && (object != NodePool.NONE);
Modified: trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreResolution.java
===================================================================
--- trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreResolution.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreResolution.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -147,7 +147,7 @@
toGraphTuplesIndex(constraint.getElement(0)) < 0 ||
toGraphTuplesIndex(constraint.getElement(1)) < 0 ||
toGraphTuplesIndex(constraint.getElement(2)) < 0 ||
- toGraphTuplesIndex(constraint.getGraph()) < 0;
+ toGraphTuplesIndex(constraint.getModel()) < 0;
baseDefinition = calculateBaseDefinition(constraint);
fixedLength = calculatePrefixLength(baseDefinition);
@@ -162,7 +162,7 @@
Tuples countTuples = store.findTuples(toGraphTuplesIndex(constraint.getElement(0)),
toGraphTuplesIndex(constraint.getElement(1)),
toGraphTuplesIndex(constraint.getElement(2)),
- toGraphTuplesIndex(constraint.getGraph()));
+ toGraphTuplesIndex(constraint.getModel()));
long rowCount = countTuples.getRowCount();
countTuples.close();
@@ -180,7 +180,7 @@
countTuples = store.findTuples(toGraphTuplesIndex(constraint.getElement(0)),
toGraphTuplesIndex(constraint.getElement(1)),
toGraphTuplesIndex(constraint.getElement(2)),
- toGraphTuplesIndex(constraint.getGraph()));
+ toGraphTuplesIndex(constraint.getModel()));
int rowCount = 0;
countTuples.beforeFirst();
while (countTuples.next()) {
@@ -222,7 +222,7 @@
constraint.getElement(0) instanceof LocalNode,
constraint.getElement(1) instanceof LocalNode,
constraint.getElement(2) instanceof LocalNode,
- constraint.getGraph() instanceof LocalNode
+ constraint.getModel() instanceof LocalNode
};
}
Modified: trunk/src/jar/resolver-test/java/org/mulgara/resolver/test/TestConstraint.java
===================================================================
--- trunk/src/jar/resolver-test/java/org/mulgara/resolver/test/TestConstraint.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-test/java/org/mulgara/resolver/test/TestConstraint.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -39,7 +39,6 @@
package org.mulgara.resolver.test;
// Java packages
-import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@@ -50,7 +49,6 @@
import org.mulgara.query.Constraint;
import org.mulgara.query.ConstraintElement;
import org.mulgara.query.Variable;
-import org.mulgara.query.filter.Filter;
import org.mulgara.query.rdf.LiteralImpl;
@@ -65,12 +63,14 @@
* @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
*/
-public class TestConstraint implements Constraint, Serializable {
+public class TestConstraint implements Constraint {
// /** Logger */
// private static Logger logger = Logger.getLogger(TestConstraint.class);
- /** ID for serializing */
- private static final long serialVersionUID = -171274827754305623L;
+ /**
+ * Fixme, generate proper version UID
+ */
+ static final long serialVersionUID = 0000000000000000001L;
private Variable var1;
private Variable var2;
@@ -132,7 +132,7 @@
return vars;
}
- public ConstraintElement getGraph() {
+ public ConstraintElement getModel() {
throw new IllegalStateException("TestConstraint is of fixed extent, no model available");
}
@@ -159,11 +159,4 @@
testSelection.equals(rhs.testSelection) &&
testParam.equals(rhs.testParam);
}
-
- public Filter getFilter() {
- return Filter.NULL;
- }
-
- public void setFilter(Filter filter) {
- }
}
Modified: trunk/src/jar/resolver-url/java/org/mulgara/resolver/url/URLResolver.java
===================================================================
--- trunk/src/jar/resolver-url/java/org/mulgara/resolver/url/URLResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-url/java/org/mulgara/resolver/url/URLResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -295,7 +295,7 @@
if (constraint == null) {
throw new IllegalArgumentException("constraint null");
}
- else if (!(constraint.getGraph() instanceof LocalNode)) {
+ else if (!(constraint.getModel() instanceof LocalNode)) {
throw new QueryException("Constraint model can't be variable");
}
Modified: trunk/src/jar/resolver-view/java/org/mulgara/resolver/view/ViewResolver.java
===================================================================
--- trunk/src/jar/resolver-view/java/org/mulgara/resolver/view/ViewResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-view/java/org/mulgara/resolver/view/ViewResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -245,7 +245,7 @@
if (logger.isDebugEnabled()) {
logger.debug("Resolve " + constraint);
}
- ConstraintElement modelElem = constraint.getGraph();
+ ConstraintElement modelElem = constraint.getModel();
if (!(modelElem instanceof LocalNode)) {
logger.warn("Ignoring solutions for " + constraint);
return new EmptyResolution(constraint, false);
Modified: trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalConstraint.java
===================================================================
--- trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalConstraint.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalConstraint.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -49,7 +49,6 @@
import org.mulgara.query.Constraint;
import org.mulgara.query.ConstraintElement;
import org.mulgara.query.Variable;
-import org.mulgara.query.filter.Filter;
import org.mulgara.query.rdf.URIReferenceImpl;
import org.jrdf.graph.URIReference;
@@ -111,10 +110,7 @@
*/
private final URIReference model;
- /** The filter to use on resolutions */
- protected Filter filter = Filter.NULL;
-
- /**
+ /**
* Sole constructor.
*
* @param variable the variable to constrain, never <code>null</code>
@@ -165,7 +161,7 @@
}
- public ConstraintElement getGraph() {
+ public ConstraintElement getModel() {
return new URIReferenceImpl(model.getURI());
}
@@ -331,21 +327,4 @@
buffer.append("]");
return buffer.toString();
}
-
- /**
- * Adds a filter to this constraint.
- * @param filter The filter for this constraint.
- */
- public void setFilter(Filter filter) {
- this.filter = filter;
- }
-
- /**
- * Gets the filter for this constraint.
- * @return Always null.
- */
- public Filter getFilter() {
- return filter;
- }
-
}
Modified: trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalTransformation.java
===================================================================
--- trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalTransformation.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/IntervalTransformation.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -268,7 +268,7 @@
// Confirm model is of type XSDModel.
try {
- ConstraintElement modelElement = constraintImpl.getGraph();
+ ConstraintElement modelElement = constraintImpl.getModel();
if (!(modelElement instanceof URIReference)) {
logger.debug("model not URIReference; cannot participate in transform returning null");
return null;
@@ -331,7 +331,7 @@
variable,
boundedBelow ? bound : null,
boundedBelow ? null : bound,
- (URIReference)constraintImpl.getGraph()
+ (URIReference)constraintImpl.getModel()
);
}
}
Modified: trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolver.java
===================================================================
--- trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolver.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolver.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -208,7 +208,7 @@
logger.debug("!! Resolving " + constraint);
}
- if (constraint.getGraph() instanceof Variable) {
+ if (constraint.getModel() instanceof Variable) {
logger.warn("Ignoring solutions for " + constraint);
return new EmptyResolution(constraint, false);
}
@@ -224,7 +224,7 @@
(LocalNode) oppositePropertyMap.get(
constraint.getElement(1)),
constraint.getElement(0),
- constraint.getGraph());
+ constraint.getModel());
}
long property = ((LocalNode) constraint.getElement(1)).getValue();
Modified: trunk/src/jar/tuples/java/org/mulgara/store/tuples/ConstrainedNegationTuples.java
===================================================================
--- trunk/src/jar/tuples/java/org/mulgara/store/tuples/ConstrainedNegationTuples.java 2008-03-18 01:24:19 UTC (rev 688)
+++ trunk/src/jar/tuples/java/org/mulgara/store/tuples/ConstrainedNegationTuples.java 2008-03-18 04:32:14 UTC (rev 689)
@@ -201,7 +201,7 @@
subject = toGraphTuplesIndex(constraint.getElement(0));
predicate = toGraphTuplesIndex(constraint.getElement(1));
object = toGraphTuplesIndex(constraint.getElement(2));
- metanode = toGraphTuplesIndex(constraint.getGraph());
+ metanode = toGraphTuplesIndex(constraint.getModel());
allFixedConstraints = (subject != NodePool.NONE) &&
(predicate != NodePool.NONE) && (object != NodePool.NONE);
More information about the Mulgara-svn
mailing list