Java Code Examples for org.eclipse.rdf4j.query.Query#getClass()

The following examples show how to use org.eclipse.rdf4j.query.Query#getClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QueryManager.java    From CostFed with GNU Affero General Public License v3.0 3 votes vote down vote up
/**
 * Prepare a tuple query which uses the underlying federation to evaluate the query.<p>
 * 
 * The queryString is modified to use the declared PREFIX declarations, see 
 * {@link Config#getPrefixDeclarations()} for details.
 * 
 * @param queryString
 * @return
 * @throws MalformedQueryException
 */
public TupleQuery prepareTupleQuery(String queryString) {
	Query q = prepareQuery(queryString);
	if (!(q instanceof TupleQuery))
		throw new FedXRuntimeException("Query is not a tuple query: " + q.getClass());
	return (TupleQuery)q;
}
 
Example 2
Source File: QueryManager.java    From CostFed with GNU Affero General Public License v3.0 3 votes vote down vote up
/**
 * Prepare a tuple query which uses the underlying federation to evaluate the query.<p>
 * 
 * The queryString is modified to use the declared PREFIX declarations, see 
 * {@link Config#getPrefixDeclarations()} for details.
 * 
 * @param queryString
 * @return
 * @throws MalformedQueryException
 */
public GraphQuery prepareGraphQuery(String queryString) {
	Query q = prepareQuery(queryString);
	if (!(q instanceof GraphQuery))
		throw new FedXRuntimeException("Query is not a graph query: " + q.getClass());
	return (GraphQuery)q;
}
 
Example 3
Source File: QueryManager.java    From CostFed with GNU Affero General Public License v3.0 3 votes vote down vote up
/**
 * Prepare a boolean query which uses the underlying federation to evaluate the query.<p>
 * 
 * The queryString is modified to use the declared PREFIX declarations, see 
 * {@link Config#getPrefixDeclarations()} for details.
 * 
 * @param queryString
 * @return
 * @throws MalformedQueryException
 */
public BooleanQuery prepareBooleanQuery(String queryString) {
	Query q = prepareQuery(queryString);
	if (!(q instanceof BooleanQuery))
		throw new FedXRuntimeException("Unexpected query type: " + q.getClass());
	return (BooleanQuery)q;
}
 
Example 4
Source File: QueryManager.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 3 votes vote down vote up
/**
 * Prepare a tuple query which uses the underlying federation to evaluate the query.
 * <p>
 *
 * The queryString is modified to use the declared PREFIX declarations, see
 * {@link FedXConfig#getPrefixDeclarations()} for details.
 *
 * @param queryString
 * @return the prepared tuple query
 * @throws MalformedQueryException
 */
public TupleQuery prepareTupleQuery(String queryString) throws MalformedQueryException {

	Query q = prepareQuery(queryString);
	if (!(q instanceof TupleQuery)) {
		throw new FedXRuntimeException("Query is not a tuple query: " + q.getClass());
	}
	return (TupleQuery) q;
}
 
Example 5
Source File: QueryManager.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 3 votes vote down vote up
/**
 * Prepare a tuple query which uses the underlying federation to evaluate the query.
 * <p>
 *
 * The queryString is modified to use the declared PREFIX declarations, see
 * {@link FedXConfig#getPrefixDeclarations()} for details.
 *
 * @param queryString
 * @return the prepared graph query
 * @throws MalformedQueryException
 */
public GraphQuery prepareGraphQuery(String queryString) throws MalformedQueryException {

	Query q = prepareQuery(queryString);
	if (!(q instanceof GraphQuery)) {
		throw new FedXRuntimeException("Query is not a graph query: " + q.getClass());
	}
	return (GraphQuery) q;
}
 
Example 6
Source File: QueryManager.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 3 votes vote down vote up
/**
 * Prepare a boolean query which uses the underlying federation to evaluate the query.
 * <p>
 *
 * The queryString is modified to use the declared PREFIX declarations, see
 * {@link FedXConfig#getPrefixDeclarations()} for details.
 *
 * @param queryString
 * @return the prepared {@link BooleanQuery}
 * @throws MalformedQueryException
 */
public BooleanQuery prepareBooleanQuery(String queryString) throws MalformedQueryException {

	Query q = prepareQuery(queryString);
	if (!(q instanceof BooleanQuery)) {
		throw new FedXRuntimeException("Unexpected query type: " + q.getClass());
	}
	return (BooleanQuery) q;
}