Value purposeNode = purposesI.next().getObject();
if (purposeNode instanceof Resource) {
Resource purposeRes = (Resource) purposeNode;
out.addPurpose(new Purpose(purposeRes));
} else {
throw new ParsingException(purposeNode.toString() + "could not be used as a :Purpose");
}
}
} finally {
purposesI.close();
}
// label
RepositoryResult<Statement> labelI = conn.getStatements(selected, FresnelCore.label, (Value) null, false);
try {
if (labelI.hasNext()) {
Statement labelS = labelI.next();
if (labelI.hasNext()) throw new ParsingException("Too many fresnel:label statements; only one allowed: " + selected);
Value labelObj = labelS.getObject();
out.setLabel(PropertyLabel.parse(labelObj));
}
} finally {
labelI.close();
}
// value
RepositoryResult<Statement> valueI = conn.getStatements(selected, FresnelCore.value, (Value) null, false);
try {
if (valueI.hasNext()) {
Statement valueS = valueI.next();
if (valueI.hasNext()) throw new ParsingException("Too many fresnel:value statements; only one allowed: " + selected);
Value valueObj = valueS.getObject();
out.setValueType(PropertyValue.parse(valueObj));
}
} finally {
valueI.close();