CSE 428 Semantic Web Topics RDF

8
CSE 428 Semantic Web Topics RDF Jeff Heflin Lehigh University

description

CSE 428 Semantic Web Topics RDF. Jeff Heflin Lehigh University. Turtle vs. RDF/XML. Turtle: - PowerPoint PPT Presentation

Transcript of CSE 428 Semantic Web Topics RDF

Page 1: CSE 428 Semantic Web Topics RDF

CSE 428Semantic Web TopicsRDF

Jeff Heflin

Lehigh University

Page 2: CSE 428 Semantic Web Topics RDF

Turtle vs. RDF/XML

Turtle:@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .@prefix foaf: <http://xmlns.com/foaf/0.1/> .<http://www.yahoo.com/~jdoe#jane> foaf:name "Jane Doe" ; foaf:knows http://www.yahoo.com/~jsmith#john .

RDF/XML:<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/"> <rdf:Description rdf:about="http://www.yahoo.com/~jdoe#jane"> <foaf:knows rdf:resource="http://www.yahoo.com/~jsmith#john" />

<foaf:name>Jane Doe</foaf:name> </rdf:Description>

</rdf:RDF>

Page 3: CSE 428 Semantic Web Topics RDF

Default Namespaces

<rdf:RDF xmlns="http://xmlns.com/foaf/0.1/"xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<rdf:Description rdf:about="http://www.yahoo.com/~jdoe#jane"> <knows rdf:resource="http://www.yahoo.com/~jsmith#john" /> <name>Jane Doe</name> </rdf:Description>

</rdf:RDF>

Page 4: CSE 428 Semantic Web Topics RDF

Using XML Entities

<!DOCTYPE rdf:RDF [<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">] >

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:foaf="http://xmlns.com/foaf/0.1/" >

<rdf:Description rdf:about="http://www.aol.com/~jdoe"> <foaf:age rdf:datatype="&xsd;integer">30</foaf:age>

</rdf:Description> </rdf:RDF>

Resolves to:http://www.w3.org/2001/XMLSchema#integer

Page 5: CSE 428 Semantic Web Topics RDF

Nesting Descriptions

<rdf:RDF xmlns="http://xmlns.com/foaf/0.1/"xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<rdf:Description rdf:about="http://www.aol.com/~jdoe"> <foaf:name>Jane Doe</foaf:name><foaf:knows><rdf:Description rdf:about="http://www.aol.com/~jsmith"> <foaf:name>John Smith</foaf:name>

</rdf:Description> </foaf:knows>

</rdf:Description></rdf:RDF>

Page 6: CSE 428 Semantic Web Topics RDF

Typed Nodes in RDF/XML

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:foaf="http://xmlns.com/foaf/0.1/">

<rdf:Description rdf:about="http://www.yahoo.com/~jdoe#jane"><rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person" /> <foaf::name>Jane Doe</foaf:name>

</rdf:Description> </rdf:RDF> Jane is an instance of Person

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:foaf="http://xmlns.com/foaf/0.1/">

<foaf:Person rdf:about="http://www.yahoo.com/~jdoe#jane"><foaf::name>Jane Doe</foaf:name>

</foaf:Person> </rdf:RDF>

Shorthand for the same thing

Page 7: CSE 428 Semantic Web Topics RDF

RDFa

<html xmlns="http://www.w3.org/1999/xhtml" prefix="bibo: http://purl.org/ontology/bibo/ dc: http://purl.org/dc/terms/" > <head> <title>Books by Marco Pierre White</title> </head> <body> I think White's book '<span about="urn:ISBN:0091808189" typeof="bibo:Book" property="dc:title">Canteen Cuisine</span>' is well worth getting since although it's quite advanced stuff, he makes it pretty easy to follow. You might also like <span about="urn:ISBN:1596913614" typeof="bibo:Book" property="dc:description" >White's autobiography</span>. </body></html>

Declare namespace prefixes

This item is of type Book, and has title “Canteen Cuisine”

This item is of type Book, and has description “White’s autobiography”

Example from http://www.w3.org/TR/rdfa-syntax/

Page 8: CSE 428 Semantic Web Topics RDF

RDF Schema Example

<rdf:RDF xml:base="http://example.org/univ-ont#"xmlns:rdf="http://www.w3.org/1999/02/22-rdf-

syntax-ns#"xmlns:rdfs="http://www.w3.org/2000/01/rdf-

schema#" xmlns:univ="http://example.org/univ-ont#">

<rdf:Property rdf:about="#teaches"><rdfs:domain rdf:resource="#Professor" /><rdfs:range rdf:resource="#Course" />

</rdf:Property><univ:Person rdf:about="#heflin" >

<univ:teaches rdf:resource="#cse428" />

</univ:Person></rdf:RDF>

teaches

Course

Professor

heflin cse428

rdf:Property

teaches

rdf:type

rdfs:domain

rdfs:range