use of com.bigdata.rdf.internal.constraints.IsBNodeBOp in project wikidata-query-rdf by wikimedia.
the class IsSomeValueFunctionFactory method create.
@Override
public IValueExpression<? extends IV> create(BOpContextBase context, GlobalAnnotations globals, Map<String, Object> map, ValueExpressionNode... args) {
FunctionRegistry.checkArgs(args, ValueExpressionNode.class);
IValueExpression<? extends IV> ve = AST2BOpUtility.toVE(context, globals, args[0]);
if (mode == SomeValueMode.Blank) {
return new IsBNodeBOp(ve);
} else {
String namespace = globals.lex;
long timestamp = globals.timestamp;
LexiconRelation lex = (LexiconRelation) context.getResource(namespace, timestamp);
IV vocabPrefix = lex.getContainer().getVocabulary().get(lex.getValueFactory().createURI(skolemURIPrefix));
if (vocabPrefix == null) {
throw new IllegalStateException("[" + skolemURIPrefix + "] must be part of the vocabulary");
}
return new InlineVocabEqBOp(new BOp[] { ve }, vocabPrefix);
}
}
Aggregations