+ All Categories
Home > Documents > INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(•...

INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(•...

Date post: 29-Sep-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
48
INFO/CS 4302 Web Informa6on Systems FT 2012 Week 9 : Linked Data Technologies (RDF/S, OWL) Bernhard Haslhofer
Transcript
Page 1: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

INFO/CS  4302  Web  Informa6on  Systems  

FT  2012  Week  9  :  Linked  Data  Technologies  (RDF/S,  OWL)  

 -­‐  Bernhard  Haslhofer  -­‐    

Page 2: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Plan  for  today...  •  Linked  Data  Technologies  Overview  

•  RDF  

•  RDFS,  OWL  

•  Groupwork:  movie  data  in  RDF  

•  Ques6ons,  Housekeeping,  ...  

2

Page 3: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

LINKED  DATA  TECHNOLOGIES  OVERVIEW  

3

Page 4: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

What  is  Linked  Data?  •  A  method  to  build  a  Web  of  Data  •  Architectural  style,  set  of  standards  

Page 5: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

5

Page 6: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

URI  

•  Name  and  iden6fy  things  (resources)  •  Dereferencable  HTTP  URIs  

http://dbpedia.org/resource/The_Shining_(film)

http://rdf.freebase.com/ns/m/04fjzv

http://data.linkedmdb.org/resource/film/2014

Page 7: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF  •  A  data  model  for  represen6ng  data  on  the  Web  •  Several  statements  (triples)  form  a  graph  

http://dbpedia.org/resource/The_Shining_(film)

The Shining (film)

rdfs:label

闪灵 (电影)

rdfs:label

http://dbpedia.org/ontology/Film

rdf:type

http://dbpedia.org/resource/Jack_Nicholsondbpprop:starring

http://xmlns.com/foaf/0.1/Person

rdf:type

1937-04-22 Jack Nicholson

dbpedia-owl:birthDatefoaf:name

Page 8: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF/XML,  N3,  Turtle,  etc.  •  Data  formats  for  RDF  resource  representa6ons  

•  Used  to  transfer  RDF  data  between  apps  

Page 9: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDFS  

•  A  language  for  describing  the  syntax  and  seman6cs  of  vocabularies  in  a  machine-­‐understandable  way  

http://dbpedia.org/ontology/Film

http://dbpedia.org/ontology/Work

rdfs:subClassOf

Page 10: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

OWL  •  A  more  expressive  (formal)  language  for  defining  the  

syntax  and  seman6cs  of  vocabularies  •  Solves  RDFS  shortcomings  but  introduces  quite  some  

complexity  

http://dbpedia.org/ontology/starring

http://www.w3.org/2002/07/owl#ObjectProperty

http://dbpedia.org/ontology/Person

http://dbpedia.org/ontology/Work

starring

rdf:type

rdfs:range

rdfs:domain

rdfs:label

Page 11: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

SKOS  •  A  language  for  describing  controlled  vocabularies  

(taxonomies,  thesauri,  classifica6on  schemes)  

http://dbpedia.org/resource/The_Shining_(film)

http://dbpedia.org/resource/Category:1980s_horror_films

http://dbpedia.org/resource/Category:1980s_films

http://www.w3.org/2004/02/skos/core#Concept

dcterms:subject rdf:type

skos:broader

rdf:type

Page 12: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

SPARQL  

•  A  query  language  and  protocol  for  accessing  RDF  data  on  the  Web  

SELECT DISTINCT ?x!WHERE {!

!?x dcterms:subject !!<http://dbpedia.org/resource/Category:1980s_horror_films> .!

}!

Page 13: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Database  Systems  Analogy...  

Purpose   Rela;onal  Database  Management  Systems  (RDBMS)  

Linked  Data  Technologies  

Query  

Schema  Defini6on  Language  

Data  Representa6on  

Iden6fiers  

13

?

Page 14: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Database  Systems  Analogy...  

Purpose   Rela;onal  Database  Management  Systems  (RDBMS)  

Linked  Data  Technologies  

Query   SQL   SPARQL  

Schema  Defini6on  Language  

SQL  DDL   RDFS  /  OWL  

Data  Representa6on  

Rela6onal  Model  /  Tables   RDF  /  Graph  

Iden6fiers   Primary  Keys  (numeric  sequences)   URI  

14

Page 15: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF  

15

Page 16: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF    

•  Resource  Descrip6on  Framework    •  A  graph-­‐based  data  model  to  represent  data  on  the  Web  

•  Machine-­‐readability  

•  Uses  URIs  to  name  and  iden6fy  things  

16

Page 17: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF  Statements  /  Triples  

•  The  basic  structural  element  of  RDF  is  the  statement  /  triple  

17

http://dbpedia.org/resource/The_Shining_(film) 146.0dbpprop:runtime

Subject Property Value

dbpedia-owl:Filmrdf:typehttp://dbpedia.org/resource/

The_Shining_(film)

Subject Predicate Object

Page 18: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF  Statements  /  Triples  

•  RDF  triples  can  be  merged  into  a  set  of  triples,  cons6tu6ng  a  directed  graph  structure  

18

http://dbpedia.org/resource/The_Shining_(film)

146.0dbpprop:runtime

dbpedia-owl:Filmrdf:type

Page 19: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

URIs  in  RDF  

•  The  labels  of  graph  nodes  or  edges  in  these  slides  are  either    full  URIs  or  use  prefixes  

•  Example:  – dbprop:run6me  is  a  shorthand  using  the  prefix  dbprop  

– dbprop  stands  for  h`p://dbpedia.org/property  – dbprop:run6me  therefore  qualifies  to  h`p://dbpedia.org/property/run6me  

•  Both  are  equivalent  to  each  other  

19

Page 20: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF  Serializa6on  

•  RDF  can  be  serialized  using  various  syntax  formats:  – NTriples  – N3/Turtle  – RDF/XML  –  JSON-­‐LD  –  ....  

•  The  following  examples  convey  the  same  informa6on  

20

Page 21: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

21

Page 22: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

22

Page 23: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Language  Tags  

•  Literals  may  carry  language  tags  (@en,  @zh)  

23

http://dbpedia.org/resource/The_Shining_(film)

The Shining (film) @en

rdfs:label

�� (��) @zh

rdfs:label

Page 24: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Typed  Literals  

•  Literals  can  be  typed  using  arbitrary  datatypes  – XML  Schema  datatypes  – custom  datatypes  

24

http://dbpedia.org/resource/The_Shining_(film)

146^^<http://dbpedia.org/datatype/minute>dbprop:runtime

Page 25: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Other  RDF  features    

•  Blank  Nodes  à  „Non-­‐URI  nodes“  

•  Containers  à  „Grouping  of  resources“  

•  Collec6ons  à  „Linked  Lists“  

•  Reifica6on  à  „Statements  about  statements“  

25

Page 26: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDFS,  OWL  

26

Page 27: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF  Vocabulary  Descrip6on  Language  (RDFS)  

•  Extends  RDF  with  the  possibility  to  define  – classes  and  associated  – proper6es  

•  Allows  different  applica6ons  to  agree  on  common  informa6on  models  (vocabularies)  

•  RDF  Schema  is  based  on  RDF  à  every  RDF  Schema  document  is  an  RDF  document  

27

Page 28: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Classes  

28

http://dbpedia.org/resource/The_Shining_(film)

http://dbpedia.org/ontology/Film

http://www.w3.org/1999/02/22-rdf-syntax-ns#type

http://dbpedia.org/ontology/Work

http://www.w3.org/2000/01/rdf-schema#subClassOf

http://dbpedia.org/ontology/Newspaper

http://www.w3.org/2000/01/rdf-schema#subClassOf

http://www.w3.org/2000/01/rdf-schema#Class

http://www.w3.org/1999/02/22-rdf-syntax-ns#type

Page 29: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Proper6es  

29

dbprop:starring

http://www.w3.org/1999/02/22-rdf-syntax-ns#property

http://www.w3.org/1999/02/22-rdf-syntax-ns#type

http://dbpedia.org/ontology/Film

http://www.w3.org/2000/01/rdf-schema#domain

http://dbpedia.org/ontology/Person

http://www.w3.org/2000/01/rdf-schema#range

Page 30: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Other  RDFS  features  

•  rdfs:subPropertyOf:  hierarchical  proper6es  •  rdfs:comment:  human-­‐readable  comments  •  rdfs:label:  Human-­‐readable  names  for  resources  

•  rdfs:seeAlso  •  rdfs:isDefinedBy  

30

Page 31: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDFS  Shortcomings  

•  No  dis6nc6on  between  – a`ributes  –  rela6onships    

•  No  cardinality  constraints  (min,  max)  

à  OWL  tries  to  solve  RDFS  shortcomings  

31

Page 32: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Web  Ontology  Language  (OWL)  

•  A  language  designed  to  represent  rich  and  complex  knowledge  about  things  

•  Logic-­‐based  – verify  consistency  of  defined  knowledge  – make  implicit  knowledge  explicit  (inference)  – driven  by  AI  community  

•  OWL  models  can  be  exchanged  as  RDF  documents  

32

Page 33: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

OWL  Class  

33

http://dbpedia.org/resource/The_Shining_(film)

dbpedia-owl:Film

rdf:type

owl:Class

rdf:type dbpedia-owl:Work

rdfs:subClassOf

•  owl:Class:  defines  a  group  of  individuals  that  belong  together  because  of  shared  proper6es  

Page 34: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

OWL  Object  Proper6es  

•  owl:ObjectProperty:  proper6es  whose  value  is  an  individual  

34

http://dbpedia.org/ontology/starring

http://www.w3.org/2002/07/owl#ObjectProperty

http://dbpedia.org/ontology/Person

http://dbpedia.org/ontology/Work

starring

rdf:type

rdfs:range

rdfs:domain

rdfs:label

Page 35: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

OWL  Datatype  Proper6es  

•  owl:DatatypeProperty:  proper6es  whose  value  is  a  literal  

35

http://dbpedia.org/ontology/runtime

http://www.w3.org/2002/07/owl#DatatypeProperty

http://www.w3.org/2001/XMLSchema#double

http://dbpedia.org/ontology/Work

runtime (s)

rdf:type

rdfs:range

rdfs:domain

rdfs:label

διάρκεια (s)

rdfs:label

Page 36: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Equality  of  Individuals  

•  owl:sameAs:  Two  individuals  may  be  stated  to  be  the  same  – used  to  link  data  across  data  sources  – controversy  on  the  no6on  of  „sameness“  

36

http://dbpedia.org/resource/The_Shining_(film)

http://rdf.freebase.com/ns/m.04fjzvowl:sameAs

Page 37: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Class  Equivalence  

•  owl:equivalentClass:  classes  may  refer  to  the  same  set  of  individuals  – used  to  map  between  schemas/vocabularies  

37

http://dbpedia.org/ontology/Work

http://schema.org/CreativeWorkowl:equivalentClass

Page 38: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Property  Equivalence  

•  owl:equivalentProperty:  two  proper6es  may  be  stated  to  be  equivalent  – used  to  map  between  schemas/vocabularies  

38

http://dbpedia.org/ontology/runtime http://schema.org/durationowl:equivalentProperty

Page 39: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Other  OWL  Features  

•  We  scretched  OWL  just  on  the  surface  

•  More  details  at:  h`p://www.w3.org/TR/owl2-­‐primer/  

•  A  good  star6ng  point:  h`p://protege.stanford.edu/doc/owl/geing-­‐started.html  

39

Page 40: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

How  to  represent  data  in  RDF  •  Design  an  informa6on  model  expressing  –  the  resource  types  in  your  dataset  (  =  RDFS/OWL  classes)  

–  their  a`ributes  (=  RDF/OWL  proper6es)  –  the  rela6onships  between  them  (  =  proper6es)  

•  Assign  names  (URIs)  to  model  en66es,  either  by  –  reusing  exis6ng  terms  or  –  defining  new,  proprietary  terms  

•  Create  resources,  assign  names  (URIs),  describe  them  with  a`ributes,  and  connect  them  via  rela6onships    

40

Page 41: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

How  to  find  vocabulary  terms?  •  Dublin  Core  terms:    

h`p://dublincore.org/documents/dcmi-­‐terms/  •  Friend  of  a  Friend:  

h`p://xmlns.com/foaf/spec/  •  GoodRela6ons:  

h`p://www.heppnetz.de/projects/goodrela6ons/  •  Bibliographic  Ontology:  

h`p://bibliontology.com/  •  BBC  Programmes  Ontology:  

h`p://www.bbc.co.uk/ontologies/programmes/2009-­‐09-­‐07.shtml  

•  schema.org:  h`p://schema.org  

41

Page 42: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

GROUPWORK:  MOVIE  DATA  IN  RDF  

42

Page 43: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Instruc6ons  

•  Form  groups  of  3  •  Take  one  example  movie  from  the  HW  dataset  (e.g,  „The  Godfather“)  

•  Discuss  how  to  represent  this  movie,  its  a`ributes  and  rela6onships  in  RDF  

•  Draw  a  diagram  at:  h`p://bit.ly/infocs4302-­‐movie-­‐rdf  

43

Page 44: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

USEFUL  APIS  /  TOOLS  

44

Page 45: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

RDF  APIs  •  Java  

–  Jena  Seman6c  Web  Framework  (h`p://openjena.org/)  –  Sesame  RDF  API  (h`p://www.openrdf.org/)  

•  PHP  –  ARC  (h`p://arc.semsol.org/)  

•  Ruby  –  RDF.rb:  Linked  Data  for  Ruby  (h`p://rdf.rubyforge.org/)  

•  Python  –  RDFLib  (h`p://www.rdflib.net/)  

•  C  –  Redland  RDF  Libraries  (h`p://librdf.org/)  

Page 46: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Linked  Data  debugging  

using  cURL:  !curl -iH "Accept: application/rdf+xml" http://dbpedia.org/resource/The_Shining_\(film\)!!curl -LH "Accept: application/rdf+xml" http://dbpedia.org/resource/The_Shining_\(film\)!!curl -iH "Accept: text/n3" http://dbpedia.org/resource/The_Shining_\(film\)!!!

Page 47: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

Linked  Data  debugging  

47

using  raptor  (h`p://librdf.org/raptor/):  

!!!

rapper -o rdfxml http://dbpedia.org/resource/The_Shining_\(film\)!!!rapper http://dbpedia.org/resource/The_Shining_\(film\)

!> ~/Desktop/the_shining.nt!

Page 48: INFO/CS(4302( Web(Informaon(Systems - Cornell University · 2013. 2. 6. · Whatis(Linked(Data?(• A(method(to(build(a Web(of(Data • Architectural(style,(setof(standards

QUESTIONS  &  HOUSEKEEPING  

48


Recommended