You are on page 1of 31

12

DBpedia

http://DBpedia.org/
http://wiki.DBpedia.org/Datasets2014/DatasetStatistics

13

DBpedia SPARQL Endpoint (1)


http://DBpedia.org/sparql

14

DBpedia SPARQL Endpoint (1)


Finding information about Steve Jobs
1) Check Wikipedia URL for Steve Jobs

http://en.wikipedia.org/wiki/Steve_Jobs
2) Change it to DBpedia URI

http://DBpedia.org/resource/Steve_Jobs
3) Use SPARQL on DBpedia SPARQL Endpoint

15

DBpedia SPARQL Endpoint (1)

16

DBpedia SPARQL Endpoint (1)


SPARQL Example 1
select ?p ?o
where {
<http://DBpedia.org/resource/Steve_Jobs> ?p ?o.
}

17

DBpedia SPARQL Endpoint (1)

18

DBpedia SPARQL Endpoint (2)


By using foaf:Person, look up all people on DBpedia.
SPARQL Example 2

select distinct ?s ?p ?o
where {
?s rdf:type foaf:Person .
?s ?p ?o .
} LIMIT 1000

19

Quiz (1)
Find soccer players who were born in South Korea (or in your

home country)

20

Answer (1)
select distinct ?s
where {
?s rdf:type foaf:Person .
?s a dbo:SoccerPlayer .
?s dbp:birthPlace dbr:South_Korea .
} order by ASC(?s)

rdf:type = a

21

22

DBpedia SPARQL Endpoint (3)


http://DBpedia.org/resource/Harry_Potter

23

DBpedia SPARQL Endpoint (3)


Specific information about the Harry Potter series can be

found using the following URI: <http://DBpedia.org/resource/


Harry_Potter>
Find the author of Harry Potter on DBpedia.

SPARQL Example 3-1


select ?o
where {
<http://DBpedia.org/resource/Harry_Potter> dbp:author ?o
}

24

DBpedia SPARQL Endpoint (3)


Specific information about the Harry Potter series can be

found using the following URI: <http://DBpedia.org/resource/


Harry_Potter>
Find a brief description about Harry Potter on DBpedia.

SPARQL Example 3-2


select ?o
where {
<http://DBpedia.org/resource/Harry_Potter> dbo:abstract ?o
}

25

DBpedia SPARQL Endpoint (6)


Using <http://DBpedia.org/ontology/Company>, look up all

companies listed on DBpedia.


SPARQL Example 4
select *
where {
?company_name rdf:type <http://DBpedia.org/ontology/Company>
}
order by ASC(?company_name)

26

Quiz (2)
Find companies on DBpedia which are located in South Korea

(or in your home country)

27

Answer (2)
select *
where {
?company_name rdf:type <http://DBpedia.org/ontology/Company> .
?company_name dbo:location dbr:South_Korea .
}
order by ASC(?company_name)

28

29

DBpedia SPARQL Endpoint (5)


By using FILTER, find countries with a population > 3 million
SPARQL Example 5.1

SELECT distinct ?country_uri ?population


WHERE {
?country_uri a dbo:Country ;
rdfs:label ?country_name ;
dbp:populationEstimate ?population .
FILTER (?population > "3000000"^^xsd:integer).

}
^^xsd:integer = data type

30

DBpedia SPARQL Endpoint (5)


By using FILTER, find countries with a population > 3 million
SPARQL Example 5.2

PREFIX dbp: <http://DBpedia.org/property/>


SELECT distinct ?country_uri ?population
WHERE {
?country_uri rdf:type dbo:Country ;
rdfs:label ?country_name ;
dbp:populationEstimate ?population .
FILTER (?population > 3000000) .
}

31

DBpedia SPARQL Endpoint (5)


By using FILTER, find countries with a population > 3 million
SPARQL Example 5.3

PREFIX dbp: <http://DBpedia.org/property/>


SELECT distinct ?country_name ?population
WHERE {
?country_uri rdf:type dbo:Country ;
rdfs:label ?country_name ;
dbp:populationEstimate ?population .
FILTER (?population > 3000000) .
}

32

SPARQL Example 5.1

33

34

A Few Interesting Classes


Class Name
dbo:Actor

dbo:Game

dbo:Animal

dbo:Region

dbo:Book

dbo:Religious

dbo:City

dbo:Song

dbo:College

dbo:Mountain

dbo:Disease

dbo:Musical

dbo:Economist

dbo:Stream

dbo:Firm

dbo:Theatre

dbo:Food

dbo:Tower

35

DBO:City example
Search for cities in South Korea (dbr:South_Korea)

using dbo:City, dbo:country.

36

DBO:City example
select ?s
where {
?s a dbo:City.
?s dbo:country dbr:South_Korea
}

37

38

Finding Requisite Vocabularies


Use Linked Open Vocabularies (LOV / derived from LOD).

URL :
http://lov.okfn.org/
dataset/lov

39

Finding Requisite Vocabularies


A vocabulary in LOV gathers definitions of a set of classes and

properties (collectively referred to as terms of the vocabulary)


Terms of vocabularies are useful in describing specific types of
things, things in a given domain or industry, or things at large
intended for specific usage.
Terms of vocabularies also provide the links in linked data (in
the above case, links between a Person and a City). Definitions
of terms provided by the vocabularies bring clear semantics to
descriptions and links thanks to the formal language they use (a
dialect of RDF such as RDFS or OWL).
In short, vocabularies provide the semantic glue enabling data
to become meaningful.

40

Finding Requisite Vocabularies

Enter search term!

41

Finding Requisite Vocabularies

42

Distinguishing between Class and


Property

You can distinguish


between class and property
by color.
Blue indicates class;
yellow indicates property.

You might also like