Hi David, I would like to thank you for helping me in your previous mail. Your thoughts about how to make the data merge possible was exactly the way I thought and with your advices a find my way out and write a limited version of this new importer. By now it only accept one item inside the data file and only one attribute mapping.
So I´ve created a new type of importer, the mashup-importer. Registered it on the javascriptFiles array at exhibit-api.js and created the file mashup-importer.js at the importers directory. The user must include a html script tag like this: <link href="fakeData1.js" sref="fakeData2.js" type="application/mashup" rel="exhibit/data" fromProp="artist" toProp="artista" /> I explain it: href - the first json with the data that´s going to be dynamically changed to match the sref file format sref - the second data file fromProp - the attribute name that´s going to be renamed with the toProp attribute name After I let the Exhibit merge the data just the way it does. If you like I can send you what I did, it´s not complete yet for use but it´s a begining =). On Thu, May 19, 2011 at 2:26 PM, David Karger <[email protected]> wrote: > Oliver, merging data is something I've been interested in doing for quite > some time. The problem is that there are so many ways to do it. You should > take a look at the ex:converter attribute of the jsonp importer > (data/importers/jsonp-importer), which can be used to transform the incoming > json before it is delivered to exhibit's database. You could use > ex:converter to generate a canonical id based on the primary key(s) of the > data; since exhibit merges items with the same id (even if different labels) > that will solve your problem. The advantage is that this can be done > separate from exhibit. If you get inside the codebase, you could introduce > ex:primaryKeys as a way to specify that in the <link> tag for the data; this > would tell exhibit to generate the id by concatenating the given keys. > > I'm also not sure that a label equality test is sufficient, since for > example the properties used in different data sets might need to be aligned > as well. One approach I've considered in the past is "mapping": consider a > new set of attributes ex:fromProperties="a,b,c" and ex:toProperties="x,y,z". > This would instruct exhibit to rename the properties a, b, and c to > property names x, y, and z respectively as the data was imported. > > On 5/18/2011 8:53 PM, Oliver M. Batista wrote: >> >> Hello friends, My name is Oliver and I´m a grad student here at UFPR, >> Curitiba - Brazil. I am trying to write an addition to the exhibit, my >> problem is when two "itens" have the same label they´re treated as one >> (more like a union), if not they are considered as two itens. Okay if >> we could insert some "rules" to the<script> tag that loads a json >> file in a way that we can say wich itens should be treated as equal >> and more if we could control wich properties of those "equal" items >> should be choosen as the best or the more recent we can kind of make a >> "ontology" over this data. >> >> That´s the feature I wanna add, this could be great for creating >> mashups, since that data from different sources probably have >> differents values for the same "key->value" pair of data. >> >> If I am wrong please say me why. I am also writting a paper for this. >> >> If you think that´s a good feature and know how to help, like saying >> where in the code exhibit treat the data and determine when a item is >> the same as another (okay I still trying to figure out this). >> >> I appreciate any help, tank you for your time. >> >> Regards >> > > -- > You received this message because you are subscribed to the Google Groups > "SIMILE Widgets" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/simile-widgets?hl=en. > > -- Oliver M. Batista -- You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en.
