// Path: src/main/java/com/anqit/spanqit/constraint/Operand.java
// public interface Operand extends QueryElement { }
// 
// Path: src/main/java/com/anqit/spanqit/graphpattern/GraphName.java
// public interface GraphName extends QueryElement { }
// 
// Path: src/main/java/com/anqit/spanqit/rdf/RdfObject.java
// public interface RdfObject extends QueryElement { }
// 
// Path: src/main/java/com/anqit/spanqit/rdf/RdfPredicate.java
// public interface RdfPredicate extends QueryElement {
// 	/**
// 	 * The built-in predicate shortcut for <code>rdf:type</code>
// 	 * 
// 	 * @see <a href="https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#abbrevRdfType">
// 	 * 		RDF Type abbreviation</a>
// 	 */
// 	public static RdfPredicate a = () -> "a";
// }
// 
// Path: src/main/java/com/anqit/spanqit/rdf/RdfSubject.java
// public interface RdfSubject extends QueryElement {
// 	/**
// 	 * Create a triple pattern from this subject and the given predicate and
// 	 * object
// 	 * 
// 	 * @param predicate
// 	 *            the predicate of the triple pattern
// 	 * @param objects
// 	 *            the object(s) of the triple pattern
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate and object(s)
// 	 * 
// 	 * @see <a
// 	 *      href="http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#QSynTriples">
// 	 *      Triple pattern syntax</a>
// 	 */
// 	default public TriplePattern has(RdfPredicate predicate, RdfObject... objects) {
// 		return GraphPatterns.tp(this, predicate, objects);
// 	}
// 	
// 	/**
// 	 * Create a triple pattern from this subject and the given predicate-object list(s) 
// 	 * @param lists
// 	 * 		the {@link RdfPredicateObjectList}(s) to describing this subject
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate-object list(s)
// 	 */
// 	default public TriplePattern has(RdfPredicateObjectList... lists) {
// 		return GraphPatterns.tp(this, lists);
// 	}
// 	
// 	/**
// 	 * Wrapper for {@link #has(RdfPredicate, RdfObject...)} that converts String objects into RdfLiteral instances
// 	 * 
// 	 * @param predicate
// 	 * 			the predicate of the triple pattern
// 	 * @param objects
// 	 * 			the String object(s) of the triple pattern
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate and object(s)
// 	 */
// 	default public TriplePattern has(RdfPredicate predicate, String... objects) {
// 		return GraphPatterns.tp(this, predicate, toRdfLiteralArray(objects));
// 	}
// 	
// 	/**
// 	 * Wrapper for {@link #has(RdfPredicate, RdfObject...)} that converts Number objects into RdfLiteral instances
// 	 * 
// 	 * @param predicate
// 	 * 			the predicate of the triple pattern
// 	 * @param objects
// 	 * 			the Number object(s) of the triple pattern
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate and object(s)
// 	 */
// 	default public TriplePattern has(RdfPredicate predicate, Number... objects) {
// 		return GraphPatterns.tp(this, predicate, toRdfLiteralArray(objects));
// 	}
// 	
// 	/**
// 	 * Wrapper for {@link #has(RdfPredicate, RdfObject...)} that converts Boolean objects into RdfLiteral instances
// 	 * 
// 	 * @param predicate
// 	 * 			the predicate of the triple pattern
// 	 * @param objects
// 	 * 			the Boolean object(s) of the triple pattern
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate and object(s)
// 	 */
// 	default public TriplePattern has(RdfPredicate predicate, Boolean... objects) {
// 		return GraphPatterns.tp(this, predicate, toRdfLiteralArray(objects));
// 	}
// 	
// 	/**
// 	 * Use the built-in shortcut "a" for <code>rdf:type</code> to build a triple with this subject and the given objects
// 	 * @param objects the objects to use to describe the <code>rdf:type</code> of this subject
// 	 * 
// 	 * @return a {@link TriplePattern} object with this subject, the "a" shortcut predicate, and the given objects 
// 	 * 
// 	 * @see <a href="https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#abbrevRdfType">
// 	 * 		RDF Type abbreviation</a>
// 	 */
// 	default public TriplePattern isA(RdfObject... objects) {
// 		return has(RdfPredicate.a, objects);
// 	}
// }


import com.anqit.spanqit.constraint.Operand;
import com.anqit.spanqit.graphpattern.GraphName;
import com.anqit.spanqit.rdf.RdfObject;
import com.anqit.spanqit.rdf.RdfPredicate;
import com.anqit.spanqit.rdf.RdfSubject;

package com.anqit.spanqit.core;


/**
 * A SPARQL query variable
 * 
 * @see <a
 *      href="http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#QSynVariables">
 *      SPARQL Variable Syntax</a>
 */
public class Variable implements Projectable, RdfSubject,
		RdfPredicate, RdfObject, Operand, Orderable,
		Groupable, GraphName, Assignable {
	private String alias;

	Variable(String varName) {
		this.alias = varName;
	}

	@Override
	public String getQueryString() {
		return "?" + alias;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {

// Path: src/main/java/com/anqit/spanqit/constraint/Operand.java
// public interface Operand extends QueryElement { }
// 
// Path: src/main/java/com/anqit/spanqit/graphpattern/GraphName.java
// public interface GraphName extends QueryElement { }
// 
// Path: src/main/java/com/anqit/spanqit/rdf/RdfObject.java
// public interface RdfObject extends QueryElement { }
// 
// Path: src/main/java/com/anqit/spanqit/rdf/RdfPredicate.java
// public interface RdfPredicate extends QueryElement {
// 	/**
// 	 * The built-in predicate shortcut for <code>rdf:type</code>
// 	 * 
// 	 * @see <a href="https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#abbrevRdfType">
// 	 * 		RDF Type abbreviation</a>
// 	 */
// 	public static RdfPredicate a = () -> "a";
// }
// 
// Path: src/main/java/com/anqit/spanqit/rdf/RdfSubject.java
// public interface RdfSubject extends QueryElement {
// 	/**
// 	 * Create a triple pattern from this subject and the given predicate and
// 	 * object
// 	 * 
// 	 * @param predicate
// 	 *            the predicate of the triple pattern
// 	 * @param objects
// 	 *            the object(s) of the triple pattern
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate and object(s)
// 	 * 
// 	 * @see <a
// 	 *      href="http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#QSynTriples">
// 	 *      Triple pattern syntax</a>
// 	 */
// 	default public TriplePattern has(RdfPredicate predicate, RdfObject... objects) {
// 		return GraphPatterns.tp(this, predicate, objects);
// 	}
// 	
// 	/**
// 	 * Create a triple pattern from this subject and the given predicate-object list(s) 
// 	 * @param lists
// 	 * 		the {@link RdfPredicateObjectList}(s) to describing this subject
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate-object list(s)
// 	 */
// 	default public TriplePattern has(RdfPredicateObjectList... lists) {
// 		return GraphPatterns.tp(this, lists);
// 	}
// 	
// 	/**
// 	 * Wrapper for {@link #has(RdfPredicate, RdfObject...)} that converts String objects into RdfLiteral instances
// 	 * 
// 	 * @param predicate
// 	 * 			the predicate of the triple pattern
// 	 * @param objects
// 	 * 			the String object(s) of the triple pattern
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate and object(s)
// 	 */
// 	default public TriplePattern has(RdfPredicate predicate, String... objects) {
// 		return GraphPatterns.tp(this, predicate, toRdfLiteralArray(objects));
// 	}
// 	
// 	/**
// 	 * Wrapper for {@link #has(RdfPredicate, RdfObject...)} that converts Number objects into RdfLiteral instances
// 	 * 
// 	 * @param predicate
// 	 * 			the predicate of the triple pattern
// 	 * @param objects
// 	 * 			the Number object(s) of the triple pattern
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate and object(s)
// 	 */
// 	default public TriplePattern has(RdfPredicate predicate, Number... objects) {
// 		return GraphPatterns.tp(this, predicate, toRdfLiteralArray(objects));
// 	}
// 	
// 	/**
// 	 * Wrapper for {@link #has(RdfPredicate, RdfObject...)} that converts Boolean objects into RdfLiteral instances
// 	 * 
// 	 * @param predicate
// 	 * 			the predicate of the triple pattern
// 	 * @param objects
// 	 * 			the Boolean object(s) of the triple pattern
// 	 * @return a new {@link TriplePattern} with this subject, and the given predicate and object(s)
// 	 */
// 	default public TriplePattern has(RdfPredicate predicate, Boolean... objects) {
// 		return GraphPatterns.tp(this, predicate, toRdfLiteralArray(objects));
// 	}
// 	
// 	/**
// 	 * Use the built-in shortcut "a" for <code>rdf:type</code> to build a triple with this subject and the given objects
// 	 * @param objects the objects to use to describe the <code>rdf:type</code> of this subject
// 	 * 
// 	 * @return a {@link TriplePattern} object with this subject, the "a" shortcut predicate, and the given objects 
// 	 * 
// 	 * @see <a href="https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#abbrevRdfType">
// 	 * 		RDF Type abbreviation</a>
// 	 */
// 	default public TriplePattern isA(RdfObject... objects) {
// 		return has(RdfPredicate.a, objects);
// 	}
// }


// Path: src/main/java/com/anqit/spanqit/core/Variable.java
import com.anqit.spanqit.constraint.Operand;
import com.anqit.spanqit.graphpattern.GraphName;
import com.anqit.spanqit.rdf.RdfObject;
import com.anqit.spanqit.rdf.RdfPredicate;
import com.anqit.spanqit.rdf.RdfSubject;

package com.anqit.spanqit.core;


/**
 * A SPARQL query variable
 * 
 * @see <a
 *      href="http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#QSynVariables">
 *      SPARQL Variable Syntax</a>
 */
public class Variable implements Projectable, RdfSubject,
		RdfPredicate, RdfObject, Operand, Orderable,
		Groupable, GraphName, Assignable {
	private String alias;

	Variable(String varName) {
		this.alias = varName;
	}

	@Override
	public String getQueryString() {
		return "?" + alias;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {

			return false;
