The Yarn Game: an introduction to RDF graphs

Acknowledgments and reuse

The idea for the Yarn Game originally came from Kathryn Lybarger, who constructed a very similar game to teach cataloging concepts. I am grateful to Kathryn for allowing me to build on her brilliant teaching tool.

I am also grateful to all the Yarn Game players in my course LIS 652 “XML and Linked Data.”

Please feel free to use this activity, in whole or in part, anywhere it is handy. I always appreciate but never require credit.

Accessibility notes

I have not had opportunity to adapt the Yarn Game to learners with visual disabilities. It might be made to work, but I am honestly not sure how; I welcome ideas!

Color can be used to assist learners in playing; color schemes should be tested for perceptibility to learners with colorblindness.

Because the game is played in groups, learners with motor difficulties can play alongside abled groupmates, as long as those groupmates heed everyone’s verbal input.

Intended outcomes

The Yarn Game solidifies learners’ command of most rules underlying RDF graphs, enabling them to read RDF graphs fairly fluently. It also prepares them to learn various RDF serializations and introduces them to a few RDF vocabularies. It is suitable for a first-day introduction to RDF, after some explanation (to be detailed below). In my experience, learners who have played the Yarn Game typically understand with minimal further reminders:

  • that triple subjects and properties must be URIs
  • that only triple values can be literals
  • that the same URI can be the subject of one triple and the value of another
  • that URIs can be abbreviated via prefixes (though they will not know the syntax for making the connection yet)
  • the common “a”/rdf:type property and its use with RDF classes
  • a little bit about the Dublin Core and FOAF vocabularies
  • a little bit about VIAF and id.loc.gov
  • what the prefix.cc website does
  • that triple graphs are in theory infinitely expandable

Because the Yarn Game was designed for a library-school course, the examples and vocabularies chosen are library-centric. The game is easily adaptable to other discourse contexts, however; life scientists could easily build a Yarn Game around Darwin Core, for example.

Preparation

Learners will be divided into groups of three to five to play the Yarn Game. Each group will need:

  • a few yards of yarn
  • transparent tape
  • scissors
  • butcher paper, or paper from an easel pad, to build the graph on (optional, but makes cleanup easier)

The facilitator will also need to prepare a premade set of slips of paper representing subject/value URIs and properties for each group. Each URI should also list its prefixed form, ideally in smaller type. Choose vocabularies and (especially) properties that learners will most readily understand and be able to use without tedious explanation or endless online lookups. Here is a premade set I have used in my course; others are obviously possible. A paper-cutter will speed preparation considerably, and a binder clip suffices to keep each group’s allotment together until use. Having an extra set or two on hand is a good idea.

Printing on colored paper can help learners keep the rules straight by correlating paper color with allowable positions in triples. I recommend using different colors of paper for:

  • URIs used as subjects/values
  • Properties
  • RDF classes, if any (in my example set, all from FOAF)
  • Literals, though these will all be blanks

Testing a meditated color scheme is strongly recommended for accessibility to learners with colorblindness.

Cut blank slips in the appropriate colors for URIs, properties, and literals from extra sheets of paper. These should be a bit larger than the printed slips so that cumbersome URIs or long literals can be written on them. A communal stash of these is fine; there is no need to allot them by group. A dozen URI blanks, a dozen literal blanks, and half a dozen property blanks per group should suffice. (I have yet to have a group want to use an RDF class not pre-provided.)

Finally, the facilitator should prepare one or two “starter triples” for each group by taping a short (two- to three-inch) piece of yarn between slips of paper for subject and (the left side of) property, and another between (the right side of) property and value. In my example set, I prebuild the following triples:

<http://viaf.org/viaf/313386663> <http://purl.org/dc/terms/creator> <http://viaf.org/viaf/88985552>.

<http://viaf.org/viaf/308048374/> <http://purl.org/dc/terms/creator> <http://viaf.org/viaf/95309794>.

(Colloquially, these triples mean “Qu’est-ce que la documentation was created by Suzanne Briet” and “Intellectual foundation of information organization was created by Elaine Svenonius.”)

In digital-humanities contexts, Isabel Allende is a marvelous subject for a starter triple, given her literary and political connections and the easy availability of VIAF work IDs for her writings.

Pre-game explanations

Almost any standard introduction to RDF will give Yarn Game learners all the background they need to play. Before playing, they should read and/or be told:

  • the subject, property, value structure of an RDF triple, and how it is typically represented visually; pay particular attention to the direction of the arrow
  • that subjects and properties must be URI identifiers
  • that values may be URIs or literals, but URIs are preferable when available
  • that literals should be surrounded with quotation marks (note: because this is graphing rather than triple construction, I don’t bother with angle brackets around URIs, as most RDF graphs don’t either)
  • that reliable URIs, especially for properties, are usually pulled from controlled vocabularies

To avoid learner confusion and overload, do not go into detail about:

  • Blank nodes. I mention their existence (as an advance organizer for later instruction), but refuse to explain them.
  • Domain and range. For purposes of the Yarn Game, RDF classes are simply values of the “a” property.
  • Syntaxes for prefix declaration, or even that declaring prefixes is necessary. Explain prefixes as URI abbreviations.

Setting up the game

Divide learners into groups of three to five. Give each group yarn, scissors, tape, butcher paper if any, and the premade slips and triple(s). Explain that they are to build an RDF graph from an example triple you have made for them by connecting more triples to it that add additional information about the subject or value of the triple. By convention, because yarn does not have arrows, subject URIs are at the left or top of a triple—“before the yarn”—and values should be at the right or bottom of a triple—“after the yarn.”

If you are using colored paper, explain the color scheme you have chosen, being specific about where each color is permitted within triples. Assure learners that the colors will help them keep the rules straight.

Start the game! If groups need a nudge to get started, ask them to look at the properties you have provided and see if any can be used to build a new triple based on the subject or value of the premade one. Half an hour to an hour should be enough to produce excellent graphs with (minimally) two to three triples per group member.

I do not make the Yarn Game competitive when I use it in class, but if this is desirable, the obvious win determiner is the largest number of correct triples built per group member (to avoid privileging larger groups). For additional reinforcement, when graph construction is complete, groups can change places to read other groups’ graphs.

While the game is running

Circulate to answer questions and look for malformed triples. Common initial errors include:

  • literals as subjects
  • literals without quotation marks
  • backwards triples (to correct, ask learners to read the triple’s meaning aloud)
  • using the wrong color paper (yes, it’s just a mnemonic, but it really does help)

Common questions

Most questions, of course, will depend on the chosen vocabularies and properties. Those I list arose mostly from Dublin Core and FOAF.

“Given a property, how do you know what its subject and value should be, that is, which side of the property the other pieces of the triple go on?”
It’s pure convention. Find an example if you can. With Dublin Core, it’s safe to assume that the document being described is the subject of the triple.
“Are there URIs/URLs for languages?”
Yes. The Library of Congress maintains several lists at id.loc.gov; ISO-639-1 usually suffices. There is also lexvo.org.
“Are there URIs/URLs for dates?”
No, dates are always literals. Use the four-digit year. If month and/or day are available, write the literal in the form YYYYMMDD.
“If something doesn’t seem to have a URI identifier, what can we do?”
Find it in Wikipedia and scroll down to the “Authority Control” section for suitable URIs. For scholarly articles, see if they have a DOI. For books, check VIAF to see if there’s a Work or Expression URI there. If not, look the book up in WorldCat and use that. If all else fails, use the most obvious literal.
“What does the property ‘a’ mean?”
It means “is a.” The only possible value for it is an RDF class, which can be recognized because it begins with a capital letter (e.g. foaf:Person, foaf:Document).