Search in sources :

Example 1 with IsBNodeBOp

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);
    }
}
Also used : IsBNodeBOp(com.bigdata.rdf.internal.constraints.IsBNodeBOp) IV(com.bigdata.rdf.internal.IV) LexiconRelation(com.bigdata.rdf.lexicon.LexiconRelation)

Aggregations

IV (com.bigdata.rdf.internal.IV)1 IsBNodeBOp (com.bigdata.rdf.internal.constraints.IsBNodeBOp)1 LexiconRelation (com.bigdata.rdf.lexicon.LexiconRelation)1