@Override public void handle(final IV newIV) { bValue.setIV(newIV); } });
@Override public void handle(final IV newIV) { bValue.setIV(newIV); } });
public void apply(final KVO<BigdataValue> t) { t.obj.setIV(iv); // System.err.println("Assigned term identifier to duplicate: "+tid+" : "+t.obj); }
@Override public void handle(final IV newIV) { bValue.setIV(newIV); } });
@Override public void handle(final IV newIV) { bValue.setIV(newIV); } });
public void apply(final KVO<BigdataValue> t) { t.obj.setIV(iv); // System.err.println("Assigned term identifier to duplicate: "+tid+" : "+t.obj); }
/** * De-serializes the {@link ITuple} as a {@link BigdataValue}, including * the term identifier extracted from the unsigned byte[] key, and sets * the appropriate {@link BigdataValueFactoryImpl} reference on that object. */ public BigdataValue deserialize(final ITuple tuple) { final IV<?,?> iv = deserializeKey(tuple); final BigdataValue tmp = valueSer.deserialize(tuple.getValueStream(), new StringBuilder()); tmp.setIV(iv); return tmp; }
/** * De-serializes the {@link ITuple} as a {@link BigdataValue}, including * the term identifier extracted from the unsigned byte[] key, and sets * the appropriate {@link BigdataValueFactoryImpl} reference on that object. */ public BigdataValue deserialize(final ITuple tuple) { final IV<?,?> iv = deserializeKey(tuple); final BigdataValue tmp = valueSer.deserialize(tuple.getValueStream(), new StringBuilder()); tmp.setIV(iv); return tmp; }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static final IV toDummyIV(final BigdataValue val) { final IV dummy = TermId.mockIV(VTE.valueOf(val)); dummy.setValue(val); val.setIV(dummy); return dummy; }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static final IV toDummyIV(final BigdataValue val) { final IV dummy = TermId.mockIV(VTE.valueOf(val)); dummy.setValue(val); val.setIV(dummy); return dummy; }
@SuppressWarnings({ "rawtypes", "unchecked" }) private void fillInDummyIV(BigdataValue value) { final IV iv = value.getIV(); if (iv == null) { /* * Since the term identifier is NULL this value is not known * to the kb. */ if (INFO) log.info("Not in knowledge base: " + value); /* * Create a dummy iv and cache the unknown value on it so * that it can be used during query evaluation. */ final IV dummyIV = TermId.mockIV(VTE.valueOf(value)); value.setIV(dummyIV); dummyIV.setValue(value); } else { iv.setValue(value); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) private void fillInDummyIV(BigdataValue value) { final IV iv = value.getIV(); if (iv == null) { /* * Since the term identifier is NULL this value is not known * to the kb. */ if (INFO) log.info("Not in knowledge base: " + value); /* * Create a dummy iv and cache the unknown value on it so * that it can be used during query evaluation. */ final IV dummyIV = TermId.mockIV(VTE.valueOf(value)); value.setIV(dummyIV); dummyIV.setValue(value); } else { iv.setValue(value); } }
/** * Unit test verifies that a new {@link BigdataValue} instance is returned * when {@link BigdataValueFactory#asValue(org.openrdf.model.Value)} is * invoked with a {@link BigdataValue} whose {@link IV} is a "dummmy" IV * (aka a "mock" IV). A "dummy" or "mock" {@link IV} is an {@link IV} which * stands in for a "null" and is used to hold the place for an RDF * {@link Value} which is not known to the database. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/348 */ public void test_asValue_mockIV() { final BigdataValue v1 = vf.createURI("http://www.bigdata.com"); final BigdataValue v2 = vf.asValue(v1); v1.setIV(TermId.mockIV(VTE.URI)); final BigdataValue v3 = vf.asValue(v1); // same BigdataValue assertTrue(v2 == v1); // distinct BigdataValue assertTrue(v3 != v1); }
/** * Unit test verifies that a new {@link BigdataValue} instance is returned * when {@link BigdataValueFactory#asValue(org.openrdf.model.Value)} is * invoked with a {@link BigdataValue} whose {@link IV} is a "dummmy" IV * (aka a "mock" IV). A "dummy" or "mock" {@link IV} is an {@link IV} which * stands in for a "null" and is used to hold the place for an RDF * {@link Value} which is not known to the database. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/348 */ public void test_asValue_mockIV() { final BigdataValue v1 = vf.createURI("http://www.bigdata.com"); final BigdataValue v2 = vf.asValue(v1); v1.setIV(TermId.mockIV(VTE.URI)); final BigdataValue v3 = vf.asValue(v1); // same BigdataValue assertTrue(v2 == v1); // distinct BigdataValue assertTrue(v3 != v1); }
@Override public void handle(final IV newIV) { final BigdataValue resolved = vf.asValue(v); if (resolved.getIV() == null && newIV!=null) { resolved.setIV(newIV); newIV.setValue(resolved); final Constant newConstant = new Constant(newIV); // we need to reread value expression from the node, as it might get changed by sibling nodes resolution // @see https://jira.blazegraph.com/browse/BLZG-1682 final IValueExpression<? extends IV> fve = ((ValueExpressionNode)bop).getValueExpression(); IValueExpression<? extends IV> newVe = (IValueExpression<? extends IV>) ((IVValueExpression) fve).setArg(fk, newConstant); ((ValueExpressionNode)bop).setValueExpression(newVe); ((ValueExpressionNode)bop).setArg(fk, new ConstantNode(newConstant)); } } });
@Override public void handle(final IV newIV) { final BigdataValue resolved = vf.asValue(v); if (resolved.getIV() == null && newIV!=null) { resolved.setIV(newIV); newIV.setValue(resolved); final Constant newConstant = new Constant(newIV); // we need to reread value expression from the node, as it might get changed by sibling nodes resolution // @see https://jira.blazegraph.com/browse/BLZG-1682 final IValueExpression<? extends IV> fve = ((ValueExpressionNode)bop).getValueExpression(); IValueExpression<? extends IV> newVe = (IValueExpression<? extends IV>) ((IVValueExpression) fve).setArg(fk, newConstant); ((ValueExpressionNode)bop).setValueExpression(newVe); ((ValueExpressionNode)bop).setArg(fk, new ConstantNode(newConstant)); } } });
value.setIV(iv);
value.setIV(iv);
value.setIV(iv);
/** * Unit test verifies that a new {@link BigdataValue} instance is returned * when {@link BigdataValueFactory#asValue(org.openrdf.model.Value)} is * invoked with a {@link BigdataValue} whose {@link IV} is a "dummmy" IV * (aka a "mock" IV). A "dummy" or "mock" {@link IV} is an {@link IV} which * stands in for a "null" and is used to hold the place for an RDF * {@link Value} which is not known to the database. * * @see https://sourceforge.net/apps/trac/bigdata/ticket/348 */ public void test_asValue_mockIV() { final BigdataValue v1 = vf.createURI("http://www.bigdata.com"); final BigdataValue v2 = vf.asValue(v1); v1.setIV(TermId.mockIV(VTE.URI)); final BigdataValue v3 = vf.asValue(v1); // same BigdataValue assertTrue(v2 == v1); // distinct BigdataValue assertTrue(v3 != v1); }