I am looking for a straightforward way to export results from functions like ImageContents, FacialFeatures, and WolframAlpha - symbols that return stuff containing knowledgebase content.

Aside from obvious non-JSON-exportable things like Missing[], Complex, None, etc. exporting Quantities and Entities look like the main hurdle.

Is there a standard way to replace them with common name strings and strip uuids so that they are jsonifiable as well as understandable to the non-wolfram world?


1 Answer 1


You can use "ConversionFunction" / "ConversionRules" for "RawJSON" export and define whatever you want, and as a quick start you can do:

 {1, Quantity[1, "Meters"], Missing[], 1 - I, None}
, "RawJSON"
, "Compact" -> 1
, "ConversionFunction" -> (
    <|"type" -> "ExpressionJSON", 
      "value" -> ImportString[ 
        ExportString[#, "ExpressionJSON", "Compact" -> True]
      , "JSON"]
    |> &

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.