Graph data formats: common RDF vocabularies
Jakub Klímek
This work is licensed under a Creative Commons Attribution 4.0 International License.
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
RDF model: classes
3
my:Person
my:staff/85740
rdf:type
Resource
Resource
Class
Dublin Core
4
Need for standardization
5
Name
Label
Title
1995: OCLC/NCSA Metadata Workshop
6
1995: OCLC/NCSA Metadata Workshop
7
Dublin�Core metadata
1995: Dublin Core metadata
8
dcterms: DCMI Metadata Terms
Dublin Core Metadata Initiative (DCMI)
9
Position in Linked Open Vocabularies
10
Example: dcterms:publisher
11
Term Name: publisher | |
URI | http://purl.org/dc/terms/publisher |
Label | Publisher |
Definition | An entity responsible for making the resource available. |
Type of Term | Property |
Range Includes |
|
Subproperty of |
|
dcterms: DCMI Metadata Terms
12
Properties in the /terms/ namespace: | abstract, accessRights, accrualMethod, accrualPeriodicity, accrualPolicy, alternative, audience, available, bibliographicCitation, conformsTo, contributor, coverage, created, creator, date, dateAccepted, dateCopyrighted, dateSubmitted, description, educationLevel, extent, format, hasFormat, hasPart, hasVersion, identifier, instructionalMethod, isFormatOf, isPartOf, isReferencedBy, isReplacedBy, isRequiredBy, issued, isVersionOf, language, license, mediator, medium, modified, provenance, publisher, references, relation, replaces, requires, rights, rightsHolder, source, spatial, subject, tableOfContents, temporal, title, type, valid |
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
SKOS�Simple Knowledge Organization System
14
Codelists, taxonomies
15
SKOS: Simple Knowledge Organization System
SKOS Simple Knowledge Organization System
16
skos:Concept
17
<https://example.org/resource/attraction-types/sights-and-landmarks>� a skos:Concept .
skos:ConceptScheme
<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
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
skos:altLabel
skos:hiddenLabel
19
skos:notation
<MyConcept> skos:notation "303.4833"^^<MyNotationDatatype> .
20
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
SKOS: Semantic Relations
22
A
B
C
D
SKOS: Collections
Useful if some concepts share something in common and/or can be meaningfully ordered.
<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
SKOS: Mappings
To specify mapping/alignment between schemes.
<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
GoodRelations
25
GoodRelations
26
Position in Linked Open Vocabularies
27
28
GoodRelations - the Agent-Promise-Object principle
29
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
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
GoodRelations - gr:OpeningHoursSpecification
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
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
GoodRelations – Product or Service
34
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
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
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
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
38
A more elaborate approach: QUDT, specifically, QUDT Units
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
Schema.org
41
“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.”
42
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
Schema.org - inconsistent typing conventions
Primary schema.org use case: extraction of data from web pages
Primarily based on HTML Microdata
=> 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
Wikidata
Community-built and community-managed
Unlike DBpedia, where data is scraped from Wikipedia data boxes
46
47
Wikibase / Wikidata data model
48
Wikidata = one of Wikibase instances
50
P69
51
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,
...
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 ;
...
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> .
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" .
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 .
[AUTO_LANGUAGE] - language of the UI
59
# Airports within 100km from Berlin
60
# Airports within 100km from Berlin
61