@SuppressWarnings("unchecked") public <T extends Resource> T createResource(Class<T> returnType, URI resourceUri) { Resource resource = new Resource(createModel(), resourceUri, true); resource.getModel().addStatement(resourceUri, RDF.type, getUriOfClass(returnType)); return (T) resource.castTo(returnType); }
public Resource createResource(URI type, URI resourceUri) { Resource resource = new Resource(createModel(), resourceUri, true); resource.getModel().addStatement(resource, RDF.type, type); return resource; }