๐Ÿ—๏ธ RDFS: RDF Schema & Semantics

Chapter 4 Interactive Learning Companion

๐ŸŒณ Class Hierarchy Explorer

Load a class hierarchy, then run inference to see all derived triples from rdfs:subClassOf and rdf:type.

// Select an example above

๐Ÿ‘† Select an example, then click "Run Inference"

๐Ÿ“š Remember: rdfs:subClassOf is transitive and reflexive. Instances inherit all superclass types.

โšก RDFS Inference Engine

Add RDFS triples and watch the engine derive new facts. Implements rules rdfs2, rdfs3, rdfs5, rdfs7, rdfs9, rdfs11.

Add triples above and click "Compute All Inferences"

๐ŸŽฏ Domain & Range Lab

Experiment with domain and range. See how they INFER types, not validate!

๐Ÿ“ Define Property Constraints

๐Ÿ“ Use the Property

โš ๏ธ RDFS infers types โ€” it does NOT validate!

Explicit Triples:

ex:teaches rdfs:domain ex:Professor . ex:teaches rdfs:range ex:Course . ex:Alice ex:teaches ex:WebData .

โœจ Inferred Triples:

ex:Alice rdf:type ex:Professor . # from rdfs:domain (rdfs2) ex:WebData rdf:type ex:Course . # from rdfs:range (rdfs3)
๐Ÿ’ก Try This: Set domain to "ex:Professor" and subject to "ex:Fido". RDFS will happily infer Fido is a Professor โ€” it doesn't reject it! For validation, use SHACL or ShEx.

๐Ÿ—๏ธ RDFS Vocabulary Builder

Build a complete RDFS vocabulary interactively and see the generated Turtle.

Generated Turtle:

@prefix ex: <http://example.org/> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . # Add classes and properties above!

๐ŸŽฎ Inference Challenge

Given an RDFS graph, find ALL inferred triples. Type them to score points!

Score: 0
Challenge 1 / 3

Press "Start" to begin the challenge!

๐Ÿ“ Chapter 4 Quiz

Test your understanding of RDFS concepts!

๐Ÿ“‹ RDFS Cheat Sheet

Your quick reference for all things RDFS.

๐Ÿท๏ธ RDFS Classes

rdfs:Resource # Class of everything rdfs:Class # Class of all classes rdfs:Literal # Class of literal values rdfs:Datatype # Class of datatypes rdfs:Container # Superclass of Bag/Seq/Alt rdf:Property # Class of all properties

๐Ÿ”— RDFS Properties

rdfs:subClassOf # Class hierarchy rdfs:subPropertyOf # Property hierarchy rdfs:domain # Subject type (infers!) rdfs:range # Object type (infers!) rdfs:label # Human-readable name rdfs:comment # Human description rdfs:seeAlso # Related resource rdfs:isDefinedBy # Defining vocabulary

โšก Key Inference Rules

rdfs2 (Domain): P domain C ยท X P Y โ†’ X type C
rdfs3 (Range): P range C ยท X P Y โ†’ Y type C
rdfs7 (SubProp): P subPropOf Q ยท X P Y โ†’ X Q Y
rdfs9 (SubClass): C subClassOf D ยท X type C โ†’ X type D
rdfs5 (Trans SubProp): P sub Q ยท Q sub R โ†’ P sub R
rdfs11 (Trans SubClass): C sub D ยท D sub E โ†’ C sub E

โš ๏ธ Common Traps

โŒ Domain/range do NOT validate โ€” they INFER types
โŒ Multiple domains = intersection (AND), not union
โŒ rdfs:Class is an instance of itself (that's OK!)
โœ… subClassOf is transitive AND reflexive
โœ… For validation, use SHACL or ShEx instead

๐Ÿ“„ Example Vocabulary

@prefix ex: <http://example.org/> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . ex:Person a rdfs:Class ; rdfs:label "Person"@en . ex:Student rdfs:subClassOf ex:Person . ex:enrolledIn a rdf:Property ; rdfs:domain ex:Student ; rdfs:range ex:Course .

๐Ÿ”— Useful Resources

๐Ÿ› ๏ธ RDF Playground

Validate and visualize RDF

๐Ÿ” Wikidata Query Service

Query real RDFS data with SPARQL

๐Ÿ“„ RDF 1.1 Semantics

Formal model-theoretic semantics