org.apache.rya.api.domain.RyaStatement.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中org.apache.rya.api.domain.RyaStatement.getValue方法的一些代码示例,展示了RyaStatement.getValue的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RyaStatement.getValue方法的具体详情如下:
包路径:org.apache.rya.api.domain.RyaStatement
类名称:RyaStatement
方法名:getValue

RyaStatement.getValue介绍

暂无

代码示例

代码示例来源:origin: org.apache.rya/rya.api

final String qualifer = stmt.getQualifer();
final byte[] qualBytes = qualifer == null ? EMPTY_BYTES : qualifer.getBytes(StandardCharsets.UTF_8);
final byte[] value = stmt.getValue();
assert subject != null && predicate != null && object != null;
final byte[] cf = (context == null) ? EMPTY_BYTES : context.getData().getBytes(StandardCharsets.UTF_8);

代码示例来源:origin: apache/incubator-rya

final String qualifer = stmt.getQualifer();
final byte[] qualBytes = qualifer == null ? EMPTY_BYTES : qualifer.getBytes(StandardCharsets.UTF_8);
final byte[] value = stmt.getValue();
assert subject != null && predicate != null && object != null;
final byte[] cf = (context == null) ? EMPTY_BYTES : context.getData().getBytes(StandardCharsets.UTF_8);

代码示例来源:origin: org.apache.rya/rya.mapreduce

write(dataOutput, columnQualifier);
write(dataOutput, ryaStatement.getColumnVisibility());
write(dataOutput, ryaStatement.getValue());
Long timestamp = ryaStatement.getTimestamp();
boolean b = timestamp != null;

代码示例来源:origin: apache/incubator-rya

write(dataOutput, columnQualifier);
write(dataOutput, ryaStatement.getColumnVisibility());
write(dataOutput, ryaStatement.getValue());
Long timestamp = ryaStatement.getTimestamp();
boolean b = timestamp != null;

代码示例来源:origin: org.apache.rya/rya.indexing

private static List<TripleRow> serializeStatement(final RyaStatement stmt) throws RyaTypeResolverException {
  final RyaURI subject = stmt.getSubject();
  final RyaURI predicate = stmt.getPredicate();
  final RyaType object = stmt.getObject();
  final RyaURI context = stmt.getContext();
  final Long timestamp = stmt.getTimestamp();
  final byte[] columnVisibility = stmt.getColumnVisibility();
  final byte[] value = stmt.getValue();
  assert subject != null && predicate != null && object != null;
  final byte[] cf = (context == null) ? EMPTY_BYTES : context.getData().getBytes(StandardCharsets.UTF_8);
  final byte[] subjBytes = subject.getData().getBytes(StandardCharsets.UTF_8);
  final byte[] predBytes = predicate.getData().getBytes(StandardCharsets.UTF_8);
  final byte[][] objBytes = RyaContext.getInstance().serializeType(object);
  return Lists.newArrayList(new TripleRow(subjBytes,
    predBytes,
    Bytes.concat(cf, DELIM_BYTES,
      OBJECT.getBytes(StandardCharsets.UTF_8), DELIM_BYTES,
      objBytes[0], objBytes[1]),
    timestamp,
    columnVisibility,
    value),
    new TripleRow(objBytes[0],
      predBytes,
      Bytes.concat(cf, DELIM_BYTES,
        SUBJECT.getBytes(StandardCharsets.UTF_8), DELIM_BYTES,
        subjBytes, objBytes[1]),
      timestamp,
      columnVisibility,
      value));
}

代码示例来源:origin: apache/incubator-rya

private static List<TripleRow> serializeStatement(final RyaStatement stmt) throws RyaTypeResolverException {
  final RyaIRI subject = stmt.getSubject();
  final RyaIRI predicate = stmt.getPredicate();
  final RyaType object = stmt.getObject();
  final RyaIRI context = stmt.getContext();
  final Long timestamp = stmt.getTimestamp();
  final byte[] columnVisibility = stmt.getColumnVisibility();
  final byte[] value = stmt.getValue();
  assert subject != null && predicate != null && object != null;
  final byte[] cf = (context == null) ? EMPTY_BYTES : context.getData().getBytes(StandardCharsets.UTF_8);
  final byte[] subjBytes = subject.getData().getBytes(StandardCharsets.UTF_8);
  final byte[] predBytes = predicate.getData().getBytes(StandardCharsets.UTF_8);
  final byte[][] objBytes = RyaContext.getInstance().serializeType(object);
  return Lists.newArrayList(new TripleRow(subjBytes,
    predBytes,
    Bytes.concat(cf, DELIM_BYTES,
      OBJECT.getBytes(StandardCharsets.UTF_8), DELIM_BYTES,
      objBytes[0], objBytes[1]),
    timestamp,
    columnVisibility,
    value),
    new TripleRow(objBytes[0],
      predBytes,
      Bytes.concat(cf, DELIM_BYTES,
        SUBJECT.getBytes(StandardCharsets.UTF_8), DELIM_BYTES,
        subjBytes, objBytes[1]),
      timestamp,
      columnVisibility,
      value));
}

代码示例来源:origin: org.apache.rya/rya.api

final String qualifer = stmt.getQualifer();
final byte[] qualBytes = qualifer == null ? EMPTY_BYTES : qualifer.getBytes(StandardCharsets.UTF_8);
final byte[] value = stmt.getValue();
assert subject != null && predicate != null && object != null;
final byte[] cf = (context == null) ? EMPTY_BYTES : context.getData().getBytes(StandardCharsets.UTF_8);

代码示例来源:origin: apache/incubator-rya

final String qualifer = stmt.getQualifer();
final byte[] qualBytes = qualifer == null ? EMPTY_BYTES : qualifer.getBytes(StandardCharsets.UTF_8);
final byte[] value = stmt.getValue();
assert subject != null && predicate != null && object != null;
final byte[] cf = (context == null) ? EMPTY_BYTES : context.getData().getBytes(StandardCharsets.UTF_8);

代码示例来源:origin: apache/incubator-rya

private static RyaStatement updateRyaStatementColumnVisibility(final RyaStatement ryaStatement, final ColumnVisibility newCv) {
  final RyaStatement newCvRyaStatement = new RyaStatement(ryaStatement.getSubject(), ryaStatement.getPredicate(), ryaStatement.getObject(), ryaStatement.getContext(), ryaStatement.getQualifer(), newCv.getExpression(), ryaStatement.getValue(), ryaStatement.getTimestamp());
  return newCvRyaStatement;
}

代码示例来源:origin: org.apache.rya/rya.api

output.writeLong(object.getTimestamp());
shouldWrite = object.getValue() != null;
output.writeBoolean(shouldWrite);
if(shouldWrite){
  output.writeBytes(object.getValue());

代码示例来源:origin: apache/incubator-rya

output.writeLong(object.getTimestamp());
shouldWrite = object.getValue() != null;
output.writeBoolean(shouldWrite);
if(shouldWrite){
  output.writeBytes(object.getValue());

代码示例来源:origin: org.apache.rya/rya.mapreduce

/**
 * Comparison method for natural ordering. Compares based on the logical
 * triple (the s/p/o/context information in the underlying RyaStatement)
 * and then by the metadata contained in the RyaStatement if the triples are
 * the same.
 * @return  Zero if both RyaStatementWritables contain equivalent statements
 *          or both have null statements; otherwise, an integer whose sign
 *          corresponds to a consistent ordering.
 */
@Override
public int compareTo(RyaStatementWritable other) {
  CompareToBuilder builder = new CompareToBuilder();
  RyaStatement rsThis = this.getRyaStatement();
  RyaStatement rsOther = other.getRyaStatement(); // should throw NPE if other is null, as per Comparable contract
  builder.append(rsThis == null, rsOther == null);
  if (rsThis != null && rsOther != null) {
    builder.append(rsThis.getSubject(), rsOther.getSubject());
    builder.append(rsThis.getPredicate(), rsOther.getPredicate());
    builder.append(rsThis.getObject(), rsOther.getObject());
    builder.append(rsThis.getContext(), rsOther.getContext());
    builder.append(rsThis.getQualifer(), rsOther.getQualifer());
    builder.append(rsThis.getColumnVisibility(), rsOther.getColumnVisibility());
    builder.append(rsThis.getValue(), rsOther.getValue());
    builder.append(rsThis.getTimestamp(), rsOther.getTimestamp());
  }
  return builder.toComparison();
}

代码示例来源:origin: apache/incubator-rya

/**
 * Comparison method for natural ordering. Compares based on the logical
 * triple (the s/p/o/context information in the underlying RyaStatement)
 * and then by the metadata contained in the RyaStatement if the triples are
 * the same.
 * @return  Zero if both RyaStatementWritables contain equivalent statements
 *          or both have null statements; otherwise, an integer whose sign
 *          corresponds to a consistent ordering.
 */
@Override
public int compareTo(RyaStatementWritable other) {
  CompareToBuilder builder = new CompareToBuilder();
  RyaStatement rsThis = this.getRyaStatement();
  RyaStatement rsOther = other.getRyaStatement(); // should throw NPE if other is null, as per Comparable contract
  builder.append(rsThis == null, rsOther == null);
  if (rsThis != null && rsOther != null) {
    builder.append(rsThis.getSubject(), rsOther.getSubject());
    builder.append(rsThis.getPredicate(), rsOther.getPredicate());
    builder.append(rsThis.getObject(), rsOther.getObject());
    builder.append(rsThis.getContext(), rsOther.getContext());
    builder.append(rsThis.getQualifer(), rsOther.getQualifer());
    builder.append(rsThis.getColumnVisibility(), rsOther.getColumnVisibility());
    builder.append(rsThis.getValue(), rsOther.getValue());
    builder.append(rsThis.getTimestamp(), rsOther.getTimestamp());
  }
  return builder.toComparison();
}

相关文章