use of com.bigdata.rdf.lexicon.LexiconRelation in project wikidata-query-rdf by wikimedia.
the class WikibaseGeoUnitTest method testInteger.
@Test
@SuppressWarnings("rawtypes")
public void testInteger() {
LexiconRelation rel = store().getLexiconRelation();
Literal l = pointLiteral("Point(40.4426 -80.0068)");
LiteralExtensionIV iv = (LiteralExtensionIV) rel.getInlineIV(l);
assertEquals(GeoSparql.WKT_LITERAL, iv.getExtensionIV().getValue().toString());
assertEquals(new XSDIntegerIV(new BigInteger("1008819921758573694187894119050371595694851885687493623808")), iv.getDelegate());
}
use of com.bigdata.rdf.lexicon.LexiconRelation 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