SlideShare une entreprise Scribd logo
1  sur  9
Social Web: Where are the Semantics?
ESWC 2014
Miriam Fernández, Victor Rodríguez,
Andrés García-Silva, Oscar Corcho
Ontology Engineering Group, UPM, Spain
Knowledge Media Institute, The Open University
OAuth
• Twitter needs authentication
• Many SNS rely on OAuth to grant access to API features
• OAuth is a security protocol for Web applications.
– Security for REST and XML-RPC services.
– Signed HTTP Requests
– Safe, Password-less Token Exchange
• Actors: User / ServiceProvider / Consumer
ESWC 2014 Social Web: Where are the Semantics? 2
Twitter API
• General ideas
– Limit on the requests, in a per 15-min basis
– Each Tweet as an ID
– Objets: Tweets, Users, Entities (hashtags, photos, urls…), Places
• Capabilities
– Timelines (of user mentions, retweets, etc.)
– Tweets (given ID, retweet, etc.)
– Search (shown this in this tutorial)
– Friends & Followers, Direct Messages, Favourites, Trends….
– Places & Geo
– Users
– Streaming (the most powerful!)
ESWC 2014 Social Web: Where are the Semantics? 3
1.- Obtain a Twitter account, register application
ESWC 2014 Social Web: Where are the Semantics? 4
1. Register a new Twitter account (or use yours)
2. Register as a developer: https://dev.twitter.com/
3. Register your new application
2. – Obtain your credentials
4. See your API keys and generate a token
ESWC 2014 Social Web: Where are the Semantics? 5
To set up your project…you need two files
• TwitterDataCollector.java contains the code that you need to use
the Twitter REST API
• twitterCollector.properties. This is the properties file that you need
to set up. You need to add:
– consumerKey = (the data obtained in the step before)
– consumerSecret = (the data obtained in the step before)
– accessToken = (the data obtained in the step before)
– accessTokenSecret = (the data obtained in the step before)
ESWC 2014 Social Web: Where are the Semantics? 6
TwitterDataCollector
• You can find the code:
– In the code folder of the given USB
– https://gist.github.com/vroddon/9d5aac253afaa14c9471
• Open a command line window
• Test 1
– java -jar TwitterDataCollector.jar
– And you will have searched for tweets containing the word "#eswc2014"
• Test 2
– java -jar TwitterDataCollector.jar twitterCollector.properties #obama
– And you will have used the given properties file looking for the hashtag
#obama
• Output: a list of JSONs with Tweet info, one tweet per line
ESWC 2014 Social Web: Where are the Semantics? 7
Sample output
• Hint: use http://jsonviewer.stack.hu/ to see the JSON
ESWC 2014 Social Web: Where are the Semantics? 8
Sample output (II)
ESWC 2014 Social Web: Where are the Semantics? 9

Contenu connexe

Plus de Miriam Fernandez

Iswc 2011: Linking Data Across Universities: An Integrated Video Lectures Dat...
Iswc 2011: Linking Data Across Universities: An Integrated Video Lectures Dat...Iswc 2011: Linking Data Across Universities: An Integrated Video Lectures Dat...
Iswc 2011: Linking Data Across Universities: An Integrated Video Lectures Dat...
Miriam Fernandez
 

Plus de Miriam Fernandez (15)

On the Application of Social Data Science to Address Societal Challenges
On the Application of Social Data Science to Address Societal ChallengesOn the Application of Social Data Science to Address Societal Challenges
On the Application of Social Data Science to Address Societal Challenges
 
Online radicalisation: work, challenges and future directions
Online radicalisation: work, challenges and future directionsOnline radicalisation: work, challenges and future directions
Online radicalisation: work, challenges and future directions
 
Mining Social Media Data For Policing
Mining Social Media Data For PolicingMining Social Media Data For Policing
Mining Social Media Data For Policing
 
Introduction to Mining Social Media Data
Introduction to Mining Social Media DataIntroduction to Mining Social Media Data
Introduction to Mining Social Media Data
 
Online Misinformation: Challenges and Future Directions
Online Misinformation: Challenges and Future DirectionsOnline Misinformation: Challenges and Future Directions
Online Misinformation: Challenges and Future Directions
 
Slides 28-feb-2018-v2.pptx
Slides 28-feb-2018-v2.pptxSlides 28-feb-2018-v2.pptx
Slides 28-feb-2018-v2.pptx
 
Artificial Intelligence for Policing
Artificial Intelligence for PolicingArtificial Intelligence for Policing
Artificial Intelligence for Policing
 
OUSocial OUSocMed conference
OUSocial OUSocMed conference OUSocial OUSocMed conference
OUSocial OUSocMed conference
 
On the use of social media for evidence-based policing
On the use of social media for evidence-based policingOn the use of social media for evidence-based policing
On the use of social media for evidence-based policing
 
ESWC 2014 Tutorial Part 4
ESWC 2014 Tutorial Part 4ESWC 2014 Tutorial Part 4
ESWC 2014 Tutorial Part 4
 
ESWC 2014 Tutorial part 2
ESWC 2014 Tutorial part 2ESWC 2014 Tutorial part 2
ESWC 2014 Tutorial part 2
 
ESWC 2014 Tutorial part 1
ESWC 2014 Tutorial part 1ESWC 2014 Tutorial part 1
ESWC 2014 Tutorial part 1
 
Wm unit1.6-slides-semantic web-final
Wm unit1.6-slides-semantic web-finalWm unit1.6-slides-semantic web-final
Wm unit1.6-slides-semantic web-final
 
CAEPIA 2011
CAEPIA 2011CAEPIA 2011
CAEPIA 2011
 
Iswc 2011: Linking Data Across Universities: An Integrated Video Lectures Dat...
Iswc 2011: Linking Data Across Universities: An Integrated Video Lectures Dat...Iswc 2011: Linking Data Across Universities: An Integrated Video Lectures Dat...
Iswc 2011: Linking Data Across Universities: An Integrated Video Lectures Dat...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

ESWC 2014 Tutorial Handson 1: Collect Data from Twitter

  • 1. Social Web: Where are the Semantics? ESWC 2014 Miriam Fernández, Victor Rodríguez, Andrés García-Silva, Oscar Corcho Ontology Engineering Group, UPM, Spain Knowledge Media Institute, The Open University
  • 2. OAuth • Twitter needs authentication • Many SNS rely on OAuth to grant access to API features • OAuth is a security protocol for Web applications. – Security for REST and XML-RPC services. – Signed HTTP Requests – Safe, Password-less Token Exchange • Actors: User / ServiceProvider / Consumer ESWC 2014 Social Web: Where are the Semantics? 2
  • 3. Twitter API • General ideas – Limit on the requests, in a per 15-min basis – Each Tweet as an ID – Objets: Tweets, Users, Entities (hashtags, photos, urls…), Places • Capabilities – Timelines (of user mentions, retweets, etc.) – Tweets (given ID, retweet, etc.) – Search (shown this in this tutorial) – Friends & Followers, Direct Messages, Favourites, Trends…. – Places & Geo – Users – Streaming (the most powerful!) ESWC 2014 Social Web: Where are the Semantics? 3
  • 4. 1.- Obtain a Twitter account, register application ESWC 2014 Social Web: Where are the Semantics? 4 1. Register a new Twitter account (or use yours) 2. Register as a developer: https://dev.twitter.com/ 3. Register your new application
  • 5. 2. – Obtain your credentials 4. See your API keys and generate a token ESWC 2014 Social Web: Where are the Semantics? 5
  • 6. To set up your project…you need two files • TwitterDataCollector.java contains the code that you need to use the Twitter REST API • twitterCollector.properties. This is the properties file that you need to set up. You need to add: – consumerKey = (the data obtained in the step before) – consumerSecret = (the data obtained in the step before) – accessToken = (the data obtained in the step before) – accessTokenSecret = (the data obtained in the step before) ESWC 2014 Social Web: Where are the Semantics? 6
  • 7. TwitterDataCollector • You can find the code: – In the code folder of the given USB – https://gist.github.com/vroddon/9d5aac253afaa14c9471 • Open a command line window • Test 1 – java -jar TwitterDataCollector.jar – And you will have searched for tweets containing the word "#eswc2014" • Test 2 – java -jar TwitterDataCollector.jar twitterCollector.properties #obama – And you will have used the given properties file looking for the hashtag #obama • Output: a list of JSONs with Tweet info, one tweet per line ESWC 2014 Social Web: Where are the Semantics? 7
  • 8. Sample output • Hint: use http://jsonviewer.stack.hu/ to see the JSON ESWC 2014 Social Web: Where are the Semantics? 8
  • 9. Sample output (II) ESWC 2014 Social Web: Where are the Semantics? 9