本文整理汇总了Java中org.eclipse.rdf4j.query.MalformedQueryException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java MalformedQueryException.getMessage方法的具体用法?Java MalformedQueryException.getMessage怎么用?Java MalformedQueryException.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.rdf4j.query.MalformedQueryException
的用法示例。
在下文中一共展示了MalformedQueryException.getMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSparqlUpdateQueryValidator
import org.eclipse.rdf4j.query.MalformedQueryException; //导入方法依赖的package包/类
private Validator createSparqlUpdateQueryValidator() {
Validator validator = new Validator() {
private static final long serialVersionUID = 1L;
@Override
public void validate(Object value) throws InvalidValueException {
final String valueStr = (String) value;
if (value == null || valueStr.isEmpty()) {
throw new InvalidValueException(ctx.tr("sparqlvalidator.emptyQuery"));
}
try {
QueryParserUtil.parseUpdate(QueryLanguage.SPARQL, valueStr, null);
} catch (MalformedQueryException ex) {
throw new InvalidValueException(ctx.tr("sparqlvalidator.invalidQuery") + " " + ex.getMessage());
}
}
};
return validator;
}
示例2: createSparqlQueryValidator
import org.eclipse.rdf4j.query.MalformedQueryException; //导入方法依赖的package包/类
private Validator createSparqlQueryValidator() {
Validator validator = new Validator() {
private static final long serialVersionUID = 1L;
@Override
public void validate(Object value) throws InvalidValueException {
final String valueStr = (String) value;
if (value == null || valueStr.isEmpty()) {
throw new InvalidValueException(ctx.tr("sparqlvalidator.emptyQuery"));
}
try {
ParsedQuery parsedQuery = QueryParserUtil.parseQuery(QueryLanguage.SPARQL, valueStr, null);
if (!(parsedQuery instanceof ParsedBooleanQuery)&&!(parsedQuery instanceof ParsedTupleQuery)) {
throw new InvalidValueException(ctx.tr("error.unsupported.query.type"));
}
} catch (MalformedQueryException ex) {
throw new InvalidValueException(ctx.tr("sparqlvalidator.invalidQuery") + " " + ex.getMessage());
}
}
};
return validator;
}
示例3: createSparqlQueryValidator
import org.eclipse.rdf4j.query.MalformedQueryException; //导入方法依赖的package包/类
private Validator createSparqlQueryValidator() {
Validator validator = new Validator() {
private static final long serialVersionUID = 1L;
@Override
public void validate(Object value) throws InvalidValueException {
final String valueStr = (String) value;
if (value == null || valueStr.isEmpty()) {
throw new InvalidValueException(ctx.tr("sparqlvalidator.emptyQuery"));
}
try {
QueryParserUtil.parseQuery(QueryLanguage.SPARQL, valueStr, null);
} catch (MalformedQueryException ex) {
throw new InvalidValueException(ctx.tr("sparqlvalidator.invalidQuery") + " " + ex.getMessage());
}
}
};
return validator;
}