{
<>
a schema:WebPage, foaf:Document;
rdfs:label "Buhari's Election Promises"@en ;
rdfs:comment """
Buhari's promises to Nigerians during his political campaigns.
"""@en;
schema:creator ;
dcterms:created "2015-05-09T03:15:00-05:00"^^xsd:dateTime ;
dcterms:modified "2015-05-09T03:15:00-05:00"^^xsd:dateTime ;
schema:about <#ElectionPromise> ;
dcterms:hasPart <#Promise1>, <#Promise2>, <#Promise3>, <#Promise4>,<#Promise5>,<#Promise6>,<#Promise7>,<#Promise8>,<#Promise9>,<#Promise10>,<#Promise11> ;
dcterms:source ;
xhv:license .
<#Buhari>
a foaf:Person ;
foaf:name "Muhammadu Buhari" ;
owl:sameAs dbpedia:Muhammadu_Buhari ;
schema:about , , .
<#Promise1>
a schema:CommunicateAction ;
rdfs:label "Promise #1" ;
skos:altLabel "Electricty" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ Buhari promised to deliver 20,000 megawatts of electricity in four years to surpass Nigeria’s consumption level of around 15,000mw. """ @en ;
schema:mentions dbpedia:Power_Holding_Company_of_Nigeria, dbpedia:Nigeria, dbpedia:Electricity ;
dcterms:source ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise2>
a schema:CommunicateAction ;
rdfs:label "Promise #2" ;
skos:altLabel "Exchange Rate" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ Sometime around March 23 in Owerri, Imo State, Buhari promised to make naira equal to dollar. """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Nigerian_naira, dbpedia:Dollar ;
dcterms:source ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise3>
a schema:CommunicateAction ;
rdfs:label "Promise #3" ;
skos:altLabel "Employment" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ Around January 25, Buhari promised to create one million jobs for Igbo youths by revamping huge coal deposits in Enugu State for generation of electricity and export """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Employment,dbpedia:Nigerian_Coal_Corporation, dbpedia:Electricity ;
dcterms:source ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise4>
a schema:CommunicateAction ;
rdfs:label "Promise #4" ;
skos:altLabel "Housing" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ Sometime around December 18, Buhari told the nation that he will create around 4 million new home owners by 2019 """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Affordable_housing, dbpedia:Housing ;
dcterms:source ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise5>
a schema:CommunicateAction ;
rdfs:label "Promise #5" ;
skos:altLabel "Industry" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ During his campaign in Lokoja sometime around January 17, Buhari pledged to revive Ajaokuta Steel Company. He said he would resuscitate the company which had been out of production for the past five years. """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Ajaokuta ;
dcterms:source ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise6>
a schema:CommunicateAction ;
rdfs:label "Promise #6" ;
skos:altLabel "Transportation" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Ekiti_State ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ He also promised to build an airport in Ekiti State, which someone called a deceit. """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Airport, dbpedia:Ekiti_State ;
dcterms:source ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise7>
a schema:CommunicateAction ;
rdfs:label "Promise #7" ;
skos:altLabel "Poverty" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ He also promised to make direct cash transfer of NGN 5,000 to the 25 million poorest and most vulnerable citizens, if they immunize children and enroll them in school. """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Poverty_in_Nigeria ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise8>
a schema:CommunicateAction ;
rdfs:label "Promise #8" ;
skos:altLabel "Education" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ I will provide 1 meal a day for children in public primary schools. """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Education_in_Nigeria ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise9>
a schema:CommunicateAction ;
rdfs:label "Promise #9" ;
skos:altLabel "Oil and Gas" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ Revive and reactivate our minimally performing Refineries to optimum capacity; Make the industry and Nigeria one of the world leading/cutting edge centres for clean oil and gas technology; also producing leading world Oil and Gas technologist, scientists, and owing mega structure installations. """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Petroleum_industry_in_Nigeria, dbpedia:Oil_refinery ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise10>
a schema:CommunicateAction ;
rdfs:label "Promise #10" ;
skos:altLabel "Women" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ Implementation of the 2005 National Gender Policy, which serves as a road map for the promotion of women’s empowerment and gender equality in Nigeria. """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Woman, dbpedia:Women_in_Nigeria ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#Promise11>
a schema:CommunicateAction ;
rdfs:label "Promise #11" ;
skos:altLabel "Security" ;
schema:agent <#Buhari> ;
schema:recipient dbpedia:Nigerians ;
schema:participant dbpedia:All_Progressives_Congress ;
schema:object """ He also promised to deal with Boko Haram with a few months. """ @en ;
schema:mentions dbpedia:Nigeria, dbpedia:Boko_Haram ;
dcterms:isPartOf ;
schema:creator ;
schema:about <> .
<#ElectionPromise>
a skos:Concept ;
rdfs:label "Election Promise"@en;
owl:sameAs dbpedia:Election_promise .
a schema:WebPage, schema:BlogPosting;
rdfs:label "Just So We Don’t Forget; A Recap Of Buhari’s Promises – Simon Ateba" ;
schema:about <#Buhari> ;
schema:url .
a foaf:Person ;
foaf:name "Emeka Okoye" ;
owl:sameAs , ;
schema:about , .
}
We are crowdsourcing data from blogs, websites, public datasets, institutional databases and printed publications that Nigerians (and Africans) can find interesting and thought provoking.
If you have data or visualization to share, send an email to opendatang@vikanttimobile.com
Saturday, May 9, 2015
Muhammadu Buhari's Election Campaign Promises in Nanotation
Friday, December 26, 2014
How to Create an API Listing Nigerian States or Local Government Areas
How to Create an API for listing Nigerian States and Local Government Area using Linked Data from the Web of Data
.Subjects:
API
,
Linked Data
,
Nigeria
,
Local Government Areas of Nigeria
,
States of Nigeria
Situation Analysis:
Mfoniso Ossom (https://www.facebook.com/mfoniso?fref=nf) posed the question on Silicon Africa Facebook group (https://www.facebook.com/groups/siliconafrica/), "Is there a public API that provides a listing of Nigerian states, Cities, LGA e.t.c?". Investigation has shown there was none as the time of this post.Challenge:
How do I create an API out of a document that comprised of data representing States or Local Government Areas of Nigeria? We know that Wikipedia documents hosts these data so we can use DBPedia data as well as any other additional data source on the web.Solution:
- Use any server side programming language like PHP, Ruby, Python, Perl, ASP, etc to exploit SPARQL via REST based web service.
- Determine which SPARQL endpoint, a REST web service URI, you want to access e.g DBpedia (http://dbpedia.org/sparql) or a local virtuoso instance (typically http://localhost:8890/sparql). SPARQL endpoints provides a REST API to exploit RDF documents. The URL we'll send will start with the SPARQL endpoint and then pass it some query string parameters, "query" and "output".
- Construct the SPARQL query to list the data
## SPARQL Query PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?s1 as ?stateURI str(?s4) as ?stateName str(?s5) as ?stateDesc WHERE { ?s1 a <http://dbpedia.org/ontology/Place> . ?s1 <http://dbpedia.org/property/type> ?s3 . ?s1 rdfs:label ?s4 . ?s1 rdfs:comment ?s5 . FILTER ( ?s3 in ( <http://dbpedia.org/resource/States_of_Nigeria> ) ) FILTER langMatches( lang(?s4), "en" ) FILTER langMatches( lang(?s5), "en" ) - URL Encode the SPARQL query and add it to the "query" parameter in the HTTP URL (e.g http://dbpedia.org/sparql?query=[encoded sparql here]).
- Add the query output format to the "output" parameter (e.g http://dbpedia.org/sparql?query=[encoded sparql here]&output=json).
- This URI is usable anywhere on the Web.
- Make the HTTP request to the URL and return the response body as a string.
- Using the right content header, you can write to standard output.
Download:
- Source codes for the Local Government Areas API https://github.com/emekaokoye/NG-LGA-API - here.
- Source codes for the States API https://github.com/emekaokoye/NG-States-API - here.
Live Demo:
- Local Government Areas API http://linkedopendatang.com/entity/localgov/getlg.php?f=xml - here.
- States API http://linkedopendatang.com/entity/state/getstate.php?f=json - here.
- Note: Options for query parameter 'f' are json,csv,xml,ttl,rdf.
References
http://en.wikipedia.org/wiki/DBpedia - DBpedia
http://en.wikipedia.org/wiki/SPARQL - SPARQL
http://www.w3.org/TR/rdf-sparql-query/ - SPARQL Query Language for RDF
http://semanticweb.org/wiki/SPARQL_endpoint - SPARQL Endpoint
http://en.wikipedia.org/wiki/Server-side_scripting - Server Side Scripting
Keywords: linkedopendatang, open data, linked data, nigeria, sparql, states, local government areas, api
Monday, March 24, 2014
Big Data at the Nigerian Movies
Using Big Data and Natural Language Processing techniques to query the Global Graph for Nigerian Movies and Actors.
Nigerian Movies on LinkedMDB
The following query lists all the Nigerian movies in the RDF store of LinkedMDB or in SPARQL terms, "show me movies whose 'movie:country' is 'country:NG' which may have a 'dc:title' or a 'dc:date'" :
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
select ?s ?Title ?Date
where {
SERVICE <http://data.linkedmdb.org/sparql> {
?s movie:country country:NG .
optional { ?s dc:title ?Title. }
optional { ?s dc:date ?Date. }
}
}
[View query in Virtuoso SPARQL Editor]The answer looks like this.
---------------------------------------------------------------------------------------------------
| S | Title | Date |
===================================================================================================
| <http://data.linkedmdb.org/resource/film/10659> | "Rise and Fall of Idi Amin" | "1980" |
| <http://data.linkedmdb.org/resource/film/16051> | "Osuofia in London" | |
| <http://data.linkedmdb.org/resource/film/16118> | "Ezra" | "2007-01-23" |
| <http://data.linkedmdb.org/resource/film/16130> | "Aki na Ukwa" | |
| <http://data.linkedmdb.org/resource/film/16131> | "2 Rats" | "2003" |
| <http://data.linkedmdb.org/resource/film/16463> | "Above Death: In God We Trust" | "2003" |
| <http://data.linkedmdb.org/resource/film/17663> | "Abuja Connection" | |
| <http://data.linkedmdb.org/resource/film/24122> | "Missing Angel" | |
---------------------------------------------------------------------------------------------------
[Run the query using URIburner Endpoint].Wow! they have only 8 Nigerian movies in their dataset.
Who acted in the movie "2 Rats"
Let us find out who acted in the movie "2 Rats" by using the following query. In SPARQL terms "show me the 'movie:actor' of '.../film/16131' and also tell me his '?Name'" :
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
select ?Name
where {
SERVICE <http://data.linkedmdb.org/sparql> {
<http://data.linkedmdb.org/resource/film/16131> movie:actor ?actor .
?actor movie:actor_name ?Name .
}
}
[View query in Virtuoso SPARQL Editor].The answer .
--------
| Name |
========
--------
[Run the query using URIburner Endpoint].Wow! LinkedMDB does not have that information. Let me see what else they have on the movie using the following query or in SPARQL terms "show me all you have on the subject of '.../film/16131'" :
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>
PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX dbowl: <http://dbpedia.org/ontology/>
select *
where {
SERVICE <http://data.linkedmdb.org/sparql> {
<http://data.linkedmdb.org/resource/film/16131> ?PropertyName ?Value
}
}
[View query in Virtuoso SPARQL Editor]The answer.
----------------------------------------------------------------------------------------------------------------------------
| property | object |
============================================================================================================================
| <http://xmlns.com/foaf/0.1/based_near> | <http://sws.geonames.org/2328926/> |
| <http://xmlns.com/foaf/0.1/page> | <http://www.freebase.com/view/guid/9202a8c04000641f8000000005674af3> |
| movie:initial_release_date | "2003" |
| dc:date | "2003" |
| movie:country | country:NG |
| movie:language | <http://www.lingvoj.org/lingvo/en> |
| movie:filmid | "16131"^^<http://www.w3.org/2001/XMLSchema#int> |
| dc:title | "2 Rats" |
| rdfs:label | "2 Rats" |
| <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> | movie:film |
----------------------------------------------------------------------------------------------------------------------------
[Run the query using URIburner Endpoint]This just shows the release date, country, lanaguage, title of the movie. This is not much. Let us check from the very nucleus of the Linked Open Data web, DBpedia (http://dbpedia.org), if they have some more data than LinkedMDB.
"2 Rats" at DBpedia
Let us see if we can catch "2 Rats" in DBpedia by using the following query or in SPARQL terms "show us the ?moviename and ?actor of any dbpedia:Film that has '2 Rats' in its name and dbprop:country is 'nigeria' " :
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>
PREFIX dbprop: <http://dbpedia.org/property/>
select ?s as ?Movie ?moviename as ?Name ?actor as ?Actor
where {
SERVICE <http://dbpedia.org/sparql> {
?s a dbpedia:Film .
?s dbprop:country ?country.
?s dbpedia:starring ?dbname .
?s rdfs:label ?moviename.
?dbname dbprop:name ?actor.
filter regex(?moviename,"^2 Rats") .
filter regex(?country,"^nigeria","i") .
}
}
[View query in Virtuoso SPARQL Editor]The answer .
-------------------------------------------------------------------------------
| s | moviename | actor |
===============================================================================
| <http://dbpedia.org/resource/2_Rats> | "2 Rats"@en | "Osita Iheme"@en |
| <http://dbpedia.org/resource/2_Rats> | "2 Rats"@en | "Iheme, Osita"@en |
| <http://dbpedia.org/resource/2_Rats> | "2 Rats"@en | "Chinedu Ikedieze"@en |
| <http://dbpedia.org/resource/2_Rats> | "2 Rats"@en | "Ikedieze, Chinedu"@en |
-------------------------------------------------------------------------------
[Run the query using URIburner Endpoint]Now we can see that DBpedia has the actors name.
What else do they have on the movie
Let us check for the movie description, director, distributor with the following query. In SPARQL terms "show me the ?director and ?distributor of any dbpedia:Film that has '2 Rats' in its name and dbprop:country is 'nigeria'" :
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>
PREFIX dbprop: <http://dbpedia.org/property/>
select distinct ?s as ?Movie ?director ?distributor
where {
SERVICE <http://dbpedia.org/sparql> {
?s a dbpedia:Film .
?s dbprop:country ?country.
?s dbpedia:starring ?dbname .
?s rdfs:label ?moviename.
?s rdfs:comment ?description .
?s dbprop:director ?director.
?s dbprop:distributor ?distributor.
?dbname dbprop:name ?actor.
filter regex(?moviename,"^2 Rats") .
filter regex(?country,"^nigeria","i") .
}
}
[View query in Virtuoso SPARQL Editor]and the result shows
-----------------------------------------------------------------------------------------------
| s | director | distributor |
===============================================================================================
| <http://dbpedia.org/resource/2_Rats> | "Andy Chukwu"@en | "OJ Productions International"@en |
-----------------------------------------------------------------------------------------------
[Run the query using URIburner Endpoint]so we can now see that DBpedia has much more information on this movie. We can get more information like the movie description with the following query.
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>
PREFIX dbprop: <http://dbpedia.org/property/>
select distinct ?description as ?Summary
where {
SERVICE <http://dbpedia.org/sparql> {
?s a dbpedia:Film .
?s dbprop:country ?country.
?s dbpedia:starring ?dbname .
?s rdfs:label ?moviename.
?s rdfs:comment ?description .
?s dbprop:director ?director.
?s dbprop:distributor ?distributor.
?dbname dbprop:name ?actor.
filter regex(?moviename,"^2 Rats") .
filter regex(?country,"^nigeria","i") .
}
}
[View query in Virtuoso SPARQL Editor]and it showed....
| "2 Rats is a 2003 Nigeria film. Nollywood's highest paid actors, Osita Iheme (A-boy) and Chinedu Ikedieze (Bobo) are two young boys whose father has been murdered by their uncle. In a selfish move, Amaechi Muonagor wants them to work as house boys in their father's own house. A-boy and Bobo have other plans. The film features performances by Aki na Pawpaw and can be dubbed as Nollywood's Home Alone."@en |
[Run the query using URIburner Endpoint]
Chinedu Ikedieze's filmography
Which other movie did Chinedu Ikedieze star in? Let us ask DBpedia the following query or in SPARQL terms "Show us any 'dbpedia:Film' 'dbpedia:starring' 'dbr:Chinedu_Ikedieze', giving us the '?director' and '?distributor' if available " :
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>
PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX dbr: <http://dbpedia.org/resource/>
select distinct ?s as ?Movie ?director ?distributor
where {
SERVICE <http://dbpedia.org/sparql> {
?s a dbpedia:Film .
?s dbpedia:starring dbr:Chinedu_Ikedieze .
optional {?s dbprop:director ?director. }
optional {?s dbprop:distributor ?distributor. }
}
}
[View query in Virtuoso SPARQL Editor]and the result showed ...
---------------------------------------------------------------------------------------
| s | director | distributor |
=======================================================================================
| dbr:2_Rats | "Andy Chukwu"@en | "OJ Productions International"@en |
| dbr:Aki_na_Ukwa | "Amayo Uzo Philips"@en | "Kas-Vid International"@en |
| dbr:Games_Men_Play | dbr:Lancelot_Oduwa_Imasuen | |
---------------------------------------------------------------------------------------
[Run the query using URIburner Endpoint]Hmm! only 3 films.
Chinedu Ikedieze and Osita Iheme
Which films in DBpedia have starred both Chinedu and Osita together? Let us ask with the following query :
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>
PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX dbr: <http://dbpedia.org/resource/>
select distinct ?s as ?Movie ?director ?distributor
where {
SERVICE <http://dbpedia.org/sparql> {
?s a dbpedia:Film .
?s dbpedia:starring dbr:Chinedu_Ikedieze .
?s dbpedia:starring dbr:Osita_Iheme .
optional {?s dbprop:director ?director. }
optional {?s dbprop:distributor ?distributor. }
}
}
[View query in Virtuoso SPARQL Editor]The answer.
--------------------------------------------------------------------------------
| s | director | distributor |
================================================================================
| dbr:2_Rats | "Andy Chukwu"@en | "OJ Productions International"@en |
| dbr:Aki_na_Ukwa | "Amayo Uzo Philips"@en | "Kas-Vid International"@en |
--------------------------------------------------------------------------------
[Run the query using URIburner Endpoint]Just only 2 movies.
Nollywood in DBpedia
Let us ask DBpedia which Nigerian movies does it have, using the following query or in SPARQL terms "show us all the dbpedia:Film you have that dbprop:country is 'nigeria' and give it to me in english language".
## SPARQL Query
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX movie: <http://data.linkedmdb.org/resource/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX country: <http://data.linkedmdb.org/resource/country/>
PREFIX dbpedia: <http://dbpedia.org/ontology/>
PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX dbr: <http://dbpedia.org/resource/>
select distinct ?s as ?Movie ?moviename as ?Name ?country as ?Country
where {
SERVICE <http://dbpedia.org/sparql> {
?s a dbpedia:Film .
?s dbprop:country ?country.
optional {?s rdfs:label ?moviename. }
filter regex(?country,"^nigeria","i") .
filter (lang(?moviename) ='en') .
}
}
[View query in Virtuoso SPARQL Editor]The answer.
-----------------------------------------------------------------------------------------------------------------------
| s | country | moviename |
=======================================================================================================================
| <http://dbpedia.org/resource/Area_Boys_(film)> | "Nigeria"@en | "Area Boys (film)"@en |
| dbr:Lilies_of_the_Ghetto | "Nigeria"@en | "Lilies of the Ghetto"@en |
| dbr:Living_in_Bondage | "Nigeria"@en | "Living in Bondage"@en |
| dbr:Mirror_Boy | "Nigeria"@en | "Mirror Boy"@en |
| dbr:Oni_Ise_Owo | "Nigeria"@en | "Oni Ise Owo"@en |
| <http://dbpedia.org/resource/Rag_Tag_(film)> | "Nigeria"@en | "Rag Tag (film)"@en |
| dbr:Rising_Moon | "Nigeria"@en | "Rising Moon"@en |
| dbr:Tango_with_Me | "Nigeria"@en | "Tango with Me"@en |
| dbr:The_Mayors | "Nigeria"@en | "The Mayors"@en |
| dbr:2_Rats | "Nigeria"@en | "2 Rats"@en |
| <http://dbpedia.org/resource/30_Days_(2006_film)> | "Nigeria"@en | "30 Days (2006 film)"@en |
| dbr:Games_Men_Play | "Nigeria"@en | "Games Men Play"@en |
| dbr:The_Figurine | "Nigeria"@en | "The Figurine"@en |
| dbr:Jenifa | "Nigeria"@en | "Jenifa"@en |
| <http://dbpedia.org/resource/Above_Death:_In_God_We_Trust> | "Nigeria"@en | "Above Death: In God We Trust"@en |
| dbr:Abuja_Connection | "Nigeria"@en | "Abuja Connection"@en |
| dbr:Aki_na_Ukwa | "Nigeria"@en | "Aki na Ukwa"@en |
| <http://dbpedia.org/resource/Anchor_Baby_(film)> | "Nigeria"@en | "Anchor Baby (film)"@en |
| <http://dbpedia.org/resource/Black_Gold_(2011_Nigerian_film)> | "Nigeria"@en | "Black Gold (2011 Nigerian film)"@en |
| <http://dbpedia.org/resource/Ezra_(film)> | "Nigeria"@en | "Ezra (film)"@en |
| dbr:Missing_Angel | "Nigeria"@en | "Missing Angel"@en |
| dbr:Osuofia_in_London | "Nigeria"@en | "Osuofia in London"@en |
-----------------------------------------------------------------------------------------------------------------------
[Run the query using URIburner Endpoint]Wow! just only 21 movies.
Conclusion
The web of linked data or Semantic Web is a global information space consisting of inter-linked data. SPARQL enables applications to query this global graph or database for information about resources or entities..
I have shown how easy to query these graphs for information on Nollywood. We have also seen that not enough information on Nollywood exist in the global graph so there is need to publish more.
Why? Applications can consume the results of these kind of queries to create a rich experience for users in interacting with these resources e.g. movie recommendation app, an actor app, etc.
Keywords: linkedopendatang, linkedopendata, opendatang, linkeddata, lod, nigeria, sparql, films, movies, nollywood
References
http://www.linkedmdb.org/ - LinkedMDB.
http://dbpedia.org - DBpedia.
http://en.wikipedia.org/wiki/SPARQL - About SPARQL.
http://www.w3.org/TR/rdf-sparql-query/ - SPARQL Query Language for RDF.
http://semanticweb.org/wiki/SPARQL_endpoint - SPARQL Endpoint.
http://www.w3.org/TR/sparql11-federated-query/ - Federated SPARQL.
http://linkeddata.uriburner.com/sparql/ - URIBurner SPARQL Endpoint.
http://virtuoso.openlinksw.com/ - Openlink Virtuoso.
Tuesday, March 18, 2014
Edo State Food Centers Search App
Introduction
As we are have converted some of Edo State Open Data datasets to Linked Data, you are probably thinking what applications we can develop from the data. We decided to use the Food Centers list to create a cool app.
About The App
The app, "Food Centers", let's you search for eatries, restaurants, bukas (local restaurants), etc in Edo State by street or business names. You can find the application here.
How Does It Work
It's simple and straightforward.
- Start the application
- Enter a street name (without the 'street') or business name in the 'Find' box.
- Click the 'Search' button
- A SPARQL query based on your search is generated and sent to a SPARQL Endpoint using PHP CURL lib.
- The search result is retrieved in JSON format and displayed with JQuery Mobile
- Each business name is anchored with a URI so that It can be exploited via Linked Data follow-your-nose
Further Work
We will geocode each of the addresses and display them on Google map.
Under The Hood
The app was developed with PHP, JQuery mobile, SPARQL, HTML5. The data was converted to RDF format.
Data
RDF/Turtle, RDF/XML.
SPARQL query
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix edo: <http://www.vikanttimobile.com/opendatang/data/edo-food-centers.ttl#>
select distinct ?biz ?Name? Address
from <http://www.vikanttimobile.com/opendatang/data/edo-food-centers.ttl>
where {
?biz a foaf:Organization.
?biz edo:IsLocated ?Address .
?biz foaf:name ?Name.
FILTER ( regex(?Name,'" + nameValue + "','i') || regex(?Address,'" + nameValue + "','i') )
}
Keywords: linkedopendatang, linkedopendata, opendatanigeria, opendatang, opendata, linkeddata, buka, nigeria, restaurant, hotel, naija30, food, edo
Edo State Food Centers Search App.
Edo State Open Data
Edo State Food Centers in RDF/Turtle



Thursday, March 6, 2014
Dataset: State of Nigerian Universities 2012
Description: State of Nigerian Universities 2012 .
Country: Nigeria
Download: RDF/Turtle dump Jan 7 2014 (7kb) ,
Keywords: linkedopendatang, linkedopendata, opendatanigeria, opendatang, opendata, linkeddata, graduate, school, dataset, nigeria, universities, education, naija30, africa30, undergraduate
Information: About the Linked Data document.
Predicates/Properties [via URIBurner Endpoint], [via SPARQLer Endpoint]
Linked Data Follow Your Nose (hosted on rww.io)
Sample Visualization: Pie Chart on the Population of Nigerian Undergraduates by their Courses
Sample SPARQL Queries:
State of Nigerian Universities 2012.
Tuesday, March 4, 2014
Dataset: Edo State Food Centers
Description: Edo State Food Centers .
Country: Nigeria
Download: RDF/Turtle dump Jan 7 2014 (107kb) ,
Keywords: linkedopendatang, linkedopendata, opendatanigeria, opendatang, opendata, linkeddata, dataset, nigeria, edo, food, naija30, africa30, restaurant
Information: About the Linked Data document.
Predicates/Properties [via URIBurner Endpoint], [via SPARQLer Endpoint]
Linked Data Follow Your Nose (hosted on rww.io)
Sample Visualization:
Sample SPARQL Queries:
List of food centers in Edo State Nigeria.
Dataset: Nigerian Government Budgets for Education
Description: Nigeria Government Budgets For Education .
Country: Nigeria
Download: RDF/Turtle dump Feb 1 2014 (5kb) ,
Keywords: linkedopendatang, linkedopendata, opendatanigeria, opendatang, opendata, linkeddata, dataset, nigeria, budget, examination, naija30, africa30, education
Information: About the Linked Data document.
Predicates/Properties [via URIBurner Endpoint], [via SPARQLer Endpoint]
Linked Data Follow Your Nose (hosted on rww.io)
Sample Visualization:
Sample SPARQL Queries:
The top Education Budgets in recent time based on percentage of allocation to Education [via URIBurner Endpoint], [via SPARQLer Endpoint] .
prefix odng: <http://www.vikanttimobile.com/opendatang/data/odng-education-budget.ttl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select str(?year) as ?Year, str(?alloc) as ?Education, str(?budget) as ?TotalBudget, str(?percent) as ?Percent from <http://www.vikanttimobile.com/opendatang/data/odng-education-budget.ttl> where { ?s odng:year ?year . ?s odng:educationAllocation ?alloc. ?s odng:totalBudget ?budget. optional { ?s odng:percentage ?percent. } } order by desc(xsd:double(?percent))
Nigeria Government Budgets For Education.
Dataset: West African Examination Council (WAEC) Examination Results
Description: Results of the West African Examination Council Examination in Nigeria .
Country: Nigeria
Download: RDF/Turtle dump Feb 1 2014 (11kb) ,
Keywords: linkedopendatang, linkedopendata, opendatanigeria, opendatang, opendata, linkeddata, dataset, nigeria, waec, examination, naija30, africa30, education
Information: About the Linked Data document.
Predicates/Properties [via URIBurner Endpoint], [via SPARQLer Endpoint]
Linked Data Follow Your Nose (hosted on rww.io)
Sample Visualization:
Sample SPARQL Queries:
The top 5 WAEC Examinations with the best performance in 5 subjects including English and Maths [via URIBurner Endpoint], [via SPARQLer Endpoint] .
prefix odng: <http://www.vikanttimobile.com/opendatang/data/odng-education-waec-results.ttl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?examName as ?Examination, str(?totalCandidates) as ?TotalCandidates, str(?scored5creditsengmaths) as ?Scored5CreditsEngMaths, str(?pctScored5creditsengmaths) as ?PercentScored5creditsEngMaths from <http://www.vikanttimobile.com/opendatang/data/odng-education-waec-results.ttl> where { ?s rdfs:label ?examName. ?s odng:totalCandidates ?totalCandidates . ?s odng:have5CreditsWithEnglishMaths ?scored5creditsengmaths . ?s odng:pct5CreditsEnglishMaths ?pctScored5creditsengmaths . optional {?s odng:have6Credits ?scored6credits .} optional {?s odng:have5Credits ?scored5credits .} optional {?s odng:have4Credits ?scored4credits .} optional {?s odng:have3Credits ?scored3credits .} optional {?s odng:have2Credits ?scored2credits .}
} order by desc(xsd:integer(?pctScored5creditsengmaths)) limit 5
The top 5 WAEC Examinations with the worst performance in 5 subjects including English and Maths [via URIBurner Endpoint], [via SPARQLer Endpoint] .
prefix odng: <http://www.vikanttimobile.com/opendatang/data/odng-education-waec-results.ttl#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?examName as ?Examination, str(?totalCandidates) as ?TotalCandidates, str(?scored5creditsengmaths) as ?Scored5CreditsEngMaths, str(?pctScored5creditsengmaths) as ?PercentScored5creditsEngMaths from <http://www.vikanttimobile.com/opendatang/data/odng-education-waec-results.ttl> where { ?s rdfs:label ?examName. ?s odng:totalCandidates ?totalCandidates . ?s odng:have5CreditsWithEnglishMaths ?scored5creditsengmaths . ?s odng:pct5CreditsEnglishMaths ?pctScored5creditsengmaths . optional {?s odng:have6Credits ?scored6credits .} optional {?s odng:have5Credits ?scored5credits .} optional {?s odng:have4Credits ?scored4credits .} optional {?s odng:have3Credits ?scored3credits .} optional {?s odng:have2Credits ?scored2credits .}
} order by asc(xsd:integer(?pctScored5creditsengmaths)) limit 5
Results of the West African Examination Council Examination in Nigeria.