Uploaded image for project: 'Apache Any23 (Retired)'
  1. Apache Any23 (Retired)
  2. ANY23-378

JsonParseException caused by trailing commas in JSON-LD

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3
    • 2.3
    • extractors
    • None

    Description

      On the page http://golfavisen.dk/golfavisen-award-2018/ I'm getting a JsonParseException in the EmbeddedJSONLDExtractor:

      org.apache.any23.extractor.ExtractionException: Error while parsing RDF document.
      	at org.apache.any23.extractor.rdf.BaseRDFExtractor.run(BaseRDFExtractor.java:175)
      	at org.apache.any23.extractor.html.EmbeddedJSONLDExtractor.extractJSONLDScript(EmbeddedJSONLDExtractor.java:149)
      	at org.apache.any23.extractor.html.EmbeddedJSONLDExtractor.run(EmbeddedJSONLDExtractor.java:83)
      	at org.apache.any23.extractor.html.EmbeddedJSONLDExtractor.run(EmbeddedJSONLDExtractor.java:54)
      	at org.apache.any23.extractor.SingleDocumentExtraction.runExtractor(SingleDocumentExtraction.java:480)
      	at org.apache.any23.extractor.SingleDocumentExtraction.run(SingleDocumentExtraction.java:259)
      	at org.apache.any23.extractor.SingleDocumentExtraction.run(SingleDocumentExtraction.java:323)
      	at org.apache.any23.extractor.html.AbstractExtractorTestCase.extract(AbstractExtractorTestCase.java:189)
      	at org.apache.any23.extractor.html.AbstractExtractorTestCase.assertExtract(AbstractExtractorTestCase.java:204)
      	... 28 more
      Caused by: org.eclipse.rdf4j.rio.RDFParseException: Could not parse JSONLD
      	at org.eclipse.rdf4j.rio.jsonld.JSONLDParser.parse(JSONLDParser.java:77)
      	at org.apache.any23.extractor.rdf.BaseRDFExtractor.run(BaseRDFExtractor.java:171)
      	... 36 more
      Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('}' (code 125)): was expecting double-quote to start field name
       at [Source: (BufferedReader); line: 9, column: 10]
      	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1804)
      	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:663)
      	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:561)
      	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddName(ReaderBasedJsonParser.java:1757)
      	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextFieldName(ReaderBasedJsonParser.java:907)
      	at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:512)
      	at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:364)
      	at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:29)
      	at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3972)
      	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2264)
      	at com.fasterxml.jackson.core.JsonParser.readValueAs(JsonParser.java:1729)
      	at com.github.jsonldjava.utils.JsonUtils.fromJsonParser(JsonUtils.java:196)
      	at com.github.jsonldjava.utils.JsonUtils.fromReader(JsonUtils.java:173)
      	at com.github.jsonldjava.utils.JsonUtils.fromInputStream(JsonUtils.java:154)
      	at com.github.jsonldjava.utils.JsonUtils.fromInputStream(JsonUtils.java:111)
      	at org.eclipse.rdf4j.rio.jsonld.JSONLDParser.parse(JSONLDParser.java:71)
      	... 37 more
      
      

      caused by the following json:

      {	"@context": "http://schema.org",
      	"@type": "Event",
      	"name": "PINNACLE BANK CHAMPIONSHIP",
      	"startDate": "2018-7-19T00-00-00-00",
      	"endDate": "2018-7-19T23-23-59-00",
      	"image":"http://golfavisen.dk/wp-content/uploads/2017/03/WEB.png",
      	"description":"PINNACLE BANK CHAMPIONSHIP",
      }
      

      Attachments

        Issue Links

          Activity

            People

              hansbrende Hans Brende
              hansbrende Hans Brende
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: