WolframResearch / WolframLanguageForJupyter

Wolfram Language kernel for Jupyter notebooks
MIT License
1.03k stars 124 forks source link

Expression export error #44

Closed fedeinthemix closed 5 years ago

fedeinthemix commented 5 years ago

I'm trying to reproduce the example found here on semantic web.

After executing

Needs["GraphStore`"]
rdf[s_] := IRI["http://www.w3.org/1999/02/22-rdf-syntax-ns#" <> s];
schema[s_] := IRI["http://schema.org/" <> s];
ex[s_] := IRI["http://example.org/" <> s];
store = RDFStore[{
   RDFTriple[ex["anover"], rdf["type"], schema["Book"]],
   RDFTriple[ex["anover"], schema["name"], RDFString["A nővér", "hu"]],
   RDFTriple[ex["anover"], schema["author"], "Sándor Márai"],
   RDFTriple[ex["anover"], schema["dateCreated"], "1946"],
   RDFTriple[ex["anover"], schema["isbn"], "978-84-9838-089-7"]
   }]

and typing store to see the value of the variable, the kernel becomes irresponsive. The Jupyter server logs the following error:

[I 17:22:37.126 NotebookApp] Kernel started: c4ece69f-9c59-42fb-bb32-a0def544a5d1
[I 17:22:38.470 NotebookApp] Adapting to protocol v5.3.0 for kernel c4ece69f-9c59-42fb-bb32-a0def544a5d1

General::jsonoutofrangeunicode: Out of range unicode code point encountered.

Import::jsonhintposition: An error occurred at line 1:255

ToExpression::notstr: The format type InputForm is valid only for string input.

StringLength::string: String expected at position 1 in StringLength[ToExpression[Association[ImportString[content$5235, JSON]][code], InputForm, uninteract][GeneratedMessages]].

ToExpression::notstr: The format type InputForm is valid only for string input.

StringJoin::string: String expected at position 2 in <div><>If[StringLength[ToExpression[Association[ImportString[content$5235, JSON]][code], InputForm, uninteract][GeneratedMessages]] == 0, {}, {<pre style=", StringJoin[({&#, ToString[#1], ;} & ) /@ ToCharacterCode[color:red; font-family: "Courier New",Courier,monospace;, UTF-8]], ">, StringJoin[({&#, ToString[#1], ;} & ) /@ ToCharacterCode[totalResult$5270[GeneratedMessages], UTF-8]], </pre>}]<><pre style="&#102;&#111;&#110;&#116;&#45;&#102;&#97;&#109;&#105;&#108;&#121;&#58;&#32;&#34;&#67;&#111;&#117;&#114;&#105;&#101;&#114;&#32;&#78;&#101;&#119;&#34;&#44;&#67;&#111;&#117;&#114;&#105;&#101;&#114;&#44;&#109;&#111;&#110;&#111;&#115;&#112;&#97;&#99;&#101;&#59;">&#69;&#118;&#97;&#108;&#117;&#97;&#116;&#105;&#111;&#110;&#82;&#101;&#115;&#117;&#108;&#116;</pre></div>.

Export::jsonstrictencoding: Expression StringJoin cannot be exported as JSON.

Export::jsonstrictencoding: Expression Plus cannot be exported as JSON.

Export::jsonstrictencoding: Expression Plus cannot be exported as JSON.

If I start wolframscript in a terminal and copy and paste the same code, I get the expected result (similar to the one on the web page).

cc-wr commented 5 years ago

I cannot reproduce this issue. I get the expected result.

If you are not using the latest version on master, is the issue resolved if you do?

fedeinthemix commented 5 years ago

I was using a checkout from the 21st of May. I updated to master and the problem disappeared.

Thanks for your help!