SlideShare uma empresa Scribd logo
1 de 7
Linked Data &
Semantic Web
Technology
Development of
Twitter Applications
Part 7. Search API
Dr. Myungjin Lee
Linked Data & Semantic Web Technology
Search API
• Search REST API
– find and return a collection of relevant Tweets based
on matching a specified query
• Limitation
– not complete index of all Tweets, but instead an index
of recent 6-9 days of Tweets
– cannot find Tweets older than about a week.
– limited due to complexity
– not support authentication meaning all queries are
made anonymously.
– focused in relevance and not completeness
– limited to 1,000 characters in query length, including
any operators.
2
Linked Data & Semantic Web Technology
Search Operator
3
Example Finds tweets...
twitter search containing both "twitter" and "search". This is the default operator
"happy hour" containing the exact phrase "happy hour"
love OR hate containing either "love" or "hate" (or both)
beer -root containing "beer" but not "root"
#haiku containing the hashtag "haiku"
from:twitterapi sent from the user @twitterapi
to:twitterapi sent to the user @twitterapi
place:opentable:2 about the place with OpenTable ID 2
place:247f43d441defc03 about the place with Twitter ID 247f43d441defc03
@twitterapi mentioning @twitterapi
superhero since:2011-05-09 containing "superhero" and sent since date "2011-05-09"
twitterapi until:2011-05-09 containing "twitterapi" and sent before the date "2011-05-09".
movie -scary :) containing "movie", but not "scary", and with a positive attitude.
flight :( containing "flight" and with a negative attitude.
traffic ? containing "traffic" and asking a question.
hilarious filter:links containing "hilarious" and with a URL.
news source:tweet_button containing "news" and entered via the Tweet Button
Linked Data & Semantic Web Technology
GET search/tweets
• Resource URL
– https://api.twitter.com/1.1/search/tweets.json
• Parameters
• Other Information
– Requests per rate limit window: 180/user, 450/app
– Authentication: Required
– Response Object: Tweets
q
required
A UTF-8, URL-encoded search query of 1,000 characters maximum, including
operators. Queries may additionally be limited by complexity.
geocode
optional
Returns tweets by users located within a given radius of the given latitude/longitude.
lang
optional
Restricts tweets to the given language, given by an ISO 639-1 code. Language
detection is best-effort.
result_type
optional
Optional. Specifies what type of search results you would prefer to receive. The
current default is "mixed." Valid values include:
* mixed: Include both popular and real time results in the response.
* recent: return only the most recent results in the response
* popular: return only the most popular results in the response.
count
optional
The number of tweets to return per page, up to a maximum of 100. Defaults to 15.
until
optional
Returns tweets generated before the given date. Date should be formatted as
YYYY-MM-DD.
since_id
optional
Returns results with an ID greater than (that is, more recent than) the specified ID.
max_id
optional
Returns results with an ID less than (that is, older than) or equal to the specified ID.
include_entities
optional
The entities node will be disincluded when set to false.
callback
optional
If supplied, the response will use the JSONP format with a callback of the given
name.
4
Linked Data & Semantic Web Technology
Twitter4J Classes for Search
• SearchResource Interface
– Methods
• QueryResult search(Query query)
• Query Class
– A data class represents search query.
– Constructor
• Query()
• Query(java.lang.String query)
– Methods
• void setCount(int count)
• void setGeoCode(GeoLocation location, double radius,
java.lang.String unit)
• void setLang(java.lang.String lang)
• void setLocale(java.lang.String locale)
• void setMaxId(long maxId)
• void setQuery(java.lang.String query)
• void setResultType(java.lang.String resultType)
– MIXED, POPULAR, RECENT
• void setSince(java.lang.String since)
• void setSinceId(long sinceId)
• void setUntil(java.lang.String until)
5
Linked Data & Semantic Web Technology
Twitter4J Classes for Search
• QueryResult Interface
– A data interface representing search API response
– Methods
• int getCount()
• long getMaxId()
• java.lang.String getQuery()
• long getSinceId()
• java.util.List<Status> getTweets()
• boolean hasNext()
• Query nextQuery()
6
Linked Data & Semantic Web Technology
Searching Tweets
1. import java.util.List;
2. import twitter4j.Query;
3. import twitter4j.QueryResult;
4. import twitter4j.Status;
5. import twitter4j.Twitter;
6. import twitter4j.TwitterException;
7. import twitter4j.TwitterFactory;
8. public class TwitterSearch {
9. Twitter twitter = null;
10. public TwitterSearch() {
11. this.twitter = TwitterFactory.getSingleton();
12. this.twitter.setOAuthConsumer(TwitterAccessToken.consumerKey,
13. TwitterAccessToken.consumerSecret);
14. this.twitter.setOAuthAccessToken(TwitterAccessToken.loadAccessToken());
15. }
16. public static void main(String args[]) throws TwitterException {
17. TwitterSearch tt = new TwitterSearch();
18. Query q = new Query();
19. q.setQuery("GentleMan");
20. q.setResultType(Query.RECENT);
21. q.setCount(100);
22. QueryResult qr = tt.twitter.search(q);
23. List<Status> tweets = qr.getTweets();
24. for (int i = 0; i < tweets.size(); i++) {
25. Status tweet = tweets.get(i);
26. System.out.println("Text: " + tweet.getText() + ", "
27. + tweet.getCreatedAt() + ", " + tweet.getRetweetCount());
28. }
29. }
30. }
7

Mais conteúdo relacionado

Mais procurados

Improving VIVO search through semantic ranking.
Improving VIVO search through semantic ranking.Improving VIVO search through semantic ranking.
Improving VIVO search through semantic ranking.Deepak K
 
Search Me: Using Lucene.Net
Search Me: Using Lucene.NetSearch Me: Using Lucene.Net
Search Me: Using Lucene.Netgramana
 
A Learning to Rank Project on a Daily Song Ranking Problem
A Learning to Rank Project on a Daily Song Ranking ProblemA Learning to Rank Project on a Daily Song Ranking Problem
A Learning to Rank Project on a Daily Song Ranking ProblemSease
 
Explainability for Learning to Rank
Explainability for Learning to RankExplainability for Learning to Rank
Explainability for Learning to RankSease
 
Advanced Document Similarity With Apache Lucene
Advanced Document Similarity With Apache LuceneAdvanced Document Similarity With Apache Lucene
Advanced Document Similarity With Apache LuceneAlessandro Benedetti
 
Search Engines and its working
Search Engines and its workingSearch Engines and its working
Search Engines and its workingMukesh Kumar
 
Googling of GooGle
Googling of GooGleGoogling of GooGle
Googling of GooGlebinit singh
 
Introduction into Search Engines and Information Retrieval
Introduction into Search Engines and Information RetrievalIntroduction into Search Engines and Information Retrieval
Introduction into Search Engines and Information RetrievalA. LE
 
From Academic Papers To Production : A Learning To Rank Story
From Academic Papers To Production : A Learning To Rank StoryFrom Academic Papers To Production : A Learning To Rank Story
From Academic Papers To Production : A Learning To Rank StoryAlessandro Benedetti
 
Bio solr building a better search for bioinformatics
Bio solr   building a better search for bioinformaticsBio solr   building a better search for bioinformatics
Bio solr building a better search for bioinformaticsCharlie Hull
 
The Crossref/ORCID Auto-Update: all you need to know
The Crossref/ORCID Auto-Update: all you need to knowThe Crossref/ORCID Auto-Update: all you need to know
The Crossref/ORCID Auto-Update: all you need to knowCrossref
 
Sfx monthly training - final
Sfx monthly training - finalSfx monthly training - final
Sfx monthly training - finalntunmg
 
Web Crawlers - Exploring the WWW
Web Crawlers - Exploring the WWWWeb Crawlers - Exploring the WWW
Web Crawlers - Exploring the WWWSiddhartha Anand
 
GContext: A context-based query construction service for Google
GContext: A context-based query construction service for GoogleGContext: A context-based query construction service for Google
GContext: A context-based query construction service for GoogleJohn Pap
 
Extracting Resources that Help Tell Events' Stories
Extracting Resources that Help Tell Events' StoriesExtracting Resources that Help Tell Events' Stories
Extracting Resources that Help Tell Events' StoriesCarlo Andrea Conte
 
Search engines powerpoint
Search engines powerpointSearch engines powerpoint
Search engines powerpointvbaker2210
 

Mais procurados (20)

Stack_Overflow-Network_Graph
Stack_Overflow-Network_GraphStack_Overflow-Network_Graph
Stack_Overflow-Network_Graph
 
Improving VIVO search through semantic ranking.
Improving VIVO search through semantic ranking.Improving VIVO search through semantic ranking.
Improving VIVO search through semantic ranking.
 
Vivo Search
Vivo SearchVivo Search
Vivo Search
 
Search Me: Using Lucene.Net
Search Me: Using Lucene.NetSearch Me: Using Lucene.Net
Search Me: Using Lucene.Net
 
A Learning to Rank Project on a Daily Song Ranking Problem
A Learning to Rank Project on a Daily Song Ranking ProblemA Learning to Rank Project on a Daily Song Ranking Problem
A Learning to Rank Project on a Daily Song Ranking Problem
 
Explainability for Learning to Rank
Explainability for Learning to RankExplainability for Learning to Rank
Explainability for Learning to Rank
 
Advanced Document Similarity With Apache Lucene
Advanced Document Similarity With Apache LuceneAdvanced Document Similarity With Apache Lucene
Advanced Document Similarity With Apache Lucene
 
Search Engines and its working
Search Engines and its workingSearch Engines and its working
Search Engines and its working
 
Googling of GooGle
Googling of GooGleGoogling of GooGle
Googling of GooGle
 
Introduction into Search Engines and Information Retrieval
Introduction into Search Engines and Information RetrievalIntroduction into Search Engines and Information Retrieval
Introduction into Search Engines and Information Retrieval
 
Web Search Engine
Web Search EngineWeb Search Engine
Web Search Engine
 
From Academic Papers To Production : A Learning To Rank Story
From Academic Papers To Production : A Learning To Rank StoryFrom Academic Papers To Production : A Learning To Rank Story
From Academic Papers To Production : A Learning To Rank Story
 
Bio solr building a better search for bioinformatics
Bio solr   building a better search for bioinformaticsBio solr   building a better search for bioinformatics
Bio solr building a better search for bioinformatics
 
The Crossref/ORCID Auto-Update: all you need to know
The Crossref/ORCID Auto-Update: all you need to knowThe Crossref/ORCID Auto-Update: all you need to know
The Crossref/ORCID Auto-Update: all you need to know
 
Sfx monthly training - final
Sfx monthly training - finalSfx monthly training - final
Sfx monthly training - final
 
Web Crawlers - Exploring the WWW
Web Crawlers - Exploring the WWWWeb Crawlers - Exploring the WWW
Web Crawlers - Exploring the WWW
 
GContext: A context-based query construction service for Google
GContext: A context-based query construction service for GoogleGContext: A context-based query construction service for Google
GContext: A context-based query construction service for Google
 
Extracting Resources that Help Tell Events' Stories
Extracting Resources that Help Tell Events' StoriesExtracting Resources that Help Tell Events' Stories
Extracting Resources that Help Tell Events' Stories
 
Search engines powerpoint
Search engines powerpointSearch engines powerpoint
Search engines powerpoint
 
Search Engine
Search EngineSearch Engine
Search Engine
 

Destaque

시맨틱 웹에서의 콘텐츠 검색(Contents search on the semantic web)
시맨틱 웹에서의 콘텐츠 검색(Contents search on the semantic web)시맨틱 웹에서의 콘텐츠 검색(Contents search on the semantic web)
시맨틱 웹에서의 콘텐츠 검색(Contents search on the semantic web)Myungjin Lee
 
Development of Twitter Application #3 - OAuth
Development of Twitter Application #3 - OAuthDevelopment of Twitter Application #3 - OAuth
Development of Twitter Application #3 - OAuthMyungjin Lee
 
Domain, Range, Functions -5 2 All Ex amples
Domain, Range, Functions -5 2 All Ex amplesDomain, Range, Functions -5 2 All Ex amples
Domain, Range, Functions -5 2 All Ex amplesguestf492df
 
The Semantic Web #6 - RDF Schema
The Semantic Web #6 - RDF SchemaThe Semantic Web #6 - RDF Schema
The Semantic Web #6 - RDF SchemaMyungjin Lee
 
Mining Social media for Product Development & Marketing Insights
Mining Social media for Product Development & Marketing InsightsMining Social media for Product Development & Marketing Insights
Mining Social media for Product Development & Marketing Insightsjuliannacole
 
Social Semantic Web on Facebook Open Graph protocol and Twitter Annotations
Social Semantic Web on Facebook Open Graph protocol and Twitter AnnotationsSocial Semantic Web on Facebook Open Graph protocol and Twitter Annotations
Social Semantic Web on Facebook Open Graph protocol and Twitter AnnotationsMyungjin Lee
 
The Standardization of Semantic Web Ontology
The Standardization of Semantic Web OntologyThe Standardization of Semantic Web Ontology
The Standardization of Semantic Web OntologyMyungjin Lee
 
쉽게 이해하는 LOD
쉽게 이해하는 LOD쉽게 이해하는 LOD
쉽게 이해하는 LODMyungjin Lee
 

Destaque (9)

시맨틱 웹에서의 콘텐츠 검색(Contents search on the semantic web)
시맨틱 웹에서의 콘텐츠 검색(Contents search on the semantic web)시맨틱 웹에서의 콘텐츠 검색(Contents search on the semantic web)
시맨틱 웹에서의 콘텐츠 검색(Contents search on the semantic web)
 
Development of Twitter Application #3 - OAuth
Development of Twitter Application #3 - OAuthDevelopment of Twitter Application #3 - OAuth
Development of Twitter Application #3 - OAuth
 
Hpm2010seminar2
Hpm2010seminar2Hpm2010seminar2
Hpm2010seminar2
 
Domain, Range, Functions -5 2 All Ex amples
Domain, Range, Functions -5 2 All Ex amplesDomain, Range, Functions -5 2 All Ex amples
Domain, Range, Functions -5 2 All Ex amples
 
The Semantic Web #6 - RDF Schema
The Semantic Web #6 - RDF SchemaThe Semantic Web #6 - RDF Schema
The Semantic Web #6 - RDF Schema
 
Mining Social media for Product Development & Marketing Insights
Mining Social media for Product Development & Marketing InsightsMining Social media for Product Development & Marketing Insights
Mining Social media for Product Development & Marketing Insights
 
Social Semantic Web on Facebook Open Graph protocol and Twitter Annotations
Social Semantic Web on Facebook Open Graph protocol and Twitter AnnotationsSocial Semantic Web on Facebook Open Graph protocol and Twitter Annotations
Social Semantic Web on Facebook Open Graph protocol and Twitter Annotations
 
The Standardization of Semantic Web Ontology
The Standardization of Semantic Web OntologyThe Standardization of Semantic Web Ontology
The Standardization of Semantic Web Ontology
 
쉽게 이해하는 LOD
쉽게 이해하는 LOD쉽게 이해하는 LOD
쉽게 이해하는 LOD
 

Semelhante a Development of Twitter Application #7 - Search

Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIsamesar0
 
Development of Twitter Application #8 - Streaming API
Development of Twitter Application #8 - Streaming APIDevelopment of Twitter Application #8 - Streaming API
Development of Twitter Application #8 - Streaming APIMyungjin Lee
 
Development of Twitter Application #5 - Users
Development of Twitter Application #5 - UsersDevelopment of Twitter Application #5 - Users
Development of Twitter Application #5 - UsersMyungjin Lee
 
Building Social Tools
Building Social ToolsBuilding Social Tools
Building Social ToolsAnand Hemmige
 
Fun! with the Twitter API
Fun! with the Twitter APIFun! with the Twitter API
Fun! with the Twitter APIErin Shellman
 
Development of Twitter Application #4 - Timeline and Tweet
Development of Twitter Application #4 - Timeline and TweetDevelopment of Twitter Application #4 - Timeline and Tweet
Development of Twitter Application #4 - Timeline and TweetMyungjin Lee
 
Social Media Data Collection & Analysis
Social Media Data Collection & AnalysisSocial Media Data Collection & Analysis
Social Media Data Collection & AnalysisScott Sanders
 
Using Thinking Sphinx with rails
Using Thinking Sphinx with railsUsing Thinking Sphinx with rails
Using Thinking Sphinx with railsRishav Dixit
 
Hacking RSS: Filtering & Processing Obscene Amounts of Information (short ve...
Hacking RSS: Filtering & Processing  Obscene Amounts of Information (short ve...Hacking RSS: Filtering & Processing  Obscene Amounts of Information (short ve...
Hacking RSS: Filtering & Processing Obscene Amounts of Information (short ve...Dawn Foster
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformAntonio Peric-Mazar
 
aip-workshop1-dev-tutorial
aip-workshop1-dev-tutorialaip-workshop1-dev-tutorial
aip-workshop1-dev-tutorialMatthew Vaughn
 
restapitest-anil-200517181251.pdf
restapitest-anil-200517181251.pdfrestapitest-anil-200517181251.pdf
restapitest-anil-200517181251.pdfmrle7
 
Rest API Testing
Rest API TestingRest API Testing
Rest API Testingupadhyay_25
 
Sumo Logic Search Job API
Sumo Logic Search Job APISumo Logic Search Job API
Sumo Logic Search Job APISumo Logic
 
Improving your team’s source code searching capabilities
Improving your team’s source code searching capabilitiesImproving your team’s source code searching capabilities
Improving your team’s source code searching capabilitiesNikos Katirtzis
 
Improving your team's source code searching capabilities - Voxxed Thessalonik...
Improving your team's source code searching capabilities - Voxxed Thessalonik...Improving your team's source code searching capabilities - Voxxed Thessalonik...
Improving your team's source code searching capabilities - Voxxed Thessalonik...Nikos Katirtzis
 
Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001Fred Meng
 
SXSW Hacking RSS: Filtering & Processing Obscene Amounts of Information
SXSW Hacking RSS: Filtering & Processing Obscene Amounts of InformationSXSW Hacking RSS: Filtering & Processing Obscene Amounts of Information
SXSW Hacking RSS: Filtering & Processing Obscene Amounts of InformationDawn Foster
 

Semelhante a Development of Twitter Application #7 - Search (20)

Twitter api
Twitter apiTwitter api
Twitter api
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
 
Jinchao demo v3
Jinchao demo v3Jinchao demo v3
Jinchao demo v3
 
Development of Twitter Application #8 - Streaming API
Development of Twitter Application #8 - Streaming APIDevelopment of Twitter Application #8 - Streaming API
Development of Twitter Application #8 - Streaming API
 
Development of Twitter Application #5 - Users
Development of Twitter Application #5 - UsersDevelopment of Twitter Application #5 - Users
Development of Twitter Application #5 - Users
 
Building Social Tools
Building Social ToolsBuilding Social Tools
Building Social Tools
 
Fun! with the Twitter API
Fun! with the Twitter APIFun! with the Twitter API
Fun! with the Twitter API
 
Development of Twitter Application #4 - Timeline and Tweet
Development of Twitter Application #4 - Timeline and TweetDevelopment of Twitter Application #4 - Timeline and Tweet
Development of Twitter Application #4 - Timeline and Tweet
 
Social Media Data Collection & Analysis
Social Media Data Collection & AnalysisSocial Media Data Collection & Analysis
Social Media Data Collection & Analysis
 
Using Thinking Sphinx with rails
Using Thinking Sphinx with railsUsing Thinking Sphinx with rails
Using Thinking Sphinx with rails
 
Hacking RSS: Filtering & Processing Obscene Amounts of Information (short ve...
Hacking RSS: Filtering & Processing  Obscene Amounts of Information (short ve...Hacking RSS: Filtering & Processing  Obscene Amounts of Information (short ve...
Hacking RSS: Filtering & Processing Obscene Amounts of Information (short ve...
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
aip-workshop1-dev-tutorial
aip-workshop1-dev-tutorialaip-workshop1-dev-tutorial
aip-workshop1-dev-tutorial
 
restapitest-anil-200517181251.pdf
restapitest-anil-200517181251.pdfrestapitest-anil-200517181251.pdf
restapitest-anil-200517181251.pdf
 
Rest API Testing
Rest API TestingRest API Testing
Rest API Testing
 
Sumo Logic Search Job API
Sumo Logic Search Job APISumo Logic Search Job API
Sumo Logic Search Job API
 
Improving your team’s source code searching capabilities
Improving your team’s source code searching capabilitiesImproving your team’s source code searching capabilities
Improving your team’s source code searching capabilities
 
Improving your team's source code searching capabilities - Voxxed Thessalonik...
Improving your team's source code searching capabilities - Voxxed Thessalonik...Improving your team's source code searching capabilities - Voxxed Thessalonik...
Improving your team's source code searching capabilities - Voxxed Thessalonik...
 
Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001
 
SXSW Hacking RSS: Filtering & Processing Obscene Amounts of Information
SXSW Hacking RSS: Filtering & Processing Obscene Amounts of InformationSXSW Hacking RSS: Filtering & Processing Obscene Amounts of Information
SXSW Hacking RSS: Filtering & Processing Obscene Amounts of Information
 

Mais de Myungjin Lee

지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)Myungjin Lee
 
JSP 프로그래밍 #05 HTML과 JSP
JSP 프로그래밍 #05 HTML과 JSPJSP 프로그래밍 #05 HTML과 JSP
JSP 프로그래밍 #05 HTML과 JSPMyungjin Lee
 
JSP 프로그래밍 #04 JSP 의 기본
JSP 프로그래밍 #04 JSP 의 기본JSP 프로그래밍 #04 JSP 의 기본
JSP 프로그래밍 #04 JSP 의 기본Myungjin Lee
 
JSP 프로그래밍 #03 서블릿
JSP 프로그래밍 #03 서블릿JSP 프로그래밍 #03 서블릿
JSP 프로그래밍 #03 서블릿Myungjin Lee
 
JSP 프로그래밍 #02 서블릿과 JSP 시작하기
JSP 프로그래밍 #02 서블릿과 JSP 시작하기JSP 프로그래밍 #02 서블릿과 JSP 시작하기
JSP 프로그래밍 #02 서블릿과 JSP 시작하기Myungjin Lee
 
JSP 프로그래밍 #01 웹 프로그래밍
JSP 프로그래밍 #01 웹 프로그래밍JSP 프로그래밍 #01 웹 프로그래밍
JSP 프로그래밍 #01 웹 프로그래밍Myungjin Lee
 
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)Myungjin Lee
 
오픈 데이터와 인공지능
오픈 데이터와 인공지능오픈 데이터와 인공지능
오픈 데이터와 인공지능Myungjin Lee
 
법령 온톨로지의 구축 및 검색
법령 온톨로지의 구축 및 검색법령 온톨로지의 구축 및 검색
법령 온톨로지의 구축 및 검색Myungjin Lee
 
도서관과 Linked Data
도서관과 Linked Data도서관과 Linked Data
도서관과 Linked DataMyungjin Lee
 
공공데이터, 현재 우리는?
공공데이터, 현재 우리는?공공데이터, 현재 우리는?
공공데이터, 현재 우리는?Myungjin Lee
 
LODAC 2017 Linked Open Data Workshop
LODAC 2017 Linked Open Data WorkshopLODAC 2017 Linked Open Data Workshop
LODAC 2017 Linked Open Data WorkshopMyungjin Lee
 
Introduction of Deep Learning
Introduction of Deep LearningIntroduction of Deep Learning
Introduction of Deep LearningMyungjin Lee
 
서울시 열린데이터 광장 문화관광 분야 LOD 서비스
서울시 열린데이터 광장 문화관광 분야 LOD 서비스서울시 열린데이터 광장 문화관광 분야 LOD 서비스
서울시 열린데이터 광장 문화관광 분야 LOD 서비스Myungjin Lee
 
LOD(Linked Open Data) Recommendations
LOD(Linked Open Data) RecommendationsLOD(Linked Open Data) Recommendations
LOD(Linked Open Data) RecommendationsMyungjin Lee
 
Interlinking for Linked Data
Interlinking for Linked DataInterlinking for Linked Data
Interlinking for Linked DataMyungjin Lee
 
Linked Open Data Tutorial
Linked Open Data TutorialLinked Open Data Tutorial
Linked Open Data TutorialMyungjin Lee
 
Linked Data Usecases
Linked Data UsecasesLinked Data Usecases
Linked Data UsecasesMyungjin Lee
 
공공데이터와 Linked open data
공공데이터와 Linked open data공공데이터와 Linked open data
공공데이터와 Linked open dataMyungjin Lee
 
공공데이터와 Linked open data
공공데이터와 Linked open data공공데이터와 Linked open data
공공데이터와 Linked open dataMyungjin Lee
 

Mais de Myungjin Lee (20)

지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
 
JSP 프로그래밍 #05 HTML과 JSP
JSP 프로그래밍 #05 HTML과 JSPJSP 프로그래밍 #05 HTML과 JSP
JSP 프로그래밍 #05 HTML과 JSP
 
JSP 프로그래밍 #04 JSP 의 기본
JSP 프로그래밍 #04 JSP 의 기본JSP 프로그래밍 #04 JSP 의 기본
JSP 프로그래밍 #04 JSP 의 기본
 
JSP 프로그래밍 #03 서블릿
JSP 프로그래밍 #03 서블릿JSP 프로그래밍 #03 서블릿
JSP 프로그래밍 #03 서블릿
 
JSP 프로그래밍 #02 서블릿과 JSP 시작하기
JSP 프로그래밍 #02 서블릿과 JSP 시작하기JSP 프로그래밍 #02 서블릿과 JSP 시작하기
JSP 프로그래밍 #02 서블릿과 JSP 시작하기
 
JSP 프로그래밍 #01 웹 프로그래밍
JSP 프로그래밍 #01 웹 프로그래밍JSP 프로그래밍 #01 웹 프로그래밍
JSP 프로그래밍 #01 웹 프로그래밍
 
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)
 
오픈 데이터와 인공지능
오픈 데이터와 인공지능오픈 데이터와 인공지능
오픈 데이터와 인공지능
 
법령 온톨로지의 구축 및 검색
법령 온톨로지의 구축 및 검색법령 온톨로지의 구축 및 검색
법령 온톨로지의 구축 및 검색
 
도서관과 Linked Data
도서관과 Linked Data도서관과 Linked Data
도서관과 Linked Data
 
공공데이터, 현재 우리는?
공공데이터, 현재 우리는?공공데이터, 현재 우리는?
공공데이터, 현재 우리는?
 
LODAC 2017 Linked Open Data Workshop
LODAC 2017 Linked Open Data WorkshopLODAC 2017 Linked Open Data Workshop
LODAC 2017 Linked Open Data Workshop
 
Introduction of Deep Learning
Introduction of Deep LearningIntroduction of Deep Learning
Introduction of Deep Learning
 
서울시 열린데이터 광장 문화관광 분야 LOD 서비스
서울시 열린데이터 광장 문화관광 분야 LOD 서비스서울시 열린데이터 광장 문화관광 분야 LOD 서비스
서울시 열린데이터 광장 문화관광 분야 LOD 서비스
 
LOD(Linked Open Data) Recommendations
LOD(Linked Open Data) RecommendationsLOD(Linked Open Data) Recommendations
LOD(Linked Open Data) Recommendations
 
Interlinking for Linked Data
Interlinking for Linked DataInterlinking for Linked Data
Interlinking for Linked Data
 
Linked Open Data Tutorial
Linked Open Data TutorialLinked Open Data Tutorial
Linked Open Data Tutorial
 
Linked Data Usecases
Linked Data UsecasesLinked Data Usecases
Linked Data Usecases
 
공공데이터와 Linked open data
공공데이터와 Linked open data공공데이터와 Linked open data
공공데이터와 Linked open data
 
공공데이터와 Linked open data
공공데이터와 Linked open data공공데이터와 Linked open data
공공데이터와 Linked open data
 

Último

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

Development of Twitter Application #7 - Search

  • 1. Linked Data & Semantic Web Technology Development of Twitter Applications Part 7. Search API Dr. Myungjin Lee
  • 2. Linked Data & Semantic Web Technology Search API • Search REST API – find and return a collection of relevant Tweets based on matching a specified query • Limitation – not complete index of all Tweets, but instead an index of recent 6-9 days of Tweets – cannot find Tweets older than about a week. – limited due to complexity – not support authentication meaning all queries are made anonymously. – focused in relevance and not completeness – limited to 1,000 characters in query length, including any operators. 2
  • 3. Linked Data & Semantic Web Technology Search Operator 3 Example Finds tweets... twitter search containing both "twitter" and "search". This is the default operator "happy hour" containing the exact phrase "happy hour" love OR hate containing either "love" or "hate" (or both) beer -root containing "beer" but not "root" #haiku containing the hashtag "haiku" from:twitterapi sent from the user @twitterapi to:twitterapi sent to the user @twitterapi place:opentable:2 about the place with OpenTable ID 2 place:247f43d441defc03 about the place with Twitter ID 247f43d441defc03 @twitterapi mentioning @twitterapi superhero since:2011-05-09 containing "superhero" and sent since date "2011-05-09" twitterapi until:2011-05-09 containing "twitterapi" and sent before the date "2011-05-09". movie -scary :) containing "movie", but not "scary", and with a positive attitude. flight :( containing "flight" and with a negative attitude. traffic ? containing "traffic" and asking a question. hilarious filter:links containing "hilarious" and with a URL. news source:tweet_button containing "news" and entered via the Tweet Button
  • 4. Linked Data & Semantic Web Technology GET search/tweets • Resource URL – https://api.twitter.com/1.1/search/tweets.json • Parameters • Other Information – Requests per rate limit window: 180/user, 450/app – Authentication: Required – Response Object: Tweets q required A UTF-8, URL-encoded search query of 1,000 characters maximum, including operators. Queries may additionally be limited by complexity. geocode optional Returns tweets by users located within a given radius of the given latitude/longitude. lang optional Restricts tweets to the given language, given by an ISO 639-1 code. Language detection is best-effort. result_type optional Optional. Specifies what type of search results you would prefer to receive. The current default is "mixed." Valid values include: * mixed: Include both popular and real time results in the response. * recent: return only the most recent results in the response * popular: return only the most popular results in the response. count optional The number of tweets to return per page, up to a maximum of 100. Defaults to 15. until optional Returns tweets generated before the given date. Date should be formatted as YYYY-MM-DD. since_id optional Returns results with an ID greater than (that is, more recent than) the specified ID. max_id optional Returns results with an ID less than (that is, older than) or equal to the specified ID. include_entities optional The entities node will be disincluded when set to false. callback optional If supplied, the response will use the JSONP format with a callback of the given name. 4
  • 5. Linked Data & Semantic Web Technology Twitter4J Classes for Search • SearchResource Interface – Methods • QueryResult search(Query query) • Query Class – A data class represents search query. – Constructor • Query() • Query(java.lang.String query) – Methods • void setCount(int count) • void setGeoCode(GeoLocation location, double radius, java.lang.String unit) • void setLang(java.lang.String lang) • void setLocale(java.lang.String locale) • void setMaxId(long maxId) • void setQuery(java.lang.String query) • void setResultType(java.lang.String resultType) – MIXED, POPULAR, RECENT • void setSince(java.lang.String since) • void setSinceId(long sinceId) • void setUntil(java.lang.String until) 5
  • 6. Linked Data & Semantic Web Technology Twitter4J Classes for Search • QueryResult Interface – A data interface representing search API response – Methods • int getCount() • long getMaxId() • java.lang.String getQuery() • long getSinceId() • java.util.List<Status> getTweets() • boolean hasNext() • Query nextQuery() 6
  • 7. Linked Data & Semantic Web Technology Searching Tweets 1. import java.util.List; 2. import twitter4j.Query; 3. import twitter4j.QueryResult; 4. import twitter4j.Status; 5. import twitter4j.Twitter; 6. import twitter4j.TwitterException; 7. import twitter4j.TwitterFactory; 8. public class TwitterSearch { 9. Twitter twitter = null; 10. public TwitterSearch() { 11. this.twitter = TwitterFactory.getSingleton(); 12. this.twitter.setOAuthConsumer(TwitterAccessToken.consumerKey, 13. TwitterAccessToken.consumerSecret); 14. this.twitter.setOAuthAccessToken(TwitterAccessToken.loadAccessToken()); 15. } 16. public static void main(String args[]) throws TwitterException { 17. TwitterSearch tt = new TwitterSearch(); 18. Query q = new Query(); 19. q.setQuery("GentleMan"); 20. q.setResultType(Query.RECENT); 21. q.setCount(100); 22. QueryResult qr = tt.twitter.search(q); 23. List<Status> tweets = qr.getTweets(); 24. for (int i = 0; i < tweets.size(); i++) { 25. Status tweet = tweets.get(i); 26. System.out.println("Text: " + tweet.getText() + ", " 27. + tweet.getCreatedAt() + ", " + tweet.getRetweetCount()); 28. } 29. } 30. } 7