Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Semi-‐Automa+cally Modeling Web APIs to Create Linked APIs
Mohsen Taheriyan, Craig A. Knoblock, Pedro Szekely, and Jose Luis Ambite USC Information Sciences Institute
Slide by Shubham Gupta
dbpedia.org!
Current temperature 73°F Wind 10 mph SW Humidity 51% Dew Point 54°
Live weather
Slide by Shubham Gupta
not! dbpedia.org!
Current temperature 73°F Wind 10 mph SW Humidity 51% Dew Point 54°
Events Transparent Ci+es 5/1/2012 REDCAT Theater Saving Our Sons : A Community Conversa+o… …
Events
Slide by Shubham Gupta
not! dbpedia.org!
Current temperature 73°F Wind 10 mph SW Humidity 51% Dew Point 54°
Events Transparent Ci+es 5/1/2012 REDCAT Theater Saving Our Sons : A Community Conversa+o… …
TwiUer Feed Los Angeles becomes the largest U.S. city to ban.. Plas+c grocery bags will now be banned in … …
Live Twitter Feed
Slide by Shubham Gupta
not! dbpedia.org!
Current temperature 73°F Wind 10 mph SW Humidity 51% Dew Point 54°
Events Transparent Ci+es 5/1/2012 REDCAT Theater Saving Our Sons : A Community Conversa+o… …
TwiUer Feed Los Angeles becomes the largest U.S. city to ban.. Plas+c grocery bags will now be banned in … …
Slide by Shubham Gupta
But, the Information is Available in Web APIs ….
Current temperature 73°F Wind 10 mph SW Humidity 51% Dew Point 54°
Events Transparent Ci+es 5/1/2012 REDCAT Theater Saving Our Sons : A Community Conversa+o… …
TwiUer Feed Los Angeles becomes the largest U.S. city to ban.. Plas+c grocery bags will now be banned in … …
Slide by Shubham Gupta
The Problem
? ?
JSON/XML
RDF
RDF/SPARQL Query
Web-‐service Invocation request http://free.worldweatheronline.com/feed/…. format=csv
Slide by Shubham Gupta
Modeling APIs
• Input – Examples of the request URLs – Ontology
• Output – A semantic model of the API built interactively
Slide by Mohsen Taheriyan
Approach
API Invocation
Annotating Inputs and
Outputs
Extracting Relationships
Slide by Mohsen Taheriyan
Service Invoca+on KARMA
Sample Request URLs
Invoking API
Inputs Outputs Slide by Mohsen Taheriyan
Annota+ng Inputs and Outputs • Using Conditional Random Fields (CRF) to assign a semantic type to each column
• Semantic Types – Class – Data property and domain
• Example – OWL Class: State
• http://dbpedia.org/page/California – OWL Data Property, Domain class: State.name
• Califonia
Slide by Mohsen Taheriyan
WeatherReport
WindEvent
TemperatureEvent
WeatherObesrvation
Station
hasObservation
hasStation
hasWindEvent
hasTemperatureEvent hasDate
windSpeed
windDirection
SpatialThing
State City
hasLocation
in
temperature
dewPoint
humidity
description
name
icao
name
Weather Ontology
Slide by Mohsen Taheriyan
WeatherReport
WindEvent
TemperatureEvent
WeatherObesrvation
Station
hasObservation
hasStation
hasWindEvent
hasTemperatureEvent
hasDate
windSpeed
windDirection
SpatialThing
State City
hasLocation
in
temperature
dewPoint
humidity description
name
icao
name
City.name
State.name
WeatherReport.hasDate
TemperatureEvent.temperature
TemperatureEvent.tempeature
WindEvent.windSpeed
WeatherObserva<on.humidity
WeatherObserva<on.descrip<on Sta<on.ICAO
Wrong Label
Slide by Mohsen Taheriyan
Extrac+ng the Rela+onships • Construct a graph from
– Assigned Semantic Types – Ontology Graph
• Select minimal tree that connects all semantic types – A customized Steiner tree algorithm
• Steiner minimal tree (SMT) – G=(V,E) , S ⊂ V, c: E →ℜ (S: Steiner Nodes) – Shortest network connecting vertices of T – Approximation Alg. [Kou & Markowsky, 1981]
• O(|V|2|S|) , Approximation Ratio: less than 2
Slide by Mohsen Taheriyan
Construc+ng Graph
WeatherReport WindEvent TemperatureEvent
WeatherObesrvation Station
State City
name name
hasDate icao
temperature
temperature windSpeed humidity
description
• Graph Initialization – Add one node for each semantic type – For data property types, also add the domain (if not added before)
Slide by Mohsen Taheriyan
Construc+ng Graph • Compute Nodes Closure – Object Property or hasSubClass relations
SpatialThing Spa<alThing – hasSubClass City
WeatherReport WindEvent TemperatureEvent
WeatherObesrvation Station
State City
name name
hasDate icao
temperature
temperature windSpeed humidity
description
Slide by Mohsen Taheriyan
WeatherReport
WindEvent
TemperatureEvent
WeatherObesrvation
Station
SpatialThing State City
Construc+ng Graph
name name
hasDate
icao
temperature
temperature
windspeed
hmidity
description
1 1
1 1
1
1
1 1
1
• Adding the Links – Put a link with w=1 from the domains to data property nodes – For every pair of class nodes like A and B:
• Put a link with w=1 from A to B if there is a direct or inferred object property in the ontology
• If B is a direct or inferred subclass of A, put a link with w=1/ε from A to B
hasLocation
in
1
1
1 1
1 1
1
1
1
1/ε 1/ε
Slide by Mohsen Taheriyan
WeatherReport
WindEvent
TemperatureEvent
WeatherObesrvation
Station
SpatialThing State City
Steiner Tree
name name
hasDate
icao
temperature
temperature
windSpeed
HUMIDITY
description
1 1
1 1
1
1
1 1
1 1
1
1 1
1
1
1
1
1
Steiner Nodes: Semantic Types (Blue Ovals)
1/ε 1/ε
1
1 hasLocation
in
Wrong Link
Slide by Mohsen Taheriyan
Visualizing Model in Karma
Slide by Mohsen Taheriyan
Refinement – Change Seman+c Types
Slide by Mohsen Taheriyan
Refinement – Adjust the links
Click on State
Slide by Mohsen Taheriyan
Final Model in Karma
Slide by Mohsen Taheriyan
Status
JSON/XML
RDF
RDF/SPARQL Query
Web-‐service Invocation request http://free.worldweatheronline.com/feed/…. format=csv
Karma
Slide by Pedro Szekely
Generate Other Models?
Karma Model
MSM Model
LOS Model
LIDS Model
Slide by Pedro Szekely
Current temperature 73°F Wind 10 mph SW Humidity 51% Dew Point 54°
Challenge 1: Live Weather in DBPedia (For Every City)
Slide by Pedro Szekely
Current temperature 73°F Wind 10 mph SW Humidity 51% Dew Point 54°
Challenge 2: Scale-‐Up
Slide by Pedro Szekely