"An electric guitar requires an amplifier." Modelled with SKOS concepts as values, and modelled with no SKOS at all. The same facts, the same question, two places for the rule to live.
"An electric guitar requires an amplifier" says two things. The rule is about every electric guitar there will ever be: each one needs some amplifier. The fact is about one guitar: Dana's 1962 Stratocaster is played through Dana's Fender Deluxe. The fact is the same in both models below, an object property between two things you can hold. The rule is what changes between them.
# the fact, identical in both models: thing to thing, in the ABox data:dana-strat io:requires data:dana-deluxe .
inst: is the Instruments concept scheme, io: the classes and properties, data: the things. Your own file binds the scheme to the empty prefix; the names after the colon are the same.Electric Guitar is a concept in the Instruments scheme. Its hierarchy is skos:broader. A concept is never the subject of a relation of your own and never the object of rdf:type. Everything you can hold is typed with one of two classes, Instrument or Musical Accessory, and says which entry in the scheme it is through a property whose range is skos:Concept.
inst:ElectricGuitar a skos:Concept ; skos:prefLabel "Electric Guitar"@en ; skos:broader inst:Guitar . io:hasInstrumentType a owl:ObjectProperty ; rdfs:domain io:Instrument ; rdfs:range skos:Concept .
Electric Guitar is a class. Its hierarchy is rdfs:subClassOf, and a reasoner propagates membership up it. The words go on rdfs:label and rdfs:comment. A thing says what it is with rdf:type alone; there is no second property for the type.
io:ElectricGuitar a owl:Class ; rdfs:subClassOf io:Guitar ; rdfs:label "Electric Guitar"@en . io:Guitar a owl:Class ; rdfs:subClassOf io:StringInstrument .
Adding a baritone guitar is one concept in the scheme on the left, no schema edit. On the right it is a new class, and the schema changes. With forty instrument types the right-hand tree has forty classes; that is a list, not a product, so it is not the explosion from Why the TBox Stays Small. It is still the ontologist's file every time a type is added.
A concept cannot be the subject of a relation, so the rule cannot be written on Electric Guitar. It becomes an individual of a class made for rules, Accessory Requirement, with two properties whose values are concepts. The rules are rows in a table; the scheme supplies the words. They live in the ABox and are entered as data.
io:AccessoryRequirement a owl:Class . io:forInstrumentType a owl:ObjectProperty ; rdfs:domain io:AccessoryRequirement ; rdfs:range skos:Concept . io:requiresAccessoryType a owl:ObjectProperty ; rdfs:domain io:AccessoryRequirement ; rdfs:range skos:Concept . data:req-1 a io:AccessoryRequirement ; io:forInstrumentType inst:ElectricGuitar ; io:requiresAccessoryType inst:Amplifier .
Electric Guitar is a class, so the rule is a statement about the class: every member requires some Amplifier. That is an OWL restriction, written once on the class with owl:someValuesFrom. It lives in the TBox and is written by the ontologist.
io:Amplifier a owl:Class ; rdfs:subClassOf io:MusicalAccessory . io:ElectricGuitar rdfs:subClassOf [ a owl:Restriction ; owl:onProperty io:requires ; owl:someValuesFrom io:Amplifier ] .
The yellow lines are the rule. On the left it is three triples about a new individual. On the right it is an anonymous class, "things that require some amplifier", and Electric Guitar is declared a subclass of it.
data:dana-strat a io:Instrument ; schema:name "Dana's 1962 Stratocaster" ; io:hasInstrumentType inst:ElectricGuitar ; io:requires data:dana-deluxe . data:dana-deluxe a io:MusicalAccessory ; schema:name "Dana's Fender Deluxe Reverb" ; io:hasAccessoryType inst:Amplifier .
data:dana-strat a io:ElectricGuitar ; schema:name "Dana's 1962 Stratocaster" ; io:requires data:dana-deluxe . data:dana-deluxe a io:Amplifier ; schema:name "Dana's Fender Deluxe Reverb" .
Two classes and a value on the left; one class each on the right. The fact, io:requires from the guitar to the amplifier, is the same triple in both.
A property chain follows the guitar to its type, the type back to the rule, and the rule to the accessory type. The reasoner then adds data:dana-strat io:needsAccessoryType inst:Amplifier. Nobody types it in. Without a reasoner the same walk is one SPARQL query.
io:needsAccessoryType a owl:ObjectProperty ;
owl:propertyChainAxiom (
io:hasInstrumentType
[ owl:inverseOf io:forInstrumentType ]
io:requiresAccessoryType ) .From rdf:type io:ElectricGuitar the reasoner adds Guitar, String Instrument, Instrument and Music Equipment. The restriction tells it that some amplifier exists for the Stratocaster, and that is all it concludes. It never says which amplifier, and it never complains when none is listed.
# inferred from the subclass tree data:dana-strat a io:Guitar, io:StringInstrument, io:Instrument, io:MusicEquipment .
# the gap query, SKOS-as-values model: which required accessory type has no matching accessory? SELECT ?accessoryType WHERE { data:dana-strat io:hasInstrumentType ?type . ?rule io:forInstrumentType ?type ; io:requiresAccessoryType ?accessoryType . FILTER NOT EXISTS { data:dana-strat io:requires ?a . ?a io:hasAccessoryType ?accessoryType } } # the same question, no-SKOS model: read the restrictions up the class tree SELECT ?accessoryClass WHERE { data:dana-strat a ?type . ?type rdfs:subClassOf* ?c . ?c rdfs:subClassOf [ owl:onProperty io:requires ; owl:someValuesFrom ?accessoryClass ] . FILTER NOT EXISTS { data:dana-strat io:requires ?a . ?a a ?accessoryClass } }
| Question | With SKOS as values | Without SKOS |
|---|---|---|
| What is Electric Guitar? | a concept, a value | a class |
| Where is the hierarchy? | skos:broader, climbed by a query | rdfs:subClassOf, propagated by a reasoner |
| How does a thing say its type? | rdf:type io:Instrument plus io:hasInstrumentType inst:ElectricGuitar | rdf:type io:ElectricGuitar |
| Where does the rule live? | ABox an Accessory Requirement individual with two values | TBox a restriction on the class |
| Who writes the rule? | whoever enters data | the ontologist |
| What does a reasoner add? | the needed accessory type, through a property chain | the superclasses of the thing |
| Adding an instrument type | one concept, no schema edit | one class, a schema edit |
| Labels, synonyms, definitions | skos:prefLabel, skos:altLabel, skos:definition, one preferred label per language | rdfs:label, rdfs:comment; synonyms need extra labels with no rule about them |
| Where is the fact? | ABox data:dana-strat io:requires data:dana-deluxe, the same in both | |
Choose the SKOS model when the list of types is long, changes often, has synonyms, or is maintained by people who do not edit ontologies. Choose the pure OWL model when the types are few and stable and the rules about them must be read by a reasoner from the class alone. The music graph in this course uses the first; a small, fixed domain can use the second.
Some questions ask which model a statement belongs to. Pick an answer; the explanation appears at once.