Java Code Examples for org.eclipse.rdf4j.query.QueryLanguage#SERQL

The following examples show how to use org.eclipse.rdf4j.query.QueryLanguage#SERQL . 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: QueryStorage.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
/**
 * Save a query. UNSAFE from an injection point of view. It is the responsibility of the calling code to call
 * checkAccess() with the full credentials first.
 *
 * @param repository    the repository the query is associated with
 * @param queryName     the name for the query
 * @param userName      the user saving the query
 * @param shared        whether the query is to be shared with other users
 * @param queryLanguage the language, SeRQL or SPARQL, of the query
 * @param queryText     the actual query text
 * @param infer
 * @param rowsPerPage   rows to display per page, may be 0 (all), 10, 50, 100, or 200)
 * @throws RDF4JException
 */
public void saveQuery(final HTTPRepository repository, final String queryName, final String userName,
		final boolean shared, final QueryLanguage queryLanguage, final String queryText, final boolean infer,
		final int rowsPerPage) throws RDF4JException {
	if (QueryLanguage.SPARQL != queryLanguage && QueryLanguage.SERQL != queryLanguage) {
		throw new RepositoryException("May only save SPARQL or SeRQL queries, not" + queryLanguage.toString());
	}
	if (0 != rowsPerPage && 10 != rowsPerPage && 20 != rowsPerPage && 50 != rowsPerPage && 100 != rowsPerPage
			&& 200 != rowsPerPage) {
		throw new RepositoryException("Illegal value for rows per page: " + rowsPerPage);
	}
	this.checkQueryText(queryText);
	final QueryStringBuilder save = new QueryStringBuilder(SAVE);
	save.replaceURI(REPOSITORY, repository.getRepositoryURL());
	save.replaceURI(QUERY, "urn:uuid:" + UUID.randomUUID());
	save.replaceQuote(QUERY_NAME, queryName);
	this.replaceUpdateFields(save, userName, shared, queryLanguage, queryText, infer, rowsPerPage);
	updateQueryRepository(save.toString());
}
 
Example 2
Source File: ConversionUtil.java    From semweb4j with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static QueryLanguage toRDF4JQueryLanguage(String queryLanguage) {
	String queryLanguageLowerCase = queryLanguage.toLowerCase();

	switch (queryLanguageLowerCase) {
		case "sparql":
			return QueryLanguage.SPARQL;
		case "serql":
			return QueryLanguage.SERQL;
		default:
			throw new QueryLanguageNotSupportedException("Query language '"
					+ queryLanguageLowerCase
					+ "' not supported. Valid values are \"sparql\" and \"serql\".");
	}
}
 
Example 3
Source File: MemorySeRQLQueryTest.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
protected QueryLanguage getQueryLanguage() {
	return QueryLanguage.SERQL;
}
 
Example 4
Source File: SeRQLQueryTest.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
protected QueryLanguage getQueryLanguage() {
	return QueryLanguage.SERQL;
}
 
Example 5
Source File: NativeSeRQLQueryTest.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
protected QueryLanguage getQueryLanguage() {
	return QueryLanguage.SERQL;
}
 
Example 6
Source File: SeRQLQueryRenderer.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * @inheritDoc
 */
@Override
public QueryLanguage getLanguage() {
	return QueryLanguage.SERQL;
}
 
Example 7
Source File: SeRQLParserFactory.java    From rdf4j with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Returns {@link QueryLanguage#SERQL}.
 */
@Override
public QueryLanguage getQueryLanguage() {
	return QueryLanguage.SERQL;
}