You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Qi He <he...@gmail.com> on 2013/11/01 18:11:08 UTC

Reading RDF/JSON into model, there is error when json file has number value

Hello,

After call model.read("http://dbpedia.org/data/The_Adventures_of_Tom_Sawyer.
json","RDF/JSON");

It show error message: JSON Values given for properties for an Object must
be Strings

In JSON file, some value are number not string, I can't change
the JSON file. how could I parse number value?

-Qi

Re: Reading RDF/JSON into model, there is error when json file has number value

Posted by Andy Seaborne <an...@apache.org>.
On 01/11/13 17:11, Qi He wrote:
> Hello,
>
> After call model.read("http://dbpedia.org/data/The_Adventures_of_Tom_Sawyer.
> json","RDF/JSON");
>
> It show error message: JSON Values given for properties for an Object must
> be Strings

It actully gives the line and column number of the error together with a 
stacktrace.

> In JSON file, some value are number not string, I can't change
> the JSON file. how could I parse number value?

The data does not conform to RDF/JSON:

http://jena.apache.org/documentation/io/rdf-json.html

is a copy of the original Talis description and

https://dvcs.w3.org/hg/rdf/raw-file/default/rdf-json/index.html

is the text that will become the RDF Working Group Note.

Directly using numbers is not allowed. The dbpedia.org response is not 
conformant.

You choices would seem to be:

1/ Read into and string, fix up, then read from that string
2/ Ask for a different format like Turtle
3/ Take the jena sourcecode and change it - the stack trace gives the 
right place to change.

	Andy

>
> -Qi
>