It's totally possible: don't use ".", but use "!" instead. "." goes 
forward while "!" goes backward (picture a directed graph). On the first 
data model, evaluating ".organizers" on "Exhibit hackfest" returns 
"Johan" and "Martin" while evaluating "!organizers" on "Johan" returns 
"Exhibit hackfest".

You can string several of these path segments together, e.g., 
.spouseOf!parentOf returns the parents in law of whoever in question 
while .spouseOf.parentOf returns children + step children.

David

Johan Sundström wrote:
> Given an exhibit defined as Exhibit.create('Person') and a dataset like this:
>
> {"items":[
> {"type":"Person","label":"Johan"},
> {"type":"Person","label":"Martin"},
> {"type":"Event","label":"Exhibit hackfest","organizers":["Johan","Martin"]},
> {"type":"Event","label":"Dinner party","organizers":["Martin"]}
> ]}
>
> Can I somehow construct an Exhibit.TileView that maps persons to a
> list of events they have organized?
>
> I know how to achieve the result given the same dataset reformatted as
>
> {"items":[
> {"type":"Person","label":"Johan","organized":["Exhibit hackfest"]},
> {"type":"Person","label":"Martin","organized":["Exhibit
> hackfest","Dinner party"]},
> {"type":"Event","label":"Exhibit hackfest"},
> {"type":"Event","label":"Dinner party"}
> ], "properties":{ organized:{ valueType:"item" } } }
>
> (using <ol ex:content=".organized"><li
> ex:content=".label"></li></ol>), but I was hoping there is a way of
> using the original data format (probably extended with some properties
> of some sort), as it is a data format my data entry person is capable
> of producing. If impossible, I suppose I'll do a json schema
> transofmation on the dataset prior to feeding it to Exhibit, but I
> thought I'd at least ask first.
>
>   

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to