Powered by BBC Connected Studio

Seedhack 4.0
Paul Wilton (@pwilton)
Technical Architect
Ontoba (@Ontoba1)
www.ontoba.com
Juicer Data + APIs
•
•

Approx 500k news articles – various news providers

•
•

Concept APIs - find and lookup concepts

Each article semantically annotated with DBpedia
Concepts, Events and Storylines

News APIs - query news via the semantic annotations
– use SPARQL !
API Endpoints
ROOT : /bbc.api.mashery.com/juicer-ld-api/
Accept : application/json
Common API Query Parameters :
limit = {integer} - limits number of things returned
before = {yyyy-mm-dd} - restricts by article date
after = {yyyy-mm-dd} - restricts by article date
api_key = {your mashery key}
Signup for Mashery Key
http://bbc.mashery.com/

Live Examples
http://newshack.co.uk/tech-talks/juicer-apis/
Docs
http://bbc.mashery.com/docs/read/Home
Concept APIs
Find Concepts - OpenSearch Suggestions JSON
GET /concepts/tagged?q={ text search term }

Find Concepts - filtered by class
GET /concepts/tagged?q={ text }&class={ ontology class }
Example :
GET /concepts/tagged?q=goo&class=http://dbpedia.org/ontology/Organisation

GET a Concept
GET /concepts?uri=http://dbpedia.org/resource/Larry_Page
Get Concept Occurrences
ordered my most frequent first
GET /concepts/occurrences?type={ type URI }
Example
GET /concepts/occurrences?type=http://dbpedia.org/ontology/Person
&after=2013-10-01
Get Concept Co-Occurrences
Finds concepts co-occurring with the supplied concept
ordered by most frequently occurring
GET /concepts/co-occurrences?concept={ source concept URI }&type={ type URI }

Example
GET /concepts/co-occurrences?concept=http://dbpedia.org/resource/Barack_Obama&
type=http://dbpedia.org/ontology/Person&after=2013-10-01
Search News Articles
Full Text Search for Articles:
GET /search?q={ text phrase }

Example
GET /search?q=chemical weapons&limit=20&after=2013-09-01
Semantic Query for News Articles
Use SPARQL grammar to find articles
Exploit the DBpedia ontology
GET /articles?binding=articles&where={ sparql grammar, URL encoded }
Example clause, that finds articles tagged with companies in the aerospace
industry:
?articles cwork:tag ?thing .
?thing a <http://dbpedia.org/ontology/Company> .
?thing <http://dbpedia.org/ontology/industry>
<http://dbpedia.org/resource/Aerospace> .
Live Examples
http://newshack.co.uk/tech-talks/juicer-apis/

Signup for Mashery Key
http://bbc.mashery.com/

Find me tomorrow and ask me questions !
Paul Wilton @pwilton

BBC JUICER API Presentation - for SeedHack 4.0 - BBC News Labs

  • 1.
    Powered by BBCConnected Studio Seedhack 4.0
  • 2.
    Paul Wilton (@pwilton) TechnicalArchitect Ontoba (@Ontoba1) www.ontoba.com
  • 3.
    Juicer Data +APIs • • Approx 500k news articles – various news providers • • Concept APIs - find and lookup concepts Each article semantically annotated with DBpedia Concepts, Events and Storylines News APIs - query news via the semantic annotations – use SPARQL !
  • 4.
    API Endpoints ROOT :/bbc.api.mashery.com/juicer-ld-api/ Accept : application/json Common API Query Parameters : limit = {integer} - limits number of things returned before = {yyyy-mm-dd} - restricts by article date after = {yyyy-mm-dd} - restricts by article date api_key = {your mashery key}
  • 5.
    Signup for MasheryKey http://bbc.mashery.com/ Live Examples http://newshack.co.uk/tech-talks/juicer-apis/ Docs http://bbc.mashery.com/docs/read/Home
  • 6.
    Concept APIs Find Concepts- OpenSearch Suggestions JSON GET /concepts/tagged?q={ text search term } Find Concepts - filtered by class GET /concepts/tagged?q={ text }&class={ ontology class } Example : GET /concepts/tagged?q=goo&class=http://dbpedia.org/ontology/Organisation GET a Concept GET /concepts?uri=http://dbpedia.org/resource/Larry_Page
  • 7.
    Get Concept Occurrences orderedmy most frequent first GET /concepts/occurrences?type={ type URI } Example GET /concepts/occurrences?type=http://dbpedia.org/ontology/Person &after=2013-10-01
  • 8.
    Get Concept Co-Occurrences Findsconcepts co-occurring with the supplied concept ordered by most frequently occurring GET /concepts/co-occurrences?concept={ source concept URI }&type={ type URI } Example GET /concepts/co-occurrences?concept=http://dbpedia.org/resource/Barack_Obama& type=http://dbpedia.org/ontology/Person&after=2013-10-01
  • 9.
    Search News Articles FullText Search for Articles: GET /search?q={ text phrase } Example GET /search?q=chemical weapons&limit=20&after=2013-09-01
  • 10.
    Semantic Query forNews Articles Use SPARQL grammar to find articles Exploit the DBpedia ontology GET /articles?binding=articles&where={ sparql grammar, URL encoded } Example clause, that finds articles tagged with companies in the aerospace industry: ?articles cwork:tag ?thing . ?thing a <http://dbpedia.org/ontology/Company> . ?thing <http://dbpedia.org/ontology/industry> <http://dbpedia.org/resource/Aerospace> .
  • 11.
    Live Examples http://newshack.co.uk/tech-talks/juicer-apis/ Signup forMashery Key http://bbc.mashery.com/ Find me tomorrow and ask me questions ! Paul Wilton @pwilton