1 of 61

Graph data formats: common RDF vocabularies

Jakub Klímek

2 of 61

RDF model: a triple, a statement

<http://example.com/index.html> <http://purl.org/dc/terms/creator> <http://example.com/staff/8574> .

2

http://example.com/index.html

http://example.com/staff/8574

http://purl.org/dc/terms/creator

subject (S)

predicate (P)�(property)

object (O)

Resource / Thing

Resource / Thing

3 of 61

RDF model: classes

3

my:Person

my:staff/85740

rdf:type

Resource

Resource

Class

 

4 of 61

Dublin Core

4

5 of 61

Need for standardization

5

Name

Label

Title

6 of 61

1995: OCLC/NCSA Metadata Workshop

6

7 of 61

1995: OCLC/NCSA Metadata Workshop

7

Dublin�Core metadata

8 of 61

1995: Dublin Core metadata

8

9 of 61

dcterms: DCMI Metadata Terms

Dublin Core Metadata Initiative (DCMI)

  • DCMI Metadata Terms
    • latest update: 2020-01-20
  • 2 namespaces
    • http://purl.org/dc/elements/1.1/
      • The original one
      • dc: prefix
      • Deprecated for our purposes
    • http://purl.org/dc/terms/
      • The one we use
      • dcterms: prefix

9

10 of 61

Position in Linked Open Vocabularies

10

11 of 61

Example: dcterms:publisher

11

Term Name: publisher

More details

URI

http://purl.org/dc/terms/publisher

Label

Publisher

Definition

An entity responsible for making the resource available.

Type of Term

Property

Range Includes

  • http://purl.org/dc/terms/Agent

Subproperty of

  • Publisher (http://purl.org/dc/elements/1.1/publisher)

12 of 61

dcterms: DCMI Metadata Terms

12

Properties in the /terms/ namespace:

Classes:

13 of 61

13

ex:catalog

dcat:Catalog

"my catalog"

ex:homepage

rdf:type

dcterms:title

"my first testing catalog"

dcterms:description

foaf:homepage

foaf:Page

rdf:type

14 of 61

SKOS�Simple Knowledge Organization System

14

15 of 61

Codelists, taxonomies

15

16 of 61

SKOS: Simple Knowledge Organization System

SKOS Simple Knowledge Organization System

  • W3C Recommendation
  • 18 August 2009
  • For hierarchies and collections of concepts
  • skos: http://www.w3.org/2004/02/skos/core#

16

17 of 61

skos:Concept

  • Core class of SKOS
  • Idea, notion, unit of thought

17

18 of 61

skos:ConceptScheme

  • Aggregation of one or more concepts
  • Semantic relations between the concepts
  • Roughly corresponds to
    • Individual thesaurus
    • Classification scheme
    • Subject heading system

<https://example.org/resource/attraction-types> a skos:ConceptScheme ;

skos:hasTopConcept <https://example.org/resource/attraction-types/sights-and-landmarks> .

<https://example.org/resource/attraction-types/sights-and-landmarks> a skos:Concept ;

skos:inScheme <https://example.org/resource/attraction-types> ;

skos:topConceptOf <https://example.org/resource/attraction-types> .

18

19 of 61

SKOS: Lexical Label

String in a given natural language

<MyConcept>

skos:prefLabel "animals"@en ;

skos:altLabel "fauna"@en ;

skos:hiddenLabel "aminals"@en ;

skos:prefLabel "animaux"@fr ;

skos:altLabel "faune"@fr .

skos:prefLabel

  • Human readable representation
  • one per language

skos:altLabel

  • Human readable representation
  • multiple per language, cannot be the same as prefLabel

skos:hiddenLabel

  • For example for common misspellings
  • We want to use it in search, but we do not want the users to see it

19

20 of 61

skos:notation

  • A string of characters
    • e.g."T58.5" or "303.4833"
    • uniquely identifies a concept within concept scheme
  • Not normally recognizable as a word in any natural language
    • does not have a language tag
    • can have a custom data type

<MyConcept> skos:notation "303.4833"^^<MyNotationDatatype> .

20

21 of 61

SKOS Concept Scheme example

@prefix atold: <http://publications.europa.eu/resource/authority/> .

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

<http://publications.europa.eu/resource/authority/continent/AFRICA> a skos:Concept ;

skos:inScheme atold:continent ;

skos:prefLabel "Африка"@bg ,

"Africa"@cs,

...

"Africa"@en .

<http://publications.europa.eu/resource/authority/continent/AMERICA> a skos:Concept ;

skos:inScheme atold:continent ;

skos:prefLabel "Америка"@bg,

"Amerika"@cs,

...

"America"@en .

atold:continent a skos:ConceptScheme ;

rdfs:label "Continent"@en ;

skos:prefLabel "Continent"@en .

21

22 of 61

SKOS: Semantic Relations

  • skos:semanticRelation
    • skos:related
    • skos:broaderTransitive
      • skos:broader
    • skos:narrowerTransitive
      • skos:narrower

22

A

B

C

D

23 of 61

SKOS: Collections

Useful if some concepts share something in common and/or can be meaningfully ordered.

  • skos:Collection
    • skos:member
  • skos:OrderedCollection
    • skos:memberList

<MyCollection> a skos:Collection ;

skos:member <A> , <B> , <MyNestedCollection> .

<MyNestedCollection> a skos:Collection ;

skos:member <X> , <Y> , <Z> .

<MyOrderedCollection> a skos:OrderedCollection ;

skos:memberList ( <X> <Y> <Z> ) .

23

24 of 61

SKOS: Mappings

To specify mapping/alignment between schemes.

  • skos:mappingRelation
    • skos:closeMatch (not transitive)
      • skos:exactMatch (transitive)
    • skos:relatedMatch
    • skos:broadMatch
    • skos:narrowMatch

<https://data.mvcr.gov.cz/zdroj/číselníky/pohlaví/položky/ženské> a skos:Concept;

skos:inScheme <https://data.mvcr.gov.cz/zdroj/číselníky/pohlaví>;

skos:prefLabel "Female"@en, "Ženské"@cs ;

skos:exactMatch <https://data.cssz.cz/resource/ciselniky/ciselnik-pohlavi/2/2009-01-01>,

<http://publications.europa.eu/resource/authority/human-sex/FEMALE> .

24

25 of 61

GoodRelations

25

26 of 61

GoodRelations

  • GoodRelations - The Web Vocabulary for E-Commerce
    • Author: Martin Hepp
  • Used by Google, Yahoo, BestBuy, sears.com, kmart.com
    • and 10 000 more...
  • Syntax-neutral
    • Microdata, RDFa, RDF/XML, Turtle, JSON, OData, GData, …
  • Industry-neutral
    • consumer electronics, cars, tickets, real-estate, ...
  • Different stages of the value chain
    • raw materials, after-sales services, …
  • Rich Snippet Generator

26

27 of 61

Position in Linked Open Vocabularies

27

28 of 61

28

29 of 61

GoodRelations - the Agent-Promise-Object principle

  1. Agent - gr:BusinessEntity
    1. person or organization
  2. Object or service - gr:ProductOrService
    • camcorder, house, car
    • haircut
  3. Promise (offer) - gr:Offering
    • To transfer some rights (ownership, usage, license) on the object or
    • To provide the service for a certain compensation (money)
    • Made by the agent and related to the object or service
  4. Location - gr:Location
    • From which this offer is available
      1. store, bus stop, gas station

29

30 of 61

GoodRelations - gr:BusinessEntity

foo:ACME a gr:BusinessEntity;

gr:legalName "ACME Bagel Bakery Ltd."@en;

foaf:page <http://www.example.com/>;

s:address [ a s:PostalAddress;

s:streetAddress "Bagel Street 1234";

s:postalCode "12345";

s:addressLocality "Munich, Germany" ];

s:telephone "+49-89-12345678-0";

s:faxNumber "+49-89-12345678-99";

s:email "contact@example.org".

30

31 of 61

GoodRelations - gr:Location

foo:pos a gr:Location;

gr:name "Hepp's Bagel Restaurant Munich - Bagel Street"@en;

s:address [ a s:PostalAddress;

s:streetAddress "Bagel Street 1234";

s:postalCode "12345";

s:addressLocality "Munich, Germany" ];

s:geo [ a s:GeoCoordinates ;

s:latitude 45.75;

s:longitude 49.98 ];

s:telephone "+49-89-12345678-0" .

31

32 of 61

GoodRelations - gr:OpeningHoursSpecification

  • One gr:OpeningHoursSpecification entity specifies a time interval, and links to days
  • Typically, full specification contains multiple entities

foo:restaurant a gr:Location;

gr:name "Hepp's Happy Burger Restaurant"@en;

gr:hasOpeningHoursSpecification

[ a gr:OpeningHoursSpecification;

gr:opens "08:00:00"^^xsd:time;

gr:closes "12:00:00"^^xsd:time;

gr:hasOpeningHoursDayOfWeek gr:Monday,

gr:Tuesday, gr:Wednesday, gr:Thursday,

gr:Friday ],

[ a gr:OpeningHoursSpecification;

gr:opens "13:00:00"^^xsd:time;

gr:closes "20:00:00"^^xsd:time;

gr:hasOpeningHoursDayOfWeek

gr:Friday ] .

32

33 of 61

GR - gr:Offering, gr:PriceSpecification

foo:offer a gr:Offering;

gr:name "Hepp Personal SCSI Controller Card"@en;

gr:description """The Hepp Personal SCSI is a 16-bit add-on card that allows attaching up to seven SCSI devices to your computer."""@en;

gr:hasBusinessFunction gr:Sell;

gr:condition "used";

gr:hasEAN_UCC-13 "1234567890123"^^xsd:string;

gr:hasMPN "PSCSI"^^xsd:string;

gr:hasStockKeepingUnit "123-456"^^xsd:string;

gr:hasInventoryLevel [ a gr:QuantitativeValue;

gr:hasMinValue "1"^^xsd:float ];

s:aggregateRating [ a s:AggregateRating;

s:ratingValue "4.9"^^xsd:float;

s:reviewCount 99 ];

foaf:depiction <http://example.com/images/pscsi.jpg>;

foaf:page <http://example.com/products/pscsi> .

foo:offer a gr:Offering;

gr:hasPriceSpecification [ a gr:UnitPriceSpecification;

gr:hasCurrency "USD"^^xsd:string;

gr:hasCurrencyValue "99.99"^^xsd:float;

gr:validThrough "2012-11-30T23:59:59"^^xsd:dateTime ];

33

34 of 61

GoodRelations – Product or Service

  • A real product
    • e.g. my laptop with its serial number
    • e.g. my car with its VIN and mileage
    • e.g. a particular item on eBay
    • Can be sold only once
    • gr:Individual
  • A product model
    • Nikon T90, iPod Nano 16 GB
    • Abstract definition, not a particular item
    • In GoodRelations modeled as prototype
    • In contrast to modeling as datasheet
    • gr:ProductOrServiceModel
  • Black boxes of products
    • Amazon page for a new book
      • multiple ones in stock, not list of individual ones
    • Difference: Statements about the same entity do not imply that the statements refer to the same individual product
      • some statements may be about a subset
      • some statements may be about a different subset
    • Multiple items of some type, can be sold more times
    • gr:SomeItems

34

35 of 61

GoodRelations – Product or Service

foo:myVolkswagenBeetle a <http://www.productontology.org/id/Automobile>, gr:Individual;

gr:name "1973 Volkswagen Beetle"@en;

gr:description """This car is simply unique - it has been owned by Madonna."""@en .

foo:model a gr:ProductOrServiceModel;

gr:name "ACME Colorvision 123"@en;

gr:description "The ACME Colorvision 123 is the leading-edge color TV from our company."@en;

gr:hasEAN_UCC-13 "1234567890123"^^xsd:string;

gr:width [ a gr:QuantitativeValue;

gr:hasValueFloat "102.0"^^xsd:float;

gr:hasUnitOfMeasurement "CMT"^^xsd:string ];

gr:height [ a gr:QuantitativeValue;

gr:hasValueFloat "60.0"^^xsd:float;

gr:hasUnitOfMeasurement "CMT"^^xsd:string ].

35

36 of 61

GoodRelations – Product or Service

foo:product a gr:SomeItems;

gr:name "Canon Rebel T2i (EOS 550D)"@en;

gr:description "The Rebel T2i EOS 550D is Canon's latest digital SLR camera."@en;

gr:hasEAN_UCC-13 "9781906672799"^^xsd:string;

foaf:depiction <http://www.example.com/canon_rebel_t2i.jpg>;

foaf:page <http://www.example.com/canon_rebel_t2i.html> .

36

37 of 61

GoodRelations - Linking the Data

foo:be a gr:BusinessEntity;

gr:offers foo:offer .

foo:offer a gr:Offering .

foo:offer a gr:Offering;

gr:includes foo:product .

foo:be a gr:BusinessEntity;

gr:hasPOS foo:pos .

foo:pos a gr:Location .

37

38 of 61

GoodRelations - gr:QuantitativeValue

foo:product a gr:ProductOrServiceModel;

gr:name "ACME Electric Anvil"@en;

gr:weight [ a gr:QuantitativeValue;

gr:hasUnitOfMeasurement "KGM"^^xsd:string;

gr:hasValue "50"^^xsd:float ];

foo:voltage [ a gr:QuantitativeValue;

gr:hasUnitOfMeasurement "VLT"^^xsd:string;

gr:hasMinValue "100"^^xsd:integer;

gr:hasMaxValue "220"^^xsd:integer ].

Documentation/UN/CEFACT Common Codes

  • MTR
    • m
  • MTK
  • MTQ
  • KGM
    • kg
  • 28
    • kg/m²
  • C62
    • 1 (no unit)

38

A more elaborate approach: QUDT, specifically, QUDT Units

39 of 61

GoodRelations - gr:QualitativeValue

foo:GarmentSize a rdfs:Class;

rdfs:subClassOf gr:QualitativeValue;

rdfs:label "Garment sizes (value class)"@en.

foo:M a foo:GarmentSize;

rdfs:label "M - Medium."@en;

gr:lesser foo:L.

foo:L a foo:GarmentSize;

rdfs:label "L - Large."@en;

gr:greater foo:M.

foo:size a rdf:Property ;

rdfs:subPropertyOf gr:qualitativeProductOrServiceProperty ;

rdfs:range foo:GarmentSize ;

rdfs:label "size (0..1)"@en .

foo:tshirt a gr:SomeItems;

gr:name "Blue T-Shirt (Size M)"@en;

gr:color "blue"@en;

foo:size foo:M.

39

40 of 61

40

41 of 61

Schema.org

41

42 of 61

“Schema.org is a collaborative, community activity with a mission to create, maintain, and promote schemas for structured data on the Internet, on web pages, in email messages, and beyond.”

  • Founded by Google, Microsoft, Yahoo and Yandex
  • Integrates existing vocabularies, creates new terms
    • foaf, GoodRelations, DCAT ...
  • Maintained on GitHub
  • 811 types, 1484 properties, 495 enumeration values (2024)

42

43 of 61

Schema.org & GoodRelations 2012 approach

<#model> a schema:Product ;

schema:name "ACME Electric Anvil" ;

schema:feature [ a schema:ProductFeature ;

schema:propertyName "Power supply" ;

schema:propertyValue "110-220" ;

schema:unitText "Volts" ] ;

schema:feature [ a schema:ProductFeature ;

schema:propertyName "Weight" ;

schema:propertyValue "2.25" ;

schema:unitText "kg" ] ;

schema:feature [ a schema:ProductFeature ;

schema:propertyName "Safety belt" ;

schema:propertyValue "yes" ] .

43

44 of 61

Schema.org - inconsistent typing conventions

Primary schema.org use case: extraction of data from web pages

Primarily based on HTML Microdata

  • then RDFa
  • eventually JSON-LD

=> use rdf:langString (language tags) and proven XML Schema datatypes

# xsd:string

<#model> a schema:Product ;

schema:name "ACME Electric Anvil" .

# rdf:langString

<#model> a schema:Product ;

schema:name "ACME Electric Anvil"@en .

# schema:Text

<#model> a schema:Product ;

schema:name "ACME Electric Anvil"^^schema:Text .

44

45 of 61

Wikidata

46 of 61

Free encyclopedic database

  • Like Wikipedia, but for facts, not documents
  • Queryable via SPARQL endpoint

Community-built and community-managed

  • Anyone can contribute
  • Anyone can edit anything

Unlike DBpedia, where data is scraped from Wikipedia data boxes

  • Queryable via SPARQL endpoint

46

47 of 61

47

48 of 61

Wikibase / Wikidata data model

48

49 of 61

Wikidata = one of Wikibase instances

50 of 61

50

P69

51 of 61

51

52 of 61

53 of 61

Wikidata RDF data model - QID, labels, descriptions, aliases

53

@prefix wd: <http://www.wikidata.org/entity/> .

@prefix wikibase: <http://wikiba.se/ontology#> .

wd:Q42 a wikibase:Item .

wd:Q42 rdfs:label "Douglas Adams"@en ;

skos:prefLabel "Douglas Adams"@en ;

schema:name "Douglas Adams"@en ;

schema:name "ダグラス・アダムズ"@ja ;

schema:name "ഡഗ്ലസ് ആഡംസ്"@ml ;

...

skos:altLabel "Douglas Noel Adams"@en ;

...

schema:description "English writer and humorist"@en,

...

54 of 61

Wikidata RDF data model - truthy values

54

@prefix wd: <http://www.wikidata.org/entity/> .

@prefix wikibase: <http://wikiba.se/ontology#> .

wd:Q42 a wikibase:Item .

wd:Q42 rdfs:label "Douglas Adams"@en ;

# P569 - date of birth

wdt:P569 "1952-03-11T00:00:00Z"^^xsd:dateTime ;

...

55 of 61

Wikidata RDF data model - statements

55

@prefix wd: <http://www.wikidata.org/entity/> .

@prefix wikibase: <http://wikiba.se/ontology#> .

wd:Q42 a wikibase:Item .

wd:Q42 rdfs:label "Douglas Adams"@en ;

# P569 - date of birth

p:P569 s:q42-D8404CDA-25E4-4334-AF13-A3290BCD9C0F .

s:q42-D8404CDA-25E4-4334-AF13-A3290BCD9C0F a wikibase:Statement,

wikibase:BestRank ;

wikibase:rank wikibase:NormalRank ;

ps:P569 "1952-03-11T00:00:00Z"^^xsd:dateTime ;

psv:P569 v:426df9023763f08b066f4478480f44cd .

v:426df9023763f08b066f4478480f44cd a wikibase:TimeValue ;

wikibase:timeValue "1952-03-11T00:00:00Z"^^xsd:dateTime ;

wikibase:timePrecision "11"^^xsd:integer ;

wikibase:timeTimezone "0"^^xsd:integer ;

wikibase:timeCalendarModel <http://www.wikidata.org/entity/Q1985727> .

56 of 61

Wikidata RDF data model - references

56

@prefix wd: <http://www.wikidata.org/entity/> .

@prefix wikibase: <http://wikiba.se/ontology#> .

wd:Q42 a wikibase:Item .

wd:Q42 rdfs:label "Douglas Adams"@en ;

# P569 - date of birth

p:P569 s:q42-D8404CDA-25E4-4334-AF13-A3290BCD9C0F .

s:q42-D8404CDA-25E4-4334-AF13-A3290BCD9C0F a wikibase:Statement,

wikibase:BestRank ;

wikibase:rank wikibase:NormalRank ;

ps:P569 "1952-03-11T00:00:00Z"^^xsd:dateTime ;

psv:P569 v:426df9023763f08b066f4478480f44cd ;

prov:wasDerivedFrom ref:355b56329b78db22be549dec34f2570ca61ca056,

...

ref:a3feaf25fa95c4893bc1dc74ca6d884bc37c2723 .

ref:a3feaf25fa95c4893bc1dc74ca6d884bc37c2723 a wikibase:Reference ;

#P248 - stated in

pr:P248 wd:Q2877812 ;

#P3630 - Babelio author ID

pr:P3630 "2627" ;

#P1810 - named as

pr:P1810 "Douglas Adams" .

57 of 61

Wikidata RDF data model - qualifiers

57

@prefix wd: <http://www.wikidata.org/entity/> .

@prefix wikibase: <http://wikiba.se/ontology#> .

wd:Q42 a wikibase:Item .

wd:Q42 rdfs:label "Douglas Adams"@en ;

#P3373 - sibling

#Q14623673 - Susan Adams

wdt:P3373 wd:Q14623673 ;

wd:Q42 p:P3373 s:Q42-A3B1288B-67A9-4491-A3AA-20F881C292B9 .

s:Q42-A3B1288B-67A9-4491-A3AA-20F881C292B9 a wikibase:Statement,

wikibase:BestRank ;

wikibase:rank wikibase:NormalRank ;

ps:P3373 wd:Q14623673 ;

#P1039 - kinship to subject

#Q10943095 - younger sister

pq:P1039 wd:Q10943095 ;

prov:wasDerivedFrom ref:6a3634133c828f5c3cba3f33d033c4d2ae67f5ec .

58 of 61

[AUTO_LANGUAGE] - language of the UI

59 of 61

59

60 of 61

# Airports within 100km from Berlin

60

61 of 61

# Airports within 100km from Berlin

61