You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@any23.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/02 21:49:00 UTC

[jira] [Commented] (ANY23-381) JsonParseException: Illegal unquoted character

    [ https://issues.apache.org/jira/browse/ANY23-381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16567522#comment-16567522 ] 

ASF GitHub Bot commented on ANY23-381:
--------------------------------------

GitHub user HansBrende opened a pull request:

    https://github.com/apache/any23/pull/112

    ANY23-381 escape illegal characters in JSON-LD strings

    mvn clean test -> all tests passed

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/HansBrende/any23 ANY23-381

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/any23/pull/112.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #112
    
----
commit 817e744af90d8f3c9bf419e5c395c421e0c3924a
Author: Hans <fi...@...>
Date:   2018-08-02T21:33:36Z

    ANY23-381 fix illegal unescaped characters in JSON-LD

----


> JsonParseException: Illegal unquoted character
> ----------------------------------------------
>
>                 Key: ANY23-381
>                 URL: https://issues.apache.org/jira/browse/ANY23-381
>             Project: Apache Any23
>          Issue Type: Bug
>          Components: extractors
>    Affects Versions: 2.3
>            Reporter: Hans Brende
>            Assignee: Hans Brende
>            Priority: Major
>             Fix For: 2.3
>
>
> While perusing the site http://losangeles.eventful.com/events I stumbled across the following exception:
> {noformat}
> 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:196)
> 	... 36 more
> Caused by: com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10)): has to be escaped using backslash to be included in string value
>  at [Source: (BufferedReader); line: 1, column: 147]
> 	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._throwUnquotedSpace(ParserMinimalBase.java:627)
> 	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._finishString2(ReaderBasedJsonParser.java:2045)
> 	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._finishString(ReaderBasedJsonParser.java:2016)
> 	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.getText(ReaderBasedJsonParser.java:278)
> 	at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:672)
> 	at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:527)
> 	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
> {noformat}
> caused by the {{description}} field in the following json spanning multiple unescaped newlines: 
> {noformat}
>   {
>     "@context": "http://schema.org",
>     "@type": "Event",
>     "name": "#1 Magic Show in L.A.",
>     "description": "#1 MAGIC SHOW IN L.A.
> The current WINNER of the CW’s Penn & Teller’s FOOL US, Illusionist extraordinaire Ivan Amodei is on a national tour with his show INTIMATE ILLUSIONS. 
> Currently, on an ei...",
>     "startDate": "Saturday, August 11, 2018  4:00 PM",
>     "image": "//d1marr3m5x4iac.cloudfront.net/images/perspectivecrop373by249/I0-001/040/358/185-9.png_/1-magic-show-la-85.png",
>     "location": {
>       "@type": "Place",
>       "name": "Beverly Wilshire Hotel",
>       "url": "//losangeles.eventful.com/venues/beverly-wilshire-hotel-/V0-001-003541383-4",
>       "address": {
>         "streetAddress": "9500 Wilshire Boulevard",
>         "addressLocality": "Beverly Hills",
>         "addressRegion": "California",
>         "postalCode": "90212"
>       }
>     },
>     "offers": {
>       "@type": "Offer",
>       "url": "//losangeles.eventful.com/events/1-magic-show-la-/E0-001-114704991-1/tickets",
>       "availability": "http://schema.org/InStock"
>     },
>     "performer": [        {
>           "@type": "Person",
>           "name": "Ivan Amodei"
>         }    ]
>   }
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)