You could actually create a column called id, and I believe Babel should 
correctly merge rows with the same id.

David

mowi wrote:
> Thanks David K,
>
> your workaround works. It is a bit awkward though, I hope the higher
> power looks upon me with kindness and fixes the babel bug ;)
>
> On Feb 26, 5:07 pm, David Karger <[email protected]> wrote:
>   
>> ah, so you are describing a babel bug rather than an exhibit bug.
>> for that it might be necessary to invoke a higher power (davidh).
>>
>> One quick hack you could do is as follows:
>> for your spreadsheet, rename the current "label" column as "intendedLabel"
>> create a new "label" column that you fill with _distinct_ values (eg,
>> increasing integers).
>> after your json is generated, do a global replace in it of "label" by
>> "fakeLabel" and then replace "intendedLabel" with "label"
>>
>> Because babel is presumably using the label field to merge items, your
>> use of distinct labels will prevent the merge.  But after you rename the
>> properties, exhibit will carry out the correct merge on the client side.
>>
>> mowiwrote:
>>     
>>> Hi David,
>>>       
>>> Thanks for making a quick example. I understand how my JSON file
>>> should look like but I do not make my JSON by hand, that would be too
>>> much work..
>>> I generate my JSON file with babel from an excel sheet.
>>> I cannot figure out how I can get babel to generate a file like
>>> your .js file
>>>       
>>> my excel file looks like this:
>>> http://spreadsheets.google.com/pub?key=pEBZe9K5tabOdZXuL1uEoRQ
>>>       
>>> and the JSON that is generated by Babel like this.
>>> http://www.moniquedewilt.com/test/manytomanytest.js
>>>       
>>> I have tried making to seperate JSONs, one with the items and one with
>>> the connections but that did not work either. Babel only makes one
>>> "record" for each item and only one value in each field. when the item
>>> appears multiple times in excel with the same field, babel only uses
>>> the last value for that field.
>>> Any clues how to get Babel to do this?
>>>       
>>> On Feb 26, 4:21 pm, David Karger <[email protected]> wrote:
>>>       
>>>> Take a look at
>>>>  http://people.csail.mit.edu/karger/Exhibit/example.html
>>>> and you'll see that "thing" has three children first, second, and
>>>> third.  If you look at the data file
>>>>  http://people.csail.mit.edu/karger/Exhibit/data.js
>>>> you will see that those children were introduced using two separate
>>>> mentions of "thing"
>>>>         
>>>> mowiwrote:
>>>>         
>>>>> Hi David,
>>>>>           
>>>>> I tried it like you said and made a third excel sheet for the
>>>>> connections.  The authors are now connected to the articles but
>>>>> instead of multiple authors only the last author got connected to the
>>>>> article in the JSON file. I used Babel to convert the excel file to
>>>>> JSON. I have also tried to convert to JSONP but that didn`t matter.
>>>>> Any ideas?
>>>>>           
>>>>> On Feb 19, 2:52 pm, David Karger <[email protected]> wrote:
>>>>>           
>>>>>> It's ok; you can use author and article as ID even if they appear
>>>>>> multiple times.  First do the obvious thing, creating items for the
>>>>>> exhibit corresponding to the authors and articles (using author name as
>>>>>> id for the authors, and article title as id for the articles):
>>>>>> {type: "Author", id: "name of author", affiliation: "affiliation of
>>>>>> author"...}
>>>>>> {type: "Article", id: "title of article", year: "year of publication", 
>>>>>> ....}
>>>>>>             
>>>>>> Finally, take your relationship table.  Suppose it has a row (authorX,
>>>>>> articleY)
>>>>>> add another fragment of json to the collection of "items":
>>>>>> {id: "articleY", author: "authorX"}
>>>>>> Do this for every row.  This will accomplish what you want.
>>>>>>             
>>>>>> To understand what is going on, note how exhibit will interpret these
>>>>>> final fragments from the relationship table.  It will say "ok, this
>>>>>> person is specifying an item whose id is articleY and has an author
>>>>>> property with value authorX. But I already know about an item whose id
>>>>>> is articleY---namely, the one that was defined at the beginning of type
>>>>>> "Article".  So, I'm not going to create a new item with id articleY.
>>>>>> Instead, I will _merge_ the attributes of the new item (in particular,
>>>>>> the author relationship to authorX) into the already existing item.  And
>>>>>> if that item already has a value of the author property, because I
>>>>>> already saw an author of that article, then I will _add_ authorX as an
>>>>>> additional value for the now-multivalued author property on articleX."
>>>>>>             
>>>>>> mowiwrote:
>>>>>>             
>>>>>>> hi,
>>>>>>> I have some data with many to many relationships just like the
>>>>>>> articles and authors in the example  website about ISWC 2007 + ASWC
>>>>>>> 2007.http://people.csail.mit.edu/dfhuynh/projects/graph-based-exhibit/grap...
>>>>>>>               
>>>>>>> there it is solved by putting multiple persons in the "author" field.
>>>>>>>               
>>>>>>> I have a problem getting multiple values in one  field because the
>>>>>>> data is from acces 2003. I have got one table with articles, one with
>>>>>>> authors and one with relationships. The relationship list has three
>>>>>>> columns:id (which I do not really use), author and article. Can i also
>>>>>>> do it like that in exhibit? how can I do that?
>>>>>>> In the example you use ".author.affiliation" to get a value from the
>>>>>>> author list in the article overview. Author is an id there. In my
>>>>>>> relationship list both author and article cannot be id because they
>>>>>>> appear multiple times.
>>>>>>>               
> >
>   


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to