org.openrdf.model.Model.objectValue()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(107)

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

Model.objectValue介绍

[英]Gets the object of the statement(s). If the model contains one or more statements, all these statements should have the same object. A ModelException is thrown if this is not the case.
[中]获取语句的对象。如果模型包含一个或多个语句,则所有这些语句都应该具有相同的对象。如果情况并非如此,则会引发ModelException。

代码示例

代码示例来源:origin: org.openrdf.sesame/sesame-model

/**
 * Utility method that returns the string value of {@link #objectValue()}.
 * 
 * @return The object string value of the matched statement(s), or
 *         {@link Optional#empty()} if no matching statements were found.
 * @throws ModelException
 *         If the statements matched by the specified parameters have more
 *         than one unique object.
 * @deprecated since 4.0. Instead, use {@link Models#objectString(Model)} to
 *             retrieve an object string value, and/or use the size of the
 *             set returned by {@link #objects()} to verify if the object is
 *             unique.
 */
@Deprecated
public default Optional<String> objectString()
  throws ModelException
{
  Optional<Value> objectValue = objectValue();
  if (objectValue.isPresent()) {
    return Optional.of(objectValue.get().stringValue());
  }
  else {
    return Optional.empty();
  }
}

代码示例来源:origin: org.openrdf.alibaba/alibaba-repository-object

private BigInteger getBigInteger(URI pred) {
  Value value = model.filter(self, pred, null).objectValue();
  if (value == null)
    return null;
  return new BigInteger(value.stringValue());
}

代码示例来源:origin: anno4j/anno4j

private BigInteger getBigInteger(URI pred) {
  Value value = model.filter(self, pred, null).objectValue();
  if (value == null)
    return null;
  return new BigInteger(value.stringValue());
}

代码示例来源:origin: org.openrdf.sesame/sesame-model

throws ModelException
Optional<Value> objectValue = objectValue();
if (objectValue.isPresent()) {
  if (objectValue.get() instanceof IRI) {

代码示例来源:origin: org.openrdf.sesame/sesame-model

throws ModelException
Optional<Value> objectValue = objectValue();
if (objectValue.isPresent()) {
  if (objectValue.get() instanceof Literal) {

代码示例来源:origin: org.openrdf.sesame/sesame-model

throws ModelException
Optional<Value> objectValue = objectValue();
if (objectValue.isPresent()) {
  if (objectValue.get() instanceof Resource) {

代码示例来源:origin: org.openrdf.alibaba/alibaba-repository-object

private List<Value> copyTo(Value node, List<Value> list) {
  Value first = triples.match(node, RDF.FIRST, null).objectValue();
  Resource rest = triples.match(node, RDF.REST, null).objectResource();
  if (first == null)
    return list;
  list.add(first);
  return copyTo(rest, list);
}

代码示例来源:origin: anno4j/anno4j

private List<Value> copyTo(Value node, List<Value> list) {
  Value first = triples.match(node, RDF.FIRST, null).objectValue();
  Resource rest = triples.match(node, RDF.REST, null).objectResource();
  if (first == null)
    return list;
  list.add(first);
  return copyTo(rest, list);
}

代码示例来源:origin: anno4j/anno4j

@Override
public void parse(Graph graph, Resource subj)
    throws RepositoryConfigException {
  super.parse(graph, subj);
  try {
    Model model = new LinkedHashModel(graph);
    parseAssocation(subj, datatypes, DATATYPE, model);
    parseAssocation(subj, concepts, CONCEPT, model);
    parseAssocation(subj, behaviours, BEHAVIOUR, model);
    conceptJars.clear();
    for (Value obj : model.filter(subj, CONCEPT_JAR, null).objects()) {
      conceptJars.add(new URL(obj.stringValue()));
    }
    behaviourJars.clear();
    for (Value obj : model.filter(subj, BEHAVIOUR_JAR, null).objects()) {
      behaviourJars.add(new URL(obj.stringValue()));
    }
    blobStore = model.filter(subj, BLOB_STORE, null).objectValue();
    blobStoreParameters.clear();
    blobStoreParameters.addAll(model.filter(subj, BLOB_STORE_PARAMETER, null).objects());
  } catch (MalformedURLException e) {
    throw new ObjectStoreConfigException(e);
  } catch (ModelException e) {
    throw new ObjectStoreConfigException(e);
  }
}

代码示例来源:origin: org.openrdf.alibaba/alibaba-repository-object

compileRepository = false;
blobStore = model.filter(subj, BLOB_STORE, null).objectValue();
blobStoreParameters.clear();
blobStoreParameters.addAll(model.filter(subj, BLOB_STORE_PARAMETER, null).objects());

相关文章