OpenWetWare:Software/Extensions/Wibbit

=Wibbit=

(from http://simile.mit.edu/wiki/Wibbit/Use)

This is an extension to the Mediawiki package (you know, the thing you're using right now to view this page!) to allow you to embed Exhibits in a wiki page. Best of all, you can use data directly from tables right there in that page and others across the wiki. First you will need to make sure the wiki has the extension installed (See Installing Wibbit, for how to install it). Then, you will edit the pages that you want to put the exhibits in using the special syntax explained below.

Tables as Data
Exhibit is a way to display and deal with data. A standalone exhibit uses json files hosted along with the page the exhibit is on. Wibbit, in contrast, uses tables in wikis. The advantage of this is that anyone can edit the tables, so the data can be both edited and expanded easily and collaboratively. Also, visitors without Javascript have some access to the structured data.

The data, in turn, is composed of items, each of which has properties. For a fuller description of exhibit's data model, see its own wiki page. Here we will just explain the tabular wiki aspect of it.

Each item is represented by a row in the table. Each property of that item is a column. A page can have multiple tables which Exhibit can draw from, but any given table can only be used for one item type. So perhaps you could have an exhibit about historical literature. It might make sense to have one table for all the books with information like when it was published, who the author was, how many pages it has, etc. Then you could have another table for the authors, which would include information like when and where they were born and when and where they died, all the books they've written, and so on.

In order for exhibit to find the tables you want to use on the page you will have to give each an "id" to which you can refer to it. So the top of the 'authors' table might look like:

{| id="authors" |- !Name

or something like that.

All other schema data relating to authors and books is taken care of in the

Now keep in mind, that you look through this lens at every item that's going to get displayed. So, .president will mean something different each time. One time you might get something like this:

Feel free to make the lens as complicated as you want. You can specify background colors, and images, and links, and so on. Rememebr, if you want the exhibit data to pop in, use an ex:content=".whatever" attribute of the thing you want it to show up in.

If you want the exhibit data to show up in the attribute, you can do that too. Simply take the attribute you want filled in, put 'ex:' in front of it and '-content=".blah"' after it. So, if you want the href attribute of a link filled in with some link you have in the data, that can be done with something like the following:

Click here!

You can go even further, though. Suppose you want just part of the attribute to get filled in. For that you use -subcontent instead of -content, and indicate where you want it filled in with. If you've chosen to display each president, say, in a table, and you want a unique id for each table (e.g. id="prez-table-clinton"), you can do something like the following:

You need the coderClass attribute to indicate which kind of coder you want. The id attribute is also important because you need to refer back to your coder later, in the configurations for the Map or Timeline views. Be sure to check there to see the rest of the configuration to ensure the coding works. The code tags specify what to code by, and how to code it. For example, to specify that all Republicans are coded as Red, do as you see above. If items are completely missing the property that the coding is based on, then the missing case refers to them. If they have the property, but a color is not specified for it, then others refers to it. Mixed is if more than one item gets placed at the same point and they have different values for that property.

You can also make coders that code using a size gradient or a color gradient. You just need to specify a gradientPoints attribute. These graident points consist of two pairs. The first item in a pair represents the value of a data point, and the the second item represents the corresponding size or color you would like that data point's icon to have. By specifying two points, Exhibit can figure out how to fill in the rest of the points, but you can also specify more points for different gradient patterns.

 

BibTeX
Wibbit can be used as a BibTeX repository. Not only can anyone add entries to it, but anyone can set up their own external web page somewhere and draw out just the entries they want from it.

An example use scenario may be something like follows:

A group can all add their own publications to the BibTeX repository in the wiki. These are all compiled on that wiki page, and can be viewed and filtered using the Exhibit that everybody knows and loves. Anyone interested in the group's publications can go there and see them all, filter by author or year or type, or whatever strikes their fancy.

Now consider an individual member of the group, setting up her own personal web page. She can, with a simple link on that page, extract out just her own publications to display in her own exhibit. Any new, relevant, publications added to the group wiki will be automatically incorporated into her peronsal web page. This way she (along with all her group colleagues) can continue to update the group's repository on the wiki whenever new publications come out, and be confident that her own personal page is always up to date.

A demonstration of this principle is set up involving a book club. Anyone who has some books they want to read can add it to that list. I then have my own personal reading list which gets out just my own books that I want to read from that page.

tags
If you already have BibTeX files lying around, then making them into an exhibit on your wiki is very easy. Simply copy and paste all the BibTeX Entries into the wiki page, putting them between tags. Perhaps you're the author of a book that you'd like in the wiki. You could do something like this:

@book{my-wonderful-book, title = "What a Wonderful Book this is!", author = "Norbert Ukulele", isbn = "978-0123456789" } That's it. Wibbit will see the tags, and parse the entries into a table with the fields as the headers. Its id is automatically set as "bibtextable" and its itemType is automatically set as "Publication" (making this customizable is on our todos). Now that there is a table on the page with the id specified -- you guessed it! -- you can bring it into your exhibit.

One thing to note is that we don't really check for "correct" BibTeX. Correct BibTeX will work, but some syntactically incorrect entries will work, too. For instance Something beginning with "@Blah Blah {" will work, even though "Blah Blah" is not a valid BibTeX type. Also worth noting is that it's possible to use anything within the Bibtex entry. There are standard entry fields that most BibTeX parsers know, but you can add your own as well. So, for instance, you could have a field with a link to a PDF, or a cover image or something like that. Those will all be imported into that item's records in the exhibit database.

BibTeXExport Special Page
This mediawiki extension includes a Special Page -- Special:BibTeXExport (or if you don't like its unique capitalization, Special:BibtexExport) -- which is used to retrieve the BibTeX on a page for use in an external page.

To see how this works, we'll walk through the book club example. If you visit that page, you'll see it has an exhibit composed of several items it gleamed from pasted-in BibTeX. Click on 'edit' to see the BibTeX.

Now, to get at just the BibTeX in that page without all the mediawiki fluff (or even HTML fluff like head and body tags for that matter), you can append that page's name to "Special:BibTeXExport/". So to get the BibTeX from "My_Page", simply visit Special:BibTeXExport/My_Page.

Check out the Special:BibtexExport page for the book club to see it in action. If you view the source for that page, you'll see all the BibTeX there and none of the other stuff, formatted just as it was inputted into the wiki. It only shows up nicely formatted in the source because the browser won't render newlines and spaces and tabs and all that.

But that returns all the BibTeX in the page, verbatim. It is possible to construct a query to return only the BibTeX that satisfies certain requirements. Right now, the only filter available is checking whether something exists in a certain field in each of the BibTeX entries. To only return the BibTeX entries that have Charles Darwin as the author, append ?field:author=Charles Darwin to the URL.

In the book club example, you might have noticed that each entry has an "added-by" field. This refers to whoever it was that found that book interesting and added it to the list. To retrieve the BibTeX from that page of all the entries added by me, Gabe, you would visit the URL:

http://simile.mit.edu/axo/Special:BibTeXExport/Book_Club?field:added-by=Gabe

The last thing to note is that, if you filter by author, it will check each individual offer. So if a paper is written by Bob, Joe, and Mary, and the filter is field:author=Bob, then that paper will make the cut and be returned.

Using exported BibTeX in another exhibit
The BibTeX you extracted in the section above can be fed right into an external exhibit somewhere. Since Exhibit can natively comprehend BibTeX, all you have to do is specify this in the head of the page somewhere:



Exhibit will see this and then grab the BibTeX that appears on that page and pop it right into its database. You can, of course, use the query language specified above with ?field:fieldname=value at the end of the URL.

Disabling Your Exhibit
If for some reason you decide that you want to disable your exhibit temporarily, don't delete everything you've entered! You can add a "disabled" attribute to your exhibit tag, which will stop our scripts from processing your exhibit specifications. It will look like this:

<source ...   ...

Wiki Table Editor
After you install the Wibbit extension, you will find two new buttons on the left side of the editing toolbar that appears on the edit page of every article. These buttons are comprise a Wiki Table Editor. The first button helps you edit existing tables, and the second button allows you to easily insert a new table in your wikitext.

Get Lat/Lng Button
The "Get Lat/Lng" button in the wiki table editor converts a column of human-friendly addresses to a column of latitude/longitude pairs that the Exhibit map view can use to create markers for a map.

Just place your cursor anywhere in the column of addresses you would like to convert, then press "Get Lat/Lng." A new column should appear next to address column, filled with latitude/longitude data. If some data is missing, check to make sure that the address corresponding to the missing data is a valid address. If you change any addresses, you can always press the button again to generate a new column, but you'll want to delete the column with the missing data.

More Information
* For Wibbit tag/attribute reference, go here. * For some examples, check out Wibbit Examples! * For additional Exhibit documentation, look at the Main Exhibit Wiki and the Exhibit 2.0 Wiki.