๐Ÿ”— RDF: Resource Description Framework

Chapter 3 Interactive Learning Companion

๐Ÿ”ฌ Triple Dissector

Click on each part of the RDF triple to learn what it is and why it matters.

Triple 1 of 5
ex:Copenhagen ex:capitalOf ex:Denmark .

๐Ÿ‘† Click on any part of the triple above to analyze it

๐Ÿ“š Remember:

IRI Can be Subject, Predicate, or Object
Literal Can ONLY be Object
Blank Node Can be Subject or Object

๐Ÿฉบ Syntax Surgeon

Find and fix the errors in this Turtle RDF. Click on a line to edit it, then check your work!

Challenge 1 of 3
1 @prefix ex: <http://example.org/>
2 @prefix rdf <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
4 ex:Alice ex:name "Alice .
5 ex:Alice a ex:Person
6 ex:Alice ex:age "25" .

๐Ÿ”„ Format Transformer

Convert RDF between different serialization formats. See how the same data looks in Turtle, N-Triples, and JSON-LD.

Input

๐Ÿ“ค Output

๐Ÿ’ก Format Guide:
  • Turtle: Human-readable, supports prefixes and shortcuts
  • N-Triples: One triple per line, full IRIs, easy to process
  • JSON-LD: JSON format with @context, great for web APIs

๐Ÿงช Datatype Laboratory

Experiment with RDF literals and datatypes. See how values are represented and compared.

๐Ÿ“ String Builder

"..."

Language tags are used for human-readable strings

๐Ÿ”ข Number Typer

"..."^^xsd:integer

Typed numbers enable proper mathematical comparisons

๐Ÿ“… Date Formatter

"..."^^xsd:date

ISO 8601 format is standard for RDF dates

โœ“ Boolean Creator

"true"^^xsd:boolean

Only "true" or "false" are valid boolean values

๐Ÿงฎ Comparison Tester

See why datatypes matter! Compare these values:

Value A Value B A > B (String) A > B (Typed)
"25" "100" TRUE (2 > 1) FALSE (25 < 100)
"9" "10" TRUE (9 > 1) FALSE (9 < 10)
"2024-01-15" "2024-02-01" FALSE FALSE (Jan < Feb)

๐Ÿ—๏ธ Blank Node Builder

Create complex structures using blank nodes. Model an address or other nested data.

has address โ†’ _:address1

Properties of the blank node:

Generated Turtle:

@prefix ex: <http://example.org/> . ex:Alice ex:hasAddress _:address1 . _:address1 ex:street "Main Street" . _:address1 ex:city "Copenhagen" .
โš ๏ธ When to use Blank Nodes:
  • โœ“ Intermediate structures (addresses, coordinates)
  • โœ“ Data that won't be referenced externally
  • โœ— Don't use if you need to link from other documents
  • โœ— Don't use for important entities that need global identity

๐ŸŽฎ Prefix Master

Compress full IRIs into prefixed form as fast as you can! Beat your high score!

Score: 0
๐Ÿ”ฅ Streak: 0
Available Prefixes: rdf: = http://www.w3.org/1999/02/22-rdf-syntax-ns# rdfs: = http://www.w3.org/2000/01/rdf-schema# xsd: = http://www.w3.org/2001/XMLSchema# foaf: = http://xmlns.com/foaf/0.1/ schema: = https://schema.org/ ex: = http://example.org/

Press "Start Game" to begin!

๐Ÿ“ Chapter 3 Quiz

Test your understanding of RDF concepts!

๐Ÿ“‹ RDF Cheat Sheet

Your quick reference for all things RDF.

๐Ÿท๏ธ Standard Prefixes

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix schema: <https://schema.org/> . @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix skos: <http://www.w3.org/2004/02/skos/core#> .

โœ๏ธ Turtle Syntax

Semicolon ; = same subject ex:Alice ex:name "Alice" ; ex:age 30 .
Comma , = same subject + predicate ex:Alice ex:knows ex:Bob, ex:Carol .
a = rdf:type ex:Alice a foaf:Person .
[ ] = anonymous blank node ex:Alice ex:address [ ex:city "CPH" ] .

๐Ÿ”ข XSD Datatypes

xsd:string "hello" xsd:integer "42"^^xsd:integer xsd:decimal "3.14"^^xsd:decimal xsd:float "3.14"^^xsd:float xsd:boolean "true"^^xsd:boolean xsd:date "2024-01-15"^^xsd:date xsd:dateTime "2024-01-15T14:30:00"^^xsd:dateTime xsd:anyURI "http://..."^^xsd:anyURI

๐Ÿ“ Term Position Rules

Subject Predicate Object IRI โœ“ โœ“ โœ“ Literal โœ— โœ— โœ“ Blank Node โœ“ โœ— โœ“

โš ๏ธ Only IRIs can be predicates!

๐Ÿ“„ Serialization Formats

Turtle (.ttl)

Human-readable, prefixes, shortcuts

N-Triples (.nt)

One triple/line, full IRIs, streamable

JSON-LD (.jsonld)

JSON with @context, web-friendly

RDF/XML (.rdf)

XML format, legacy support

๐Ÿ”— Useful Resources

๐Ÿ› ๏ธ RDF Playground

Validate and visualize RDF

๐Ÿ” Wikidata Query

Query real RDF with SPARQL

๐Ÿ”„ EasyRDF Converter

Convert between formats

๐Ÿ“‹ JSON-LD Playground

Test JSON-LD documents