[kepler-users] using semi-structured data in tokens?

Christopher Brooks cxh at eecs.berkeley.edu
Wed Mar 12 15:46:12 PDT 2014


Hi Rich,
The devel version of Ptolemy II has support for a JSON token, see
http://sisyphus.eecs.berkeley.edu:8079/hudson/job/ptII/javadoc/ptolemy/actor/lib/conversions/json/JSONToToken.html

The code is in $PTII/ptolemy/actor/lib/conversions/json

To get this to work, we had to do quite a bit with type propagation.
Marten Lohstroh implemented backward type propagation, which is useful with
JSON because the types are not always well defined.

To my knowledge, there is no support for YAML.

Ptolemy II does support RecordTokens which are structured.

There is a an attribute for use with files, see
ptolemy/kernel/attributes/FileAttribute.java

Java-style Serialization is not supported.  This could be done, but would
require quite a bit of work.

_Christopher


On Wed, Mar 12, 2014 at 2:48 PM, Rich Morin <rdm at cfcl.com> wrote:

> Section 3.2.6 of the User Manual (Data Types) details the kinds of data
> that can be put into a token.  Unfortunately, I don't see anything that
> talks about semi-structured data in general, let alone specific ways of
> serializing it (eg, JSON, YAML).
>
> YAML is my preferred format for passing data between processes.  Each
> message (ie, file, token) is a tree of polymorphic hashes (ie, maps,
> dictionaries) and lists, with scalars as the leaf nodes.  Web-based
> applications (eg, composable web services) might use JSON encoding,
> but the data structures would be the same.
>
> I'm sure that I could make this work in Kepler, if only by putting the
> file path into a String token.  However, I wonder if I'm missing some
> sort of Best Practice.  Help?
>
> -r
>
>  --
> http://www.cfcl.com/rdm           Rich Morin           rdm at cfcl.com
> http://www.cfcl.com/rdm/resume    San Bruno, CA, USA   +1 650-873-7841
>
> Software system design, development, and documentation
>
>
> _______________________________________________
> Kepler-users mailing list
> Kepler-users at kepler-project.org
> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20140312/dec3a5cc/attachment.html>


More information about the Kepler-users mailing list