dashboard-gsicrawler.env.html 16.1 KB
Newer Older
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<link rel="import" href="/bower_components/polymer/polymer.html">
<link rel="import" href="/bower_components/material-search/material-search.html">
<link rel="import" href="/bower_components/paper-material/paper-material.html">
<link rel="import" href="/elements/google-chart-elasticsearch/google-chart.html">
<link rel="import" href="/bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="/bower_components/paper-tabs/paper-tab.html">
<link rel="import" href="/elements/number-chart/number-chart.html">
<link rel="import" href="/bower_components/comment-chart/comment-chart.html">
<link rel="import" href="/bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="/bower_components/yasgui-polymer/yasgui.html">
<link rel="import" href="/bower_components/iron-pages/iron-pages.html">
<link rel="import" href="/bower_components/paper-item/paper-item.html">
<link rel="import" href="/bower_components/paper-menu/paper-menu.html">
<link rel="import" href="/bower_components/paper-autocomplete/paper-autocomplete.html">
<link rel="import" href="/elements/entities-chart/entities-chart.html">
<link rel="import" href="/elements/people-chart/people-chart.html">
<link rel="import" href="/elements/news-chart/news-chart.html">
<link rel="import" href="/elements/propaganda-chart/propaganda-chart.html">
<link rel="import" href="/elements/tweet-chart/tweet-chart.html">
<link rel="import" href="/elements/annotate-view/annotate-view.html">
<link rel="import" href="/elements/happymap/happymap-element.html">

Tasio Mendez's avatar
Tasio Mendez committed
23
24
<!-- <link href="dist/css/fs-modal.min.css" rel="stylesheet"> -->
<!-- <script src="dist/js/fs-modal.min.js"></script> -->
25

Tasio Mendez's avatar
Tasio Mendez committed
26
27
28
29
<!-- Bootstrap -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
30
31
32
33
<!--<script src="https://hypothes.is/embed.js" async></script>-->

<dom-module id="dashboard-gsicrawler">

Tasio Mendez's avatar
Tasio Mendez committed
34
  <link rel="import" type="css" href="dashboard-gsicrawler.css">
Tasio Mendez's avatar
Tasio Mendez committed
35
36
  <link rel="import" type="text/html" href="/styles/app-theme.html">

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
37
  <template>
Daniel Suarez's avatar
Daniel Suarez committed
38
39
    <iron-ajax auto
        url="/queries.json"
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
40
        handle-as="json"
Tasio Mendez's avatar
Tasio Mendez committed
41
        last-response="{{queries}}"></iron-ajax>
42
43
44
    <iron-ajax auto
        url="/sources.json"
        handle-as="json"
Tasio Mendez's avatar
Tasio Mendez committed
45
        on-response="sourceResponse"></iron-ajax>
46

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
47
48
49
50
51
    <!--
    <div style="width:10%; padding: 1em; display:inline-block">
      <img style="width: 100%;"src="/images/trivalent.jpg">
    </div>
    -->
52
    <div class="container">
Tasio Mendez's avatar
Tasio Mendez committed
53
54
    <div class="header" style="width:100%; padding-bottom: 20px; text-align:center; display:inline-block">
      <img class="trivalent" src="/images/trivalent.jpg">
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
55
56
    </div>

Tasio Mendez's avatar
Tasio Mendez committed
57
    <paper-tabs selected="{{selected}}">
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
58
59
60
61
62
      <paper-tab>Dashboard</paper-tab>
      <paper-tab>Sparql Editor</paper-tab>
      <paper-tab>About</paper-tab>
    </paper-tabs>

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
63
   <iron-pages selected="{{selected}}">
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
64
65
      <div>
        <div class="row">
Tasio Mendez's avatar
Tasio Mendez committed
66
          <material-search active="true" search-value="{{query}}" style="margin: 0 15px;"></material-search>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
67
        </div>
Tasio Mendez's avatar
Tasio Mendez committed
68
        <br>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
69
        <div class="row">
Tasio Mendez's avatar
Tasio Mendez committed
70
          <div class="col-md-6 col-xs-12 col-sm-6">
Tasio Mendez's avatar
Tasio Mendez committed
71
72
            <number-chart
               data="{{data}}"
73
74
               object="schema:NewsArticle"
               aggKey="type"
Tasio Mendez's avatar
Tasio Mendez committed
75
               title="News"
76
               icon="/images/news.svg"
Daniel Suarez's avatar
Daniel Suarez committed
77
               subtitle="Total"
Tasio Mendez's avatar
Tasio Mendez committed
78
               stylebg="bg-yellow">
Daniel Suarez's avatar
Daniel Suarez committed
79
             </number-chart>
80
          </div>
Tasio Mendez's avatar
Tasio Mendez committed
81
          <div class="col-md-6 col-xs-12 col-sm-6">
Tasio Mendez's avatar
Tasio Mendez committed
82
83
             <number-chart
               data="{{data}}"
Daniel Suarez's avatar
Daniel Suarez committed
84
85
               aggKey="type"
               object="schema:Article"
Tasio Mendez's avatar
Tasio Mendez committed
86
               title="Magazines"
Daniel Suarez's avatar
Daniel Suarez committed
87
88
               icon="/images/magazine.svg"
               subtitle="Total"
Tasio Mendez's avatar
Tasio Mendez committed
89
               stylebg="bg-purple">
Daniel Suarez's avatar
Daniel Suarez committed
90
91
92
             </number-chart>
          </div>
        </div>
Tasio Mendez's avatar
Tasio Mendez committed
93
94
         <br>
     <div class="row">
Tasio Mendez's avatar
Tasio Mendez committed
95
         <div class="col-md-6 col-xs-12 margin-bottom-phone">
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
96
97
98
            <entities-chart
                field="entities.name"
                data="{{data}}"
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
99
                title="Entities"
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
100
101
102
                icon="icons:list"
                param="{{param}}"
                id="entitieschart"
103
104
105
106
                filters="{{filters}}"
                legend='[{"name":"Organization","type":"schema:Organization","color":"#dd4b39"},
                          {"name":"Place","type":"schema:Place","color":"#ff9900"},
                          {"name": "Person","type":"schema:Person","color":"#00c0ef"}]'>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
107
            </entities-chart>
Tasio Mendez's avatar
Tasio Mendez committed
108
         </div>
Tasio Mendez's avatar
Tasio Mendez committed
109
          <div class="col-md-6 col-xs-12 margin-bottom-phone">
110
            <entities-chart
111
                field="categories.name"
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
112
                data="{{data}}"
113
114
                title="Categories"
                icon="icons:list"
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
115
                param="{{param}}"
116
                id="categorieschart"
117
                color = "#505050"
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
118
                filters="{{filters}}">
119
            </entities-chart>
Tasio Mendez's avatar
Tasio Mendez committed
120

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
121
122
          </div>
      </div>
Tasio Mendez's avatar
Tasio Mendez committed
123

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
124
      <br>
125
      <div class="row">
Tasio Mendez's avatar
Tasio Mendez committed
126
        <div class="col-md-6 col-xs-12 margin-bottom-phone">
Daniel Suarez's avatar
Daniel Suarez committed
127
128
129
          <google-chart
              field="schema:author"
              data="{{data}}"
Tasio Mendez's avatar
Tasio Mendez committed
130
              sources="{{sources}}"
Daniel Suarez's avatar
Daniel Suarez committed
131
132
133
134
135
136
137
              id='pie-chart3'
              extra-id='pie-chart3'
              type='pie'
              filters="{{filters}}"
              icon='icons:reorder'
              options='{"title": "Source"}'
              cols='[{"label": "type", "type": "string"},{"label": "Count", "type": "number"}]'>
Tasio Mendez's avatar
Tasio Mendez committed
138
            </google-chart>
Daniel Suarez's avatar
Daniel Suarez committed
139
        </div>
Tasio Mendez's avatar
Tasio Mendez committed
140
        <div class="col-md-6 col-xs-12 margin-bottom-phone">
141
142
143
144
145
146
147
148
          <people-chart
              data="{{data}}"
              title="People"
              icon="maps:person-pin"
              param="{{param}}"
              id="entitieschart"
              filters="{{filters}}">
          </people-chart>
Tasio Mendez's avatar
Tasio Mendez committed
149

150
151
152
153
        </div>
      </div>
      <br>
      <div class="row">
Tasio Mendez's avatar
Tasio Mendez committed
154
        <div class="col-md-12 col-xs-12 margin-bottom-phone">
155
156
          <google-chart
            field="schema:datePublished"
Tasio Mendez's avatar
Tasio Mendez committed
157
            data="{{data}}"
158
159
160
161
162
163
164
165
166
167
168
169
            id='line-chart'
            extra-id='line-chart'
            type='line'
            filters="{{filters}}"
            sources="{{sources}}"
            icon='icons:trending-up'
            options='{"title": "Temporal Trends"}'
            optionsbi='{"legend": { "position": "bottom"}}'>
          </google-chart>
        </div>
      </div>
      <br>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
170
      <div class="row">
Tasio Mendez's avatar
Tasio Mendez committed
171
      <div class="col-md-6 col-xs-12 margin-bottom-phone">
172
        <paper-tabs selected="{{selectedpage}}" style="height: 38px">
173
          <paper-tab><iron-icon icon="icons:receipt"></iron-icon> News</paper-tab>
Daniel Suarez's avatar
Daniel Suarez committed
174
175
<!--           <paper-tab><iron-icon icon="icons:speaker-notes"></iron-icon> Social Media</paper-tab>
 -->          <paper-tab><iron-icon icon="icons:speaker-notes"></iron-icon> Magazines</paper-tab>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
176
        </paper-tabs>
Tasio Mendez's avatar
Tasio Mendez committed
177
        <iron-pages class="lists" selected="{{selectedpage}}" style="padding-top: 0px !important;">
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
178
        <div>
Tasio Mendez's avatar
Tasio Mendez committed
179
          <news-chart
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
180
181
182
183
184
185
            datos = "{{data}}"
            title="List of news"
            filters="{{filters}}"
            icon='icons:receipt'>
          </news-chart>
        </div>
Daniel Suarez's avatar
Daniel Suarez committed
186
        <!-- <div>
Tasio Mendez's avatar
Tasio Mendez committed
187
          <tweet-chart
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
188
189
190
191
            datos = "{{data}}"
            title="List of tweets"
            filters="{{filters}}"
            icon='communication:comment'>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
192
          </tweet-chart>
Daniel Suarez's avatar
Daniel Suarez committed
193
        </div> -->
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
194
        <div>
Tasio Mendez's avatar
Tasio Mendez committed
195
          <propaganda-chart
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
196
197
198
199
            datos = "{{data}}"
            title="List of propaganda"
            filters="{{filters}}"
            icon='communication:comment'>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
200
201
          </propaganda-chart>
        </div>
Tasio Mendez's avatar
Tasio Mendez committed
202

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
203
204
        </iron-pages>
       </div>
Tasio Mendez's avatar
Tasio Mendez committed
205
       <div class="col-md-6 col-xs-12 margin-bottom-phone">
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
206
207
        <div class="top-bar">
        <iron-icon icon="maps:my-location"></iron-icon>
Daniel Suarez's avatar
Daniel Suarez committed
208
          <span>Geolocated News</span>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
209
210
211
212
        </div>
        <!--
        <leaflet-map fit-to-markers>
          <template is="dom-repeat" items="[[getPlaces(data)]]" as="place">
Tasio Mendez's avatar
Tasio Mendez committed
213
                <leaflet-marker latitude="{{place.lat}}" longitude="{{place.lng}}" title="{{place.name}}">
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
214
215
216
217
218
219
                    <b>Headline:</b>
                    <span>{{place.name}}</span>
                </leaflet-marker>
              </template>
        </leaflet-map>
        -->
Tasio Mendez's avatar
Tasio Mendez committed
220
        <happymap-element
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
221
222
          data="{{data}}",
          '<!-- visalized data in case of connection error -->'>
Tasio Mendez's avatar
Tasio Mendez committed
223

224
        </happymap-element>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
225
226
       </div>
      </div>
227

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
228
229
230
    </div>
    <div>
        <yasgui-ui
231
       endpoint="http://sefarad-fuseki.cluster.gsi.dit.upm.es/gsicrawler/query"
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
232
       queries="{{queries}}">
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
233
234
        </yasgui-ui>
    </div>
Tasio Mendez's avatar
Tasio Mendez committed
235
    <div class="about-info">
Tasio Mendez's avatar
Tasio Mendez committed
236

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
237
238
239
240
241
242
243
244
245
246
247

This demo shows GSI-Crawler functionalities in the context of the project Trivalent. The system is aimed at crawling from a variety of data sources including news web sites such as CNN and New York Times, as well as social media platforms, like Twitter. The presented demo is the result of the ingest of the crawled online data and posterior analysis and semantic augmentation of said data. The resulting information is stored in both ElastiSearch and Fuseki databases, which allows the user to consult the data is a variety of forms, as showed.

<br><br>
For a quick overview of the funtionalities of the demo, please watch the following video:
<br><br>
<iframe width="560" height="315" src="https://www.youtube.com/embed/3s894sjevBQ" frameborder="0" allowfullscreen></iframe>
<br><br>
To discover more, please consult the documentation at <a href="http://gsicrawler.readthedocs.io" target="_blank">Read The Docs</a>
<br><br>
H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing a comprehensive approach to violent radicalization in the EU from early understanding to improving protection.
Tasio Mendez's avatar
Tasio Mendez committed
248
<br><br>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
249
250
251
    </div>
      <annotate-view name="annotate-view"></annotate-view>
    </iron-pages>
252
    </div>
253
         <div style="background-color:#ccc; padding: 1%; margin: -16px;margin-top: 20px;">
Tasio Mendez's avatar
Tasio Mendez committed
254
        <div  class="footer-gsi">
Tasio Mendez's avatar
Tasio Mendez committed
255
          <img style="width: 100%; height: 50px; object-fit: contain; margin-bottom: 5px;" src="/images/gsi.png">
Tasio Mendez's avatar
Tasio Mendez committed
256
          <div style="display: flex; flex-direction: column; justify-content: center; font-size: 12px; text-align: center;">© 2019 Grupo de Sistemas Inteligentes GSI-UPM </div>
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
257
258
259
260
261
        </div>
       </div>



262

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
263
  </template>
Tasio Mendez's avatar
Tasio Mendez committed
264

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
265
266
267
268
269
270
271
272
273

  <script>
  var ready = false;
    Polymer({
      is: 'dashboard-gsicrawler',
      properties: {
        selected: {
          type: Number,
          value: 0
Tasio Mendez's avatar
Tasio Mendez committed
274
        },
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
275
276
277
        selectedpage: {
          type: Number,
          value: 0
Tasio Mendez's avatar
Tasio Mendez committed
278
        },
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
279
280
281
282
283
        query: {
          type: String,
        },
        ids:{
          type: Array
Tasio Mendez's avatar
Tasio Mendez committed
284

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
285
286
287
288
289
290
291
        },
        data:{
          type: Object
        },
        client: {
          type: Object,
          notify: true,
Tasio Mendez's avatar
Tasio Mendez committed
292
          observer: '_clientChanged'
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
293
294
295
296
297
        },
        fields: {
          type: Array,
          value: function() { return []; }
        },
298
299
300
        search:{
          type:Object
        },
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
301
302
303
304
305
306
        filters: {
          type: Array,
          notify: true,
          value: function() { return []; }
        }
      },
Tasio Mendez's avatar
Tasio Mendez committed
307

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
      observers: [
      '_filtersChange(filters.*)',
      'entityselection(selectedentity)'
      ],
      behaviors: [
        Polymer.IronA11yKeysBehavior
      ],
      keyBindings: {
        'enter': '_search'
      },

      ready: function(){
        //console.log("ready");
      },

      _clientChanged: function() {
        //console.log("ClientChanged");
        ready = true;
        this._query();
      },
Tasio Mendez's avatar
Tasio Mendez committed
328

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
329
      getEntities: function(datos){
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
330
331
332
333
334
335
336
337
338
339
            console.log("getEntities")
            if(this.entityselection){
              var entities = []
              var hits = this.data.aggregations['entities.name'].buckets;
              console.log(hits)
              hits.forEach(function(entry){
                entities.push(entry.key.split('/')[4]);
              });
              console.log(entities)
              return entities
Tasio Mendez's avatar
Tasio Mendez committed
340
            }
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
341
          },
Tasio Mendez's avatar
Tasio Mendez committed
342

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
343
344
345
346
347
      entityselection: function(entity){
        console.log("entityselection")
        console.log(entity)
        if(entity == null){
          this.filters = [];
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
348
        } else this.push('filters', { terms: { 'entities.schema:name': entity.toLowerCase().split(" ")}})
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
349
      },
Tasio Mendez's avatar
Tasio Mendez committed
350

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
351
352
      getPlaces: function(data){
        var places = []
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
353
        console.log("getPlace")
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
354
355
356
357
358
359
360
361
362
        data.hits.hits.forEach( function (entry){
          entry._source.entities.forEach(function(entity){
            if ('latitude' in entity) {
              places.push({'lat': entity.latitude, 'lon': entity.longitude, 'name': entry._source['http://schema.org/headline'][0]['@value']})
            }
          })
        })
        return places
      },
363
364
365
366
367
      sourceResponse:function(e){
        //console.log(e.detail.response[0])
        this.sources=e.detail.response[0]
        //console.log(this.sources)
      },
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
368
      _search: function(){
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
369
370
        console.log("search fired")
        console.log(this.selectedentity)
Tasio Mendez's avatar
Tasio Mendez committed
371

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
372
373
        if (this.query.length == 0){
          //console.log("default search fired")
Daniel Suarez's avatar
Daniel Suarez committed
374
          this.filters = []
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
375
376
377
          this._query()
        }
        else {
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
378
          console.log("Filter")
379
          this.push('filters', {terms: {'schema:articleBody': this.query.toLowerCase().split(" ")}});
Daniel Suarez's avatar
Daniel Suarez committed
380
          //this.search={"schema:articleBody":{"query":this.query,"operator":"and"}}
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
381
382
          this._query()
        }
Tasio Mendez's avatar
Tasio Mendez committed
383

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
      },
      _filtersChange: function() {
        this._query();
       },
       _query: function() {
        //console.log("_query")
        var that = this;
        //console.log("Ready?: ", ready);
        if(ready){
          this.client.search({
          // undocumented params are appended to the query string
          index: "gsicrawler",
          body: {
            size: 200,
            query: {
              bool: {
                must: this.filters,
401
402
              }/*,
              match: this.search*/
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
403
404
405
406
407
408
409
410
411
412
413
414
            },
            aggs: {
             type: {
               terms: {
                 field: "@type.keyword",
                 order: {
                   _count: "desc"
                 }
               }
             },
             'schema:author': {
               terms: {
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
415
                 field: "schema:author.keyword",
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
416
417
418
419
420
                 order: {
                   _count: "desc"
                 }
               }
             },
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
421
             'entities.name': {
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
                terms: {
                  field: "entities.schema:name.keyword",
                  size : 16,
                  order: {
                    _count: "desc"
                  }
                },
                aggs: {
                  'entity_type': {
                      "top_hits": {
                          "_source": {
                              "includes": [ "entities.@type","entities.schema:name"]
                          },
                          "size" : 1
                      }
                  }
                }
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
439
             },
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
440
441
             'categories.name': {
                terms: {
442
                  field: "taxonomies.rdfs:label.keyword",
443
                  size:10,
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
444
445
446
447
448
                  order: {
                    _count:"desc"
                  }
                }
             },
449
             sentiment: {
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
450
               terms: {
451
                 field: "sentiments.marl:hasPolarity.keyword",
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
452
453
                 order: {
                   _count: "desc"
454
                   }
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
455
               }
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
              },
              'schema:datePublished': {
                date_histogram : {
                  field : "schema:datePublished",
                  format: "MM-yyyy",
                  interval : "month"
                },
                aggs:{
                  source:{
                    terms: {
                     field: "schema:author.keyword",
                     order: {
                       _count: "desc"
                     }
                    }
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
471
                  }
472
473
                }
              }
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
474
          }
Tasio Mendez's avatar
Tasio Mendez committed
475
        }
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
476
477
478
479
        }).then(function (resp) {
          var myids = []
          resp.hits.hits.forEach(function(entry){myids.push(entry._id)})
          that.ids = myids;
480

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
481
          that.data = resp;
Tasio Mendez's avatar
Tasio Mendez committed
482

483
          //console.log(that.data);
Tasio Mendez's avatar
Tasio Mendez committed
484

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
485
          });
Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
486
487
488
        }
      }
    });
Tasio Mendez's avatar
Tasio Mendez committed
489

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
490

Daniel Suarez Souto's avatar
Daniel Suarez Souto committed
491
492
493
  </script>

</dom-module>