Message Boards Message Boards

Automatically convert raw input values using data semantics?

I am using a simple wget / bash script to log some temperatures to Data Drop. I'm using the Web API and there is a call-out on the documentation stating that

Raw input values automatically converted using data semantics

It's not exactly clear what those semantics are, in this case.

The first try at this simply logged the temperatures as the only key/value ala

https://datadrop.wolframcloud.com/api/v1.0/Add?bin=XXX&$temperature=68

The temperature is stored with a head String when I access the data from inside Mathematica. Even more interesting is that, if I look at it using Wolfram Alpha, it treats those digits as a year - 1968, and proceeds to treat them as events and not a time series. I've tried

temperature=68
temperature=68.0
temperature=68°F

all to no avail. Always strings and basically uninterpretable in scenarios like

bin=Timeseries[Databin["xxx"]]
DateListPlot[bin["temperature"]]

So, what is best practice here? Should I set the data drop up first from Mathematica and not rely on the mystical automatic semantic interpretation? Or am I perchance doing something wrong w/ the API?

POSTED BY: Flip Phillips
2 Replies

Yes, indeed this seems to be a sure-fire way to do so. Apparently just letting the wolfram 'interpreters' do what it will without this forced interpretation results in chaos.

POSTED BY: Flip Phillips

Not that I have a lot of insight or practice, but from here and here it follows that to create a databin with a structured interpretation you need WL:

CreateDatabin["Interpretation" -> {
    "city" -> "City", 
    "temp" -> Restricted["StructuredQuantity", "DegreesCelsius"]
}]

Perhaps other ways exist, but I did not find the reference.

POSTED BY: Sam Carrettie
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract