Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-509

Location mapping doesn't work properly when preceded by calling DatasetFactory#createMem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Done
    • Jena 2.10.1
    • Jena 2.11.0
    • Jena
    • None

    Description

      The following code works in Jena 2.10.0.

              String TEST_RESOURCE = "http://example.org/test.ttl";
              Dataset dataset = DatasetFactory.createMem();
              Model model = FileManager.get().loadModel(TEST_RESOURCE, TEST_RESOURCE, "TURTLE");
      

      In Jena 2.10.1 the location-mapping.n3 resource doesn't seem to work and the following exception is thrown:

      com.hp.hpl.jena.shared.NotFoundException: Not found: http://example.org/test.ttl
      	at org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:285)
      	at com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:309)
      	at com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:296)
      ...
      

      In Jena 2.10.2-SNAPSHOT the exception is different, presumably due to the fix to JENA-505:

      org.apache.jena.atlas.web.HttpException: 404 - Not Found
      	at org.apache.jena.riot.web.HttpOp.exec(HttpOp.java:961)
      	at org.apache.jena.riot.web.HttpOp.execHttpGet(HttpOp.java:232)
      	at org.apache.jena.riot.web.HttpOp.execHttpGet(HttpOp.java:267)
      	at org.apache.jena.riot.stream.LocatorURL.open(LocatorURL.java:46)
      	at org.apache.jena.riot.stream.StreamManager.openNoMapOrNull(StreamManager.java:124)
      	at org.apache.jena.riot.adapters.AdapterFileManager.readModelWorker(AdapterFileManager.java:280)
      	at com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:309)
      	at com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:296)
      ...
      

      In both Jena 2.10.1 and Jena 2.10.2-SNAPSHOT the code works if the line Dataset dataset = DatasetFactory.createMem(); is removed.

      Attachments

        1. jena-509.zip
          10 kB
          Piotr Hołubowicz

        Activity

          People

            andy Andy Seaborne
            piotrekhol Piotr Hołubowicz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: