Project

General

Profile

Actions

Bug #2962

open

Add metadata to data tokens so that it can be used downstream

Added by ben leinfelder over 16 years ago. Updated about 12 years ago.

Status:
New
Priority:
Normal
Category:
core
Target version:
Start date:
09/11/2007
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
2962

Description

Add metadata to data tokens so that it can be used downstream (e.g., names, descriptions, units, travel with data).
Would be useful for plotting in the R actor (among other things) so that axis can be labeled in a meaningful way.


Related issues

Blocked by Kepler - Bug #2964: Change RExpression plotting actors to allow custom axis and title labelsNewben leinfelder09/11/2007

Actions
Actions #1

Updated by Christopher Brooks over 16 years ago

This sounds interesting. Below are some resources.

Currently, Ptolemy has two unit systems in place, so
some of this data is available. See ptolemy.data.unit.

There is some work involving properties such as the
const-ness of a data port. See ptolemy.data.properties
See also http://chess.eecs.berkeley.edu/pthomas

The key to adding metadata is to do it in such a manner
that the token size is not increased substantially
and processing time does not take longer. Look at
the nil token work as a possible solution.

Actions #2

Updated by ben leinfelder about 16 years ago

To address axis labeling (and any alternate naming for R objects for that matter), the RExpression now sets a "name" attribute for every object it makes available in the R environment. The attribute value is set to the port name of the upstream source port.
See the KEPLER/demos/R/upstream-axis-labels-R.xml workflow for an example.

Actions #3

Updated by ben leinfelder about 16 years ago

Turns out there is a strict vector test that does not allow extra attributes on a vector (used in barplot() method). we'll have to find another way to add metadata - hopefully one that will not adversely affect existing R actors or place undo burden on custom script authors.

I've commented out the R object metadata that adds a "name" attribute to every R object created for use in Kepler.

Actions #4

Updated by ben leinfelder almost 16 years ago

I've done some "proof of concepting" with TokenMetadata. General gist of it is:
-add metadata at EMLDataSource (name, description)
-travels along the relationships to downstream actors
-modified most of the Plotter-based actors to use the TokenMetadata names for axis labeling.

It's pretty slick and minimally invasive, but not clear how to introduce the metadata into the R environment.

Also to think about: An ArrayToken has TokenMetadata but it is a list of Tokens that too can have TokenMetadata. For instances of ArrayToken that represent the values of a column of tabular data, having a single TokenMetadata for the list is all that is necessary (all the Tokens in the list share the same metadata). The current implementation adds TokenMetadata to each and every Token in the ArrayToken list (overkill!). Are there instances that come to mind where each Token in an ArrayToken must have its own distinct TokenMetadata? My hunch is that there are indeed cases where the the array contains semantically heterogeneous data Tokens.

Actions #5

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 2962

Actions

Also available in: Atom PDF