Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

/event/{event_id}

This page is the bonus dev page for getting the graph data. Welcome to my happy place.


A good example doc to look at with all the changes is: http://nsight-api-1.rr.ikanow.com/nsight/event/53680852e4b08812fcb36d61?graph_data=true&fake_geo=true&fake_mediatype=true

To use this call the event/{id} function in the same way with the query option ?graph_data=true e..g. nsight-api-1.rr.ikanow.com/nsight/event/12345?graph_data=true

*you can also add on a &fake_geo=true to have it create a random docGeo item for every document

*you can also add on a &fake_mediatype=true to have it loop over the list of mediatypes and assign them to each document

 

This will turn on the api to add the new data model (eventually I'll just roll the regular call over to default graph_data to true so we don't have to make any changes, I just didn't want to break the current UI).

This new data model will make a few changes:

1. The event will have a new visualizations field to let the gui know which visualizations to turn on for this event (in the analysis view), the field is located:
event.metadata.json[0][0].visualizations

e.g.:

{
	"event":
	{
		...lots of fields blah blah...
		"metadata": {
            "json": [
                [
                    {
                        "_id": "5347106ce4b051fe39633d2b",
                        "key": {
                            "id": "russia/country||sanction||ukraine/country",
                            "cat": "diplomatic relations"
                        },
                        "description": "2 documents containing association: russia/country sanction ukraine/country \n'Euphoria over Crimea won't last'\nRussia's euphoria over Crimea won't last\n",
                        "title": "Russia & Ukraine - Diplomatic Relations",
                        "titles": [
                            "'Euphoria over Crimea won't last'",
                            "Russia's euphoria over Crimea won't last"
                        ],
                        "stats": {
                            "median_date": "Mon Mar 31 2014 00:00:00 GMT-0400 (EDT)"
                        },
                        "dates": [
                            "Mar 31, 2014 02:27:07 PM UTC",
                            "Mar 31, 2014 02:24:51 PM UTC"
                        ],
                        "verbs": [],
                        "visualizations": [
                            "MEDIATYPE_VOLUME_OVER_TIME",
                            "GEO_MAP",
                            "ENT_TYPE_SENTIMENT_FREQUENCY_RELEVANCE"
                        ]
                    }
                ]
            ]
        }
	}
}
2. Depending on what visualizations are turned on in the above list, the data will be aggregated in new fields currently:
doc_info_aggregation
ent_info_aggregation
...more if we need them

They are located at the root level e.g.
{
	"doc_info_aggregation":[],
	"ent_info_aggregation":[]
}

doc_info will be objects like:
{
	public String mediatype;
    public String publishedDate;
    public GeoPojo docGeo; //only exists if doc had a docGeo
    public String docTitle;
    public String docId;
}

ent_info will be objects like:
{
	public EntityPojo entity; //entire normal entity objects just copied in here
    public String arch_type;
    public Double aggregated_sentiment;
    public Long aggregated_frequency;
    public Double average_relevance;    
    public List<ObjectId> doc_ids;
}
3. The "rawdocs" will now be located at the root object in the "data" field e.g.
{
	"data":[{doc1},{doc2},...]
}

I've left them in the event.metadata.documents currently so your old UI will work,
BUT THEY WILL BE REMOVED FROM THERE IN THE FUTURE, once you have switched your gui to work with the new locations.

TL;DR;

What is getting deleted?

  • event.metadata.json[0][0].documents
  • event.entities
  • event.associations

What has moved?

  • entire event from data to event
  • "rawdocs" from data.metadata.json[0][0].documents to data

What has been added?

  • event.metadata.json[0][0].visualizations - for a list of viz to display

  • doc_info_aggregation - data source for doc centric viz
  • ent_info_aggregation - data source for ent centric viz
  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.