SlideShare a Scribd company logo
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

More Related Content

What's hot

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
 
Vivo Search
Vivo SearchVivo Search
Vivo Search
Anup Sawant
 
Search Me: Using Lucene.Net
Search Me: Using Lucene.NetSearch Me: Using Lucene.Net
Search Me: Using Lucene.Net
gramana
 
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
Sease
 
Explainability for Learning to Rank
Explainability for Learning to RankExplainability for Learning to Rank
Explainability for Learning to Rank
Sease
 
Advanced Document Similarity With Apache Lucene
Advanced Document Similarity With Apache LuceneAdvanced Document Similarity With Apache Lucene
Advanced Document Similarity With Apache Lucene
Alessandro Benedetti
 
Search Engines and its working
Search Engines and its workingSearch Engines and its working
Search Engines and its working
Mukesh 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 Retrieval
A. 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 Story
Alessandro 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 bioinformatics
Charlie 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 know
Crossref
 
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 WWW
Siddhartha 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' Stories
Carlo Andrea Conte
 
Search engines powerpoint
Search engines powerpointSearch engines powerpoint
Search engines powerpoint
vbaker2210
 
Search Engine
Search EngineSearch Engine
Search Engine
Ankush Srivastava
 

What's hot (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
 

Viewers also liked

시맨틱 웹에서의 콘텐츠 검색(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 - OAuth
Myungjin Lee
 
Hpm2010seminar2
Hpm2010seminar2Hpm2010seminar2
Hpm2010seminar2
Sean Cubitt
 
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 Schema
Myungjin 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 Insights
juliannacole
 
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
Myungjin Lee
 
The Standardization of Semantic Web Ontology
The Standardization of Semantic Web OntologyThe Standardization of Semantic Web Ontology
The Standardization of Semantic Web Ontology
Myungjin Lee
 
쉽게 이해하는 LOD
쉽게 이해하는 LOD쉽게 이해하는 LOD
쉽게 이해하는 LOD
Myungjin Lee
 

Viewers also liked (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
 

Similar to Development of Twitter Application #7 - Search

Twitter api
Twitter apiTwitter api
Twitter api
kaleem malick
 
Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
amesar0
 
Jinchao demo v3
Jinchao demo v3Jinchao demo v3
Jinchao demo v3
Jinchao Lin
 
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
Myungjin Lee
 
Development of Twitter Application #5 - Users
Development of Twitter Application #5 - UsersDevelopment of Twitter Application #5 - Users
Development of Twitter Application #5 - Users
Myungjin Lee
 
Building Social Tools
Building Social ToolsBuilding Social Tools
Building Social Tools
Anand Hemmige
 
Fun! with the Twitter API
Fun! with the Twitter APIFun! with the Twitter API
Fun! with the Twitter API
Erin 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 Tweet
Myungjin Lee
 
Social Media Data Collection & Analysis
Social Media Data Collection & AnalysisSocial Media Data Collection & Analysis
Social Media Data Collection & Analysis
Scott Sanders
 
Using Thinking Sphinx with rails
Using Thinking Sphinx with railsUsing Thinking Sphinx with rails
Using Thinking Sphinx with rails
Rishav 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 Platform
Antonio Peric-Mazar
 
aip-workshop1-dev-tutorial
aip-workshop1-dev-tutorialaip-workshop1-dev-tutorial
aip-workshop1-dev-tutorial
Matthew Vaughn
 
restapitest-anil-200517181251.pdf
restapitest-anil-200517181251.pdfrestapitest-anil-200517181251.pdf
restapitest-anil-200517181251.pdf
mrle7
 
Rest API Testing
Rest API TestingRest API Testing
Rest API Testing
upadhyay_25
 
Data-Analytics using python (Module 4).pptx
Data-Analytics using python (Module 4).pptxData-Analytics using python (Module 4).pptx
Data-Analytics using python (Module 4).pptx
DRSHk10
 
Sumo Logic Search Job API
Sumo Logic Search Job APISumo Logic Search Job API
Sumo Logic Search Job API
Sumo Logic
 
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
 
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
Nikos Katirtzis
 
Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001Fred Meng
 

Similar to 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
 
Data-Analytics using python (Module 4).pptx
Data-Analytics using python (Module 4).pptxData-Analytics using python (Module 4).pptx
Data-Analytics using python (Module 4).pptx
 
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 - 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...
 
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
 
Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001Yahoo! BOSS API external 20091001
Yahoo! BOSS API external 20091001
 

More from 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과 JSP
Myungjin 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 Data
Myungjin 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 Workshop
Myungjin Lee
 
Introduction of Deep Learning
Introduction of Deep LearningIntroduction of Deep Learning
Introduction of Deep Learning
Myungjin 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) Recommendations
Myungjin Lee
 
Interlinking for Linked Data
Interlinking for Linked DataInterlinking for Linked Data
Interlinking for Linked Data
Myungjin Lee
 
Linked Open Data Tutorial
Linked Open Data TutorialLinked Open Data Tutorial
Linked Open Data Tutorial
Myungjin Lee
 
Linked Data Usecases
Linked Data UsecasesLinked Data Usecases
Linked Data Usecases
Myungjin Lee
 
공공데이터와 Linked open data
공공데이터와 Linked open data공공데이터와 Linked open data
공공데이터와 Linked open data
Myungjin Lee
 
공공데이터와 Linked open data
공공데이터와 Linked open data공공데이터와 Linked open data
공공데이터와 Linked open data
Myungjin Lee
 

More from 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
 

Recently uploaded

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

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