Borrowed Vocabularies: foaf, xsd, owl, rdfs

Reuse what the Web already named so your graphs talk to other graphs.

0/3 done

Theory

Your : prefix is yours:Alice, :Ninja, :teaches. But you shouldn't reinvent words like name or date — the Web already has well-known vocabularies for them, and using them makes your data interoperable. Here are the four you'll see throughout Level 1:

PrefixStands forUsed for
foaf:Friend Of A Friend — vocabulary about peoplefoaf:name, foaf:knows, foaf:Person
xsd:XML Schema Datatypes — standard datatypesxsd:string, xsd:integer, xsd:date
rdfs:RDF Schema — class & property hierarchies (Level 3)rdfs:subClassOf, rdfs:label
owl:Web Ontology Language — richer semantics (Level 4)owl:Class, owl:sameAs

You don't need to memorise every term — just know that whenever you see foaf:name or xsd:date it's a borrowed word with a known meaning.

Analogy

Imagine writing a recipe in English but using French for sauté, Italian for al dente and Japanese for umami. You borrow each language for the word it does best. Vocabularies in RDF work the same way: foaf: is the language of people, xsd: is the language of datatypes, rdfs:/owl: are the languages of structure.

And just like multilingual recipes can be read worldwide, graphs built from shared vocabularies can be understood by tools and people who have never seen your data — because they already speak foaf: and xsd:.

Worked example you can copy

Worked example — the exact pattern Level 1 will ask you to write.

Say we want to record that Alice has the name "Alice Smith" (a string) and was born on 1990-04-12 (a date). Reading right-to-left through each value tells you exactly which vocabulary you need:

:Alice  foaf:name   "Alice Smith" ;
        :birthDate  "1990-04-12"^^xsd:date .

Annotated:

  • :Aliceour entity in our namespace.
  • foaf:name — borrowed predicate from FOAF; everyone in the Web of Data knows it means the name of a person.
  • "Alice Smith" — a plain string literal (no datatype written → defaults to xsd:string).
  • ; — same subject (:Alice), new predicate.
  • :birthDate — our own predicate, in our : namespace.
  • "1990-04-12"^^xsd:date — a typed literal. The ^^ operator says this string should be interpreted as an xsd:date. Numeric literals like 42 are typed xsd:integer automatically; dates need the explicit tag.
  • . — end of statement.

Bookmark this snippet — you'll write something very similar in the next lesson of Level 1.

Reading in progress · 0 of 3 activities done