Esempio n. 1
0
 @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);
 }
Esempio n. 2
0
 public Resource createResource(URI type, URI resourceUri) {
   Resource resource = new Resource(createModel(), resourceUri, true);
   resource.getModel().addStatement(resource, RDF.type, type);
   return resource;
 }