The Architecture of the Web, Web Services and the Semantic Web
by Alistair Miles
Looking back on the experience of drafting the Best Practice Recipes for Publishing RDF Vocabularies (we affectionately referred to it as the Cookbook), I felt at the time like we were trying to thread the eye of an extremely small needle. Coming up with a workable solution, that was consistent with the current W3C/IETF specifications and TAG directives, was a bit like trying to find a way through a large and rather complicated maze.
Looking at the Cookbook now, I can’t help feeling that the solution we have is far from optimal. My main cause for concern is, quite simply, the robustness of the solution. Although there are a remarkable and inspiring number of people out there who really do want to do the Right Thing, it’s just so easy to get it “Wrong”. If the integrity of the Semantic Web depends on absolutely everybody getting it “Right”, it will be a fragile system indeed.
Thinking about the problem from a different angle, it occurred to me to ask, how can an HTTP URI without a fragment identifier or query string denote anything other than an “endpoint”, to use the language of WSDL 2.0? For example, consider the URI of any normal web page. It would be quite feasible to create a WSDL description of the same resource as an endpoint of a service. Now consider a similar HTTP URI that is intended to be used to denote my girlfriend. I set up my server using a recipe from the Cookbook, so that all HTTP GET requests result in a 303 Redirect response. How does it make sense for my girlfriend to be able to serve a 303 Redirect HTTP response? Or have I simply been misinterpreting every time she’s said, not tonight honey I’m washing my hair?
Then I got to thinking about the problem from the point of view of object-oriented programming. In an O-O program it’s quite usual to define a class to represent the notion of a person, and to create objects that are instances of that class. Such an object will have attributes such as name or date of birth, and may also define operations or methods such as setName() or setDateOfBirth() or setHomeAdress(). Of course it doesn’t make sense for an actual person to support methods or operations, but we all know that my girlfriend and an object in an O-O program are different things, and that one may be used to represent the other.
Now translate that point of view into the design of RESTful web services. If an object in an O-O program can represent a person, why can’t an endpoint with an HTTP address do the same? Why can’t I create an OWL ontology defining classes such as “Person” and “House”, and at the same time create a WSDL document that defines interfaces of the same name? Why can’t I define individuals of these classes in my ontology, using HTTP URIs for naming, and at the same time create a WSDL document that defines endpoints with the same HTTP URIs as addresses?