@Override
	public String generateQuery() 
	{
		String namespace=AriadneStatement.URI;
		StringBuilder result=new StringBuilder();
		result.append("construct where {");
		if(subject==null)
			result.append("?s <"+AriadneStatement.statementData.toString()+"> ?o.");
		else result.append("<"+namespace+subject.replace(' ','_')+"> <"+AriadneStatement.statementData.toString()+"> ?o.");
		result.append("?o <http://ariadne.com/data> ?d." +
				"?o <http://ariadne.com/docRef> ?r." +
				"?o <http://ariadne.com/sentence> ?sen.");
		if(verb==null)
			result.append("?o <http://ariadne.com/verb> ?v.");
		else result.append("?o <http://ariadne.com/verb> \""+verb.replace(' ','_')+"\".");
		if(object==null&&prep==null&&prepData==null)
		{
			result.append("}");
			return result.toString();
		}
		if(object==null)
			result.append("?d <http://ariadne.com/object> ?h.");
		else result.append("?d <http://ariadne.com/object> \""+object.replace(' ','_')+"\".");
		if(prep==null)
			result.append("?d ?p");
		else result.append("?d <"+namespace+prep+"> ");
		if(prepData==null)
			result.append("?pd.");
		else result.append("\""+prepData+"\".");
		result.append("}");
		return result.toString();
	}