/** * 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(); } }
private BigInteger getBigInteger(URI pred) { Value value = model.filter(self, pred, null).objectValue(); if (value == null) return null; return new BigInteger(value.stringValue()); }
private BigInteger getBigInteger(URI pred) { Value value = model.filter(self, pred, null).objectValue(); if (value == null) return null; return new BigInteger(value.stringValue()); }
throws ModelException Optional<Value> objectValue = objectValue(); if (objectValue.isPresent()) { if (objectValue.get() instanceof IRI) {
throws ModelException Optional<Value> objectValue = objectValue(); if (objectValue.isPresent()) { if (objectValue.get() instanceof Literal) {
throws ModelException Optional<Value> objectValue = objectValue(); if (objectValue.isPresent()) { if (objectValue.get() instanceof Resource) {
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); }
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); }
@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); } }
compileRepository = false; blobStore = model.filter(subj, BLOB_STORE, null).objectValue(); blobStoreParameters.clear(); blobStoreParameters.addAll(model.filter(subj, BLOB_STORE_PARAMETER, null).objects());