3

A lot of what rdfs provides has an analog in Object Oriented Programming (OOP). For example, rdfs:subClassOf roughly corresponds to the OOP concept of a subclass.

In OOP, the mantra of prefer composition over inheritance is popular.

In the semantic web space, how would one go about representing composition?

Perhaps one way would be to assign two or more rdf:type's to an object.

What is the semantic web pattern supporting composition?

James Hudson
  • 844
  • 6
  • 19
  • If I had to find a parallel, I'd think the best fit is to not have anonymous class expressions as superclasses, but to create named classes equivalent to the desired class expressions. However, I don't think there's a real close parallelism between OO concepts and RDFS (or OWL, since the semantic-web tag relates to both) concepts. Multiple inheritance matches having more than one rdf:type property, and that's actually very common. – Ignazio May 30 '20 at 15:24
  • Allemang and Hendler write "One of the primary organizing tools in OOP is the notion of hierarchy of classes and subclasses...The Semantic Web standards also use this idea of class hierarchy for representing commonality and variability...Many readers may be familiar with terms like class and subclass from OOP. There is a close historical and technical relationship between the user of these and other terms in OOP and their use in the semantic web, but there are also important and subtle differences..." (Semantic Web for the Working Ontologist) – James Hudson Jun 01 '20 at 12:24
  • 1
    You may also want to read https://henrietteharmse.files.wordpress.com/2019/09/scenariotestingusingowl_v0-1-7-final.pdf – James Hudson Jun 01 '20 at 12:33
  • It may be the case that the closest analog for composition in OOP is multiple inheritance in the Semantic Web via assigning two or more rdf:type's to an object. – James Hudson Jun 01 '20 at 12:35
  • https://www.w3.org/TR/sw-oosd-primer/#comparison In RDF, properties are stand-alone entities that can exist without specific classes. I'd say, RDF properties are similar to OOP interfaces in some sense :). – Stanislav Kralin Jun 01 '20 at 20:35

0 Answers0