15 | 5-22-2014 China and Nigeria may be far away geographically , but sincere brotherhood will bridge the gap and bring us together in our common effort to create a better future for our later generations .
16 |
17 |
18 | 10-1-2014 Currently , China contributes 30 per cent to world economy and expects to grow its foreign direct investment to exceed $ 500 billion in the next five years .
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Sameer Singh
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5 |
6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7 |
8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9 |
10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11 |
--------------------------------------------------------------------------------
/app/org/sameersingh/ervisualizer/data/Entity.scala:
--------------------------------------------------------------------------------
1 | package org.sameersingh.ervisualizer.data
2 |
3 | /**
4 | * @author sameer
5 | * @since 6/10/14.
6 | */
7 | case class EntityHeader(id: String, name: String, nerTag: String, popularity: Double, geo: Seq[Double] = Seq.empty)
8 |
9 | case class EntityInfo(id: String, freebaseInfo: Map[String, String])
10 |
11 | case class EntityFreebase(id: String, types: Seq[String])
12 |
13 | case class EntityText(id: String, provenances: Seq[Provenance])
14 |
15 | case class TypeModelProvenances(id: String, entityType: String, provenances: Seq[Provenance])
16 |
17 | object EntityUtils {
18 | def emptyInfo(eid: String) = EntityInfo(eid, Map.empty)
19 |
20 | def emptyText(eid: String) = EntityText(eid, Seq.empty)
21 |
22 | def emptyKBA(eid: String) = org.sameersingh.ervisualizer.kba.Entity(eid, Seq.empty, Seq.empty, Seq.empty)
23 |
24 | def emptyFreebase(eid: String) = EntityFreebase(eid, Seq.empty)
25 |
26 | def emptyProvenance(eid: String) = EntityText(eid, Seq.empty)
27 |
28 | def emptyTypeProvenance(eid: String, et: String) = TypeModelProvenances(eid, et, Seq.empty)
29 | }
30 |
31 | case class RelationHeader(sourceId: String, targetId: String, popularity: Double)
32 |
33 | case class RelationFreebase(sourceId: String, targetId: String, rels: Seq[String])
34 |
35 | case class RelationText(sourceId: String, targetId: String, provenances: Seq[Provenance])
36 |
37 | case class RelModelProvenances(sourceId: String, targetId: String, relType: String, provenances: Seq[Provenance], confidence: Double = 1.0)
38 |
39 | object RelationUtils {
40 | def emptyFreebase(sid: String, tid: String) = RelationFreebase(sid, tid, Seq.empty)
41 |
42 | def emptyProvenance(sid: String, tid: String) = RelationText(sid, tid, Seq.empty)
43 |
44 | def emptyRelProvenance(sid: String, tid: String, rt: String) = RelModelProvenances(sid, tid, rt, Seq.empty)
45 | }
46 |
--------------------------------------------------------------------------------
/app/org/sameersingh/ervisualizer/nlp/ReadD2DDocs.scala:
--------------------------------------------------------------------------------
1 | package org.sameersingh.ervisualizer.nlp
2 |
3 | import edu.stanford.nlp.semgraph.SemanticGraph
4 | import play.api.libs.json.Json
5 | import org.sameersingh.ervisualizer.data.Document
6 |
7 | /**
8 | * @author sameer
9 | * @since 7/11/14.
10 | */
11 | class ReadD2DDocs(val baseDir: String) {
12 |
13 | def path(baseDir: String, name: String, format: String): String = {
14 | "%s/allafrica.com_07-2013-to-05-2014_%s/%s.%s" format(baseDir, format, name, format)
15 | }
16 |
17 | def readD2DNLP(name: String) {
18 | val source = io.Source.fromFile(path(baseDir, name, "nlp"), "UTF-8")
19 | for(s <- source.getLines().drop(8)) {
20 | println(s)
21 | val sg = SemanticGraph.valueOf(s)
22 | println(sg.toFormattedString)
23 | } //.mkString("\n")//.replaceAll("\\]\\[", "]\n[")
24 |
25 | source.close()
26 | }
27 |
28 | case class D2DDoc(title: Array[String], cite: Array[String], h1: Array[String], div: Array[String])
29 | implicit val d2dDocWrites = Json.writes[D2DDoc]
30 | implicit val d2dDocReads = Json.reads[D2DDoc]
31 |
32 | def readOriginalDoc(name: String): D2DDoc = {
33 | val source = io.Source.fromFile(path(baseDir, name, "json"), "UTF-8")
34 | val s = source.getLines().mkString("\n")//.replaceAll("\\]\\[", "]\n[")
35 | // println(s)
36 | val d = Json.fromJson[D2DDoc](Json.parse(s)).get
37 | // println(d)
38 | d
39 | }
40 |
41 | def readDoc(id: String, name: String): Document = {
42 | val d = readOriginalDoc(name)
43 | Document(id, name, d.title.mkString("___SEP___"), d.cite.mkString("___SEP___"), d.div.mkString("\n"), Seq.empty)
44 | }
45 | }
46 |
47 | object ReadD2DDocs extends ReadD2DDocs("/Users/sameer/Work/data/d2d") {
48 | def main(args: Array[String]) {
49 | readD2DNLP("Nigeria/piracy/stories/201307010505")
50 | // readOriginalDoc("Nigeria/piracy/stories/201307010505")
51 | }
52 | }
--------------------------------------------------------------------------------
/public/stylesheets/mainkba.css:
--------------------------------------------------------------------------------
1 | body {
2 | overflow-y:scroll;
3 | }
4 |
5 | text {
6 | font: 12px sans-serif;
7 | }
8 |
9 | svg {
10 | display: block;
11 | }
12 |
13 | .chart svg {
14 | height: 500px;
15 | min-width: 100px;
16 | min-height: 100px;
17 | }
18 |
19 | .center {
20 | position: absolute;
21 | top:10px;
22 | left:50%;
23 | z-index:100;
24 | }
25 |
26 | .centerContent {
27 | position: relative;
28 | left:-50%;
29 | z-index:100;
30 | }
31 |
32 | /* typeahead specific style */
33 | .typeahead,
34 | .tt-query,
35 | .tt-hint {
36 | width: 100%;
37 | height: 40px;
38 | padding: 4px 6px;
39 | font-size: 16px;
40 | line-height: 30px;
41 | border: 2px solid #ccc;
42 | border-radius: 5px;
43 | outline: none;
44 | }
45 |
46 | .typeahead {
47 | background-color: #fff;
48 | }
49 |
50 | .twitter-typeahead {
51 | width: 250px;
52 | }
53 |
54 | .typeahead:focus {
55 | border: 2px solid #0097cf;
56 | }
57 |
58 | .tt-query {
59 | -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
60 | -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
61 | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
62 | }
63 |
64 | .tt-hint {
65 | color: #999
66 | }
67 |
68 | .tt-dropdown-menu {
69 | width: 250px;
70 | margin-top: 6px;
71 | padding: 4px 0;
72 | background-color: #fff;
73 | border: 1px solid #ccc;
74 | border: 1px solid rgba(0, 0, 0, 0.2);
75 | border-radius: 5px;
76 | max-height: 150px;
77 | overflow-y: auto;
78 | }
79 |
80 | .tt-suggestion {
81 | padding: 3px 20px;
82 | font-size: 12px;
83 | line-height: 24px;
84 | }
85 |
86 | .tt-suggestion.tt-cursor {
87 | color: #fff;
88 | background-color: #0097cf;
89 |
90 | }
91 |
92 | .tt-suggestion p {
93 | margin: 0;
94 | }
95 |
96 | #entity .tt-dropdown-menu {
97 | max-height: 150px;
98 | overflow-y: auto;
99 | }
100 |
101 | .space {
102 | margin-bottom: 1.5cm;
103 | }
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/app/org/sameersingh/ervisualizer/data/DBStore.scala:
--------------------------------------------------------------------------------
1 | package org.sameersingh.ervisualizer.data
2 |
3 | import org.sameersingh.ervisualizer.Logging
4 |
5 | import scala.collection.mutable
6 | import scala.collection.mutable.HashMap
7 |
8 | /**
9 | * @author sameer
10 | * @since 1/25/15.
11 | */
12 | class DBStore(docs: DocumentStore) extends Logging {
13 | type Id = String
14 |
15 | val maxDBs = 20
16 | val dbMap = new HashMap[Id, DB]
17 | val dbQueue = new mutable.Queue[Id]()
18 | val queryMap = new HashMap[String, Id]
19 | val queryIdMap = new HashMap[Id, String]
20 |
21 | def query(string: String): (Id, DB) = {
22 | val id = queryId(string)
23 | val odb = dbMap.get(id)
24 | id -> odb.getOrElse({
25 | val docIds = docs.query(string)
26 | logger.info("Reading " + docIds.size + " docs.")
27 | val inDB = new InMemoryDB()
28 | NLPReader.readDocs(docIds.map(id => docs(id)).iterator, inDB)
29 | NLPReader.addRelationInfo(inDB)
30 | //NLPReader.removeSingletonEntities(inDB)
31 | EntityInfoReader.read(inDB)
32 | logger.info(inDB.toString)
33 | val freeMem = (Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory()) / (1024 * 1024 * 1024)
34 | logger.info("Free memory (Kbytes): " + Runtime.getRuntime().freeMemory() / 1024)
35 | logger.info("Total memory (Kbytes): " + Runtime.getRuntime().totalMemory() / 1024)
36 | logger.info("Max memory (Kbytes): " + Runtime.getRuntime().maxMemory() / 1024)
37 | logger.info("Free memory (GBs): " + freeMem + ", DBs: " + dbMap.size)
38 | if(dbMap.size >=1 && (dbMap.size >= maxDBs || freeMem < 1)) {
39 | val id = dbQueue.dequeue()
40 | logger.info("Dequeuing " + id + " for query: \"" + queryIdMap(id) + "\"")
41 | dbMap.remove(id)
42 | }
43 | dbQueue += id
44 | dbMap(id) = inDB
45 | inDB
46 | })
47 | }
48 |
49 | def id(id: String) = {
50 | dbMap.getOrElse(id, query(queryIdMap(id))._2)
51 | }
52 |
53 | private def queryId(string: String): Id = {
54 | queryMap.getOrElseUpdate(string, {
55 | val id = "db" + queryMap.size
56 | queryIdMap(id) = string
57 | id
58 | })
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/conf/reference.conf:
--------------------------------------------------------------------------------
1 | # This is the main configuration file for the application.
2 | # ~~~~~
3 |
4 | # Secret key
5 | # ~~~~~
6 | # The secret key is used to secure cryptographics functions.
7 | # If you deploy your application to several instances be sure to use the same key!
8 | application.secret="dv4Lf:17Zswrd?D^Q@0v`Rv?LuJe:wg_GC`rdCLhillOEYZu^a`>KEsUB7Sk[ir2"
9 |
10 | # The application languages
11 | # ~~~~~
12 | application.langs="en"
13 |
14 | # Global object class
15 | # ~~~~~
16 | # Define the Global object class for this application.
17 | # Default to Global in the root package.
18 | # application.global=Global
19 |
20 | # Router
21 | # ~~~~~
22 | # Define the Router object to use for this application.
23 | # This router will be looked up first when the application is starting up,
24 | # so make sure this is the entry point.
25 | # Furthermore, it's assumed your route file is named properly.
26 | # So for an application router like `my.application.Router`,
27 | # you may need to define a router file `conf/my.application.routes`.
28 | # Default to Routes in the root package (and conf/routes)
29 | # application.router=my.application.Routes
30 |
31 | # Database configuration
32 | # ~~~~~
33 | # You can declare as many datasources as you want.
34 | # By convention, the default datasource is named `default`
35 | #
36 | # db.default.driver=org.h2.Driver
37 | # db.default.url="jdbc:h2:mem:play"
38 | # db.default.user=sa
39 | # db.default.password=""
40 |
41 | # Evolutions
42 | # ~~~~~
43 | # You can disable evolutions if needed
44 | # evolutionplugin=disabled
45 |
46 | # Logger
47 | # ~~~~~
48 | # You can also configure logback (http://logback.qos.ch/),
49 | # by providing an application-logger.xml file in the conf directory.
50 |
51 | # Root logger:
52 | logger.root=ERROR
53 |
54 | # Logger used by the framework:
55 | logger.play=INFO
56 |
57 | # Logger provided to your application:
58 | logger.application=DEBUG
59 |
60 | nlp {
61 |
62 | data {
63 | baseDir = "data/test"
64 | docsFile = "docs.json.gz"
65 | defaultDB = "president"
66 | mongo = false
67 | }
68 |
69 | # UNUSED
70 | # kba {
71 | # entitiesFile = "/Users/icano/Documents/UW/RA/summer14/data/final/viz/entities.tsv"
72 | # stalenessBaseDir = "/Users/icano/Documents/UW/RA/summer14/data/final/viz/staleness"
73 | # embeddingBaseDir = "/Users/icano/Documents/UW/RA/summer14/data/final/viz/embedding"
74 | # }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/app/views/mainkba.scala.html:
--------------------------------------------------------------------------------
1 |
2 | @(title: String)
3 |
4 |
5 |
6 |
7 |
8 | @title
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
29 |
30 |
31 |
32 |
15 | 5-4-2014 Until that happens and each and every Nigerian is prepared to take up arms against Boko Haram and those that are secretly behind it our people will continue to be terrorised , slaughtered , abducted and enslaved .
16 |
17 |
18 | 9-30-2014 Boko Haram has repeatedly attacked schools , churches , mosques and markets , but state institutions such as police stations and military facilities have remained primary targets .
19 |
20 |
21 | 9-30-2014 Boko Haram has repeatedly attacked schools , churches , mosques and markets , but state institutions such as police stations and military facilities have remained primary targets .
22 |
23 |
24 | 9-30-2014 The Nigerian military claims to be making major strides in defeating Boko Haram , but rebel attacks continue .
25 |
26 |
27 | 9-30-2014 This resulted in reprisal attacks on police that spread to four states .
28 |
29 |
30 | 9-30-2014 Since 2009 , an estimated 3,600 people have been killed in an insurgency launched by the group known as Boko Haram , which says it wants to establish an Islamic state in northeastern Nigeria .
31 |
32 |
33 | 9-30-2014 A large part of Nigeria 's federal government budget is spent on security .
34 |
35 |
36 |
37 |
38 | 10-14-2014 Why Nigeria Was Able to Beat Ebola but Not Boko Haram .
39 |
40 |
41 | 10-14-2014 A country of some 170 million people split into numerous ethnic and linguistic groups , Nigeria has struggled to bridge the gap between its relatively affluent Christian south and its poorer Muslim north .
42 |
43 |
44 | 10-14-2014 Having served one full term , Jonathan will be eligible .
45 |
46 |
47 | 10-14-2014 For Nigeria 's embattled government , October 20 is a date worth circling on the calendar : That day will mark 42 days since Nigeria 's last confirmed Ebola case , which , at twice the 21-day incubation period , will allow the country to declare itself free of a disease that has ravaged its West African neighbors .
48 |
49 |
50 |
51 |
52 | 11-6-2014 Residents in Mubi , part of the governor 's home district , told AFP on Thursday that the extremists had changed the town 's name to Madinatul Islam , or '' City of Islam '' in Arabic .
53 |
54 |
55 |
56 |
57 | 11-7-2014 Bala Ngilari , Adamawa State Boko Haram has taken over at least five municipalities in northeast Nigeria 's Adamawa state , its governor said on Friday , calling for more troops to halt further Islamist gains .
58 |
59 |
60 | 11-7-2014 Boko Haram , which wants to create a hardline Islamic state in Nigeria 's northeast , is now thought to control at least two dozen towns in Yobe , Borno and Adamawa .
61 |
62 |
63 | 11-7-2014 The governor 's call for more troops seemed to contrast with federal government claims of a possible ceasefire .
64 |
65 |
66 | 11-7-2014 Boko Haram , which wants to create a hardline Islamic state in Nigeria 's northeast , is now thought to control at least two dozen towns in Yobe , Borno and Adamawa .
67 |
68 |
69 | 11-7-2014 But Boko Haram has since captured significant parts of the state , underscoring the severity of the crisis facing Nigeria , with the militants apparently advancing with little resistance south of their Borno stronghold .
70 |
71 |
72 |
73 |
74 | 12-2-2014 Magnitude of Boko Haram 's recent attack scary -- Mark • Adjourns plenary for 2 weeks By Taiwo Adisa -- Abuja SENATE President , David Mark , on Tuesday , raised the alarm over the incursions of the Boko Haram insurgents in parts of the North-East , especially the attack on Yobe State Government House .
75 |
76 |
77 | 12-3-2014 IBB condemned the killings in Kano and other parts of the country by the insurgents and commiserated with the government and people of Kano over the recent killings during Juma’at .
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/data/test/ent.info:
--------------------------------------------------------------------------------
1 | {"id":"m_01w5m","freebaseInfo":{"/common/topic/description":"Columbia University in the City of New York, commonly referred to as Columbia University, is an American private Ivy League research university located in the Morningside Heights neighborhood of Upper Manhattan in New York City. It is the oldest institution of higher learning in the State of New York, the fifth oldest in the United States, and one of the country's nine Colonial Colleges founded before the American Revolution. Today the university operates Columbia Global Centers overseas in Amman, Beijing, Istanbul, Paris, Mumbai, Rio de Janeiro, Santiago and Nairobi.\\nThe university was founded in 1754 as King's College by royal charter of George II of Great Britain. After the American Revolutionary War, King's College briefly became a state entity, and was renamed Columbia College in 1784. The University now operates under a 1787 charter that places the institution under a private board of trustees, and in 1896 it was further renamed Columbia University. That same year, the university's campus was moved from Madison Avenue to its current location in Morningside Heights, where it occupies more than six city blocks, or 32 acres.","/mid":"/m/01w5m","Name":"Columbia University"}}
2 | {"id":"m_025s5v9","freebaseInfo":{"/common/topic/description":"Michelle LaVaughn Robinson Obama, an American lawyer and writer, is the wife of the 44th and current President of the United States, Barack Obama, and the first African-American First Lady of the United States. Raised on the South Side of Chicago, Obama attended Princeton University and Harvard Law School before returning to Chicago to work at the law firm Sidley Austin, where she met her future husband. Subsequently, she worked as part of the staff of Chicago mayor Richard M. Daley, and for the University of Chicago Medical Center.\\nThroughout 2007 and 2008, she helped campaign for her husband's presidential bid. She delivered a keynote address at the 2008 Democratic National Convention and also spoke at the 2012 Democratic National Convention. She is the mother of daughters Malia and Natasha. As the wife of a Senator, and later the First Lady, she has become a fashion icon and role model for women, and an advocate for poverty awareness, nutrition, and healthy eating.","/mid":"/m/025s5v9","/common/topic/image":"/m/04s8ccw","Name":"Michelle Obama"}}
3 | {"id":"m_02mjmr","freebaseInfo":{"/common/topic/description":"Barack Hussein Obama II (/bəˈrɑːk huːˈseɪn oʊˈbɑːmə/; born August 4, 1961) is the 44th and current President of the United States. He is the first African American to hold the office. Obama served as a U.S. Senator representing the state of Illinois from January 2005 to November 2008, when he resigned following his victory in the 2008 presidential election.\\n\\nBorn in Honolulu, Hawaii, Obama is a graduate of Columbia University and Harvard Law School, where he was the president of the Harvard Law Review. He was a community organizer in Chicago before earning his law degree. He worked as a civil rights attorney in Chicago and taught constitutional law at the University of Chicago Law School from 1992 to 2004. He served three terms representing the 13th District in the Illinois Senate from 1997 to 2004.","/mid":"/m/02mjmr","/common/topic/image":"/m/059x99z","Name":"Barack Obama"}}
4 | {"id":"m_09c7w0","freebaseInfo":{"/common/topic/description":"The United States of America, commonly referred to as the United States, America, and sometimes the States, is a federal republic consisting of 50 states and a federal district. The 48 contiguous states and Washington, D.C., are in central North America between Canada and Mexico. The state of Alaska is the northwestern part of North America and the state of Hawaii is an archipelago in the mid-Pacific. The country also has five populated and nine unpopulated territories in the Pacific and the Caribbean. At 3.79 million square miles in total and with around 318 million people, the United States is the third or fourth-largest country by total area and third largest by population. It is one of the world's most ethnically diverse and multicultural nations, the product of large-scale immigration from many countries. The geography and climate of the United States is also extremely diverse, and it is home to a wide variety of wildlife.\\nPaleo-Indians migrated from Eurasia to what is now the U.S. mainland around 15,000 years ago, with European colonization beginning in the 16th century. The United States emerged from 13 British colonies located along the Atlantic seaboard.","/mid":"/m/09c7w0","/common/topic/image":"/m/059h_54","Name":"United States of America"}}
5 | {"id":"m_02hrh0_","freebaseInfo":{"/common/topic/description":"Honolulu is the state capital and the most populous city in the U.S. state of Hawaii. It is the county seat of the City and County of Honolulu. Hawaii is a major tourist destination and Honolulu, situated on the island of Oahu, is the main gateway to Hawaii and a major gateway into the United States. The city is also a major hub for international business, military defense, as well as famously being host to a diverse variety of east-west and Pacific culture, cuisine, and traditions.\\nHonolulu is both the westernmost and the southernmost major American city. For statistical purposes, the U.S. Census Bureau recognizes the approximate area commonly referred to as \\\"City of Honolulu\\\" as a census county division. Honolulu is a major financial center of the islands and of the Pacific Ocean. The population of Honolulu CCD was 390,738 at the 2010 census, while the population of the consolidated city and county was 953,207.\\nIn the Hawaiian, Honolulu means \\\"sheltered bay\\\" or \\\"place of shelter\\\"; alternatively, it means \\\"calm port\\\".","/mid":"/m/02hrh0_","/common/topic/image":"/m/03tbtzv","Name":"Honolulu"}}
6 |
--------------------------------------------------------------------------------
/public/javascripts/d3/topojson.v1.min.js:
--------------------------------------------------------------------------------
1 | !function(){function t(n,t){function r(t){var r,e=n.arcs[0>t?~t:t],o=e[0];return n.transform?(r=[0,0],e.forEach(function(n){r[0]+=n[0],r[1]+=n[1]})):r=e[e.length-1],0>t?[r,o]:[o,r]}function e(n,t){for(var r in n){var e=n[r];delete t[e.start],delete e.start,delete e.end,e.forEach(function(n){o[0>n?~n:n]=1}),f.push(e)}}var o={},i={},u={},f=[],c=-1;return t.forEach(function(r,e){var o,i=n.arcs[0>r?~r:r];i.length<3&&!i[1][0]&&!i[1][1]&&(o=t[++c],t[c]=r,t[e]=o)}),t.forEach(function(n){var t,e,o=r(n),f=o[0],c=o[1];if(t=u[f])if(delete u[t.end],t.push(n),t.end=c,e=i[c]){delete i[e.start];var a=e===t?t:t.concat(e);i[a.start=t.start]=u[a.end=e.end]=a}else i[t.start]=u[t.end]=t;else if(t=i[c])if(delete i[t.start],t.unshift(n),t.start=f,e=u[f]){delete u[e.end];var s=e===t?t:e.concat(t);i[s.start=e.start]=u[s.end=t.end]=s}else i[t.start]=u[t.end]=t;else t=[n],i[t.start=f]=u[t.end=c]=t}),e(u,i),e(i,u),t.forEach(function(n){o[0>n?~n:n]||f.push([n])}),f}function r(n,r,e){function o(n){var t=0>n?~n:n;(s[t]||(s[t]=[])).push({i:n,g:a})}function i(n){n.forEach(o)}function u(n){n.forEach(i)}function f(n){"GeometryCollection"===n.type?n.geometries.forEach(f):n.type in l&&(a=n,l[n.type](n.arcs))}var c=[];if(arguments.length>1){var a,s=[],l={LineString:i,MultiLineString:u,Polygon:u,MultiPolygon:function(n){n.forEach(u)}};f(r),s.forEach(arguments.length<3?function(n){c.push(n[0].i)}:function(n){e(n[0].g,n[n.length-1].g)&&c.push(n[0].i)})}else for(var h=0,p=n.arcs.length;p>h;++h)c.push(h);return{type:"MultiLineString",arcs:t(n,c)}}function e(r,e){function o(n){n.forEach(function(t){t.forEach(function(t){(f[t=0>t?~t:t]||(f[t]=[])).push(n)})}),c.push(n)}function i(n){return l(u(r,{type:"Polygon",arcs:[n]}).coordinates[0])>0}var f={},c=[],a=[];return e.forEach(function(n){"Polygon"===n.type?o(n.arcs):"MultiPolygon"===n.type&&n.arcs.forEach(o)}),c.forEach(function(n){if(!n._){var t=[],r=[n];for(n._=1,a.push(t);n=r.pop();)t.push(n),n.forEach(function(n){n.forEach(function(n){f[0>n?~n:n].forEach(function(n){n._||(n._=1,r.push(n))})})})}}),c.forEach(function(n){delete n._}),{type:"MultiPolygon",arcs:a.map(function(e){var o=[];if(e.forEach(function(n){n.forEach(function(n){n.forEach(function(n){f[0>n?~n:n].length<2&&o.push(n)})})}),o=t(r,o),(n=o.length)>1)for(var u,c=i(e[0][0]),a=0;n>a;++a)if(c===i(o[a])){u=o[0],o[0]=o[a],o[a]=u;break}return o})}}function o(n,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return i(n,t)})}:i(n,t)}function i(n,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:u(n,t)};return null==t.id&&delete r.id,r}function u(n,t){function r(n,t){t.length&&t.pop();for(var r,e=s[0>n?~n:n],o=0,i=e.length;i>o;++o)t.push(r=e[o].slice()),a(r,o);0>n&&f(t,i)}function e(n){return n=n.slice(),a(n,0),n}function o(n){for(var t=[],e=0,o=n.length;o>e;++e)r(n[e],t);return t.length<2&&t.push(t[0].slice()),t}function i(n){for(var t=o(n);t.length<4;)t.push(t[0].slice());return t}function u(n){return n.map(i)}function c(n){var t=n.type;return"GeometryCollection"===t?{type:t,geometries:n.geometries.map(c)}:t in l?{type:t,coordinates:l[t](n)}:null}var a=g(n.transform),s=n.arcs,l={Point:function(n){return e(n.coordinates)},MultiPoint:function(n){return n.coordinates.map(e)},LineString:function(n){return o(n.arcs)},MultiLineString:function(n){return n.arcs.map(o)},Polygon:function(n){return u(n.arcs)},MultiPolygon:function(n){return n.arcs.map(u)}};return c(t)}function f(n,t){for(var r,e=n.length,o=e-t;o<--e;)r=n[o],n[o++]=n[e],n[e]=r}function c(n,t){for(var r=0,e=n.length;e>r;){var o=r+e>>>1;n[o]n&&(n=~n);var r=o[n];r?r.push(t):o[n]=[t]})}function r(n,r){n.forEach(function(n){t(n,r)})}function e(n,t){"GeometryCollection"===n.type?n.geometries.forEach(function(n){e(n,t)}):n.type in u&&u[n.type](n.arcs,t)}var o={},i=n.map(function(){return[]}),u={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(n,t){n.forEach(function(n){r(n,t)})}};n.forEach(e);for(var f in o)for(var a=o[f],s=a.length,l=0;s>l;++l)for(var h=l+1;s>h;++h){var p,v=a[l],g=a[h];(p=i[v])[f=c(p,g)]!==g&&p.splice(f,0,g),(p=i[g])[f=c(p,v)]!==v&&p.splice(f,0,v)}return i}function s(n,t){function r(n){i.remove(n),n[1][2]=t(n),i.push(n)}var e=g(n.transform),o=m(n.transform),i=v();return t||(t=h),n.arcs.forEach(function(n){var u,f=[],c=0;n.forEach(e);for(var a=1,s=n.length-1;s>a;++a)u=n.slice(a-1,a+2),u[1][2]=t(u),f.push(u),i.push(u);n[0][2]=n[s][2]=1/0;for(var a=0,s=f.length;s>a;++a)u=f[a],u.previous=f[a-1],u.next=f[a+1];for(;u=i.pop();){var l=u.previous,h=u.next;u[1][2]0;){var r=(t+1>>1)-1,o=e[r];if(p(n,o)>=0)break;e[o._=t]=o,e[n._=t=r]=n}}function t(n,t){for(;;){var r=t+1<<1,i=r-1,u=t,f=e[u];if(o>i&&p(e[i],f)<0&&(f=e[u=i]),o>r&&p(e[r],f)<0&&(f=e[u=r]),u===t)break;e[f._=t]=f,e[n._=t=u]=n}}var r={},e=[],o=0;return r.push=function(t){return n(e[t._=o]=t,o++),o},r.pop=function(){if(!(0>=o)){var n,r=e[0];return--o>0&&(n=e[o],t(e[n._=0]=n,0)),r}},r.remove=function(r){var i,u=r._;if(e[u]===r)return u!==--o&&(i=e[o],(p(i,r)<0?n:t)(e[i._=u]=i,u)),u},r}function g(n){if(!n)return y;var t,r,e=n.scale[0],o=n.scale[1],i=n.translate[0],u=n.translate[1];return function(n,f){f||(t=r=0),n[0]=(t+=n[0])*e+i,n[1]=(r+=n[1])*o+u}}function m(n){if(!n)return y;var t,r,e=n.scale[0],o=n.scale[1],i=n.translate[0],u=n.translate[1];return function(n,f){f||(t=r=0);var c=0|(n[0]-i)/e,a=0|(n[1]-u)/o;n[0]=c-t,n[1]=a-r,t=c,r=a}}function y(){}var d={version:"1.6.15",mesh:function(n){return u(n,r.apply(this,arguments))},meshArcs:r,merge:function(n){return u(n,e.apply(this,arguments))},mergeArcs:e,feature:o,neighbors:a,presimplify:s};"function"==typeof define&&define.amd?define(d):"object"==typeof module&&module.exports?module.exports=d:this.topojson=d}();
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | er-visualizer
2 | =============
3 |
4 | D3 and Play based visualization for entity-relation graphs, especially for NLP and information extraction
5 |
6 | # Basic Example
7 |
8 | Here we are going to show the visualization with a few entities and relations, although it can handle upto hundreds of thousands of entities and relations.
9 |
10 | The first page show a simple search box to identify subsets of documents to visualize.
11 |
12 | 
13 |
14 | The visualization lays out all the extracted entities and relations onto a map as a graph. The entity nodes are sized according to their popularity (in the document collection), and colored according to their types (person, location, or organization).
15 |
16 | Clicking on an entity node bring ups details from Freebase on the left, and detailed textual provenance on the right. The provenance also contained fine-grained types, if part of the annotations.
17 |
18 | 
19 |
20 | The edges represent extracted relations, with the width proportional to the number of mentions of the relation. Clicking on a relation brings up their provenances on the right.
21 |
22 | 
23 |
24 | ## Running the Example
25 |
26 | The following are the instructions for running the basic example shown above
27 |
28 | 1. `sbt clean compile`
29 | 1. `sbt run`
30 | 1. Open [localhost:9000](http://localhost:9000/)
31 | 1. Use `obama` to visualize ~~all~~ both documents.
32 |
33 | # Input Data
34 |
35 | To visualize the documents, they needed to be annotated with basic NLP (NER specifically), linked to Freebase entities, and have relation extracted on a per-sentence level. The following are the list of files that contain this information.
36 |
37 | For the files used for the visualization above, see [data/test](https://github.com/sameersingh/er-visualizer/tree/master/data/test).
38 |
39 | ## Necessary files
40 |
41 | 1. Create a directory where all the files below will go, and specify it in `application.conf` as `nlp.data.baseDir` (See `reference.conf`)
42 | 1. **Documents**: A json file (`docs.json.gz`), as described below (see **Processed Documents**), containing the processed documents with entity linking and relations.
43 | 1. **Entities**: Information about the entities from Freebase, either read from a Mongo server, or read from files `ent.info`, `ent.freebase`, and `ent.head` as prepared from Freebase below (see **Freebase Information**)
44 | 1. `wcounts.txt.gz` and `ecounts.txt.gz`: Gzipped files containing list of keywords and entities for search (generated from `docs.json.gz` using `org.sameersingh.ervisualizer.data.WordCounts`).
45 |
46 | ## Processed Documents
47 |
48 | This will describe how we generate `docs.json.gz` (file name can me modified in the configuration using `docsFile`).
49 |
50 | We will be using `nlp_serde` as the underlying document representation. The library contains data structures for representing most of the NLP annotations, including entity linking and relation extraction, so you can directly wrap your document annotations into those classes, and then write out a documents file using `nlp_serde.writers.PerLineJsonWriter`. See [`org.sameersingh.ervisualizer.data.TestDocs`](https://github.com/sameersingh/er-visualizer/blob/master/app/org/sameersingh/ervisualizer/data/TestDocs.scala) for example annotated documents.
51 |
52 | Or, less desirably, you can write out the JSON files directly from your code (see `data/test/docs.json.gz` for an example).
53 |
54 | ## Freebase Information
55 |
56 | Visualization needs access to Freebase information about the entities that appear in your document collection.
57 |
58 | You can either have a Mongo server running (requires a lot of memory, and might be slower), or create the relevant files yourself (configured using `nlp.data.mongo` flag). The test above uses the file mode, i.e. you don't need to run a Mongo server.
59 |
60 | ### Reading Freebase Info from Mongo
61 |
62 | 1. Download a [freebase RDF dump](http://commondatastorage.googleapis.com/freebase-public/rdf/freebase-rdf-latest.gz), for example `freebase-rdf-2014-07-06-00-00.gz`.
63 | 1. Grep the dump to create a file for each of the following relations (using something like `zcat freebase-rdf-2014-07-06-00-00.gz | grep "" | gzip > $relation.gz`):
64 | - `type.object.id`
65 | - `type.object.name`
66 | - `common.topic.image`
67 | - `common.topic.description`
68 | - `common.topic.notable_types`
69 | - `location.location.geolocation`
70 | - `location.geocode.longitude`
71 | - `location.geocode.latitude`
72 | 1. Start a Mongo server, and run `org.sameersingh.ervisualizer.freebase.LoadMongo` to populate it (change `baseDir`, `host`, and `port` if needed)
73 | 1. Run visualization with `nlp.data.mongo = true` to use the Mongo server.
74 |
75 | ### Reading Freebase Info from Files
76 |
77 | Reading Mongo can be inefficient, and thus it is more efficient to read this information directly from files, as we will describe here. Note that you still need Mongo to generate the files the first time around, but you don't need it after the files have been created.
78 |
79 | The files `ent.info`, `ent.freebase`, and `ent.head` are pretty simple per-line JSON files containing the entity information, corresponding to the case classes in [`Entity.scala`](https://github.com/sameersingh/er-visualizer/blob/master/app/org/sameersingh/ervisualizer/data/Entity.scala). You can use the method below to construct these files, or generate your own directly. The only constraint is that these three files are aligned, i.e. information about the same entity appears in the three files on the same line number.
80 |
81 | If you want to use Mongo to generate these files:
82 |
83 | 1. Previous steps of creating documents and setting up a Mongo server.
84 | 1. Run `org.sameersingh.ervisualizer.freebase.GenerateEntInfo` to generate the files.
85 | 1. Run visualization with `nlp.data.mongo = false`, and you can shut down the Mongo sever.
86 |
87 | # Contact
88 |
89 | Please use Github issues if you have problems/questions.
90 |
--------------------------------------------------------------------------------
/app/controllers/Application.scala:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import com.typesafe.config.ConfigFactory
4 | import org.sameersingh.ervisualizer.Logging
5 | import org.sameersingh.ervisualizer.kba.{EntityKBAReader, KBAStore}
6 | import play.api.mvc._
7 | import org.sameersingh.ervisualizer.data._
8 | import play.api.libs.json.Json
9 |
10 | import scala.collection.mutable
11 |
12 | object Application extends Controller with Logging {
13 |
14 | val config = ConfigFactory.load()
15 | val defaultDBName = config.getString("nlp.data.defaultDB")
16 |
17 | val _docs = new DocumentStore()
18 | val _dbStore = new DBStore(_docs)
19 |
20 | private val _db: mutable.Map[String, DB] = new mutable.HashMap[String, DB]
21 | private var _entKBA: KBAStore = null
22 |
23 | def db(id: String) = _dbStore.id(id)
24 | def dbQueryId(query: String) = _dbStore.query(query)._1
25 |
26 | def entKBA = _entKBA
27 |
28 | def init() {
29 | _entKBA = EntityKBAReader.read()
30 | val docDir = config.getString("nlp.data.baseDir")
31 | val docsFile = config.getString("nlp.data.docsFile")
32 | DocumentStore.readDocs(_docs, docDir, docsFile)
33 | }
34 |
35 | import org.sameersingh.ervisualizer.data.JsonWrites._
36 |
37 | def index = search // reset(defaultDBName)
38 |
39 | def search = Action {
40 | Ok(views.html.search("UW Visualizer"))
41 | }
42 |
43 | def page(query: Option[String]) = Action {
44 | logger.info("Query : \"" + query.get + "\"")
45 | if(_docs.numDocs == 0) init()
46 | val (dbId, _) = _dbStore.query(query.getOrElse(""))
47 | logger.info(" Id : " + dbId)
48 | Ok(views.html.main("UW Visualizer - " + query.get, dbId))
49 | }
50 |
51 | def pageId(dbId: String) = Action {
52 | if(_docs.numDocs == 0) init()
53 | val query = _dbStore.queryIdMap(dbId)
54 | logger.info("Request Id : " + dbId + ", saved query: \"" + query + "\"")
55 | Ok(views.html.main("UW Visualizer - " + query, dbId))
56 | }
57 |
58 | def entityKBA(id: String) = Action {
59 | println("eKBA: " + id)
60 | Ok(Json.toJson(entKBA.entityKBA(id)))
61 | }
62 |
63 | def relationKBA(sid: String, tid: String) = Action {
64 | println("rKBA: " + sid -> tid)
65 | Ok(Json.toJson(entKBA.relationKBA(sid, tid)))
66 | }
67 |
68 | def document(docId: String, dbId: Option[String]) = Action {
69 | println("doc: " + docId)
70 | //SeeOther("http://allafrica.com/stories/%s.html?viewall=1" format(docId.take(12)))
71 | Ok(Json.prettyPrint(Json.toJson(db(dbId.get).document(docId))))
72 | }
73 |
74 | def sentence(docId: String, sid: Int, dbName: Option[String]) = Action {
75 | // println("sen: " + docId + ", " + sid)
76 | Ok(Json.toJson(db(dbName.get).document(docId).sents(sid)))
77 | }
78 |
79 | def entityHeaders(dbName: Option[String]) = Action {
80 | println("Entity Headers: " + dbName.get)
81 | Ok(Json.toJson(db(dbName.get).entityIds.map(id => db(dbName.get).entityHeader(id)).toSeq))
82 | }
83 |
84 | def entityInfo(id: String, dbName: Option[String]) = Action {
85 | println("eInfo: " + id)
86 | Ok(Json.toJson(db(dbName.get).entityInfo(id)))
87 | }
88 |
89 | def entityFreebase(id: String, dbName: Option[String]) = Action {
90 | println("eFb: " + id)
91 | Ok(Json.toJson(db(dbName.get).entityFreebase(id)))
92 | }
93 |
94 | def entityText(id: String, dbName: Option[String], limit: Option[Int]) = Action {
95 | println("eTxt: " + id)
96 | if (limit.isDefined && limit.get > 0)
97 | Ok(Json.toJson(EntityText(id, db(dbName.get).entityText(id).provenances.take(limit.get))))
98 | else Ok (Json.toJson(db(dbName.get).entityText(id)))
99 | }
100 |
101 | def entityProvs(id: String, dbName: Option[String]) = Action {
102 | println("eTxt: " + id)
103 | Ok(views.html.provs("Entity " + id, Seq(id), dbName.get))
104 | //Ok(Json.toJson(db(dbName).entityText(id)))
105 | }
106 |
107 | def entityRelations(id: String, dbName: Option[String]) = Action {
108 | println("eRels: " + id)
109 | Ok(Json.toJson(db(dbName.get).relations(id)))
110 | }
111 |
112 | def entityTypes(id: String, dbName: Option[String]) = Action {
113 | println("eT: " + id + ": " + db(dbName.get).entityTypePredictions(id).mkString(", "))
114 | Ok(Json.toJson(db(dbName.get).entityTypePredictions(id)))
115 | }
116 |
117 | def entityTypeProv(id: String, etype: String, dbName: Option[String], limit: Option[Int]) = Action {
118 | println("eTP: " + id + ", " + etype)
119 | if (limit.isDefined && limit.get > 0)
120 | Ok(Json.toJson(TypeModelProvenances(id, etype, db(dbName.get).entityTypeProvenances(id, etype).provenances.take(limit.get))))
121 | else Ok(Json.toJson(db(dbName.get).entityTypeProvenances(id, etype)))
122 | }
123 |
124 | def relationHeaders(dbName: Option[String]) = Action {
125 | println("Relation Headers: " + dbName.get)
126 | Ok(Json.toJson(db(dbName.get).relationIds.map(id => db(dbName.get).relationHeader(id._1, id._2)).toSeq))
127 | }
128 |
129 | def relationFreebase(sid: String, tid: String, dbName: Option[String]) = Action {
130 | println("RelFreebase: " + (sid -> tid))
131 | Ok(Json.toJson(db(dbName.get).relationFreebase(sid, tid)))
132 | }
133 |
134 | def relationText(sid: String, tid: String, dbName: Option[String], limit: Option[Int]) = Action {
135 | println("RelText: " + (sid -> tid))
136 | if (limit.isDefined && limit.get > 0)
137 | Ok(Json.toJson(RelationText(sid, tid, db(dbName.get).relationText(sid, tid).provenances.take(limit.get))))
138 | else Ok(Json.toJson(db(dbName.get).relationText(sid, tid)))
139 | }
140 |
141 | def relationProvs(sid: String, tid: String, dbName: Option[String]) = Action {
142 | println("RelText: " + (sid -> tid))
143 | Ok(views.html.provs("Relation: %s -> %s ".format(sid, tid), Seq(sid, tid), dbName.get))
144 | //Ok(Json.toJson(db(dbName).relationText(sid, tid)))
145 | }
146 |
147 | def relationPredictions(sid: String, tid: String, dbName: Option[String]) = Action {
148 | println("RelPred: " + (sid -> tid))
149 | Ok(Json.toJson(db(dbName.get).relationPredictions(sid, tid)))
150 | }
151 |
152 | def relationProvenances(sid: String, tid: String, rtype: String, dbName: Option[String], limit: Option[Int]) = Action {
153 | println("RelProv: " + (sid -> tid))
154 | if (limit.isDefined && limit.get > 0)
155 | Ok(Json.toJson(RelModelProvenances(sid, tid, rtype, db(dbName.get).relationProvenances(sid, tid, rtype).provenances.take(limit.get))))
156 | else Ok(Json.toJson(db(dbName.get).relationProvenances(sid, tid, rtype)))
157 | }
158 |
159 |
160 | }
--------------------------------------------------------------------------------
/public/javascripts/main-kba.js:
--------------------------------------------------------------------------------
1 |
2 | var parseDate = d3.time.format('%x');
3 | var entities = [];
4 | //var scale = 604800; // per week
5 | var scale = 86400; // day
6 |
7 | function parseData(d) {
8 | var clusters = Math.max.apply(null, _.pluck(d, "ci"))
9 | var data = [];
10 | for (i=0; i < clusters; i++) {
11 | data[i] = [];
12 | }
13 |
14 | var maxTimestamp = 0;
15 | var minTimestamp = 999999999999;
16 |
17 | d.map(function(e,i) {
18 | if (e.timestamp > maxTimestamp) {
19 | maxTimestamp = e.timestamp;
20 | }
21 | if (e.timestamp < minTimestamp) {
22 | minTimestamp = e.timestamp;
23 | }
24 | e.lambdas.map(function (c, i) {
25 | data[c.cj-1].push({x: e.timestamp, y: c.dec});
26 | data[c.cj-1].push({x: e.timestamp, y: c.inc});
27 | });
28 | });
29 |
30 | var bins = Math.round((maxTimestamp - minTimestamp) / scale);
31 | console.log(bins);
32 |
33 | xs = []
34 | vitals = []
35 | non_vitals = []
36 | for (i=0; i < bins; i++) {
37 | xs.push(Math.round(minTimestamp + (scale * i)));
38 | vitals.push(0);
39 | non_vitals.push(0);
40 | }
41 |
42 | d.map(function(e,i) {
43 | var bin = Math.round((e.timestamp - minTimestamp) / scale);
44 | if (e.relevance == 2) {
45 | vitals[bin] += 1;
46 | } else {
47 | non_vitals[bin] += 1;
48 | }
49 | });
50 |
51 | var staleness = data.map(function(cluster, i) {
52 | return {
53 | key: "C" + (i+1),
54 | values: cluster
55 | };
56 | });
57 |
58 | vitals_values = [];
59 | non_vitals_values = [];
60 | for (i=0; i < bins; i++) {
61 | vitals_values.push({x : xs[i], y: vitals[i]});
62 | non_vitals_values.push({x: xs[i], y: non_vitals[i]});
63 | }
64 |
65 | var relevance = [ {
66 | key: "Vital",
67 | values: vitals_values
68 | }, {
69 | key: "Non-Vital",
70 | values: non_vitals_values
71 | }];
72 | return [staleness, relevance]
73 | }
74 |
75 | function registerEvent(src, dst) {
76 | src.dispatch.on("brush", function(evt) {
77 | //dst.brushExtent(evt.extent);
78 | //var oldTransition = dst.transitionDuration();
79 | //dst.transitionDuration(0);
80 | //dst.dispatch.brush();
81 | //dst.transitionDuration(oldTransition);
82 | });
83 | }
84 |
85 |
86 | function getDocuments(e) {
87 | var entity = e.id;
88 | d3.json('/kba/documents/' + e.id, function(error, d) {
89 | if (!error) {
90 | var data = parseData(d);
91 | var relevanceChart = timeChart('#relevance', 'd', data[1]);
92 | relevanceChart.yAxis.axisLabel('number of documents').axisLabelDistance(40);
93 | //relevanceChart.lines.dispatch.on('elementClick', function(e) {
94 | //onRelevanceClick(entity, e.point.x);
95 | //});
96 | var stalenessChart = timeChart('#staleness', ',.2f', data[0]);
97 | stalenessChart.yAxis.axisLabel('staleness').axisLabelDistance(40);
98 | //stalenessChart.interpolate("basis");
99 | stalenessChart.lines.dispatch.on('elementClick', function(e) {
100 | onClusterClick(entity, e.series.key.charAt(1), e.point.x);
101 | });
102 | //registerEvent(relevanceChart, stalenessChart);
103 | //registerEvent(stalenessChart, relevanceChart);
104 | }
105 | });
106 | }
107 |
108 | function renderModal(d) {
109 | wordCloud(d);
110 | $('#wordcloud').modal();
111 | }
112 |
113 | function onRelevanceClick(entity, timestamp) {
114 | d3.json('/kba/wordcloud/' + entity + '/' + timestamp, function(error, d) {
115 | if (!error) {
116 | renderModal(d);
117 | }
118 | });
119 | }
120 |
121 | function onClusterClick(entity, clusterid, timestamp) {
122 | d3.json('/kba/wordcloud/' + entity + '/' + clusterid + '/' + timestamp, function(error, d) {
123 | if (!error) {
124 | renderModal(d);
125 | }
126 | });
127 | }
128 |
129 | function timeChart(id, format, data) {
130 | var chart = nv.models.lineWithFocusChart();
131 | chart.xAxis.tickFormat(function(d) {
132 | return parseDate(new Date(d * 1000));
133 | });
134 | chart.x2Axis.tickFormat(function(d) {
135 | return parseDate(new Date(d * 1000));
136 | });
137 | chart.yAxis.tickFormat(d3.format(format));
138 | chart.y2Axis.tickFormat(d3.format(format));
139 |
140 | nv.addGraph(function() {
141 | d3.select(id + ' svg').remove();
142 | d3.select(id).append('svg');
143 | d3.select(id + ' svg')
144 | .datum(data)
145 | .transition().duration(500)
146 | .call(chart);
147 | nv.utils.windowResize(chart.update);
148 | return chart;
149 | });
150 | // remove tooltips
151 | chart.tooltips(false);
152 | chart.lines.dispatch.on('elementMouseover.tooltip', null);
153 | chart.lines.dispatch.on('elementMouseout.tooltip', null);
154 | //chart.color(['#8c510a','#bf812d','#dfc27d','#f6e8c3','#c7eae5','#80cdc1','#35978f','#01665e']);
155 | return chart;
156 | }
157 |
158 | function initTypeahead() {
159 | var bh = new Bloodhound({
160 | datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
161 | queryTokenizer: Bloodhound.tokenizers.whitespace,
162 | local: $.map(entities, function(e) { return e; })
163 | });
164 | bh.initialize();
165 | $('#entity .typeahead').typeahead({
166 | hint: true,
167 | highlight: true,
168 | minLength: 1
169 | },
170 | {
171 | name: 'entities',
172 | displayKey: 'name',
173 | source: bh.ttAdapter()
174 | })
175 | .on('typeahead:selected', function($e, datum){
176 | getDocuments(datum);
177 | }
178 | )
179 | .on('typeahead:autocompleted', function($e, datum){
180 | $('#entity .typeahead').typeahead('close');
181 | getDocuments(datum);
182 | });
183 | }
184 |
185 | function wordCloud(data) {
186 | var words = data.map(function(d) {
187 | return {text: d.t, size: 10 + (d.p / 1000) * 19};
188 | });
189 | var fill = d3.scale.category20();
190 | d3.layout.cloud().size([300, 300])
191 | .words(words)
192 | .padding(5)
193 | .rotate(function() { return ~~(Math.random() * 2) * 90; })
194 | .font("Impact")
195 | .fontSize(function(d) { return d.size; })
196 | .on("end", draw)
197 | .start();
198 |
199 | function draw(words) {
200 | d3.select("#wordcloud-body svg").remove();
201 | d3.select("#wordcloud-body").append("svg")
202 | .attr("width", 300)
203 | .attr("height", 300)
204 | .append("g")
205 | .attr("transform", "translate(150,150)")
206 | .selectAll("text")
207 | .data(words)
208 | .enter().append("text")
209 | .style("font-size", function(d) { return d.size + "px"; })
210 | .style("font-family", "Impact")
211 | .style("fill", function(d, i) { return fill(i); })
212 | .attr("text-anchor", "middle")
213 | .attr("transform", function(d) {
214 | return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")";
215 | })
216 | .text(function(d) { return d.text; });
217 | }
218 | }
219 |
220 | function run() {
221 | //wordCloud();
222 | d3.json('/kba/entities', function(data) {
223 | entities = data.map(function(e, i) {
224 | return {id: e.id, name: e.name};
225 | });
226 | initTypeahead();
227 | });
228 | }
--------------------------------------------------------------------------------
/public/html/summa/randy.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | UW Summa
5 |
6 |
7 |
8 |
9 |
10 |
15 | 4-15-2014 As the strategic cooperative partner of Nigeria , China will continue its firm support to the Nigerian government in safeguarding national security and regional stability .
16 |
17 |
18 | 4-15-2014 As the strategic cooperative partner of Nigeria , China will continue its firm support to the Nigerian government in safeguarding national security and regional stability .
19 |
20 |
21 | 5-8-2014 As good as that may sound , but whichever politician refused to hijack policies in favour of the US was made to face financial espionage or '' corruption charges '' .
22 |
23 |
24 | 5-14-2014 Nigerian Military Human Rights Abuses Wo n't Stop American Search Assistance .
25 |
26 |
27 |
28 |
29 | 5-28-2014 At least 31 security personnel have been killed following an attack on a military base in Nigeria by Boko Haram fighters , security sources and witnesses said .
30 |
31 |
32 | 5-28-2014 At least 31 security personnel have been killed following an attack on a military base in Nigeria by Boko Haram fighters , security sources and witnesses said .
33 |
34 |
35 | 5-21-2014 U.S. military service members form part of an interagency team working out of the U.S. embassy in Abuja that is helping to coordinate the search with Nigerian authorities .
36 |
37 |
38 | 5-22-2014 China will carry out cooperation in six major areas , namely , industrial cooperation , financial cooperation , cooperation on poverty reduction , cooperation on environmental protection , cultural and people-to-people exchanges , and cooperation on peace and security .
39 |
40 |
41 | 5-30-2014 The northeast of Nigeria is plagued by Boko Haram attacks and has been under a state of emergency since May 2013 .
42 |
43 |
44 |
45 |
46 | 7-7-2014 U.S. officials say they believe reports that more than 60 girls who were kidnapped by the Nigerian terror group Boko Haram have escaped are accurate .
47 |
48 |
49 | 5-31-2014 Violence in northeastern Nigeria no longer fits the overly simplistic early narrative of Muslims killing Christians .
50 |
51 |
52 | 5-31-2014 Once described as the '' home of peace '' by locals , Maiduguri - the capital of Borno state - is now better known as the epicentre of deadly attacks and abductions that have killed thousands of Nigerians in schools , churches , mosques and markets .
53 |
54 |
55 | 5-31-2014 Today , visitors travelling to Maiduguri by road will notice an absence of uniformed military presence on the streets of the historic town .
56 |
57 |
58 | 7-7-2014 U.S. officials say they believe reports that more than 60 girls who were kidnapped by the Nigerian terror group Boko Haram have escaped are accurate .
59 |
60 |
61 |
62 |
63 | 8-8-2014 The World Health Organization warned on Friday that the disease is now a '' public health emergency of international concern '' and called for a coordinated international response to stop and reverse the international spread of Ebola .
64 |
65 |
66 |
67 |
68 | 8-14-2014 The Chinese government and people will not forget that the African people always reach out helping hands to offer timely help and generous support when Chinese people met with difficulties .
69 |
70 |
71 | 8-11-2014 The Chinese president said that China is willing to support the three countries in containing the spread of Ebola .
72 |
73 |
74 | 8-11-2014 Xi said that , at this difficult time , the Chinese government and people will stand together with the governments and peoples of the three nations and are willing to offer anti-epidemic supplies to them .
75 |
76 |
77 | 8-14-2014 Chinese government deems it obligatory to support African countries to tackle Ebola epidemic .
78 |
79 |
80 | 9-8-2014 Health experts say most infectious agents would not immediately manifest or make the patient contagious .
81 |
82 |
83 |
84 |
85 | 9-30-2014 Since 2009 , an estimated 3,600 people have been killed in an insurgency launched by the group known as Boko Haram , which says it wants to establish an Islamic state in northeastern Nigeria .
86 |
87 |
88 | 9-30-2014 Little is known about Boko Haram and its motivations , and information about the group 's activities remains under a tight coil .
89 |
90 |
91 | 10-2-2014 A region or country is considered Ebola-free after 42 days without any new cases .
92 |
93 |
94 | 10-10-2014 On Friday he claimed to have no knowledge of ongoing negotiations .
95 |
96 |
97 |
98 |
99 | 10-11-2014 Cameroon 's government announced Saturday that 27 hostages presumed to have been kidnapped by Boko Haram , including 10 Chinese construction workers and the wife of a vice prime minister , had been freed .
100 |
101 |
102 | 10-11-2014 Cameroon says it does not pay ransoms in kidnapping cases , and Saturday 's brief statement provided no details on the conditions of the hostages ' release .
103 |
104 |
105 | 10-14-2014 Abuja , Nigeria - Six months after the armed group Boko Haram kidnapped 276 Nigerian girls from a boarding school in the northeastern town of Chibok , 219 remain in captivity after 57 escaped .
106 |
107 |
108 | 10-17-2014 Nigeria 's military says it has agreed a truce with Islamist militant group Boko Haram - and says the schoolgirls the group has abducted will be released .
109 |
15 | 1-14-2014 Nigeria 's military on Tuesday blamed Boko Haram militants for a deadly bomb attack that killed at least 17 in a crowded market in Maiduguri , in the latest violence to hit the country 's restive north .
16 |
17 |
18 | 1-9-2014 The 7 Division of the Nigerian Army in Maiduguri on Thursday said it repelled the attack of suspected Boko Haram insurgents on Damboa Town , Damboa Local Government Area of Borno .
19 |
20 |
21 | 1-9-2014 This information is contained in a statement issued by the spokesman of the division , Col. Muhammad Dole , in Maiduguri . ''
22 |
23 |
24 | 1-12-2014 Sheriff had arrived in Maiduguri on Sunday after an 11-month absence .
25 |
26 |
27 | 1-14-2014 The Nigerian Army said it has arrested one person over Tuesday 's bomb blast in Maiduguri , Borno State .
28 |
29 |
30 |
31 |
32 | 1-15-2014 A former governor of Borno State , Ali Modu Sheriff , who has come under attack since Tuesday 's bomb blast in Maiduguri , has said the outlawed Boko Haram sect is not responsible for the blast .
33 |
34 |
35 | 1-15-2014 Mr. Sheriff blamed Borno State government officials and members of his All Progressives Congress , APC , for the blast that is believed to have killed at least 31 people with dozens more injured .
36 |
37 |
38 | 1-16-2014 Hospital sources in Maiduguri , the Borno State capital yesterday disclosed to journalists that the Tuesday bomb blast at the city 's densely populated commercial area had killed 43 persons .
39 |
40 |
41 | 1-17-2014 Spain has condemned last Tuesday 's attack on a market in Maiduguri , the Borno State capital , where the death toll has now risen to 43 .
42 |
43 |
44 |
45 |
46 | 1-22-2014 Borno State Governor , Alhaji Kashim Shettima , Tuesday reviewed the dusk to dawn curfew imposed on the state capital , Maiduguri , on December 2 , 2013 following Boko Haram attack on military and security formations .
47 |
48 |
49 | 1-22-2014 Maiduguri is seen as the outlawed sector 's spiritual base .
50 |
51 |
52 | 1-23-2014 Some students of University of Maiduguri from Gombe State on Tuesday survived a ghastly road accident along the Maiduguri-Biu highway .
53 |
54 |
55 | 1-24-2014 Some villagers in farming communities around Maiduguri said they buried 18 of their neighbours on Wednesday after gunmen suspected to be members of the Boko Haram attacked their communities .
56 |
57 |
58 |
59 |
60 |
61 |
62 | 2-23-2014 Countless military posts , countless attacks Investigation by our correspondents reveals that dozens of new military formations and checkpoints , manned by many troops have been established along all the roads leading to Maiduguri .
63 |
64 |
65 | 2-23-2014 Countless military posts , countless attacks Investigation by our correspondents reveals that dozens of new military formations and checkpoints , manned by many troops have been established along all the roads leading to Maiduguri .
66 |
67 |
68 | 2-26-2014 The Senate Committee on Defence and Army on Wednesday in Abuja urged the Chief of Army Staff to relocate temporarily to Maiduguri .
69 |
70 |
71 | 3-1-2014 Maiduguri -- Twin explosions , Saturday evening , rocked a football viewing centre in Ajilari ward , Jere Council area of Maiduguri , the Borno State capital killing several football fans .
72 |
73 |
74 |
75 |
76 | 3-11-2014 Nigerian football club Abia Warriors have asked for their weekend match against El Kanemi Warriors be moved from the northeastern city of Maiduguri , the stronghold of Islamist group Boko Haram .
77 |
78 |
79 | 3-2-2014 Expectedly , several residents of Maiduguri have become apprehensive , fearing that the city may have returned to the dark days of 2012 when there was hardly a single day without explosion .
80 |
81 |
82 | 3-2-2014 Maiduguri -- It was another tragic day in Maiduguri , Borno State capital , yesterday , after twin explosions reportedly killed about 100 people , some of them football fans .
83 |
84 |
85 | 3-8-2014 Maiduguri -- Since May , 2013 , there has been respite in Maiduguri , Borno State capital and the notorious epicenter of violent insurgency .
86 |
87 |
88 | 3-11-2014 The club cited security concerns as a justification for the proposed venue change following waves of attacks by the insurgents both in Maiduguri and in surrounding areas , but league officials have rejected the appeal .
89 |
90 |
91 |
92 |
93 | 3-14-2014 Fierce battle between soldiers and members of the Boko Haram sect has forced residents of Maiduguri to flee the city .
94 |
95 |
96 | 3-14-2014 Photo : http://www.premiumtimesng.com/ Premium Times Maiduguri attack Gunmen suspected to be members of the extremist Boko Haram sect have invaded Maiduguri , the Borno state capital , throwing the city into pandemonium .
97 |
98 |
99 | 3-15-2014 After shootings stopped , soldiers and youth vigilante group were seen combing Maiduguri for escaping terrorists .
100 |
101 |
102 | 3-18-2014 Members of the Boko Haram sect who were displaced from their Sambisa forest stronghold in Borno State and forced back from Maiduguri by the Nigerian Army have re-emerged in the southern part of the state forcing motorists to shun the Biu/Maiduguri highway for fear of being attacked on the road .
103 |
104 |
105 |
106 |
107 | 3-24-2014 Two suicide bombers driving a Volkswagen saloon car , on Monday , in Maiduguri , rammed their vehicle into a police highway patrol van killing five officers and three civilians , witnesses and security officials said .
108 |
109 |
110 | 3-21-2014 He said they were surprised to find out that the insurgents have launched attack on them despite the presence of the military detailed to protect lives and property in the area . ''
111 |
112 |
113 | 3-25-2014 Initially , the military had some success in tempering attacks within Maiduguri , but Boko Haram has carried out a series of daring raids in the heart of the city in recent months .
114 |
115 |
116 | 3-26-2014 The latest attack on Maiduguri , the Borno State capital and epicentre of the Boko Haram insurgency , coincided with a protest led my Muslim women to the National Assembly over the mindless killing of Nigerians by the terrorists .
117 |
15 | 5-8-2014 As good as that may sound , but whichever politician refused to hijack policies in favour of the US was made to face financial espionage or '' corruption charges '' .
16 |
17 |
18 | 5-8-2014 As good as that may sound , but whichever politician refused to hijack policies in favour of the US was made to face financial espionage or '' corruption charges '' .
19 |
20 |
21 | 5-8-2014 Years , later the CIA while tactically taking advantage of growing sectarian violence in Nigeria , recruited jobless Islamic extremist through Muslim and other traditional leaders offering training indirectly to the group by use of foreign based terror groups .
22 |
23 |
24 | 5-8-2014 Today as Nigerians are reeling from the negative effects of the insurgency that has befallen our dear country and earnestly seeking answers to what all this portends for the future , the GREENWHITE COALITION a citizen 's watchdog can reveal the true nature of this silent , undeclared war of attrition waged against Nigeria by the Government of United States of America .
25 |
26 |
27 |
28 |
29 | 5-17-2014 Countries neighbouring Nigeria are ready to wage war against the Nigeria-based , al-Qaeda-linked group , Boko Haram , Chad 's president says .
30 |
31 |
32 | 5-28-2014 At least 31 security personnel have been killed following an attack on a military base in Nigeria by Boko Haram fighters , security sources and witnesses said .
33 |
34 |
35 |
36 |
37 | 5-30-2014 Source 2 in Lagos claims to have heard of a '' Hosni '' through a network of associates .
38 |
39 |
40 | 5-30-2014 Source 2 in Lagos claims to have heard of a '' Hosni '' through a network of associates .
41 |
42 |
43 | 5-30-2014 The northeast of Nigeria is plagued by Boko Haram attacks and has been under a state of emergency since May 2013 .
44 |
45 |
46 | 5-30-2014 Nigeria 's president has said he has ordered '' total war '' against the armed group Boko Haram which last month abducted 276 schoolgirls in the northeastern state of Borno .
47 |
48 |
49 | 5-30-2014 Chief of Defence Staff Air Chief Marshal Alex Badeh said any potential armed rescue operation was fraught with danger as the girls could be caught in the crossfire .
50 |
51 |
52 |
53 |
54 | 5-31-2014 Violence in northeastern Nigeria no longer fits the overly simplistic early narrative of Muslims killing Christians .
55 |
56 |
57 | 5-31-2014 Today , visitors travelling to Maiduguri by road will notice an absence of uniformed military presence on the streets of the historic town .
58 |
59 |
60 | 5-31-2014 Violence in northeastern Nigeria no longer fits the overly simplistic early narrative of Muslims killing Christians .
61 |
62 |
63 | 5-31-2014 Once described as the '' home of peace '' by locals , Maiduguri - the capital of Borno state - is now better known as the epicentre of deadly attacks and abductions that have killed thousands of Nigerians in schools , churches , mosques and markets .
64 |
65 |
66 |
67 |
68 | 6-9-2014 Source 7 in Bingi reports no confirmation of the arrival of Lagos-based radical Islamists .
69 |
70 |
71 | 6-5-2014 Source 1 in Lagos has heard street talk of an impending operation to assassinate the Nigerian Prime Minister .
72 |
73 |
74 | 6-7-2014 Source 7 has heard rumors concerning the arrival in Bingi of potential radical Islamists from Lagos who may be part of a catastrophic plot to kill hundreds , if not thousands , of people in and around Lagos .
75 |
76 |
77 | 6-11-2014 Source 1 in Lagos reports that the following individuals are among the most radical members of the Khoury Habib Mosque in Lagos : Omar Assad , Hani Boutros , and Yousef Najeeb .
78 |
79 |
80 |
81 |
82 | 6-15-2014 Source 11 in Onitsha states that he has not noted any rise in anti-Nigerian sentiment among Onitsha 's small Moslem community .
83 |
84 |
85 | 6-16-2014 Source 9 in Lagos claims that two of his brother-in-law 's friends , Tawfiq Attuk and Bassam Bahran , staying in Nigeria on extended tourist visas , have expressed their support for Boko Haram activities in the Middle East .
86 |
87 |
88 |
89 |
90 | 6-21-2014 Source 10 in Abuja describes Al Samarah as leader of the '' virulent anti-Western faction '' among his business associates .
91 |
92 |
93 | 6-29-2014 She and several of her associates are lobbying for separate schools for boys and girls .
94 |
95 |
96 | 6-19-2014 Source 4 in Lagos reports no apparent increase in anti-Nigerian rhetoric among the members of his Young Men 's Islamic Association in the aftermath of Operation Iraqi Freedom .
97 |
98 |
99 | 6-22-2014 Source 16 in Benin City cites Malik Mosul as a '' dangerous subversive '' operating in the city .
100 |
101 |
102 | 6-29-2014 She and several of her associates are lobbying for separate schools for boys and girls .
103 |
104 |
105 |
106 |
107 | 7-2-2014 Source 17 in Uyo reports a political meeting having taken place between Gimmel Faruk and Dimitri Yagdanich , a Bosnian immigrant .
108 |
109 |
110 | 7-5-2014 Source believes this is probable evidence of influx of '' conspiracy-mongers from Lagos . ''
111 |
112 |
113 |
114 |
115 | 7-8-2014 Source 17 in Uyo reports that his friend Karmij Aziz claims to have been offered a job by one Ali Hakem because of his computer hacking skills .
116 |
117 |
118 | 7-10-2014 Source 1 in Lagos claims an association between Khaleed Kulloh and Djibouti Jones .
119 |
120 |
121 | 7-11-2014 Source 9 in Lagos claims to have seen Khaleed Kulloh and Phil Salwah together on several occasions at several mosques in the East Side .
122 |
123 |
124 | 7-27-2014 Samagu 's Islamic community is very small and it is unusual for an immigrant to show up and stay for several weeks without family or business ties .
125 |
126 |
127 | 7-28-2014 Source 18 , located in the University of Benin , reports that several of the more radical Islamic students have left resigned from the university to apparently return to Saudi Arabia , yet they are still staying at their hotel in Benin City .
128 |
15 | 7-2-2013 A recent UN report identified Nigeria has having the highest number of HIV infections in the world in 2012 . ''
16 |
17 |
18 | 7-2-2013 President Goodluck Jonathan has expressed his disappointment at the continued prevalence of HIV/AIDS in the country , adding that the lack of comprehensive planning to mitigate the disease needs to be addressed .
19 |
20 |
21 | 7-2-2013 The president ascribed the increase in transmission of the virus within the country to the lack of a comprehensive national plan on how to tackle the transmission and management of the disease .
22 |
23 |
24 | 7-2-2013 Mr. Jonathan said this at the presentation of the President 's Emergency Plan , PERP for HIV/AIDS in Nigeria for 2013-2015 , where he declared that no Nigerian citizen must be allowed to die from HIV henceforth .
25 |
26 |
27 | 7-2-2013 Mr. Idoko said the goal of the president 's initiative is to get the country to attain set universal access target of 80 per cent to HIV/AIDS prevention , treatment and care services .
28 |
29 |
30 |
31 |
32 | 7-8-2013 The Senate committee on Interior , yesterday expressed worry over the frequent jailbreak recorded in the country since the dreaded Boko Haram insurgency , saying it posed a great threat to the nation 's growth , peace and stability .
33 |
34 |
35 | 7-8-2013 The committee said they were visiting the Service to know it position on a proposal that Nigeria Prison Service should be removed from exclusive list and taken to concurrent list .
36 |
37 |
38 | 7-11-2013 The House of Representatives Thursday urged the federal government to take measures to address the plight of the refugees in the three states affected by the state of emergency rule .
39 |
40 |
41 | 7-12-2013 The resolution seeking succour for the refugees came on the heels of a motion sponsored by Hon. Abubakar Mahmud Wambai , member representing Mubi North / Mubi , South/Maiha Federal Constituency of Adamawa State .
42 |
43 |
44 |
45 |
46 | 7-13-2013 This is an eye focusing disorder , a condition that makes '' ; close objects look clear but distant objects appear blurred '' ; .
47 |
48 |
49 | 7-14-2013 Critical issues like fight against corruption , provision of good governance , basic infrastructure as power , roads , water , healthcare , education , credible election , etc. have all taken back seats in our governmental drive .
50 |
51 |
52 | 8-3-2013 Amnesty and state of emergency hardly go together although Mr President said both would be explored , that it will be a multi-tracked approach .
53 |
54 |
55 |
56 |
57 |
58 |
59 | 8-25-2013 From $ 11 per barrel under the military , the price of crude oil has hovered above $ 100 for the past seven years .
60 |
61 |
62 | 8-13-2013 The federal government has disclosed that it will start training about 2000 youths from the northern-east states under emergency rule as a result of Boko Haram insurgency in order to change their orientation .
63 |
64 |
65 | 8-13-2013 The programme will start with 1000 youth each from Borno and Yobe states and will extent to Adamawa state later .
66 |
67 |
68 | 8-14-2013 In the past two weeks , a lot has been said and written about the '' ; deportation '' ; of beggars and the destitute from Lagos State .
69 |
70 |
71 |
72 |
73 | 10-4-2013 In 24 hours , Nigeria shall be marking -LRB- not celebrating -RRB- 53 years as an independent state .
74 |
75 |
76 | 10-4-2013 The same Economist , in its Failed States Index , placed Nigeria amongst the 10 worst failed states with Somalia topping the list .
77 |
78 |
79 | 11-3-2013 This will ensure the general good of the nation - social , economic , political and cultural tolerance and accommodation .
80 |
81 |
82 |
83 |
84 |
85 |
86 | 11-7-2013 The Nigerian Senate on Thursday approved the extension of the state of emergency in three north-eastern states of Adamawa , Borno , and Yobe .
87 |
88 |
89 | 11-17-2013 Maiduguri -- The extension of the state of emergency in Adamawa , Borno and Yobe states did not come to many people as a surprise , partly due to the new wave of attacks by suspected members of the Boko Haram sect in recent weeks , especially in villages and towns around Borno and Yobe states .
90 |
91 |
92 | 11-20-2013 Nigerian Lawmakers Have Approved a Six month extension of the state of emergency in areas where troops are fighting Islamist militants .
93 |
94 |
95 | 12-4-2013 The Senate had recently approved President Goodluck Jonathan 's request for extension of emergency rule in Borno , Yobe and Adamawa states after a closed door meeting with security chiefs .
96 |
97 |
98 |
99 |
100 | 1-11-2014 INEC Chairman , Prof Attahiru Jega , who earlier declared that election would not be conducted in any state under emergency rule in 2015 , said , yesterday , that he did not foreclose election in the six states of Adamawa , Taraba , Bauchi , Yobe , Borno and Gombe .
101 |
102 |
103 | 12-28-2013 Despite the state of emergency in Yobe State , voters in the state will today go to the poll to elect new local government chairmen and councilors for the 17 local government areas of the state .
104 |
105 |
106 | 1-21-2014 The APC members took the decision after a six-hour meeting .
107 |
108 |
109 |
110 |
111 |
112 |
113 | 3-5-2014 President Goodluck Jonathan yesterday said rather than bickering , cordial rapport with the government at the centre and states should be sought to enhance rapid development in such states .
114 |
115 |
116 | 2-10-2014 While the Constitution defines an indigene of a state in terms of ancestral , nativist ' belonging ' to the state , administrative rules have tended to leave the practical definition of who is an ' indigene ' in the hands of local government officials .
117 |
118 |
119 | 2-10-2014 The more problematic states pose more challenging policy demands .
120 |
121 |
122 | 3-5-2014 The federal government certainly has Borno , Yobe and Adamawa , among other states , in mind while preparing the defence budget .
123 |
124 |
125 |
126 |
127 | 3-24-2014 Do n't ignite fire in Nasarawa state , that 's my warning .
128 |
129 |
130 | 3-24-2014 If anybody puts Nasarawa state on fire only God knows where it will go to , how far it will spread .
131 |
132 |
133 | 4-14-2014 The residents of the states argue that extending the emergency rule , will increase the apprehension in the area rather than lead to immediate resolution of the Boko Haram crisis .
134 |
135 |
136 |
137 |
138 |
139 |
140 | 5-13-2014 President Jonathan imposed in three troubled states a state of emergency .
141 |
142 |
143 | 5-15-2014 House of Representatives has approved President Goodluck Jonathan 's request for extension of the state of emergency currently in place in Adamawa , Borno and Yobe states .
144 |
145 |
146 | 5-21-2014 The Senate has endorsed the request of the President Goodluck Jonathan on the extension of the state of emergency in Adamawa , Borno and Yobe States for another six months .
147 |
148 |
149 | 6-6-2014 The All Progressives Congress , APC , has faulted Edwin Clark , for asking President Goodluck Jonathan to remove the democratic structures in the three states of Adamawa , Borno and Yobe states , which are under a state of emergency over the activities of the terror group , Boko Haram .
150 |
151 |
152 |
153 |
154 | 8-25-2014 By Chuks Okocha Elder statesman and Ijaw leader , Chief Edwin Clark yesterday declared that President Goodluck Jonathan would seek re-election in 2015 , insisting that nobody could stop him from doing so because he was constitutionally qualified .
155 |
156 |
157 | 8-25-2014 Clark further said that President Jonathan had performed creditably well .
158 |
159 |
160 | 9-23-2014 Already , five local government areas in the northern part of the state were excluded from the recent Permanent Voters ' Cards registration exercise .
161 |
15 | 2-2-2014 Nigeria 's Boko Haram was suspected Sunday of killing a popular Muslim cleric , his wife and child in the northern city of Zaria , Kaduna state .
16 |
17 |
18 | 2-1-2014 Governor Kashim Shettima of Borno State has called on private and corporate bodies to join the efforts of his government towards bringing succour to the victims of Boko Haram insurgents by donating their widow 's mite .
19 |
20 |
21 | 2-1-2014 He said the sufferings of the victims of Boko Haram in the state offered an opportunity for members of the society to offer assistance .
22 |
23 |
24 | 2-2-2014 Six of the dead victims were burnt beyond recognition .
25 |
26 |
27 | 2-3-2014 Speaker of the House of Representatives Aminu Waziri Tambuwal has called on the governments of Chad , Republics of Niger and Cameroon to cooperate with the Nigeria government in fighting against the Boko Haram insurgents .
28 |
29 |
30 |
31 |
32 | 2-4-2014 Internationally and locally it has long been known that Nigeria has been engaged in a brutal and protracted civil war which has been raging mostly in the northern part of the country in the last three years .
33 |
34 |
35 | 2-4-2014 Nigeria 's Muslims have voiced concern about an apparent increase in religious '' profiling '' after hundreds of terror-related arrests in the country 's Christian-majority south .
36 |
37 |
38 | 2-4-2014 Nigeria 's military on Tuesday said that a call by the country 's top military officer for a swift end to the Boko Haram insurgency had been '' taken too literally '' .
39 |
40 |
41 | 2-4-2014 The social and virtual interactive networks for example are fast gaining popularity around the world including the Islamic countries , so Islam feels threatened .
42 |
43 |
44 | 2-4-2014 The goal of the Islamic radicals is to establish a separate country in the northern part of the country where sharia legal system is the rule of law .
45 |
46 |
47 |
48 |
49 | 2-6-2014 Photo : http://www.vanguardngr.com/ Vanguard President Goodluck Jonathan being received by service chiefs at the presidential change of guards parade at the presidential villa .
50 |
51 |
52 | 2-6-2014 Jonathan , at the decoration of the service chiefs stressed the urgency of bringing the anti-terror war to a quick end , adding : '' ; None of us will sleep till Nigerians in Borno State can sleep . ''
53 |
54 |
55 | 2-7-2014 President Goodluck Jonathan said that he prays every day not to hand over Boko Haram insurgency to any future president of Nigeria .
56 |
57 |
58 | 2-8-2014 Maiduguri -- Residents who were displaced by the Boko Haram in various communities in Borno State are gradually returning to their homes following intervention by various stakeholders , the National Emergency Management Agency -LRB- NEMA -RRB- said yesterday .
59 |
60 |
61 |
62 |
63 |
64 |
65 | 2-10-2014 The counsels to the accused persons prayed the court to use its discretion to grant bail since there are no evidences that the applicants will abate justice , interfere with investigations or jump bail .
66 |
67 |
68 | 2-11-2014 Arguing the bail application of the third accused person , Abdul Mohammed submitted that by the proof of evidence , it showed that the prosecution had finished investigation and hence there was no possibility of tampering with investigation .
69 |
70 |
71 | 2-11-2014 Ocholi further submitted that going by the proof of evidence placed before the court , there was nothing linking the second accused person to the alleged crime .
72 |
73 |
74 | 2-11-2014 He further noted that the prosecution did not disclose the identity of the witnesses it would call and so , the third accused could not interfere with the witnesses .
75 |
76 |
77 | 2-11-2014 The counsels argued separately that Section 1 -LRB- 2 -RRB- -LRB- b -RRB- of the amended Terrorism Prevention Act , 2013 which prescribed capital punishment for terrorism offences , confers discretion on the judge , adding that there is no prima facie evidence against the accused persons .
78 |
79 |
80 |
81 |
82 | 2-12-2014 Reports said heavily armed extremists in 4X4 trucks attacked a mosque , markets and government buildings in a massive assault on Konduga village , which had witnessed attacks before .
83 |
84 |
85 | 2-12-2014 At least 39 persons were killed in the attack while several others were injured , residents and government officials said .
86 |
87 |
88 | 2-13-2014 Residents of Konduga and neighbouring Mailari village today said Boko Haram terrorists , who attacked Konduga village on Tuesday killing 39 have returned to launch fresh attacks .
89 |
90 |
91 | 2-15-2014 Heavily armed Islamist extremists in 4X4 trucks attacked a mosque , markets and government buildings in a massive assault on Konduga in the troubled state of Borno on Tuesday .
92 |
93 |
94 |
95 |
96 | 2-16-2014 The attack came three days after gunmen attacked the same village and killed nine soldiers in a broad day shootout .
97 |
98 |
99 | 2-16-2014 Boko Haram had carried out another attack on villagers in Doron-Baga in Kukawa local government area on the same night even though details of the incident is yet to be made public .
100 |
101 |
102 | 2-17-2014 The actual death toll from the latest attacks by Boko Haram gunmen on Izaghe village in Borno state , north east Nigeria , was higher than the 60 earlier reported .
103 |
104 |
105 | 2-18-2014 A Nigerian state governor says militant group Boko Haram is '' ; better armed and better motivated '' ; than government forces trying to stop their attacks .
106 |
107 |
108 |
109 |
110 |
111 |
112 | 2-20-2014 No fewer than 47 people were killed in the early Wednesday 's attack on Bama by dozens of Boko Haram gunmen , according to Lawal Tanko , the police boss , for the besieged state of Borno , in northern Nigeria .
113 |
114 |
115 | 2-19-2014 Suspected Boko Haram militants armed with explosives attacked Bama , a troubled spot in Nigeria 's northeast on Wednesday , sparking a battle with soldiers that killed a large number of insurgents , the military said .
116 |
117 |
118 | 2-19-2014 Governor Shettima after visiting President Goodluck Jonathan in Abuja in the wake of last Monday 's attack , declared that Nigeria is in a state of war and that the fight against Boko Haram is far from being won , as the insurgents seem to be more motivated than the Nigerian military .
119 |
120 |
121 | 2-20-2014 The Nigerian military says it is beating Boko Haram and that the recent increase in attacks signifies increased desperation among insurgents .
122 |
123 |
124 | 2-21-2014 Cameroon has stepped up security in the Far North Region following Nigeria 's military crackdown on Boko Haram , which has pushed back the insurgents to border regions and forced thousands of civilians to flee into Cameroon . ''
125 |
126 |
127 |
128 |
129 | 2-22-2014 Maiduguri -- For 14 days beginning from February 11 , the people of Borno , particularly those residing around the bushy Sambisa Forest , have seen what could be described as ' hell on earth ' following deadly attacks , bombings , killings and destruction of property .
130 |
131 |
132 | 2-22-2014 During the February 11 attacks , the insurgents invaded Konduga and killed 57 residents , burnt houses and vehicles while abducting some female students in one of the secondary schools .
133 |
134 |
135 | 2-23-2014 Photo : Vanguard.html Vanguard Bombing continues as citizens advocate for talks with Boko Haram Lagos -- THE United States expressed solidarity with locals in the northern parts of Nigeria following a reign of terror by the Boko Haram sect .
136 |
137 |
138 | 2-24-2014 The military offensive has pushed Boko Haram out of towns and cities but attacks continue in more remote , rural areas where the presence of troops is not strong .
139 |
140 |
141 |
142 |
143 | 2-25-2014 Suspected Boko Haram gunmen on Tuesday opened fire on secondary school students as they slept in a dormitory in Nigeria 's troubled northeastern Yobe state , the military said .
144 |
145 |
146 | 2-25-2014 Twenty nine people have been declared dead in the latest massacre of sleeping secondary school students in Buni Yadi , in the north eastern Nigerian state of Yobe , by gunmen from Boko Haram .
147 |
148 |
149 | 2-26-2014 Suspected Boko Haram gunmen late Wednesday killed at least 37 people in three separate attacks in northeast Nigeria in Adamawa state , including at a theological college .
150 |
151 |
152 | 2-27-2014 The blood letting continues in Nigeria 's North east No fewer than 32 people have been killed by suspected Boko Haram gunmen in three separate attacks in northeast Nigeria , including at a theological college , a local government official and residents said on Thursday .
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
--------------------------------------------------------------------------------
/public/javascripts/listCollapse.js:
--------------------------------------------------------------------------------
1 | /***************************************************************************************
2 | Nested list collapsing script written by Mark Wilton-Jones - 21/11/2003
3 | Version 2.3.0 - this script takes existing HTML nested UL or OL lists, and collapses them
4 | Updated 13/02/2004 to allow links in root of expanding branch
5 | Updated 09/09/2004 to allow state to be saved
6 | Updated 07/10/2004 to allow page address links to be highlighted
7 | Updated 28/11/2004 to allow you to force expand/collapse links to use just the extraHTML
8 | Updated 23/09/2006 to add expandCollapseAll and to allow selfLink to locate custom links
9 | ****************************************************************************************
10 |
11 | Please see http://www.howtocreate.co.uk/jslibs/ for details and a demo of this script
12 | Please see http://www.howtocreate.co.uk/jslibs/termsOfUse.html for terms of use
13 | _________________________________________________________________________
14 |
15 | You can put as many lists on the page as you like, each list may have a different format.
16 |
17 | To use:
18 | _________________________________________________________________________
19 |
20 | Inbetween the tags, put:
21 |
22 |
23 | _________________________________________________________________________
24 |
25 | Define the HTML. Note that to correctly nest lists, child OLs or ULs should be children of an LI element,
26 | not direct descendents of their parent OL/UL. The text used to expand the branch should be written
27 | between the
tag and the
tag, and should only contain HTML that is permitted inside an 'A'
28 | element. Note; Opera 7 will lose any style attributes you define in this text - use classes instead.
29 |
30 |