Commits

Anonymous committed 046025c

Escape RDF content model URI suffix, so it is compatible with remote triple store

  • Participants
  • Parent commits 127dafa

Comments (0)

Files changed (5)

File chempound-app/src/main/java/net/chempound/DefaultChempound.java

 
         final List<URI> models = new ArrayList<URI>();
         models.add(uri);
-        models.add(uri.resolve("#rdf"));
+        models.add(uri.resolve("%25rdf"));
 
         final List<String> resources = new ArrayList<String>();
         for (final AggregatedResource resource : item.getAggregatedResources()) {

File chempound-app/src/main/java/net/chempound/deposit/DepositHandler.java

         final Model model = readRdf(resource, baseUri);
 
         final URI resourceUri = baseUri.resolve(resource.getPath());
-        tripleStore.saveModel(URI.create(resourceUri.toString() + "#rdf"), model);
+        tripleStore.saveModel(URI.create(resourceUri.toString() + "%25rdf"), model);
 
         final byte[] bytes = writeModel(model, "RDF/XML-ABBREV", baseUri.toString());
         final LocalResource rdfResource = new InMemoryResource(resource.getPath(), MimeType.APPLICATION_RDF_XML, bytes);

File chempound-app/src/test/java/net/chempound/DefaultChempoundTest.java

         
         chempound.deleteEntity(ITEM_URI);
         
-        verify(tripleStore).deleteModels(asList(ITEM_URI, ITEM_URI.resolve("#rdf")));
+        verify(tripleStore).deleteModels(asList(ITEM_URI, ITEM_URI.resolve("%25rdf")));
     }
 
     @Test
 
         chempound.deleteEntity(ITEM_URI);
 
-        verify(tripleStore).deleteModels(asList(ITEM_URI, ITEM_URI.resolve("#rdf")));
+        verify(tripleStore).deleteModels(asList(ITEM_URI, ITEM_URI.resolve("%25rdf")));
         verify(resourceStore).deleteItems(asList("item/file.txt"));
     }
 
             ResourceFactory.createResource(ROOT_URI.toString())
         ));
 
-        verify(tripleStore).deleteModels(asList(ITEM_URI, ITEM_URI.resolve("#rdf")));
+        verify(tripleStore).deleteModels(asList(ITEM_URI, ITEM_URI.resolve("%25rdf")));
     }
     
     private static class CountingRepositoryListener implements RepositoryListener {

File chempound-webapp/src/main/java/net/chempound/webapp/ChempoundWebappLauncher.java

 import org.restlet.data.Protocol;
 
 import java.io.File;
+import java.io.IOException;
 import java.net.URI;
 
 /**
         component.start();
     }
 
-
-    protected Injector getInjector() {
+    protected Injector getInjector() throws IOException {
         return Guice.createInjector(stage,
                 getConfigurationModule(),
                 getChempoundModule(),
         );
     }
 
-    protected Module getConfigurationModule() {
+    protected Module getConfigurationModule() throws IOException {
         return new ChempoundConfigurationModule(initConfiguration());
     }
 

File chempound-webapp/src/main/java/net/chempound/webapp/splashpage/SplashPageGenerator.java

         if (!isCollection(model, aggregationUri)) {
             for (final AggregatedResource resource : model.getResource(aggregationUri.toString()).as(Item.class).getAggregatedResources()) {
                 if (MimeType.APPLICATION_RDF_XML.equals(resource.getFormat())) {
-                    model.add(tripleStore.getModel(URI.create(resource.getURI() + "#rdf")));
+                    model.add(tripleStore.getModel(URI.create(resource.getURI() + "%25rdf")));
                 }
             }
         }