SPARQL and dbpedia: Getting structured data from wikipedia

I was always wonder if we can extract structured data from Wikipedia. I stumbled up on DBPedia and SPARQL. DBPedia stores Wikipedia data as Dataset and it can be accessed using SPARQL. Let me demonstrate this with an example.

DBPedia has a SPARQL endpoint . And you can use SNORQL for exploring DBPedia. Let us execute the below SPARQL query in SNORQL and notice the resultset that is returned,

PREFIX rdfs: <>
PREFIX rdf: <>
PREFIX foaf: <>

SELECT DISTINCT ?film_title ?star_name
where {?film_title rdf:type <> .
?film_titleĀ  foaf:name ?film_name .
?film_title rdfs:comment ?film_abstract .
?film_title dbpedia-owl:starring ?star .
?star dbpprop:name ?star_name

I get the results as below,

SPARQL results from DBPedia

SPARQL results from DBPedia

As good place to learn SPARQL is .

I hope this article helps you.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s