SlideShare une entreprise Scribd logo
1  sur  93
RDF
Pedro Szekely
University of Southern California/ISI
Semantic Web Layer Cake
slide by Pedro Szekely
Unicode
slide by Pedro Szekely
Why Unicode?
http://site.com/Μία_Σελίδα
http://site.com/Македонски.html
http://www.中国政府.政务.cn
slide by Pedro Szekely
Unicode is a computing industry standard for
the consistent encoding, representation and
handling of text expressed in most of the
world's writing systems.
… the latest version of Unicode consists of a
repertoire of more than 110,000 characters
covering 100 scripts
Unicode
Wikipedia
slide by Pedro Szekely
URI
slide by Pedro Szekely
URL: Uniform Resource Locator
A reference to an Internet resource
Web Server
URL
Document
(Resource)
slide by Pedro Szekely
URL vs URI
URI
URL URN
nameslocators
like a person's namelike person's street address
item's identitymethod for finding it
slide by Pedro Szekely
Can USC Have a URI?
slide by Pedro Szekely
Can USC Have a URI?
http://dbpedia.org/page/University_of_Southern_California
slide by Pedro Szekely
Things can have URIs
Can the Pythagoras Theorem
Have a URI?
slide by Pedro Szekely
Can the Pythagoras Theorem
Have a URI?
http://www.freebase.com/view/en/pythagorean_theorem
slide by Pedro Szekely
Ideas can have URIs
My Dog: Can He Have a URI?
slide by Pedro Szekely
My Dog: Can He Have a URI?
http://szekelys.com/diego
slide by Pedro Szekely
It does not have to be “important” to have a URI
Namespaces
slide by Pedro Szekely
Are These the Same?
<http://amazon.com/store/Bookstore>
<http://amazon.com/store/Book>
<http://amazon.com/store/Author>John Doe</http://amazon.com/store/Author>
<http://amazon.com/store/Title>Introduction to XML</http://amazon.com/store/Title>
<http://amazon.com/store/Publisher>XYZ</http://amazon.com/store/Publisher>
</http://amazon.com/store/Book>
</http://amazon.com/store/Bookstore>
<http://barnesandnoble.com/store/Bookstore>
<http://barnesandnoble.com/store/Book>
<http://barnesandnoble.com/store/Author>John Doe</http://barnesandnoble.com/store/Author>
<http://barnesandnoble.com/store/Title>Introduction to XML</http://barnesandnoble.com/store/Title>
<http://barnesandnoble.com/store/Publisher>XYZ</http://barnesandnoble.com/store/Publisher>
</http://barnesandnoble.com/store/Book>
</http://barnesandnoble.com/store/Bookstore>
<Bookstore>
<Book>
<Author>John Doe</Author>
<Title>Introduction to XML</Title>
<Publisher>XYZ</Publisher>
</Book>
</Bookstore>
slide by Pedro Szekely
Namespaces
XML namespaces are used for
providing uniquely named elements
and attributes in an XML document
xmlns="http://amazon.com/store"
Wikipedia
slide by Pedro Szekely
Using a Namespace Declaration
<http://amazon.com/store/Bookstore>
<http://amazon.com/store/Book>
<http://amazon.com/store/Author>John Doe</http://amazon.com/store/Author>
<http://amazon.com/store/Title>Introduction to XML</http://amazon.com/store/Title>
<http://amazon.com/store/Publisher>XYZ</http://amazon.com/store/Publisher>
</http://amazon.com/store/Book>
</http://amazon.com/store/Bookstore>
<Bookstore xmlns=“http://amazon.com/store”>
<Book>
<Author>John Doe</Author>
<http://amazon.com/store/Title>Introduction to XML</Title>
<http://amazon.com/store/Publisher>XYZ</Publisher>
</Book>
</Bookstore>
=
slide by Pedro Szekely
Default and Prefix Namespaces
<http://amazon.com/store/Bookstore>
<http://amazon.com/store/Book>
<http://amazon.com/store/Author>John Doe</http://amazon.com/store/Author>
<http://amazon.com/store/Title>Introduction to XML</http://amazon.com/store/Title>
<http://amazon.com/store/Publisher>XYZ</http://amazon.com/store/Publisher>
</http://amazon.com/store/Book>
</http://amazon.com/store/Bookstore>
<Bookstore xmlns=“http://amazon.com/store”>
<Book>
<Author>John Doe</Author>
<Title>Introduction to XML</Title>
<Publisher>XYZ</Publisher>
</Book>
</Bookstore>
=
<am:Bookstore xmlns:am=“http://amazon.com/store”>
<am:Book>
<am:Author>John Doe</am:Author>
<am:Title>Introduction to XML</am:Title>
<am:Publisher>XYZ</am:Publisher>
</am:Book>
</am:Bookstore>
=
slide by Pedro Szekely
Default and Prefix Namespaces
<am:Bookstore
xmlns:am=“http://amazon.com/store”
xmlns:bn=http://barnesandnoble.com/store>
<am:Book>
<am:Author>John Doe</am:Author>
<bn:Author>Jane Doe</bn:Author>
<am:Title>Introduction to XML</am:Title>
<am:Publisher>XYZ</am:Publisher>
</am:Book>
</am:Bookstore>
If elements were defined within a global scope,
it would be a problem to
combine elements from multiple documents
slide by Pedro Szekely
XML
slide by Pedro Szekely
eXtensible Markup Language
<h2>Nonmonotonic Reasoning</h2>
<i>by <b>V. Marek</b> and <b>M. Truszczynski</b></i><br>
Springer 1993<br>
ISBN 0387976892
<book>
<title>Nonmonotonic Reasoning</title>
<author>V. Marek</author>
<author>M. Truszczynski</author>
<publisher>Springer</publisher>
<year>1993</year>
<ISBN>0387976892</ISBN>
</book>
HTML specifies how to display data
XML specifies data
extensible
set of tags
fixed
set of tags
slide by Pedro Szekely
Merging Problem in XML
<Bookstore xmlns=“http://amazon.com”>
<Book id=“1”>
<Author>John</Author>
<Title>Introduction to XML</Title>
<Publisher>ACM</Publisher>
</Book>
<Book id=“2”>
<Author>Susan</Author>
<Title>Advanced</Title>
<Publisher>Springer</Publisher>
</Book>
</Bookstore>
<Bookstore xmlns=“http://amazon.com”>
<Book id=“1”>
<Author>John</Author>
<Title>Introduction to XML</Title>
</Book>
<Book id=“2”>
<Author>Susan</Author>
<Title>Advanced</Title>
</Book>
</Bookstore>
<Bookstore xmlns=“http://amazon.com”>
<Book id=“2”>
<Publisher>Springer</Publisher>
</Book>
<Book id=“1”>
<Publisher>ACM</Publisher>
</Book>
</Bookstore>
… is difficult
Document 1
Document 2
Merged Document
slide by Pedro Szekely
Does XML Represent Meaning?
<course name=“CS101”>
<instructor> John </instructor>
<course>
<instructor name=“John”>
<teaches>CS 101</teaches>
<instructor>
John is an instructor for CS101
Opposite nesting, same information!
based on slide from Jose Luis Ambite
Does XML Represent Meaning?
<course name=“CS101”>
<instructor> John </instructor>
<course>
<instructor name=“John”>
<teaches>CS 101</teaches>
<instructor>
John is an instructor for CS101
hasInstructor inverseOf teaches
C,I hasInstructor(C,I) teaches(I,C)
range(hasInstructor) = Person
C,I hasInstructor(C,I) Peson(I)
based on slide from Jose Luis Ambite
Meaning of Data in XML?
…
<Book>
<Author>John</Author>
<Title>Introduction to XML</Title>
<Publisher>ACM</Publisher>
<Country>USA</Country>
</Book>
…
What is the meaning of Country?
… where the book is sold?
… where it is published?
… where the author lives?
… ???
slide by Pedro Szekely
XML Schema
The purpose of a schema is to
define a class of XML documents, and so the term
"instance document" is often used to
describe an XML document
that conforms to a particular schema
http://www.w3.org/TR/xmlschema-0/
a syntax checker
slide by Pedro Szekely
Example
<xsd:complexType name="USAddress" >
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:decimal"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
</xsd:complexType>
Defining the USAddress Type
… must have specific elements
… in a specific order
… filled with specific types of data
slide by Pedro Szekely
XML Schema Primitive Types
string
boolean
decimal
float
double
duration
dateTime
time
date
gYearMonth
gYear
gMonthDay
gDay
gMonth
hexBinary
base64Binary
anyURI
Qname
NOTATION
useful in RDF
slide by Pedro Szekely
Resource
Description
Framework
slide by Pedro Szekely
The Resource Description Framework (RDF)
is a language for
representing information about resources
in the World Wide Web
http://www.w3.org/TR/rdf-primer/
slide by Pedro Szekely
Intended for representing metadata about Web
resources, such as the title, author, and modification date
of a Web document
… also be used to represent information about
things that can be identified on the Web,
even when they cannot be directly retrieved on the Web
examples include information about items available from on-line
shopping facilities (e.g., prices and availability)
Resource Description Framework
slide by Pedro Szekely
Represent Resources Using URIs
http://szekelys.com/family#pedro
“Pedro”
http://xmlns.com/foaf/0.1/firstName
That guy has first name “Pedro”
slide by Pedro Szekely
Represent Information as Triples
http://szekelys.com/family#pedro “Pedro”
http://xmlns.com/foaf/0.1/firstName
Subject
Predicate
Object
The resource being described
A property of the resource
The value of the property
slide by Pedro Szekely
Use Namespaces
http://szekelys.com/family#pedro
“Pedro”
foaf:firstName
http://szekelys.com/family#pedro
“Pedro”
http://xmlns.com/foaf/0.1/firstName
slide by Pedro Szekely
RDF Graphs
http://szekelys.com/family#pedro
“Pedro”
foaf:firstName
foaf:Person
rdf:type
http://isi.edu/~szekely
foaf:homepage
slide by Pedro Szekely
RDF Graphs
http://szekelys.com/family#pedro
“Pedro”
foaf:firstName
foaf:Person
rdf:type
http://isi.edu/~szekely
foaf:homepage
slide by Pedro Szekely
Mix Vocabularies
http://szekelys.com/family#pedro
“Pedro”
foaf:firstName
foaf:Person
rdf:type
http://isi.edu/~szekely
foaf:homepage
schema:Person
rdf:type
http://szekelys.com/family#claudia
schema:spouse
slide by Pedro Szekely
Why Use URIs?
 URIs look cool
slide by Pedro Szekely
Why Use URIs?
 URIs look cool
 Precisely identify resources
 Avoid confusion among different “Jose Lopez”
 Precisely identify properties
 E.g., name of a company or name of a person
 Provide information about properties
 Look them up on the web
slide by Pedro Szekely
XML vs RDF
<course name=“CS101”>
<instructor> John </instructor>
<course>
<instructor name=“John”>
<teaches>CS 101</teaches>
<instructor>
John is an instructor for CS101
usc-people:prof-01
“John”
ex:isTeacherOf
usc-course:cs-101
ex:hasInstructor
foaf:name
“CSC-101”
ex:name
XML
RDF
slide by Pedro Szekely
RDF Syntaxes
Leverages XML tools
Hard for humans to read
XML
N3, Turtle
N-Triples
Terse RDF Triple Language
Human readable format
Works with software too
Subset of turtle, supports streaming
Standard for large RDF dumps
RDFa
Allows embedding RDF in HTML pages
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
Pedro’s homepage is "http://isi.edu/~szekely"
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
It’s an XML document
Pedro’s homepage is "http://isi.edu/~szekely"
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
Here comes some RDF
Pedro’s homepage is "http://isi.edu/~szekely"
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
Namespace declarations
Pedro’s homepage is "http://isi.edu/~szekely"
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
Subject
Pedro’s homepage is "http://isi.edu/~szekely"
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
Predicate
Pedro’s homepage is "http://isi.edu/~szekely"
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
Value
Pedro’s homepage is "http://isi.edu/~szekely"
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
Value
Pedro’s homepage is "http://isi.edu/~szekely"
Subject Predicate
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</rdf:Description>
</rdf:RDF>
http://szekelys.com/family#pedro foaf:firstName
“Pedro”
slide by Pedro Szekely
XML Syntax
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</foaf:Person>
</rdf:RDF>
http://szekelys.com/family#pedro
foaf:Person
foaf:firstName
“Pedro”rdf:type
slide by Pedro Szekely
<?xml version="1.0"?>
<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://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</foaf:Person>
</rdf:RDF>
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf=…
xmlns:foaf=…
<foaf:Person rdf:about=
"http://szekelys.com/family#pedro">
<foaf:firstName>Pedro</foaf:firstName>
</foaf:Person>
</rdf:RDF>
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf=…
xmlns:foaf=…
<foaf:Person rdf:about=
"http://szekelys.com/family#pedro">
<foaf:homepage rdf:resource="http://isi.edu/~szekely"/>
</foaf:Person>
</rdf:RDF>
+
slide by Pedro Szekely
RDF Syntaxes
Leverages XML tools
Hard for humans to read
XML
N3, Turtle
N-Triples
Terse RDF Triple Language
Human readable format
Works with software too
Subset of turtle, supports streaming
Standard for large RDF dumps
RDFa
Allows embedding RDF in HTML pages
slide by Pedro Szekely
N3 and Turtle Syntaxes
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://szekelys.com/family#pedro> foaf:firstName “Pedro” .
<http://szekelys.com/family#pedro> rdf:type foafPerson .
http://szekelys.com/family#pedro
foaf:Person
foaf:firstName
“Pedro”rdf:type
Each triple ends with a dot
slide by Pedro Szekely
More Complex Structures
“USC/ISI’s address is
4676 Admiralty Way, Marina del Rey, CA 90292”
usc:isi
schema:address
“4676 Admiralty Way, Marina del Rey, CA 90292”
.
English
RDF
In what city is USC/ISI located?
Find all universities in California
slide by Pedro Szekely
“USC/ISI’s address is
4676 Admiralty Way, Marina del Rey, CA 90292”
usc:isi
schema:address
“4676 Admiralty Way, Marina del Rey, CA 90292”
.
English
RDF
How to represent nested structures?
slide by Pedro Szekely
“USA”
usc:isi
schema:addressCountry
schema:address
“CA”
“Marina del Rey”
“90292”
“4676 Admiralty Way” schema:addressLocality
schema:postalCode
schema:addressRegion
schema:streetAddress
Represents the
address of USC/ISI
slide by Pedro Szekely
“USC/ISI’s address is
4676 Admiralty Way, Marina del Rey, CA 90292”
usc:isi schema:address usc:isi-address .
usc:isi-address
schema:addressCountry “USA” ;
schema:addressRegion “CA”
schema:addressLocality “Marina del Rey” ;
schema:postalCode “90292” ;
schema:streetAddress “4676 Admiralty Way” .
English
RDF
slide by Pedro Szekely
usc:isi schema:address usc:isi-address .
usc:isi-address
schema:addressCountry “USA” ;
schema:addressRegion “CA”
schema:addressLocality “Marina del Rey” ;
schema:postalCode “90292” ;
schema:streetAddress “4676 Admiralty Way” .
We minted a URI for USC/ISI’s address
… but sometimes we don’t want to mint URIs
slide by Pedro Szekely
usc:isi schema:address _:isi-address .
_:isi-address
schema:addressCountry “USA” ;
schema:addressRegion “CA”
schema:addressLocality “Marina del Rey” ;
schema:postalCode “90292” ;
schema:streetAddress “4676 Admiralty Way” .
Blank node
Blank Nodes
prefix is “_”
… can be improved …
slide by Pedro Szekely
What If I Don’t Know the URI?
“Pedro Szekely lives in Los Angeles”
English
_:pedro
foaf:firstName “Pedro” ;
foaf:lastName “Szekely” ;
foaf:mbox “szekely1401@gmail.com” ;
schema:addressLocality “Los Angeles” .
RDF
Blank node
… is this useful? … maybe
slide by Pedro Szekely
Typed Literals
gn:bogota weather:event [
weather:temperature “10” ;
weather:date ”18 June 2012”
] .
… what is the meaning of the strings?
… how do I specify numbers?
… how about dates?
… how do I specify 10 degrees centigrade?
Compact blank
node syntax
slide by Pedro Szekely
Typed Literals
gn:bogota weather:event [
weather:temperature “10”
^^<http://www.w3.org/2001/XMLSchema#integer> ;
weather:date ”18 June 2012” ;
] .
URI specifies the type
slide by Pedro Szekely
Typed Literals
gn:bogota weather:event [
weather:temperature “10”
^^<http://www.w3.org/2001/XMLSchema#integer> ;
weather:date ”18 June 2012” ;
weather:date ”2012-06-18” ^^xsd:date ;
] .
… No set of predefined types defined in RDF
… Software that consumes RDF must process types
… XSD types commonly used
URI from the XML Schema
namespace are popular
slide by Pedro Szekely
Containers and Collections
Bag, Sequence, Alternative
<…> “…”
rdf:Bag
<…>
<…>rdf:_1
rdf:_2
rdf:_n
rdf:Seq rdf:Alt
rdf:type
Elements, can be URI
or literal
Container, often a blank node
Kinds of containers
Properties for storing
elements in containersslide by Pedro Szekely
Bag Example
exstaff:Sue exterms:publication _:z .
_:z rdf:type rdf:Bag .
_:z rdf:_1 ex:AnthologyOfTime .
_:z rdf:_2 ex:ZoologicalReasoning .
_:z rdf:_3 ex:GravitationalReflections .
“Three papers that Sue published”
slide by Pedro Szekely
What’s the Difference?
exstaff:Sue exterms:publication _:z .
_:z rdf:type rdf:Bag .
_:z rdf:_1 ex:AnthologyOfTime .
_:z rdf:_2 ex:ZoologicalReasoning .
_:z rdf:_3 ex:GravitationalReflections .
exstaff:Sue exterms:publication ex:AnthologyOfTime .
exstaff:Sue exterms:publication ex:ZoologicalReasoning .
exstaff:Sue exterms:publication ex:GravitationalReflections .
slide by Pedro Szekely
Containers vs Collections
Open World Closed World
Incomplete information Complete Information
There are things I don’t know If I don’t know it, it does not exist
Scales to the whole Web Does not scale
RDF philosophy
Containers Collections
open world sets closed world sets
slide by Pedro Szekely
Reification
Why Do We Need Reification?
“On June 19 2012, Claudia said that
Pedro’s email address is szekely1401@gmail.com”
English
<http://szekelys.com/family#pedro> foaf:mbox <szekely1401@gmail.com>
RDF
Correct? …………………..… No!
We need to make a statement about a statement
slide by Pedro Szekely
Reification
“On June 19 2012, Claudia said that
Pedro’s email address is szekely1401@gmail.com”
English
_:s rdf:subject <http://szekelys.com/family#pedro> .
_:s rdf:predicate foaf:mbox .
_:s rdf:object <szekely1401@gmail.com> .
_:s dcterms:date “2012-06-19”^^xsd:date .
_:s dcterms:creator <http://uniandes.edu.co/faculty#claudiaj> .
RDF
slide by Pedro Szekely
Problems With Reification
_:s rdf:subject <http://szekelys.com/family#pedro> .
_:s rdf:predicate foaf:mbox .
_:s rdf:object <szekely1401@gmail.com> .
_:s dcterms:date “2012-06-19”^^xsd:date .
_:s dcterms:creator <http://uniandes.edu.co/faculty#claudiaj> .
<http://szekelys.com/family#pedro> foaf:mbox <szekely1401@gmail.com>
RDF 1 implies RDF 2?
RDF 1
RDF 2
…..… No!
slide by Pedro Szekely
Problems With Reification
• Needs 3 times more triples
• Most software cannot reason with it
• Nice idea that does not work well!
• Don’t use it, there is a better way
_:s rdf:subject <http://szekelys.com/family#pedro> .
_:s rdf:predicate foaf:mbox .
_:s rdf:object <szekely1401@gmail.com> .
_:s dcterms:date “2012-06-19”^^xsd:date .
_:s dcterms:creator <http://uniandes.edu.co/faculty#claudiaj> .
slide by Pedro Szekely
RDF Syntax
RDF Syntaxes
Leverages XML tools
Hard for humans to read
XML
N3, Turtle
N-Triples
Terse RDF Triple Language
Human readable format
Works with software too
Subset of turtle, supports streaming
Standard for large RDF dumps
RDFa
Allows embedding RDF in HTML pages
Original, still
used, but others
becoming more
popular
slide by Pedro Szekely
Turtle Syntax
http://www.w3.org/TR/2011/WD-turtle-20110809/
Turtle URIs aka IRI
<http://example.org/path/>
<http://example.org/path/#fragment>
</path>
<#fragment>
<>
URIs are in <>
Absolute
Relative
to the
base
documen
t
slide by Pedro Szekely
Turtle Prefixes (Namespaces)
@prefix foo: <http://example.org/ns#> .
@prefix : <http://other.example.org/ns#> .
foo:bar foo: : .
:bar : foo:bar .
Expands to
Empty
prefix
http://example.org/ns#bar http://example.org/ns http://other.example.org/ns .
slide by Pedro Szekely
Turtle Literals
"a string”
"""a string""”
"""a string
with newlines
"""
Strings in “”
or write them in “””
… so you can break
them in multiple lines
slide by Pedro Szekely
Turtle Literals
"That Seventies Show"
"That Seventies Show"@en
"Cette Série des Années Soixante-dix"@fr
"Cette Série des Années Septante"@fr-be
"mylexicaldata"^^<http://example.org/my/datatype>
"""10"""^^xsd:decimal
- untyped (“London” equivalent to “London”^^xsd:string)
language tag
data type
- language tag
- data type (with a URI)
Kinds of literals:
slide by Pedro Szekely
Turtle Blank Nodes
_:me
_:a1234
[]
two blank nodes
Blank nodes
_:me foaf:firstName “Pedro” .
_:me foaf:lastName “Szekely” .
[] foaf:firstName “Pedro” .
[] foaf:lastName “Szekely” .
[ foaf:firstName “Pedro” ;
foaf:lastName “Szekely” ;
]
Examples
slide by Pedro Szekely
Turtle Base URI
</path>
<#fragment>
<>
RDF document stored at http://isi.edu/szekely/example.rdf
</path>
<#fragment>
<>
<http://isi.edu/szekely/example/path>
<http://isi.edu/szekely/example/#fragment>
<http://isi.edu/szekely/example>
slide by Pedro Szekely
Turtle Base URI
# this is a complete turtle document
# In-scope base URI is the document URI at this point
<a1> <b1> <c1> .
@base <http://example.org/ns/> .
# In-scope base URI is http://example.org/ns/ at this point
<a2> <http://example.org/ns/b2> <c2> .
@base <foo/> .
# In-scope base URI is http://example.org/ns/foo/ at this point
<a3> <b3> <c3> .
@prefix : <bar#> .
:a4 :b4 :c4 .
@prefix : <http://example.org/ns2#> .
:a5 :b5 :c5 .
<a2> is <http://example.org/ns/a2>
<a3> is <http://example.org/ns/foo/a3>
:a4 is <http://example.org/ns/foo/bar#a4>
:a5 is <http://example.org/ns2#a5>
slide by Pedro Szekely
Turtle “Type” Shortcut
http://szekelys.com/family#pedro <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> foaf:Person .
You can write:
http://szekelys.com/family#pedro rdf:type foaf:Person .
You can abbreviate it to:
http://szekelys.com/family#pedro a foaf:Person .
Or even better:
slide by Pedro Szekely
Turtle Literals Revisited
-5
0
1
10
+1
Integers:
"-5"^^xsd:integer
"10"^^<http://www.w3.org/2001/XMLSchema#integer>
Integers the hard way:
0.0
1.0
1.234567890123456789
-5.0
1.3e2
10e0
-12.5e10
Floating Point:
"1.3e2"^^xsd:double
"-5.0"^^<http://www.w3.org/2001/XMLSchema#decimal>
Floating point the hard way:
true
false
Booleans:
"true"^^xsd:boolean
Booleans the hard way:
slide by Pedro Szekely
Turtle Triple Abbreviations
:subject :predicate :object-1 .
:subject :predicate :object-2 .
:subject :predicate :object-1, :object-2 .
:subject :predicate-1 :object-1 .
:subject :predicate-2 :object-2 .
:subject
:predicate-1 :object-1 ;
:predicate-2 :object-2 .
slide by Pedro Szekely
XML to N3 Converter
http://www.mindswap.org/2002/rdfconvert/ slide by Pedro Szekely

Contenu connexe

Tendances

Resource description framework
Resource description frameworkResource description framework
Resource description frameworkhozifa1010
 
The Semantic Web #4 - RDF (1)
The Semantic Web #4 - RDF (1)The Semantic Web #4 - RDF (1)
The Semantic Web #4 - RDF (1)Myungjin Lee
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)Dan Brickley
 
Get on the Linked Data Web!
Get on the Linked Data Web!Get on the Linked Data Web!
Get on the Linked Data Web!Armin Haller
 
Microformats I: What & Why
Microformats I: What & WhyMicroformats I: What & Why
Microformats I: What & WhyRachael L Moore
 

Tendances (9)

General Introduction for Semantic Web and Linked Open Data
General Introduction for Semantic Web and Linked Open DataGeneral Introduction for Semantic Web and Linked Open Data
General Introduction for Semantic Web and Linked Open Data
 
Name That Graph !
Name That Graph !Name That Graph !
Name That Graph !
 
Resource description framework
Resource description frameworkResource description framework
Resource description framework
 
Introduction to RDF Data Model
Introduction to RDF Data ModelIntroduction to RDF Data Model
Introduction to RDF Data Model
 
The Semantic Web #4 - RDF (1)
The Semantic Web #4 - RDF (1)The Semantic Web #4 - RDF (1)
The Semantic Web #4 - RDF (1)
 
Understanding RDF: the Resource Description Framework in Context (1999)
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)
 
Get on the Linked Data Web!
Get on the Linked Data Web!Get on the Linked Data Web!
Get on the Linked Data Web!
 
Microformats I: What & Why
Microformats I: What & WhyMicroformats I: What & Why
Microformats I: What & Why
 
Introduction to RDF
Introduction to RDFIntroduction to RDF
Introduction to RDF
 

Similaire à Introduction to RDF

An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataGabriela Agustini
 
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013Fabien Gandon
 
Hack U Barcelona 2011
Hack U Barcelona 2011Hack U Barcelona 2011
Hack U Barcelona 2011Peter Mika
 
Linked Data Tutorial
Linked Data TutorialLinked Data Tutorial
Linked Data TutorialSören Auer
 
Wikipedia as source of collaboratively created Knowledge Organization Systems
Wikipedia as source of collaboratively created Knowledge Organization SystemsWikipedia as source of collaboratively created Knowledge Organization Systems
Wikipedia as source of collaboratively created Knowledge Organization SystemsJakob .
 
Linked Data and Locah, UKSG2011
Linked Data and Locah, UKSG2011 Linked Data and Locah, UKSG2011
Linked Data and Locah, UKSG2011 Jane Stevenson
 
Exploring and using the Semantic Web - SSSW09 tutorial
Exploring and using the Semantic Web - SSSW09 tutorialExploring and using the Semantic Web - SSSW09 tutorial
Exploring and using the Semantic Web - SSSW09 tutorialMathieu d'Aquin
 
Semantic Web and Linked Data for cultural heritage materials - Approaches in ...
Semantic Web and Linked Data for cultural heritage materials - Approaches in ...Semantic Web and Linked Data for cultural heritage materials - Approaches in ...
Semantic Web and Linked Data for cultural heritage materials - Approaches in ...Antoine Isaac
 
One day workshop Linked Data and Semantic Web
One day workshop Linked Data and Semantic WebOne day workshop Linked Data and Semantic Web
One day workshop Linked Data and Semantic WebVictor de Boer
 
Tutorial on Semantic Digital Libraries (WWW'2007)
Tutorial on Semantic Digital Libraries (WWW'2007)Tutorial on Semantic Digital Libraries (WWW'2007)
Tutorial on Semantic Digital Libraries (WWW'2007)Sebastian Ryszard Kruk
 
Publishing and Using Linked Data
Publishing and Using Linked DataPublishing and Using Linked Data
Publishing and Using Linked Dataostephens
 
SemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n BoltsSemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n BoltsRinke Hoekstra
 
SemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeSemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeDan Brickley
 
Publishing data on the Semantic Web
Publishing data on the Semantic WebPublishing data on the Semantic Web
Publishing data on the Semantic WebPeter Mika
 
Vocabularies as Linked Data: SENESCHAL & HeritageData.org
Vocabularies as Linked Data: SENESCHAL & HeritageData.orgVocabularies as Linked Data: SENESCHAL & HeritageData.org
Vocabularies as Linked Data: SENESCHAL & HeritageData.orgKeith.May
 
Lifting the Lid on Linked Data
Lifting the Lid on Linked DataLifting the Lid on Linked Data
Lifting the Lid on Linked DataJane Stevenson
 

Similaire à Introduction to RDF (20)

An introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked DataAn introduction to Semantic Web and Linked Data
An introduction to Semantic Web and Linked Data
 
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013W3C Tutorial on Semantic Web and Linked Data at WWW 2013
W3C Tutorial on Semantic Web and Linked Data at WWW 2013
 
Hack U Barcelona 2011
Hack U Barcelona 2011Hack U Barcelona 2011
Hack U Barcelona 2011
 
Semantic web
Semantic web Semantic web
Semantic web
 
Linked Data Tutorial
Linked Data TutorialLinked Data Tutorial
Linked Data Tutorial
 
Wikipedia as source of collaboratively created Knowledge Organization Systems
Wikipedia as source of collaboratively created Knowledge Organization SystemsWikipedia as source of collaboratively created Knowledge Organization Systems
Wikipedia as source of collaboratively created Knowledge Organization Systems
 
Linked Data and Locah, UKSG2011
Linked Data and Locah, UKSG2011 Linked Data and Locah, UKSG2011
Linked Data and Locah, UKSG2011
 
Exploring and using the Semantic Web - SSSW09 tutorial
Exploring and using the Semantic Web - SSSW09 tutorialExploring and using the Semantic Web - SSSW09 tutorial
Exploring and using the Semantic Web - SSSW09 tutorial
 
Semantic Web and Linked Data for cultural heritage materials - Approaches in ...
Semantic Web and Linked Data for cultural heritage materials - Approaches in ...Semantic Web and Linked Data for cultural heritage materials - Approaches in ...
Semantic Web and Linked Data for cultural heritage materials - Approaches in ...
 
One day workshop Linked Data and Semantic Web
One day workshop Linked Data and Semantic WebOne day workshop Linked Data and Semantic Web
One day workshop Linked Data and Semantic Web
 
Tutorial on Semantic Digital Libraries (WWW'2007)
Tutorial on Semantic Digital Libraries (WWW'2007)Tutorial on Semantic Digital Libraries (WWW'2007)
Tutorial on Semantic Digital Libraries (WWW'2007)
 
Sem webmaubeuge
Sem webmaubeugeSem webmaubeuge
Sem webmaubeuge
 
Riding the Semantic Web
Riding the Semantic WebRiding the Semantic Web
Riding the Semantic Web
 
Publishing and Using Linked Data
Publishing and Using Linked DataPublishing and Using Linked Data
Publishing and Using Linked Data
 
SemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n BoltsSemanticWeb Nuts 'n Bolts
SemanticWeb Nuts 'n Bolts
 
SemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in PracticeSemWeb Fundamentals - Info Linking & Layering in Practice
SemWeb Fundamentals - Info Linking & Layering in Practice
 
Biodiversity Informatics on the Semantic Web
Biodiversity Informatics on the Semantic WebBiodiversity Informatics on the Semantic Web
Biodiversity Informatics on the Semantic Web
 
Publishing data on the Semantic Web
Publishing data on the Semantic WebPublishing data on the Semantic Web
Publishing data on the Semantic Web
 
Vocabularies as Linked Data: SENESCHAL & HeritageData.org
Vocabularies as Linked Data: SENESCHAL & HeritageData.orgVocabularies as Linked Data: SENESCHAL & HeritageData.org
Vocabularies as Linked Data: SENESCHAL & HeritageData.org
 
Lifting the Lid on Linked Data
Lifting the Lid on Linked DataLifting the Lid on Linked Data
Lifting the Lid on Linked Data
 

Plus de Pedro Szekely

Linked Data, Cultural Heritage & the Karma Mapping Software
Linked Data, Cultural Heritage & the Karma Mapping SoftwareLinked Data, Cultural Heritage & the Karma Mapping Software
Linked Data, Cultural Heritage & the Karma Mapping SoftwarePedro Szekely
 
Linked Data and Tools
Linked Data and ToolsLinked Data and Tools
Linked Data and ToolsPedro Szekely
 
A Graph-based Approach to Learn Semantic Descriptions of Data Sources
A Graph-based Approach to Learn Semantic Descriptions of Data SourcesA Graph-based Approach to Learn Semantic Descriptions of Data Sources
A Graph-based Approach to Learn Semantic Descriptions of Data SourcesPedro Szekely
 
Connecting the Smithsonian American Art Museum to the Linked Data Cloud
Connecting the Smithsonian American Art Museum to the Linked Data CloudConnecting the Smithsonian American Art Museum to the Linked Data Cloud
Connecting the Smithsonian American Art Museum to the Linked Data CloudPedro Szekely
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQLPedro Szekely
 
Karma: Tools for Publishing Cultural Heritage Data in the Linked Open Data Cloud
Karma: Tools for Publishing Cultural Heritage Data in the Linked Open Data CloudKarma: Tools for Publishing Cultural Heritage Data in the Linked Open Data Cloud
Karma: Tools for Publishing Cultural Heritage Data in the Linked Open Data CloudPedro Szekely
 
American Art Collaborative Goals
American Art Collaborative GoalsAmerican Art Collaborative Goals
American Art Collaborative GoalsPedro Szekely
 

Plus de Pedro Szekely (7)

Linked Data, Cultural Heritage & the Karma Mapping Software
Linked Data, Cultural Heritage & the Karma Mapping SoftwareLinked Data, Cultural Heritage & the Karma Mapping Software
Linked Data, Cultural Heritage & the Karma Mapping Software
 
Linked Data and Tools
Linked Data and ToolsLinked Data and Tools
Linked Data and Tools
 
A Graph-based Approach to Learn Semantic Descriptions of Data Sources
A Graph-based Approach to Learn Semantic Descriptions of Data SourcesA Graph-based Approach to Learn Semantic Descriptions of Data Sources
A Graph-based Approach to Learn Semantic Descriptions of Data Sources
 
Connecting the Smithsonian American Art Museum to the Linked Data Cloud
Connecting the Smithsonian American Art Museum to the Linked Data CloudConnecting the Smithsonian American Art Museum to the Linked Data Cloud
Connecting the Smithsonian American Art Museum to the Linked Data Cloud
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Karma: Tools for Publishing Cultural Heritage Data in the Linked Open Data Cloud
Karma: Tools for Publishing Cultural Heritage Data in the Linked Open Data CloudKarma: Tools for Publishing Cultural Heritage Data in the Linked Open Data Cloud
Karma: Tools for Publishing Cultural Heritage Data in the Linked Open Data Cloud
 
American Art Collaborative Goals
American Art Collaborative GoalsAmerican Art Collaborative Goals
American Art Collaborative Goals
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Introduction to RDF

  • 1. RDF Pedro Szekely University of Southern California/ISI
  • 2. Semantic Web Layer Cake slide by Pedro Szekely
  • 5. Unicode is a computing industry standard for the consistent encoding, representation and handling of text expressed in most of the world's writing systems. … the latest version of Unicode consists of a repertoire of more than 110,000 characters covering 100 scripts Unicode Wikipedia slide by Pedro Szekely
  • 7. URL: Uniform Resource Locator A reference to an Internet resource Web Server URL Document (Resource) slide by Pedro Szekely
  • 8. URL vs URI URI URL URN nameslocators like a person's namelike person's street address item's identitymethod for finding it slide by Pedro Szekely
  • 9. Can USC Have a URI? slide by Pedro Szekely
  • 10. Can USC Have a URI? http://dbpedia.org/page/University_of_Southern_California slide by Pedro Szekely
  • 12. Can the Pythagoras Theorem Have a URI? slide by Pedro Szekely
  • 13. Can the Pythagoras Theorem Have a URI? http://www.freebase.com/view/en/pythagorean_theorem slide by Pedro Szekely
  • 15. My Dog: Can He Have a URI? slide by Pedro Szekely
  • 16. My Dog: Can He Have a URI? http://szekelys.com/diego slide by Pedro Szekely
  • 17. It does not have to be “important” to have a URI
  • 19. Are These the Same? <http://amazon.com/store/Bookstore> <http://amazon.com/store/Book> <http://amazon.com/store/Author>John Doe</http://amazon.com/store/Author> <http://amazon.com/store/Title>Introduction to XML</http://amazon.com/store/Title> <http://amazon.com/store/Publisher>XYZ</http://amazon.com/store/Publisher> </http://amazon.com/store/Book> </http://amazon.com/store/Bookstore> <http://barnesandnoble.com/store/Bookstore> <http://barnesandnoble.com/store/Book> <http://barnesandnoble.com/store/Author>John Doe</http://barnesandnoble.com/store/Author> <http://barnesandnoble.com/store/Title>Introduction to XML</http://barnesandnoble.com/store/Title> <http://barnesandnoble.com/store/Publisher>XYZ</http://barnesandnoble.com/store/Publisher> </http://barnesandnoble.com/store/Book> </http://barnesandnoble.com/store/Bookstore> <Bookstore> <Book> <Author>John Doe</Author> <Title>Introduction to XML</Title> <Publisher>XYZ</Publisher> </Book> </Bookstore> slide by Pedro Szekely
  • 20. Namespaces XML namespaces are used for providing uniquely named elements and attributes in an XML document xmlns="http://amazon.com/store" Wikipedia slide by Pedro Szekely
  • 21. Using a Namespace Declaration <http://amazon.com/store/Bookstore> <http://amazon.com/store/Book> <http://amazon.com/store/Author>John Doe</http://amazon.com/store/Author> <http://amazon.com/store/Title>Introduction to XML</http://amazon.com/store/Title> <http://amazon.com/store/Publisher>XYZ</http://amazon.com/store/Publisher> </http://amazon.com/store/Book> </http://amazon.com/store/Bookstore> <Bookstore xmlns=“http://amazon.com/store”> <Book> <Author>John Doe</Author> <http://amazon.com/store/Title>Introduction to XML</Title> <http://amazon.com/store/Publisher>XYZ</Publisher> </Book> </Bookstore> = slide by Pedro Szekely
  • 22. Default and Prefix Namespaces <http://amazon.com/store/Bookstore> <http://amazon.com/store/Book> <http://amazon.com/store/Author>John Doe</http://amazon.com/store/Author> <http://amazon.com/store/Title>Introduction to XML</http://amazon.com/store/Title> <http://amazon.com/store/Publisher>XYZ</http://amazon.com/store/Publisher> </http://amazon.com/store/Book> </http://amazon.com/store/Bookstore> <Bookstore xmlns=“http://amazon.com/store”> <Book> <Author>John Doe</Author> <Title>Introduction to XML</Title> <Publisher>XYZ</Publisher> </Book> </Bookstore> = <am:Bookstore xmlns:am=“http://amazon.com/store”> <am:Book> <am:Author>John Doe</am:Author> <am:Title>Introduction to XML</am:Title> <am:Publisher>XYZ</am:Publisher> </am:Book> </am:Bookstore> = slide by Pedro Szekely
  • 23. Default and Prefix Namespaces <am:Bookstore xmlns:am=“http://amazon.com/store” xmlns:bn=http://barnesandnoble.com/store> <am:Book> <am:Author>John Doe</am:Author> <bn:Author>Jane Doe</bn:Author> <am:Title>Introduction to XML</am:Title> <am:Publisher>XYZ</am:Publisher> </am:Book> </am:Bookstore> If elements were defined within a global scope, it would be a problem to combine elements from multiple documents slide by Pedro Szekely
  • 25. eXtensible Markup Language <h2>Nonmonotonic Reasoning</h2> <i>by <b>V. Marek</b> and <b>M. Truszczynski</b></i><br> Springer 1993<br> ISBN 0387976892 <book> <title>Nonmonotonic Reasoning</title> <author>V. Marek</author> <author>M. Truszczynski</author> <publisher>Springer</publisher> <year>1993</year> <ISBN>0387976892</ISBN> </book> HTML specifies how to display data XML specifies data extensible set of tags fixed set of tags slide by Pedro Szekely
  • 26. Merging Problem in XML <Bookstore xmlns=“http://amazon.com”> <Book id=“1”> <Author>John</Author> <Title>Introduction to XML</Title> <Publisher>ACM</Publisher> </Book> <Book id=“2”> <Author>Susan</Author> <Title>Advanced</Title> <Publisher>Springer</Publisher> </Book> </Bookstore> <Bookstore xmlns=“http://amazon.com”> <Book id=“1”> <Author>John</Author> <Title>Introduction to XML</Title> </Book> <Book id=“2”> <Author>Susan</Author> <Title>Advanced</Title> </Book> </Bookstore> <Bookstore xmlns=“http://amazon.com”> <Book id=“2”> <Publisher>Springer</Publisher> </Book> <Book id=“1”> <Publisher>ACM</Publisher> </Book> </Bookstore> … is difficult Document 1 Document 2 Merged Document slide by Pedro Szekely
  • 27. Does XML Represent Meaning? <course name=“CS101”> <instructor> John </instructor> <course> <instructor name=“John”> <teaches>CS 101</teaches> <instructor> John is an instructor for CS101 Opposite nesting, same information! based on slide from Jose Luis Ambite
  • 28. Does XML Represent Meaning? <course name=“CS101”> <instructor> John </instructor> <course> <instructor name=“John”> <teaches>CS 101</teaches> <instructor> John is an instructor for CS101 hasInstructor inverseOf teaches C,I hasInstructor(C,I) teaches(I,C) range(hasInstructor) = Person C,I hasInstructor(C,I) Peson(I) based on slide from Jose Luis Ambite
  • 29. Meaning of Data in XML? … <Book> <Author>John</Author> <Title>Introduction to XML</Title> <Publisher>ACM</Publisher> <Country>USA</Country> </Book> … What is the meaning of Country? … where the book is sold? … where it is published? … where the author lives? … ??? slide by Pedro Szekely
  • 30. XML Schema The purpose of a schema is to define a class of XML documents, and so the term "instance document" is often used to describe an XML document that conforms to a particular schema http://www.w3.org/TR/xmlschema-0/ a syntax checker slide by Pedro Szekely
  • 31. Example <xsd:complexType name="USAddress" > <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="street" type="xsd:string"/> <xsd:element name="city" type="xsd:string"/> <xsd:element name="state" type="xsd:string"/> <xsd:element name="zip" type="xsd:decimal"/> </xsd:sequence> <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/> </xsd:complexType> Defining the USAddress Type … must have specific elements … in a specific order … filled with specific types of data slide by Pedro Szekely
  • 32. XML Schema Primitive Types string boolean decimal float double duration dateTime time date gYearMonth gYear gMonthDay gDay gMonth hexBinary base64Binary anyURI Qname NOTATION useful in RDF slide by Pedro Szekely
  • 34. The Resource Description Framework (RDF) is a language for representing information about resources in the World Wide Web http://www.w3.org/TR/rdf-primer/ slide by Pedro Szekely
  • 35. Intended for representing metadata about Web resources, such as the title, author, and modification date of a Web document … also be used to represent information about things that can be identified on the Web, even when they cannot be directly retrieved on the Web examples include information about items available from on-line shopping facilities (e.g., prices and availability) Resource Description Framework slide by Pedro Szekely
  • 36. Represent Resources Using URIs http://szekelys.com/family#pedro “Pedro” http://xmlns.com/foaf/0.1/firstName That guy has first name “Pedro” slide by Pedro Szekely
  • 37. Represent Information as Triples http://szekelys.com/family#pedro “Pedro” http://xmlns.com/foaf/0.1/firstName Subject Predicate Object The resource being described A property of the resource The value of the property slide by Pedro Szekely
  • 42. Why Use URIs?  URIs look cool slide by Pedro Szekely
  • 43. Why Use URIs?  URIs look cool  Precisely identify resources  Avoid confusion among different “Jose Lopez”  Precisely identify properties  E.g., name of a company or name of a person  Provide information about properties  Look them up on the web slide by Pedro Szekely
  • 44. XML vs RDF <course name=“CS101”> <instructor> John </instructor> <course> <instructor name=“John”> <teaches>CS 101</teaches> <instructor> John is an instructor for CS101 usc-people:prof-01 “John” ex:isTeacherOf usc-course:cs-101 ex:hasInstructor foaf:name “CSC-101” ex:name XML RDF slide by Pedro Szekely
  • 45. RDF Syntaxes Leverages XML tools Hard for humans to read XML N3, Turtle N-Triples Terse RDF Triple Language Human readable format Works with software too Subset of turtle, supports streaming Standard for large RDF dumps RDFa Allows embedding RDF in HTML pages slide by Pedro Szekely
  • 46. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> Pedro’s homepage is "http://isi.edu/~szekely" slide by Pedro Szekely
  • 47. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> It’s an XML document Pedro’s homepage is "http://isi.edu/~szekely" slide by Pedro Szekely
  • 48. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> Here comes some RDF Pedro’s homepage is "http://isi.edu/~szekely" slide by Pedro Szekely
  • 49. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> Namespace declarations Pedro’s homepage is "http://isi.edu/~szekely" slide by Pedro Szekely
  • 50. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> Subject Pedro’s homepage is "http://isi.edu/~szekely" slide by Pedro Szekely
  • 51. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> Predicate Pedro’s homepage is "http://isi.edu/~szekely" slide by Pedro Szekely
  • 52. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> Value Pedro’s homepage is "http://isi.edu/~szekely" slide by Pedro Szekely
  • 53. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> Value Pedro’s homepage is "http://isi.edu/~szekely" Subject Predicate slide by Pedro Szekely
  • 54. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </rdf:Description> </rdf:RDF> http://szekelys.com/family#pedro foaf:firstName “Pedro” slide by Pedro Szekely
  • 55. XML Syntax <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </foaf:Person> </rdf:RDF> http://szekelys.com/family#pedro foaf:Person foaf:firstName “Pedro”rdf:type slide by Pedro Szekely
  • 56. <?xml version="1.0"?> <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://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </foaf:Person> </rdf:RDF> <?xml version="1.0"?> <rdf:RDF xmlns:rdf=… xmlns:foaf=… <foaf:Person rdf:about= "http://szekelys.com/family#pedro"> <foaf:firstName>Pedro</foaf:firstName> </foaf:Person> </rdf:RDF> <?xml version="1.0"?> <rdf:RDF xmlns:rdf=… xmlns:foaf=… <foaf:Person rdf:about= "http://szekelys.com/family#pedro"> <foaf:homepage rdf:resource="http://isi.edu/~szekely"/> </foaf:Person> </rdf:RDF> + slide by Pedro Szekely
  • 57. RDF Syntaxes Leverages XML tools Hard for humans to read XML N3, Turtle N-Triples Terse RDF Triple Language Human readable format Works with software too Subset of turtle, supports streaming Standard for large RDF dumps RDFa Allows embedding RDF in HTML pages slide by Pedro Szekely
  • 58. N3 and Turtle Syntaxes @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . <http://szekelys.com/family#pedro> foaf:firstName “Pedro” . <http://szekelys.com/family#pedro> rdf:type foafPerson . http://szekelys.com/family#pedro foaf:Person foaf:firstName “Pedro”rdf:type Each triple ends with a dot slide by Pedro Szekely
  • 60. “USC/ISI’s address is 4676 Admiralty Way, Marina del Rey, CA 90292” usc:isi schema:address “4676 Admiralty Way, Marina del Rey, CA 90292” . English RDF In what city is USC/ISI located? Find all universities in California slide by Pedro Szekely
  • 61. “USC/ISI’s address is 4676 Admiralty Way, Marina del Rey, CA 90292” usc:isi schema:address “4676 Admiralty Way, Marina del Rey, CA 90292” . English RDF How to represent nested structures? slide by Pedro Szekely
  • 62. “USA” usc:isi schema:addressCountry schema:address “CA” “Marina del Rey” “90292” “4676 Admiralty Way” schema:addressLocality schema:postalCode schema:addressRegion schema:streetAddress Represents the address of USC/ISI slide by Pedro Szekely
  • 63. “USC/ISI’s address is 4676 Admiralty Way, Marina del Rey, CA 90292” usc:isi schema:address usc:isi-address . usc:isi-address schema:addressCountry “USA” ; schema:addressRegion “CA” schema:addressLocality “Marina del Rey” ; schema:postalCode “90292” ; schema:streetAddress “4676 Admiralty Way” . English RDF slide by Pedro Szekely
  • 64. usc:isi schema:address usc:isi-address . usc:isi-address schema:addressCountry “USA” ; schema:addressRegion “CA” schema:addressLocality “Marina del Rey” ; schema:postalCode “90292” ; schema:streetAddress “4676 Admiralty Way” . We minted a URI for USC/ISI’s address … but sometimes we don’t want to mint URIs slide by Pedro Szekely
  • 65. usc:isi schema:address _:isi-address . _:isi-address schema:addressCountry “USA” ; schema:addressRegion “CA” schema:addressLocality “Marina del Rey” ; schema:postalCode “90292” ; schema:streetAddress “4676 Admiralty Way” . Blank node Blank Nodes prefix is “_” … can be improved … slide by Pedro Szekely
  • 66. What If I Don’t Know the URI? “Pedro Szekely lives in Los Angeles” English _:pedro foaf:firstName “Pedro” ; foaf:lastName “Szekely” ; foaf:mbox “szekely1401@gmail.com” ; schema:addressLocality “Los Angeles” . RDF Blank node … is this useful? … maybe slide by Pedro Szekely
  • 67. Typed Literals gn:bogota weather:event [ weather:temperature “10” ; weather:date ”18 June 2012” ] . … what is the meaning of the strings? … how do I specify numbers? … how about dates? … how do I specify 10 degrees centigrade? Compact blank node syntax slide by Pedro Szekely
  • 68. Typed Literals gn:bogota weather:event [ weather:temperature “10” ^^<http://www.w3.org/2001/XMLSchema#integer> ; weather:date ”18 June 2012” ; ] . URI specifies the type slide by Pedro Szekely
  • 69. Typed Literals gn:bogota weather:event [ weather:temperature “10” ^^<http://www.w3.org/2001/XMLSchema#integer> ; weather:date ”18 June 2012” ; weather:date ”2012-06-18” ^^xsd:date ; ] . … No set of predefined types defined in RDF … Software that consumes RDF must process types … XSD types commonly used URI from the XML Schema namespace are popular slide by Pedro Szekely
  • 71. Bag, Sequence, Alternative <…> “…” rdf:Bag <…> <…>rdf:_1 rdf:_2 rdf:_n rdf:Seq rdf:Alt rdf:type Elements, can be URI or literal Container, often a blank node Kinds of containers Properties for storing elements in containersslide by Pedro Szekely
  • 72. Bag Example exstaff:Sue exterms:publication _:z . _:z rdf:type rdf:Bag . _:z rdf:_1 ex:AnthologyOfTime . _:z rdf:_2 ex:ZoologicalReasoning . _:z rdf:_3 ex:GravitationalReflections . “Three papers that Sue published” slide by Pedro Szekely
  • 73. What’s the Difference? exstaff:Sue exterms:publication _:z . _:z rdf:type rdf:Bag . _:z rdf:_1 ex:AnthologyOfTime . _:z rdf:_2 ex:ZoologicalReasoning . _:z rdf:_3 ex:GravitationalReflections . exstaff:Sue exterms:publication ex:AnthologyOfTime . exstaff:Sue exterms:publication ex:ZoologicalReasoning . exstaff:Sue exterms:publication ex:GravitationalReflections . slide by Pedro Szekely
  • 74. Containers vs Collections Open World Closed World Incomplete information Complete Information There are things I don’t know If I don’t know it, it does not exist Scales to the whole Web Does not scale RDF philosophy Containers Collections open world sets closed world sets slide by Pedro Szekely
  • 76. Why Do We Need Reification? “On June 19 2012, Claudia said that Pedro’s email address is szekely1401@gmail.com” English <http://szekelys.com/family#pedro> foaf:mbox <szekely1401@gmail.com> RDF Correct? …………………..… No! We need to make a statement about a statement slide by Pedro Szekely
  • 77. Reification “On June 19 2012, Claudia said that Pedro’s email address is szekely1401@gmail.com” English _:s rdf:subject <http://szekelys.com/family#pedro> . _:s rdf:predicate foaf:mbox . _:s rdf:object <szekely1401@gmail.com> . _:s dcterms:date “2012-06-19”^^xsd:date . _:s dcterms:creator <http://uniandes.edu.co/faculty#claudiaj> . RDF slide by Pedro Szekely
  • 78. Problems With Reification _:s rdf:subject <http://szekelys.com/family#pedro> . _:s rdf:predicate foaf:mbox . _:s rdf:object <szekely1401@gmail.com> . _:s dcterms:date “2012-06-19”^^xsd:date . _:s dcterms:creator <http://uniandes.edu.co/faculty#claudiaj> . <http://szekelys.com/family#pedro> foaf:mbox <szekely1401@gmail.com> RDF 1 implies RDF 2? RDF 1 RDF 2 …..… No! slide by Pedro Szekely
  • 79. Problems With Reification • Needs 3 times more triples • Most software cannot reason with it • Nice idea that does not work well! • Don’t use it, there is a better way _:s rdf:subject <http://szekelys.com/family#pedro> . _:s rdf:predicate foaf:mbox . _:s rdf:object <szekely1401@gmail.com> . _:s dcterms:date “2012-06-19”^^xsd:date . _:s dcterms:creator <http://uniandes.edu.co/faculty#claudiaj> . slide by Pedro Szekely
  • 81. RDF Syntaxes Leverages XML tools Hard for humans to read XML N3, Turtle N-Triples Terse RDF Triple Language Human readable format Works with software too Subset of turtle, supports streaming Standard for large RDF dumps RDFa Allows embedding RDF in HTML pages Original, still used, but others becoming more popular slide by Pedro Szekely
  • 83. Turtle URIs aka IRI <http://example.org/path/> <http://example.org/path/#fragment> </path> <#fragment> <> URIs are in <> Absolute Relative to the base documen t slide by Pedro Szekely
  • 84. Turtle Prefixes (Namespaces) @prefix foo: <http://example.org/ns#> . @prefix : <http://other.example.org/ns#> . foo:bar foo: : . :bar : foo:bar . Expands to Empty prefix http://example.org/ns#bar http://example.org/ns http://other.example.org/ns . slide by Pedro Szekely
  • 85. Turtle Literals "a string” """a string""” """a string with newlines """ Strings in “” or write them in “”” … so you can break them in multiple lines slide by Pedro Szekely
  • 86. Turtle Literals "That Seventies Show" "That Seventies Show"@en "Cette Série des Années Soixante-dix"@fr "Cette Série des Années Septante"@fr-be "mylexicaldata"^^<http://example.org/my/datatype> """10"""^^xsd:decimal - untyped (“London” equivalent to “London”^^xsd:string) language tag data type - language tag - data type (with a URI) Kinds of literals: slide by Pedro Szekely
  • 87. Turtle Blank Nodes _:me _:a1234 [] two blank nodes Blank nodes _:me foaf:firstName “Pedro” . _:me foaf:lastName “Szekely” . [] foaf:firstName “Pedro” . [] foaf:lastName “Szekely” . [ foaf:firstName “Pedro” ; foaf:lastName “Szekely” ; ] Examples slide by Pedro Szekely
  • 88. Turtle Base URI </path> <#fragment> <> RDF document stored at http://isi.edu/szekely/example.rdf </path> <#fragment> <> <http://isi.edu/szekely/example/path> <http://isi.edu/szekely/example/#fragment> <http://isi.edu/szekely/example> slide by Pedro Szekely
  • 89. Turtle Base URI # this is a complete turtle document # In-scope base URI is the document URI at this point <a1> <b1> <c1> . @base <http://example.org/ns/> . # In-scope base URI is http://example.org/ns/ at this point <a2> <http://example.org/ns/b2> <c2> . @base <foo/> . # In-scope base URI is http://example.org/ns/foo/ at this point <a3> <b3> <c3> . @prefix : <bar#> . :a4 :b4 :c4 . @prefix : <http://example.org/ns2#> . :a5 :b5 :c5 . <a2> is <http://example.org/ns/a2> <a3> is <http://example.org/ns/foo/a3> :a4 is <http://example.org/ns/foo/bar#a4> :a5 is <http://example.org/ns2#a5> slide by Pedro Szekely
  • 90. Turtle “Type” Shortcut http://szekelys.com/family#pedro <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> foaf:Person . You can write: http://szekelys.com/family#pedro rdf:type foaf:Person . You can abbreviate it to: http://szekelys.com/family#pedro a foaf:Person . Or even better: slide by Pedro Szekely
  • 91. Turtle Literals Revisited -5 0 1 10 +1 Integers: "-5"^^xsd:integer "10"^^<http://www.w3.org/2001/XMLSchema#integer> Integers the hard way: 0.0 1.0 1.234567890123456789 -5.0 1.3e2 10e0 -12.5e10 Floating Point: "1.3e2"^^xsd:double "-5.0"^^<http://www.w3.org/2001/XMLSchema#decimal> Floating point the hard way: true false Booleans: "true"^^xsd:boolean Booleans the hard way: slide by Pedro Szekely
  • 92. Turtle Triple Abbreviations :subject :predicate :object-1 . :subject :predicate :object-2 . :subject :predicate :object-1, :object-2 . :subject :predicate-1 :object-1 . :subject :predicate-2 :object-2 . :subject :predicate-1 :object-1 ; :predicate-2 :object-2 . slide by Pedro Szekely
  • 93. XML to N3 Converter http://www.mindswap.org/2002/rdfconvert/ slide by Pedro Szekely