Apologies Torbjörn for hijacking this thread into an OOP vs frames/RDF/OWL debate, but I have to weigh in on this and I will bring it back to Web Prolog.
Origins
OOP was implemented in Smalltalk-72, although an earlier language implemented inheritance in 1967 (Simula 67), whereas Minsky’s paper on frames was published in 1974. OOP “officially” predates frames.
However, the OOP wikipedia page claims OOP was emerging in the late 50’s and 60’s in MIT’s AI group, where objects were being discussed as a LISP atom with attributes. It omits that Minsky joined MIT in '58: these objects were the predecessors to frames. Alan Kay cited these ideas of objects as an influence prior to working on the design of Smalltalk, whose first version was a message passing language that then implemented inheritance ala. Stimula.
So the origins are a little murky, what is clear is that Minsky considered frames as knowledge representation framework, whereas Kay, the Stimula team, and the rest of the Smalltalk team, were using these ideas to develop a programming language. They were developed with different intentions, but from a common terminology muttered in the AI labs of MIT.
OOP
As already mentioned, OOP developed as a software engineering method. Its ideas of objects relate to components in a software system. Classes are abstract components; instances concretize them. In this way you can get the strange ideas found in design patterns like factory classes and singletons. Classes, by the single responsibility principle, are supposed to be a component that is responsible for a single part of the functionality of the system.
In OOP objects have properties and methods, inheritance isn’t strict. So in OOP you can declare a parent class has some property but declare its child class does not. In ontology, if something is true in the parent it must be true for the child too. The methods can be called on instantiation, on getting and setting properties, and at any other time you wish. As an object is a component in a software system, its methods are what provides its functionality.
Frames
Frames were developed as a knowledge representation technique. Its idea of objects is as classes and instances. A class is an abstraction of something in the real (or imagined) world, something in the domain of discourse. An instance is a concretization of this class. A frame is supposed to represent what is known about one class or one instance of a thing.
A frame, if treated as a black-box, appears to only have an identity, properties, and values of those properties. Yes it can have procedures in value slots, but these are accessed when getting or setting the value in cases where the value is dynamic. The procedures don’t provide functionality, they only provide values. They also make use of subsumption to inherit values from their class or parent class.
Example Use
An example of working with OOP and frames: I want to create a report and print it out. I can query the frames to get the data for the report, then in OOP I use this data to instantiate the “Report” class and call the “print” method. A frame is a knowledge representation method, printing is the execution of some algorithm that doesn’t return a value, thus “print” has no place to be in a frame: “print” doesn’t relate “Report” to any knowledge. The “Report” class is an component in the software system whose functionality is to generate reports, it has no business in ontologically defining a report or the data used in it, that is not it’s purpose. In this example we adhere to the separation of data and functionality principal by using frames and OOP appropriately.
RDF & OWL
To place modern ontology languages in context, RDF isn’t one. RDF only provides triples with URI’s and literals for the purpose of marking up a web document. RDFS was a first run at making RDF into something that could be used as an ontology language, but it couldn’t guarantee termination. That’s where OWL comes in, which draws upon both description logics (hence can guarantee termination) and frames. OWL uses the RDF markup, and can be used with RDFS terms. OWL is also strict with subsumption.
Furthermore, there is now SWRL, which is a declarative rule language for making and storing deductions from an OWL ontology. But, like frames, it can only be used to derive triples, unlike an OOP method, which is a capability of that component in the software system, thus can derive a value or do something else.
There is also a subtle but important difference between OWL and both Frames/OOP. In an OWL triple store things are stored strictly as triples, so “bob age 53” is an edge called “age” between nodes called “bob” and 53. In a frame, in OOP, and in modern graph databases like Neo4J, the properties associated with the subject are stored with that subject, so in this example 53 would not be it’s own node.
Different Design Intentions → Different Implementations → Different Products
Just because in OOP we have things with an identity (although this differs between language implementations) and pairs of relations to things that can be values or methods does not mean that they are equivalent to frames/triples/RDF/OWL with their ideas of identity, relations, and values. Due to the origins, they share a common terminology and some common architecture, but they have forked, for example message passing is a huge part of OOP that has no corresponding idea in frames.
They are designed for different purposes, hence they implement these ideas in different and not always strictly correct ways. Thus they are both used in different ways, their unique implementations being designed to facilitate their use-case. OOP doesn’t follow ontological rigor, but it does allow the composition of software systems. Frames/OWL should/do follow ontological rigor, but their use of procedures is limited and should be invisible to the user querying them.
To bring this back to the need for Prolog on the web.
OWL is only a knowledge representation language, Prolog is a programming language. OWL can only have maximum arity 2 relations, but some relations hold between more than 2 things, such as the quality of an entity at a particular time. OWL can’t have complex terms in the object position, so can’t operate on itself to say things like knows(karen, age(bob, 53))
. Finally OWL is open-world.
All of these were design choices to cope with the limitations of the web (what if an URL is down? .: open world) and to make it possible for non-specialists to add data without accidentally including some infinite recursion.
But we are Prolog programmers, we can wield the full capabilities of a logic programming language. We shouldn’t be constrained to (at best SROIQ) description logics for our knowledge representation. We shouldn’t be constrained to the open-world assumption as the only available solution to an unresponsive query. Furthermore, we shouldn’t be constrained to knowledge representation. We can, and do, as our predecessors for almost 50 years have done, seamlessly integrate our represented knowledge with programs that put it to use. We should be able to do the same on the web.