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

IRI throws a NullPointerException when RiotLoader reads an RDF/XML file while using dependencies of jena-sb 1.3.4-SNAPSHOT

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • SDB 1.3.5
    • ARQ 2.9.1
    • RIOT
    • None
    • Apache Maven 3.0.3
      Java version: 1.6.0_31, vendor: Apple Inc.
      OS name: "mac os x", version: "10.7.4", arch: "x86_64", family: "mac"
      Default locale: en_US, platform encoding: MacRoman

    Description

      A project I'm working on loads files at runtime and updates URIs that have place holders with the domain a web application is deployed, prior to being saved to a default or named graph with SDB. For example, mca://foo/bar/ becomes http://m.bristol.ac.uk/foo/bar/. After the jena-sdb version become 1.3.4-SNAPSHOT some of the RDF XML files were failing with the following exception:

      java.lang.NullPointerException
      at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
      at java.util.regex.Matcher.reset(Matcher.java:291)
      at java.util.regex.Matcher.<init>(Matcher.java:211)
      at java.util.regex.Pattern.matcher(Pattern.java:888)
      at org.apache.jena.iri.impl.Parser.<init>(Parser.java:89)
      at org.apache.jena.iri.impl.IRIImpl.<init>(IRIImpl.java:65)
      at org.apache.jena.iri.impl.AbsIRIImpl.create(AbsIRIImpl.java:692)
      at org.apache.jena.iri.IRI.resolve(IRI.java:432)
      at org.openjena.riot.system.IRIResolver$IRIResolverNormal.resolveSilent(IRIResolver.java:435)
      at org.openjena.riot.system.IRIResolver$IRIResolverNormal.resolve(IRIResolver.java:420)
      at org.openjena.riot.system.IRIResolver.resolveIRI(IRIResolver.java:199)
      at org.openjena.riot.system.IRIResolver.resolveString(IRIResolver.java:189)
      at org.openjena.riot.RiotReader.createParserTriples(RiotReader.java:144)
      at org.openjena.riot.RiotLoader.readTriples(RiotLoader.java:215)

      I've created a reduced sample test case (using maven). If you use the dependencies linked to jena-sdb (1.3.4-SNAPSHOT) you will get the stack trace above with mvn test. If you replace the dependencies with jena-arq (2.9.0-incubating) and run mvn clean and mvn test you won't get an error but will see a list of URIs being printed to standard out.

      Attachments

        1. Sample.tar.gz
          4 kB
          Mike Jones

        Activity

          People

            andy Andy Seaborne
            mrj1971 Mike Jones
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: