Appendix: Term Dictionary


Below is an outline of our term structure for querying the PeopleBrowsr Datamine. For any "term" below, a keyword or #hashtag may take its place. For some APIs, an @name can also be entered.

General


Sources: Twitter, Facebook, Blogs
Simple
QueryDescriptionExampleExplanation
[term]Finds the termterm=carFinds the word car and also related words like cars
"[term]"Finds the exact termterm="car"Finds the exact word car
[term]*Find words starting with termterm=car*Finds any word starting with car, including car, cars, and carrot
Complex
QueryDescriptionExampleExplanation
[term1] [term2]Find messages with both term1 and term2term=red carFinds messages with both red and car, or related words, anywhere in the message
[term1] [term2] [term3]Find messages with either term1, term2, or term3term=red blue carFinds messages with red or blue or car - for queries with three or more terms
"[term1] [term2]"Find messages with the exact two-word term term="red car" Finds messages with the exact phrase "red car"
[term1] AND [term2] Find messages with both term1 and term2red AND carFinds messages with both red and car, or related words
[term1] OR [term2]Find messages with either term1 or term2 term=red OR carFinds messages with either red or car (or both) (or related words)
[term1] NOT [term2] Find messages with term1 but not term2 term=red NOT carFinds messages with red but not car
[term1] XOR [term2]Find messages with term1 or term2 but not bothterm=red XOR carFinds messages with red or car but not both
[term1] NEAR [term2]Find messages where term1 appears within 10 words of term2term=red NEAR carFinds messages with red near (within 10 words of) car
[term1] NEAR/3 [term2]Find messages where term1 appears within 3 words of term2term=red NEAR/3 carFinds messages with red near (within 3 words of) car
[term1] ADJ [term2] Find messages where term1 appears within 10 words of term2, in that orderterm=red ADJ carFinds messages with red near (within 10 words of) car, and appearing in that order
[term1] ADJ/3 [term2]Find messages where term1 appears within 3 words of term2, in that orderterm=red ADJ/3 carFinds messages with red near (within 3 words of) car, and appearing in that order
+[term1] [term2]Find messages with term1 and preferably term2term=+red car Finds messages with red and preferably car (most useful when searching for best match)
+[term1] -[term2]Find messages with term1 and not term2term=+red -carFinds messages with red and not car
([term1] OR [term2]) AND [term3]Find messages with either term1 or term2, and also term3 term=(red OR blue) AND carFinds messages with either red or blue, and car

Advanced


Sources: Twitter, Facebook, Blogs
QueryDescriptionExampleExplanation
name:[username]*@[username]Finds messages that user or refer to usernameterm=@jack
from:[username]**user:[username]Find messages from a usernameterm=user:jack
ref:[username]***Find messages referencing to a usernameterm=ref:kevinrose
tag:[hashtag]#[hashtag]Finds messages mentioning a hashtagterm=tag:sf
stock:[stock]$[stock]Finds messages mentioning a stockterm=$GOOG
rt:[term]*Finds retweets mentioning a termterm=rt:(pie OR cake)
question:[term]* Finds messages containing questionsterm=?coffee
reply:[term]*Finds repliesterm=reply:"web site"
link:[term]Finds messages with linksterm=link:reddit
yt:[term]*Finds messages containing YouTube videosterm=yt:chillwave
pic:[term]*Finds messages containing Twitpic links pic:(lolcat AND funny)
Source*=*Twitter Only**Facebook ***Twitter + Facebook

Location


Source: Twitter
QueryDescriptionExample
cc:[country code]Finds messages from a country (See Appendix 2: Locations for a list of country codes)term=cc:AU
country:[country name]Find messages from a country using the full name. If multiple words within a name separate by using "_"; country:united_states is an example.term=Pepsi country:canada
state:[state] or area:[state]Find messages from users within a state. See Appendix 2: Locations for reference state codes.term=Pepsi state:CA
county:[county name] or subarea:[county name]Find messages from a county (works in US and UK)county:cook
city:[city name] or locality:[city name]Finds messages from a city. Cities with two names are to be separated by "_" ex: new_yorkcity:chicago // city:new_york
near:[city]Finds messages near a city (defaults to .5 degree radius)near:new_york
within:[distance] Find messages within a certain distance of the location specified by near (can use m for miles or km for kilometers)within:10m, within:20km
latitude:[x]..[y] Finds messages between latitudes x (North) and y (North) (use negative numbers for South)latitude30..40
longitude:[x]..[y]Finds messages between latitudes x (East) and y (East) (use negative numbers for West)latitude20..30

User Details


Source: Twitter
QueryDescriptionExample
bio:[term]Finds messages where the users bio contains the termbio:surfer
bio:[term] bio:[term}Finds messages where the users bio contain one term and another termbio:ucla bio:student // bio:ios bio:developer
term1+bio:[term2]Find messages containing term1 where the user’s bio contains the word term2pepsi+bio:surfer
gender:[gender] Find messages from male (m), female (f) or undetermined users (u)gender:m, gender:f

Sentiment


Sources: Twitter, Facebook, Blogs
QueryShortcutDescriptionExample
sentiment:goods+ Find messages with positive sentiment pepsi term=pepsi sentiment:good
sentiment:neutrals=Find messages with neutral sentimentterm=pepsi s=
sentiment:bad s-Find messages with negative sentiment term=pepsi s-

How to Structure Terms within the Argument


AND

expression AND expression matches documents which are matched by both of the subexpressions.

OR

expression OR expression matches documents which are matched by either of the subexpressions.

NOT

expression NOT expression matches documents which are matched by only the first subexpression. This can also be written as expression AND NOT expression.

NOT expression will match documents which don't match the subexpression.


XOR

expression XOR expression matches documents which are matched by one or other of the subexpressions, but not both. XOR is probably a bit esoteric.

Bracketed expressions

You can control the precedence of the boolean operators using brackets. In the query one OR two AND three the AND takes precedence, so this is the same as one OR (two AND three). You can override the precedence using (one OR two) AND three.

The default precedence from highest to lowest is:

+, - (equal)
AND, NOT (equal)
XOR
OR
'+' and '-'

A group of terms with some marked with + and - will match documents containing all of the + terms, but none of the - terms. Terms not marked with + or - contribute towards the document rankings. You can also use + and - on phrases and on bracketed expressions.

NEAR

one NEAR two NEAR three matches documents containing those words within 10 words of each other. You can set the threshold to n by using NEAR/n like so: one NEAR/6 two.

ADJ

ADJ is like NEAR but only matches if the words appear in the same order as in the query. So one ADJ two ADJ three matches documents containing those three words in that order and within 10 words of each other. You can set the threshold to n by using ADJ/n like so: one ADJ/6 two.

Phrase searches

A phrase surrounded with double quotes ("") matches documents containing that exact phrase. Hyphenated words are also treated as phrases, as are cases such as filenames and email addresses (e.g. "mom" instead of mom, moms, mommy, etc).