Categories
RDF Writing

RDF: Ready for Prime Time

Originally published at O’Reilly, and recovered from the Wayback Machine.

Not long ago, Marc Canter, one of the early founders of Macromedia, talked about RDF and the Semantic Web in his weblog. Specifically, he wrote:

“I’ve been spending more and more time trying to grok the RDF folks. I have to say I like what I see and hear, but what I don’t see are many apps and services actually up and running and working.

We have a saying over here: “put up or shut up.” I’m still looking for two different RDF apps or services to work together in some meaningful way. Then bring on the books.”

Considering that I’m “bringing on a book” on RDF this month, I thought it appropriate to answer Marc’s plea for meaningful, working examples of RDF apps and services, especially those that work with other RDF-based services. My problem, though, is that I have only a limited amount of time and space in this article; I can only cover a few of them. However, best to just start, but first, a little digression into RDF and XML.

RDF/XML: The Syntax That Could

You probably know that RDF has both a defined model as well as a preferred serialization, RDF/XML. In many ways there’s been far less criticism of RDF than there has been of the RDF/XML syntax. Tim Bray, one of the creators of XML has said:

“Speaking only for myself, I have never actually managed to write down a chunk of RDF/XML correctly, even when I had the triples laid out quite clearly in my head. Furthermore, once again speaking for myself, I find most existing RDF/XML entirely unreadable. And I think I understand the theory reasonably well.”

Tim even went so far as to offer his own version of RDF/XML, which he called RPV.

I’ve found that the more a person works with markup such as XML, the more they dislike RDF/XML. I’ve also found that no matter the alternative proposed, someone else will dislike it just as much, which makes RDF/XML a bit of a “damned if you do, damned if you don’t” proposition.

Ultimately, if RDF is ready for prime time, then so is RDF/XML. Regardless of our views of it, it’s official, it’s real, and it’s here now. So on to the RDF applications, starting with the basics: the APIs.

RDF APIs

For every programming language you’re interested in, there’s most likely an RDF API and a library implementing it. If you’re interested in Java, one of the most popular Java RDF libraries for RDF is Jena, from HP’s Semantic Web Research Lab. The current version of Jena is 1.6.1, which is the one I’ve used, but there is a beta-release of a new version (Jena2), and it’s the one you’ll most likely want to investigate. As you’ll see later, Jena is used for several utilities and applications.

For those interested in Python, the most popular RDF library — which also includes a triplestore with several different backends — is Daniel Krech’s RDFLib. Want something a little more unusual? Try Wilbur, a Common Lisp RDF library, written by Ora Lassila, one of the creators of RDF.

For those who work primarily with Microsoft development environments, there is a C# RDF Parser called Drive, which provides an API to parse RDF/XML into an in-memory RDF graph for manipulation. It’s fully compatible with the .NET platform, and it can also be used with the open source variant of .NET, Mono.

If Perl is more your thing, there’s Ginger Alliance’s PerlRDF, a library I’ve used in several small applications at my site. And other, popular applications like Six Apart’s weblogging application, Movable Type, are also using it. Six Apart extended the PerlRDF module by creating a new module, XML::FOAF, which enables autodiscovery and processing of FOAF files. FOAF, or Friend-of-a-Friend, is an RDF vocabulary for defining hierarchies of acquaintances and is now one of the most popular uses of RDF/XML.

If you want support for multiple RDF languages as well as a more sophisticated framework and data persistence, you’ll want to check out Dave Beckett’s Redland. In addition to providing a persistent data store, as well as multiple language support (Python, Perl, Java, Tcl, and Ruby), Redland also provides support for an independent RDF parser called Raptor. Raptor has been used, independently, in other applications, including several FOAF apps, as well as RDF Gateway, a commercial product I’ll discuss later in this article.

RDF Vocabularies

FOAF is one of the more popular vocabularies of RDF/XML. Just a quick perusal at the FOAF web site will show dozens of uses of FOAF in tools ranging from a FOAFBot, created by Edd Dumbill and used to provide services within chat forums, to uses of FOAF in desktop tools within the OS X environment for managing contacts. My own FOAF file is at http://weblog.burningbird.net/foaf.rdf, and consists of pointers to friends I know online, though the list is incomplete.

The beauty of FOAF lies in its simple way of describing personal information, including our work and academic affiliations. The power of FOAF lies in its ability to list acquaintances who themselves may have FOAF files. Over time, this interlinked network can expand until it’s a simple matter of mapping out who is connected, directly to indirectly, to each other.

Another RDF vocabulary in popular use is RSS 1.0. Webloggers and other online publications use RSS 1.0 to provide information about updates at their web sites, including the date of the update, the author, an excerpt of the material and so on.

A third RDF vocabulary is the RDF/XML used to describe Creative Commons licenses, a new way to provide more detailed information about use of copyrighted material.

All three vocabularies use, in one way or another, elements from the Dublin Core Metadata Initiative (DCMI), as defined in RDF/XML. However, these vocabularies aren’t the only ones available using RDF/XML. In fact, the W3C uses RDF/XML to define the underlying syntax for its own Web Ontology Language (OWL) effort. With RDF providing the underlying model, and OWL adding higher-level ontology support, it’s only a matter of time before a host of sophisticated, domain-specific ontologies spring up, all of them interoperable because of the underlying use of RDF/XML.

In fact, there’s a host of tools and utilities people can use right now to work with RDF/XML directly or with OWL.

Tools and Utilities to Work with RDF/XML

As much as I like RDF/XML, even I’ll admit that it requires time to understand and work with, and not everyone has either a desire or an inclination for this effort. Thankfully, there’s plenty of tools available to allow people to manually create or read RDF/XML.

The most commonly used RDF utility is the RDF Validator, a tool to check your RDF/XML to ensure that it’s valid, as well as to generate different views of the model data. I find that when working with an API, I’ll use the Validator to validate my sample RDF/XML, view the model to ensure I’ve created the appropriate one, and then create the triples to use as a pattern with my RDF/XML API calls, in whatever language I’m coding.

Another handy utility for working with RDF/XML is the BrownSauce RDF Browser. This web application uses Jena. It can open an RDF/XML document and provide easily readable and hypertext-linked pages of the RDF data contained in the document. Best of all, the browser also opens any associated RDF Schema documents that provide information about the RDF elements themselves, through the relationships described in the schema, and through comments provided with the schema elements.

A long-time advocate of RDF and a friend of mine, Danny Ayers, has been busy at work on Ideagraph, a tool for visually mapping ideas and then generating RDF/XML from the results. In addition to this effort, the tool can also act as a RDF-based weblogging tool, as well as an RSS aggregator.

Isaviz is another popular visual-editing tool for creating, importing, and working with RDF documents in RDF/XML, and within other serialization formats such as Notation 3 and N-Triple format. It’s particularly useful when you’re creating a new RDF vocabulary and want to use a visual tool for this effort rather than trying to create the vocabulary in RDF/XML manually. However, I prefer to use the tool to work with existing RDF/XML documents, particularly larger ones, because the tool has a way of being able to zoom in on components of a model, to create snapshots of particular paths, and to query on specific elements. In particular, if you’re documenting an existing RDF/XML vocabulary, Isaviz can be useful for providing snapshots of particular instances of data.

Most of these tools are geared more for working directly with RDF/XML vocabularies. If you’re working with an ontology instead, then you must look at Protege, from Stanford University. This tool not only allows you to define an ontology using an easy-to-use user interface, you can then create forms to capture the ontology data. Once the forms are defined, the tool can then be used to capture instances of data based on the ontology. Currently. effort is underway to provide support for OWL files, and mapping between Protege’s own ontology language and the W3C language. Regardless, the data captured by Protege can be output in multiple formats, most particularly RDF/XML.

Peripheral RDF Support in Other Tools and Utilities

Of course, tools that focus purely on RDF, whether to create RDF or to consume RDF, are handy when you’re starting work with RDF–but what about RDF in the real world?

Probably one of the first uses of RDF/XML was by those involved in the Mozilla effort, which still uses RDF/XML for all of its automated Table of Contents data and processing. In fact, it was through my interest in the Mozilla development environment that I became exposed to RDF/XML (see www.mozilla.org/rdf/doc/).

If you’ve worked with Linux then you’re most likely familiar with RPM, a way of packaging Linux applications for easy installation. What you may not know is that RDF has been used with RPM to provide metadata about the package being installed. A utility created by Daniel Veillard, rpmfind, uses RDF to discover RPM installations on Rpmfind.Net, a database of RPM packages maintained by the W3C. Though the original creator of the product is no longer maintaining rpmfind directly, the source is now located at sources.redhat.com, and I’m still using rpmfind for my own server.

Earlier I mentioned Movable Type and its use of RDF for autodiscovery of FOAF files. The application also uses RDF/XML to annotate weblog entries with trackback information, which can be used to document links from one weblog to another and provide reverse link information. This same functionality has been isolated for use by other tools, weblogging or otherwise.

Spring, a Mac OS X desktop tool created by Robb Beal, provides support for dragging and dropping FOAF files. Find an FOAF link in a web page? Click on it and drag it to Spring in order to automatically transform the FOAF contents into the tool.

As ubiquitous as RDF is becoming, creeping its way into a favorite tool or utility near you, the power of the RDF model’s inferential capability is particularly apparent when you look at some of the larger applications that are being built on RDF.

Larger Applications

People at MIT are working on an application, called DSpace, which will maintain a digital repository of information. The application is geared to any larger organization such as a college or university that wants to maintain a searchable index of publications from its members. DSpace is a freely available, open source application that makes use of an ontology, Harmony/ABC and RDF to maintain the historical subsystem. RDF Gateway is a Semantic Web application server that uses RDF as the core of all of its services. With the Gateway, you get access to a persistent data store that can be queried using an inferential engine that goes beyond normal SQL-like queries. Included with the application is support for server-side scripting similar in nature to both ASP (Active Scripting Pages) and JSP (Java version of same).

Siderean Software’s Seamark is another commercial application that makes use of RDF and a persistent data source, but Seamark focuses primarily on site navigation. Plugged In Software’s Tucana Knowledge Store provides sophisticated knowledge-based querying of large stores of data, again based on RDF.

These companies are just the first to start looking at RDF and the RDF data model for use in large-scale, sophisticated applications. And then there’s the Semantic Web.

The Semantic Web

It’s funny in a way, but I can sit down and rattle off a dozen uses for the RDF data model and the associated RDF/XML without once mentioning its primary purpose, which is to provide support for the Semantic Web efforts. All uses of RDF for any purpose are good because they increase our familiarity with the specification as well as the syntax. In addition, applications that increase the level of RDF/XML out on the web add to the pool of accessible data on which we are slowly building the Semantic Web. Through the use of RDF, we know that all of the vocabularies are compatible.

Beyond these good and practical uses of RDF I’ve described earlier in the article, and unlike XML or HTML or XHTML, the RDF model, and its associated syntax, brings with it the ability to define statements about data, rather than to just record pieces of data. Add to this the use of OWL, and we begin to have the ability to mine for knowledge, not just words.

Consider poetry. My favorite poem is Walt Whitman’s “Song of the Open Road”, with its friendly and positive imagery of life as an adventure, a road to follow with glee. In fact, the use of “road” as a metaphor for life and life’s journey is quite common in poetry. (See an excellent article, “Poetry of the Open Road.”) However, it’s the very use of imagery and metaphor in poetry that defeats traditional web discovery techniques.

Currently we have the ability to use keyword searches within search engines such as Google, and with this we can find poems that mention the word “road”. This is all well and good, but in the future, as the use of RDF and RDF/XML expands, we’ll be able to do searches that not only provide links to poems that have used “road”, but also know which poems use the word as a metaphor for life, which have used it metaphorically to describe freedom, and which are just talking about roads as roads.

Eventually as RDF insinuates itself throughout the web, as it has already started, you’ll be able to search on “road” and “poem” and “metaphor for life” and not get this article back as a result. As much as I like the thought of people reading this article, that search result will be a good thing because this article is not about poems, metaphors, and life. It’s about RDF and how it is now more than ready for prime time.

Categories
Writing

Danny’s on at XML.com

Hey, I’m not so caught up in the debate excitement that I’m going to fail to note Danny Ayers first xml.com article, “Extending RSS”.

Congrats, Danny! Excellent read.

Categories
Just Shelley

Marbles

I was a real tom boy growing up, more interested in climbing trees then in playing with dolls. I remember getting a Barbie doll, once, and it was a real novelty at first as I tried to slip tiny little shoes on tiny little feet, and tight shirts over not so tiny hard plastic breasts. However, I quickly lost one of the shoes, and I wasn’t particularly enamored with female physiology then and now so Barbie ended up in a box of unused, discarded toys. I believe one of our dogs eventually found it and took it off somewhere to chew.

There was a succession of rather disgruntling Christmases where I was given dolls that cried and dolls that wet their diapers and dolls that drank out of bottles, while my brother was given really cool stuff like a mini-car racing set and a BB gun. I was especially envious of the BB gun until Mike accidentally shot his best friend in the head with it and that was the last we saw of the gun.

(Mike was also was given a Boy Scout knife, which he promptly lost when he played Mumbly Peg with it in the ground by my feet one summer afternoon and the knife bounced and ended up point first in my thigh.)

My parents weren’t dummies and they eventually realized that girl toys held little interest for me, so they started giving me things I really could enjoy — a trike, a bicycle, a toy doctor’s kit, balls, musical instruments, and a tape recorder. One Christmas, after not so subtle hints on my part, I got my own bag of marbles.

Now, the year I got the marbles, the really big thing among the kids of my crowd (my crowd being the entire fourth grade class of the town’s one and only elementary school) was playing marbles. Whenever we weren’t running around playing hide n’ seek, or runaway, or tetherball, or swimming, we were playing marbles. It was mainly boys that played, but there were some other girls besides myself who liked the game.

I kept my marbles in a soft carry bag made of blue plush, with a gold drawstring closure my mother had made for me. We all had our favorite marbles, the ones we really hated losing during play, and my favorites were an orange colored aggie and a blue swirly. I’d take them out at night, polishing them against my nightgown and holding them up to the light, gloating over the rich color and sparkly surfaces.

In spite of the color of the aggies and the sparkle of the shooters and the mystery of the cats-eyes, the real prizes were the steelies — marbles made of steel rather than glass. However, the kids in our town didn’t have your average, every day steely. We got our steelies from the Blacksmith.

The Blacksmith had a shop downtown, close to the general goods store we called the Candy Store (because that’s where we bought our penny candy), and across the street from the Post Office. The shop was a bit rundown, with a grubby looking tree out front, and had a large door that opened big enough to allow a car to back in. Next to the door was a small dirty window with a sign proclaiming type of business and hours of operation. To one side was a bunch of bushes that grew by chance, and between them and the tree, you’d pass the shop if you didn’t know it was there. Of course, we all knew it was there.

When the Smith wasn’t busy, he and one or two of his friends would sit in chairs on the sidewalk in front of the shop, sometimes talking, sometimes just sitting and looking out at the cars passing.

I do remember the afternoon I went to get my steely quite clearly: the shop, the warmth of the sun reflecting off the sidewalk, and the Smith sitting out front, wearing a jeans coverall darkened with soot and grime, red and dirty white handkerchief stuffed into his back pocket, fanning himself with a folded newspaper. I don’t remember the Smith’s face, but the hands — I can still see the hands. Skin permanently darkened, calloused and scarred from years of work at the forge.

I was a bit hesitant at approaching this man who was so dirty and large and unknown. I had to be egged on my best friend, whose name I can’t remember. When I did get the nerve to approach the Smith and ask if I could, please, have a steely, his quiet, thoughtful eyes resting on my face a moment; then, with slow, deliberate movements, the Smith turned around and walked into his shop, not saying a word. When he returned, his hand was in front of him, fingers curved around something I couldn’t see. I held out my own hand, much smaller, delicate in comparison and only slightly dirty from summer dust, and into it the Smith dropped this perfect silver globe, surprising me momentarily because of the weight.

I rolled the steely around my hand and felt the fading warmth from the Smith’s hand, the smoothness of the surface, the deep glow of the metal. Looking up to thank the Blacksmith, the sun was behind his back and his face in shadows. I squinted against the light as I mumbled out my thanks, and I thought I heard a rumble of laughter in reply, or maybe it was a car going by at that time. Hard to say. But I had my steely, and I and my friend went running off to the playground to try it out, see what captures I could make with my new prize.

Over the summer, I never lost my steely but I did lose other marbles, including the orange aggie and the blue swirly. However, I also won new favorites, and everything tended to balance out. We were all friends, after all. Well, most of us were friends.

There was one boy my age who was a bully, plain and simple. His older brother used to beat up on other boys and this kid looked to follow in the same line. Surly, I remember that about him. Surly, tow headed, a bit stocky, and just plain mean. He scared most of the kids except for the few that were bigger then him, and they were scared of his brother. Between them, the two ruled the playground.

The bully and I just didn’t like each other and hadn’t for years, calling each other names, shoving each other around. Once, in third grade, when I was perched up on a cement wall above the steps leading into the school he pushed me off, and I fell on my back on the steps. I had the breath knocked out of me and scraped my arm real bad. When the teacher came out to see what the fuss was, I couldn’t find the air to push out the words to tell her what had happened and she assumed I had fallen on my own and sent me to the nurse to get my arm taken care of. Since in those days the worst scum on earth was a tattle tale, the bully never got in trouble.

It was towards the end of summer just before I started fifth grade and we were playing marbles one early evening when the bully showed up. He started taunting me as usual, but he seemed meaner that day, if possible. I tried to ignore him because I was having too much fun playing, but this just made him madder. Finally he kicked my pile of marbles scattering them about, including my favorite steely. As I watched it roll off and get lost in the grass, I jumped to my feet to run after it. When I stood, the bully kicked me in my privates.

Being kicked in the privates when you’re a girl isn’t pleasant, but it doesn’t have the crippling effect that it does on boys. The bully’s kick really didn’t impact on me that much and I remember brushing it off and started walking, quickly, towards him, determined to make this guy pay, once and for all. I’d wrestled with boys before including my best friend, and I wasn’t afraid to roll about in the dirt or get a little cut up. Might say I was a bit used to it by then.

As I got closer I noticed how much taller I was then the bully, me coming from a tall family and being a girl and girl’s getting their height sooner than boys. When I was in fist throwing distance, he moved back slightly, which surprised me a bit. I looked into his eyes and it shocked me to see that he was scared of me! The boy who terrorized the playground was afraid of me!

Now, I don’t know if I was an overly bright child but I was shrewd, the shrewdness that comes with just being a kid and trying to survive childhood. It dawned on me that he wasn’t scared of me because I could hurt him — he was scared because he realized at that moment there was a possibility I could beat him. And I was a girl. Being beaten by another boy would be bad, but to be beaten by a girl…well, that would ruin the bully for sure.

I’d like to say some noble instinct came over me, turning me away from the fight, but no such thing. Some kid’s parent showed up at that point and stopped it, telling us all to go on home. I wasn’t too happy about it, either, because I was really looking forward to putting that kid on the ground and driving his face into the dirt. I could taste the dirt in my mouth, feel his head under my hands, so real was the vision.

That was the last summer I played marbles. During the next year, I climbed trees less and danced more, discovering the Beatles and other rock n’ roll, spending more time with other girls, becoming more awkward around my best friend and the other boys. I was growing up. My bag of marbles began to collect dust and eventually my mother gave it away.

I never did find my steely that one summer day. As for the bully? He never bothered me again

Categories
Writing

Go Fly a Kite

The talk is of war and politics and the economy, in an endless cycle of news that drags one’s spirits down. I don’t want to talk about these things. Instead, I want to talk about kites.

Probably one thing that transcends cultural differences is kites. Kites are made, and flown, the world over. There’s few children that haven’t built a flimsy device out of paper and fragile wood and then promptly crashed it into something such as a tree, ala Charlie Brown.

For most of us, our first kites are little diamonds made of very fragile wood and paper, tied to a long, long string. We’d put them together, sometimes with the help of a parent or other adult, and take it out for a trial flight. I don’t know about you all, but I had my first lessons in flight, wind, and flight without wind, with a kite.

Someone had to hold the kite and run backwards very quickly, tossing the kite high into the air. If the wind was right, up the little diamond would fly. If the wind wasn’t right, whoever your flying partner was had a marvelous workout. “Run faster! Run faster!”, you’d scream. “I am running”, they’d scream back, face red, puffing like a blow fish. Half the fun of kite flying was watching the poor soul desperately trying to get the kite into the air so they could sneak off to collapse while you were distracted.

After quickly breaking these kites, or losing them into a tree, or having them removed because we “buzzed” the family cat, we either progressed on to sturdier models or, for most of us, we went on to other toys, other hobbies.

Unless we happen to become someone else’s flying partner some day (“Run faster. Run faster”) that’s the last experience many people have with kites.

However, for a lucky few, kites re-enter our lives. And this time, they stay.

Flying a kite.

Throwing a kite into the wind and hoping it catches; sending the kite dancing on transparent bands of air that originate here in this place and there in that country and high in on this mountain, and and low, skimming the ocean, until they reach you and your kite. And you soar! Can’t you just feel the tug of the string in your hand, head back, eyes on a bright spot high overhead?

Throwing a kite into the wind and the wind is fickle, maybe even a little mean, and it catches your kite only to throw it down to the ground at spar breaking speeds, out of control, spiraling. Ground breaking thud. Wince. You swear you hear ghostly evil laughter whip past you as it seems to pick your kite up off the ground only to send it thudding back again and again, until your kite is a tattered remnant of cloth and broken wood.

Standing alone on a beach and trying to get your kite to rise and no wind wants to play. You kite just sits there, and you have no one to grab it and run with it, hoping to tease one single puff of air into noticing your kite long enough to take it for at least the most gentle ride.

There is nothing more forlorn then a kite flyer on an empty beach with a kite and no wind. Still….

…there is that anticipation of the next flight, the next wind, the next moment of soaring that keeps you coming back again. And again. And again.

Categories
RDF Writing

It’s alive!

itsalive.jpg