Example #1
0
  @Override
  public IV get(final IBindingSet bs) throws SparqlTypeErrorException {

    final IV iv = getAndCheckLiteral(0, bs);

    final IV datatype = getAndCheckBound(1, bs);

    if (!datatype.isURI()) throw new SparqlTypeErrorException();

    final BigdataURI dt = (BigdataURI) asValue(datatype);

    final Literal lit = asLiteral(iv);

    if (lit.getDatatype() != null || lit.getLanguage() != null) {
      throw new SparqlTypeErrorException();
    }

    final String label = lit.getLabel();

    final BigdataLiteral str = getValueFactory().createLiteral(label, dt);

    return super.asIV(str, bs);
  }
Example #2
0
    /**
     * Return the associated {@link BigdataValue}.
     *
     * <p>Note: A resolution set is necessary if you want to attach the {@link BigdataValue} to the
     * {@link IV}.
     *
     * @throws NotMaterializedException
     */
    public BigdataValue getValue() {

      if (val == null) throw new NotMaterializedException(iv.toString());

      return val;
    }