While waiting for hints I came up with this approach, which is working well:
private AnyResource loadBean(String url) {
Response response = null;
try {
OslcClient oslcClient = getOslcClient();
response = oslcClient.getResource(url, OSLCConstants.CT_RDF);
Model rdfModel = ModelFactory.createDefaultModel();
rdfModel.read(response.readEntity(InputStream.class), url);
Resource resource = rdfModel.getResource(url);
if (resource != null) {
return JenaModelHelper.unmarshal(resource, AnyResource.class);
}
throw new RepositoryAdapterException("Resource could not be loaded: " + url);
} catch (Exception ex) {
throw RepositoryAdapterException.wrap(ex);
} finally {
if (response != null) {
response.close();
}
}
}
Is there really no API in Lyo that would do this for me?