-
Notifications
You must be signed in to change notification settings - Fork 0
this function reads all the semantic clusters containing the characters defined in a search query. results include a list of geographic clusters (parents of semantic clusters) and scores (tf-idf) associated to the searched terms
syntax: /cluster/search_topic_tf//
parameters:
- search query: plain text, url encoded
- context: [ all | topics | keywords ]
example request: /cluster/search_topic_tf/te/all
example response:
{
"terremoto":{
"score":18.329829838,
"parents":"1044 1044 1056 1069 1069 1191 1208 1323 1397 1517 1758 1818 1866 1952 1969 2292 2390",
"count":28,
"score_avg":0.655
},
"tensors":{
"score":"0.3707627",
"parents":"1056",
"count":1,
"score_avg":0.371
}
}reads a list of geographic clusters (usually called after reading the “parents” field returned by a call to search topics
syntax: /cluster/read_list/
parameter:
- list of cluster id: a list of numeric id, concatenated with character ‘x’
example request: /cluster/read_list/1044×1758
example response:
[
{
"meanLat":"45.41903648376465",
"stdDevLon":"0.22864497776262596",
"stdDevLat":"0.08076275957964905",
"meanLon":"12.088684395381383",
"id_cluster":"1044",
"id_query":"1",
"posts_meta":"557212 557226 557227 557359 557377",
"startTime":"2011-05-11T00:00:00.000+01:00",
"endTime":"2011-05-12T00:00:00.000+01:00",
"type":"time"
},
{
"meanLat":"44.535093635866495",
"stdDevLon":"0.24240303964489",
"stdDevLat":"0.08377488461360237",
"meanLon":"11.220668359553857",
"id_cluster":"1758",
"id_query":"3",
"posts_meta":"518613 518639 518871 518931 518949 519068",
"startTime":"2011-05-09T00:00:00.000+01:00",
"endTime":"2011-05-10T00:00:00.000+01:00",
"type":"time"
}
]reads topics extracted with LDA out of a geo-cluster
example request: /cluster/read_semantic/1026
example response:
[
{
"score":"1.6284352703774083",
"language":"unknown",
"type":"topic",
"id_cluster":"1027",
"id_query":"1",
"terms_meta":{
"niente":"0.034944672",
"fiction":"0.054358378",
"corporation":"0.10677538"
}
},
{
"score":"5.892291629710274",
"language":"unknown",
"type":"topic",
"id_cluster":"1029",
"id_query":"1",
"terms_meta":{
"event":"0.5338769",
"reply":"0.35430014"
}
}
]reads keywords (meta and opengraph) extracted from related links contained in the cluster
example request: /cluster/read_keywords/1026
example response:
[
{
"type":"keywords",
"id_cluster":"1031",
"id_query":"1",
"terms_meta":{
"pisapia":"0.08695652",
"silviofuoridallepalle":"0.07971015",
"moratti":"0.057971016",
"sky":"0.036231883","milano":"0.036231883"
}
}
]exports all the posts contained in a cluster
example request: /cluster/export_posts/1026/csv
example response: automatic download of a CSV file containing all the posts contained in cluster 1026
reads the content of a post
example request: /cluster/read_post/560951
example response:
{
"id_post":"560951",
"id_user":null,
"id_place":"552070",
"lat":"45.7759209",
"lon":"9.1810045",
"content":"La Repubblica: Fuoco amico sul treno dei prigionieri la tragedia dimenticata del 1944 http:\/\/j.mp\/lNSM2f",
"lang":"italian",
"created":"2011-05-11 09:39:18",
"modified":"2011-05-11 09:39:18",
"timezone":"0",
"src":"twitter",
"src_id":"68248807569231873",
"user_location":"iPhone: 45.808238,9.076990",
"coordinates_estimated":"0",
"links":"16268 ",
"twitterUserId":"21469956",
"tweetId":"68248807569231873",
"rtCount":"0",
"followerCount":"1255"
}read the content of a link related to a post (the id is usually fetched through the variable “links” returned by the function above)
example request: /cluster/read_link/16268
example response:
{
"id_link":"16268",
"uri":"http:\/\/www.repubblica.it\/esteri\/2011\/05\/11\/news\/tragedia_dimenticata-16073765\/",
"meta":{
"og:type":"article",
"keywords":"Esteri, ",
"og:title":"Fuoco amico sul treno dei prigionieri la tragedia dimenticata del 1944 - Repubblica.it",
"og:description":"Un convoglio tedesco carico di soldati angloamericani venne distrutto per errore dai bombardieri statunitensi vicino ad Orvieto. Circa trecento le vittime. Una vicenda rimasta ai margini dei resoconti ufficiali",
"og:site_name":"La Repubblica",
"og:url":"http:\/\/www.repubblica.it\/esteri\/2011\/05\/11\/news\/tragedia_dimenticata-16073765\/",
"og:image":"http:\/\/www.repubblica.it\/images\/2011\/05\/11\/090605587-13c19fa7-01ae-4486-97e3-3559ea5539af.jpg"
},
"text":"Fuoco amico sul treno dei prigionierila tragedia dimenticata del 1944 Un convoglio tedesco carico di soldati angloamericani venne distrutto per errore dai bombardieri statunitensi vicino ad Orvieto. Circa trecento le vittime. Una vicenda rimasta ai margini dei resoconti ufficiali di MARCO PATUCCHI e HARRY SHINDLER Foto scattata da un militare tedesco dopo il bombardamento del ponte (rintracciata da Fabio Roncella) ...",
"lang":"italian"
}read list of clusters contained within a location box and creates stat charts (in form of google chart images)
example request: /cluster/dzstat/c_since=2011-05-07/c_until=2011-05-10/swLat=44.61/swLon=8.52/neLat=45.57/neLon=11.33
example response:
{
"charts":{
"chartUrlPosts":"http:\/\/chart.apis.google.com\/chart?chdl=Clustered+Posts&chxr=0,0,720|1,0,0&chco=FF776B&chd=e:..",
"chartUrlClusters":"http:\/\/chart.apis.google.com\/chart?chdl=Clusters&chxr=0,0,5|1,0,0&chco=30A8C0&chd=e:.."
}
}read list of posts contained within a location box and perform stats on languages
example request: /search/dzstat/p_since=2011-05-07/p_until=2011-05-10/p_timespan=daily/swLat=44.61/swLon=8.52/neLat=45.57/neLon=11.33
example response:
{
"aaData":[
{
"date":"11.5.7 Sat",
"total":2471,
"english":"356",
"italian":"905",
"french":"9",
"spanish":"86",
"german":"22",
"portuguese":"108",
"other":985
},
{
"date":"11.5.8 Sun",
"total":2355,
"english":"337",
"italian":"862",
"french":"9",
"spanish":"83",
"german":"10",
"portuguese":"118",
"other":936
}
]
}TODO
reads the list of geo-clusters associated to a specific query id (usually fetched by the function above)
example request: /cluster/read/2
example response:
[
{
"meanLat":"40.97769661880121",
"stdDevLon":"0.20355794471415753",
"stdDevLat":"0.11449608793779217",
"meanLon":"14.428253518081293",
"id_cluster":"1344",
"id_query":"2",
"posts_meta":"537342 537572 537749"
},
{
"meanLat":"45.90417894175355",
"stdDevLon":"0.17788872373339",
"stdDevLat":"0.12594838869607203",
"meanLon":"13.577900335822306",
"id_cluster":"1350",
"id_query":"2",
"posts_meta":"537343 537347 537350 537374"
}
]