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

JENA breaks when reading a turtle file with a dot terminated IRI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • Jena 2.11.0
    • Jena 2.11.1
    • RIOT
    • None

    Description

      I have a toy example turtle file to be read by JENA:

      @prefix jpn:   <http://kaiko.getalp.org/dbnary/jpn/> .
      @prefix dbnary: <http://kaiko.getalp.org/dbnary#> .
      @prefix lemon: <http://www.lemon-model.net/lemon#> .
      
      jpn:__ws_1_青は藍より出でて藍より青し__Idiom__1
              a                   lemon:LexicalSense ;
              dbnary:senseNumber  "1"^^<http://www.w3.org/2001/XMLSchema#int> ;
              dbnary:synonym      jpn:出藍の誉れ , jpn:cf. , jpn:後生おそるべし ;
              lemon:definition    [ lemon:value  "弟子が研鑽し師を凌駕すること又はその可能性があるということ。さらには、それは、恥ずべきことでなく望ましいということ。"@ja ] .
      

      I create a default Model m and read the file using m.read(url, "TURTLE").

      JENA breaks with the following stack trace:

      [main] ERROR org.apache.jena.riot - [line: 8, col: 49] Out of place: [COMMA]
      Exception in thread "main" org.apache.jena.riot.RiotException: [line: 8, col: 49] Out of place: [COMMA]
      	at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)
      	at org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:163)
      	at org.apache.jena.riot.lang.LangEngine.exceptionDirect(LangEngine.java:156)
      	at org.apache.jena.riot.lang.LangEngine.exception(LangEngine.java:149)
      	at org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(LangTurtleBase.java:231)
      	at org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(LangTurtle.java:44)
      	at org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtleBase.java:90)
      	at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
      	at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTFactoryImpl$1.read(RDFParserRegistry.java:142)
      	at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:818)
      	at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:679)
      	at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:211)
      	at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:184)
      	at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:122)
      	at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:113)
      	at org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:77)
      	at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:247)
      	at org.getalp.dbnary.cli.RDFDiff.main(RDFDiff.java:31)
      

      The faulty IRI is jpn:cf. (an IRI with a trailing dot). If I replace it by jpn:cf.x (note that the IRI is not dot terminated anymore, then the turtle file is read whit no error.

      As far as I know, jpn:cf. is a valid IRI and there is no reason to consider this trailing dot as a turtle termination char (as the error message suggests) as it is part of the IRI.

      Regards, Gilles,

      Attachments

        Activity

          People

            andy Andy Seaborne
            serasset Gilles Sérasset
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: