Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Associations can be "something that happens or is regarded as happening; an occurrence, especially one of some importance", "the outcome, issue, or result of anything", or "something that occurs in a certain place during a particular interval of time" (Definitions found here: http://dictionary.reference.com/browse/event). Within Infinit.e events are typically a combination of entities assembled in the form of Noun - Verb - Noun, e.g. "a car crashed into a building", "the plane flew to San Diego". In addition to the Noun - Verb - Noun form events can include geographic information (i.e., where an event happened) as well as a start and/or end time for an event.

FieldDescriptionData Type
iterateOver

...

iterateOver can be used in more advanced cases.

Iterate Over a Metadata Field:

Specify a metadata field, in order to generate associations.

eg.  "iterateOver": "json.twitter_entities.user_mentions"

Metadata field nesting is also supported using dot notation, in which case they are looped over to generate calls with _value/_iterator/_index

This is the same as iterating over a metadata array to obtain entities using Manual entities.

For more information concerning metadata fields and support for nested fields, see section Manual entities.

See detailed example below

Multiplicative:

Create one association for every combination of entities of specified types.  Also referred to as combinatorial association.

eg. "iterateOver": "entity1/entity2/geo_index",

See detailed example below

Associative:

Create one association for every pair (/set) of entities of specified types.  Also referred to as lock-step or additive association.

eg. "iterateOver": "entity1,entity2"

See detailed example below

  
entity

A free form text field containing information about the event "subject", i.e. an entity's disambiguous name.

 

 
entity1_indexIf present this is the "index" field of the entity matching the entity1 disambiguous name above. 
verbA free form text field describing the event "verb" 
verb_categoryAlso a free form text field describing the event "verb", but intended to group related verbs together (eg "travel" for verbs: "flew", "drove") 

IN PROGRESS

iterateOver

iterateOver can be used in more advanced cases.

Iterate Over a Metadata Field:

Specify a metadata field, in order to generate associations.

eg.  "iterateOver": "json.twitter_entities.user_mentions"

Metadata field nesting is also supported using dot notation, in which case they are looped over to generate calls with _value/_iterator/_index

This is the same as iterating over a metadata array to obtain entities using Manual entities.

For more information concerning metadata fields and support for nested fields, see section Manual entities.

See detailed example below

Iterate Over a Single Entity Type:

A less common scenario is when you want to use "dummy" to iterate over only one a single entity type,.  You can do this by using "dummy."

eg "entity1/dummy" or "entity2,dummy"

See detailed example below

Multiplicative:

Create one association for every combination of entities of specified types. 

creationCriteriaScripts

Association fields generated from the entity loop are placed in "_iterator". For example, for Also referred to as combinatorial association.

eg. "iterateOver": "entity1/entity2/geo_index", an _iterator object with

See detailed example below

Associative:

Create one association for every pair (/set) of entities of specified types.  Also referred to as lock-step or additive association.

eg. "iterateOver": "entity1,entity2"

See detailed example below

 

 

...

creationCriteriaScripts

Association fields generated from the entity loop are placed in "_iterator". For example, for "iterateOver": "entity1/entity2/geo_index", an _iterator object with the following fields is available in the Javascript: "_iterator.entity1_index", "_iterator.entity2_index", "_iterator.geo_index".

...

In the basic association example, the code specifies an entity from the document metadata.  The association specifies the relationship between the type of offense and the date and time at which it was reported.

...

reported.

Code Block
  {
            "associations": [
                {
                    "entity1": "$metadata.offense,$metadata.method",
                    "geotag": {},
                    "time_start": "$metadata.reportdatetime",
                    "verb": "reported",
                    "verb_category": "crime"
                }
            ]
        }

 

Sample Output:

The resulting output displays the details of the date and time, and the specific type of offense reported.

Code Block
 "associations": [
        {
            "entity1": "theft,2",
            "entity1_index": "theft,2/criminalactivity",
            "verb": "reported",
            "verb_category": "crime",
            "time_start": "2011-01-29T00:00:00",
            "geotag": {
                "lat": 38.9099278028729,
                "lon": -77.0436067765966
            },
            "assoc_type": "Summary"
        }
 

...

iterateOver

Anchor
metadata
metadata
iterateOver a Metadata Field

The following code example is used to process email communication between two parties.  The association between the two entities is formed by iterating over the metadata object: "email_meta.Message-To"

Code Block
{
            "associations": [
                {
                    "assoc_type": "Event",
                    "entity1": "$SCRIPT( return _doc.metadata._FILE_METADATA_[0].metadata.Author[0];)",
                    "entity2": "$SCRIPT(return _value;)",
                    "iterateOver": "email_meta.Message-To",
                    "time_start": "$SCRIPT( return _doc.publishedDate;)",
                    "verb": "emailed",
                    "associationsverb_category": ["emailed/communicated"
                {}
            ]
       "entity1": "$metadata.offense,$metadata.method", }

 

Metadata:

The email metadata "Message-To" used to generate the associations is included in the source block below.

Code Block
         ],
        "email_meta": [
            [
               "geotag": {},
                    "time_startCreation-Date": "$metadata.reportdatetime", [
                        "verb": "reported",2001-07-09T18:33:32Z"
                     "verb_category": "crime"],
                  }  "Message-To": [
         ]          }

 

Sample Output:

The resulting output displays the details of the date and time, and the specific type of offense reported.

Code Block
 "associations": [     "will.smith@enron.com"
              {      ],
      "entity1": "theft,2",             "entity1_indexContent-Type": "theft,2/criminalactivity",[
                "verb": "reported",       "message/rfc822"
     "verb_category": "crime",             "time_start": "2011-01-29T00:00:00", ],
                    "geotagsubject": { [
                        "lat"RE: 38.9099278028729,Testing Preschedule workspace"
              "lon": -77.0436067765966     ],
       },             "assoc_typedate": "Summary" [
                   }
 

iterateOver

TODO: have a single entity version (after meta/before multi)

here's an example config element

Code Block
     "2001-07-09T18:33:32Z"
      {              ],
  "assoc_type": "Event",                 "entity1Author": "$SCRIPT( return _doc.metadata.eventtype[0]; )", [
                        "entity2": "VictimType",cara.semperger@enron.com"
                   "iterateOver": "entity2/dummy", ],
                    "verb_categoryMessage-From": "suffered" [
                  },  

here's some example entities,

Code Block
    "entities": [cara.semperger@enron.com"
                {    ]
        "actual_name": "Targeted, Paramilitary/Private Security, Adult, Tribal from Pakistan", }
           "dimension": "Who", ]
        ]


Output:

The output displays the association between the sender and receiver in the email correspondence.

Code Block
    "disambiguated_nameassociations": "Targeted, Paramilitary/Private Security, Adult, Tribal from Pakistan",[
        {
            "doccountentity1": 0"cara.semperger@enron.com",
            "frequencyentity1_index": 3"cara.semperger@enron.com/account",
            "indexverb": "targeted, paramilitary/private security, adult, tribal from pakistan/victimtypeemailed",
            "relevanceverb_category": 0"emailed/communicated",
            "totalfrequencyentity2": -1"will.smith@enron.com",
            "typeentity2_index": "VictimType"will.smith@enron.com/account",
        },    "time_start": "2001-07-09T14:33:32",
   {             "actualassoc_nametype": "Event"Targeted,
  Non Official Public Figure, Adult, Tribal from}
Pakistan",             "dimension": "Who",],

Anchor
single
single
iterateOver a single entity type

In some cases you will only want to iterate over a single entity type, rather than two or three, which is more common.  For these cases you can use "dummy" for iterateOver.

In the following source, iterateOver is setup to only iterate over the entity type: "VictimType."

Code Block
             "disambiguated_name": "Targeted, Non Official Public Figure, Adult, Tribal from Pakistan",{
                "doccountassoc_type": 0"Event",
            "frequency": 1,             "indexentity1": "targeted,$SCRIPT( non official public figure, adult, tribal from pakistan/victimtype",return _doc.metadata.eventtype[0]; )",
                "relevanceentity2": 0"VictimType",
                "totalfrequencyiterateOver": -1,"entity2/dummy",
                "typeverb_category": "VictimType"
 suffered"
            },

The code acts on the following entities in this example

Code Block
       },"entities": [
        {
            "actual_name": "Targeted, Paramilitary/Private CivilianSecurity, Adult, Tribal from Pakistan",
            "dimension": "Who",
            "disambiguated_name": "Targeted, Paramilitary/Private CivilianSecurity, Adult, Tribal from Pakistan",
            "doccount": 0,
            "frequency": 23,
            "index": "targeted, civilianparamilitary/private security, adult, tribal from pakistan/victimtype",
            "relevance": 0,
            "totalfrequency": -1,
            "type": "VictimType"
        },
     

Generates output:

Code Block
   {
    "associations": [        "actual_name": "Targeted, Non Official Public Figure, Adult, Tribal from Pakistan",
            {"dimension": "Who",
            "assocdisambiguated_typename": "EventTargeted, Non Official Public Figure, Adult, Tribal from Pakistan",
            "entity1doccount": "Armed Attack"0,
            "entity1_indexfrequency": "armed attack/eventtype"1,
            "entity2index": "targeted, paramilitary/private security non official public figure, adult, tribal from pakistan/victimtype",
            "entity2_indexrelevance": "targeted, paramilitary/private security0,
adult, tribal from pakistan/victimtype",
            "verbtotalfrequency": "suffered"-1,
            "verb_categorytype": "sufferedVictimType"
        },
        {
            "assocactual_typename": "EventTargeted, Civilian, Adult, Tribal from Pakistan",
            "entity1dimension": "Armed AttackWho",
            "entity1disambiguated_indexname": "armed attack/eventtypeTargeted, Civilian, Adult, Tribal from Pakistan",
            "entity2doccount": 0,
            "frequency"targeted, non official public figure: 2,
            "index": "targeted, civilian, adult, tribal from pakistan/victimtype",
            "entity2_indexrelevance": "targeted, non official public figure, adult, tribal from pakistan/victimtype"0,
            "totalfrequency": -1,
            "verbtype": "suffered",
      VictimType"
        },

Output:

In the example output you can see that associations are only created based on entities of entity type: "VictimType."  Three associations are created, for each of the Victim Type entities specified above.

Code Block
{
     "verb_categoryassociations": "suffered"[
        },
        {
            "assoc_type": "Event",
            "entity1": "Armed Attack",
            "entity1_index": "armed attack/eventtype",
            "entity2": "targeted, civilianparamilitary/private security, adult, tribal from pakistan",
            "entity2_index": "targeted, civilianparamilitary/private security, adult, tribal from pakistan/victimtype",
            "verb": "suffered",: "suffered",
            "verb_category": "suffered"
        },
        {
            "verbassoc_categorytype": "sufferedEvent",
          },

 

...

The following code example is used to process email communication between two parties.  The association between the two entities is formed by iterating over the metadata object: "email_meta.Message-To"

Code Block
{  "entity1": "Armed Attack",
            "associationsentity1_index": [
  "armed attack/eventtype",
             {
       "entity2": "targeted, non official public figure, adult, tribal from pakistan",
            "assocentity2_typeindex": "Event"targeted, non official public figure, adult, tribal from pakistan/victimtype",
            "entity1verb": "$SCRIPT( return _doc.metadata._FILE_METADATA_[0].metadata.Author[0];)suffered",
            "verb_category": "suffered"
      "entity2": "$SCRIPT(return _value;)" },
        {
            "iterateOverassoc_type": "email_meta.Message-ToEvent",
            "entity1": "Armed Attack",
     "time_start       "entity1_index": "$SCRIPT( return _doc.publishedDate;)",
       armed attack/eventtype",
            "verbentity2": "emailed"targeted, civilian, adult, tribal     from pakistan",
            "verbentity2_categoryindex": "emailed/communicated"targeted, civilian, adult, tribal from pakistan/victimtype",
            "verb": "suffered",
  }          "verb_category": "suffered"
 ]         }

TODO: show metadata

Output:

...

},

 

Anchor
multi
multi
Multiplicative

Multiplicative association are associations that are created by "multiplying" a combination of entities, locations, and times together to determine the number of associations to extract from the source data.

In the example, a perpetrator (Sunni Islamic Extremist) attacked multiple types of victims (an adult and a child) in Sri Lanka.

The association specification uses the multiplicative format to create events using the following math to determine the total number of associations: Entity1 (Person Perpetrator) * Entity2 (Victim Type) * Geo_index (Location) = Total Number of Associations.

 

Code Block
    "associations": [        {
   {             "entity1creationCriteriaScript": "cara.semperger@enron.com",$FUNC( isOrganizationSpecified(); )",
                "entity1_index": "cara.semperger@enron.com/accountOrganization",
                "verbentity2": "emailedVictimType",
                "verb_categoryiterateOver": "emailedentity1/communicatedentity2",
            "entity2": "will.smith@enron.com",             "entity2_index"time_start": "will.smith@enron.com/account",$SCRIPT( return _doc.metadata.incidentdate[0]; )",
              "time_start":  "2001-07-09T14:33:32",verb": "attacked",
                "assocverb_typecategory": "Eventassault/attack"
        }     ],

 

...

Multiplicative association are associations that are created by "multiplying" a combination of entities, locations, and times together to determine the number of associations to extract from the source data.

In the example, a perpetrator (Sunni Islamic Extremist) attacked multiple types of victims (an adult and a child) in Sri Lanka.

The association specification uses the multiplicative format to create events using the following math to determine the total number of associations: Entity1 (Person Perpetrator) * Entity2 (Victim Type) * Geo_index (Location) = Total Number of Associations.

 

Code Block
   },

On the following set of entities:

Code Block
    "entities": [
        {
            "actual_name": "Taliban",
            "dimension": "Who",
            "creationCriteriaScriptdisambiguated_name": "$FUNC( isOrganizationSpecified(); )Taliban",
                "entity1doccount": "Organization"0,
 
              "entity2frequency": "VictimType"1,
                "iterateOverindex": "entity1taliban/entity2organization",
   
            "time_startrelevance": "$SCRIPT( return _doc.metadata.incidentdate[0]; )",
 
              "verbtotalfrequency": "attacked",
  -1,
             "verb_categorytype": "assault/attack"
  Organization"
         },

On the following set of entities:

Code Block
    "entities": [
        {
            "actual_name": "TalibanTargeted, Civilian, Adult from Afghanistan",
            "dimension": "Who",
            "disambiguated_name": "TalibanTargeted, Civilian, Adult from Afghanistan",
            "doccount": 0,
            "frequency": 1,
            "index": "taliban/organizationtargeted, civilian, adult from afghanistan/victimtype",
            "relevance": 0,
            "totalfrequency": -1,
            "type": "OrganizationVictimType"
        },

 

Sample Output:

Code Block
{
      },"associations": [
        {
            "actualassoc_nametype": "Targeted, Civilian, Adult from AfghanistanEvent",
            "dimensionentity1": "Whotaliban",
            "disambiguatedentity1_nameindex": "Targeted, Civilian, Adult from Afghanistantaliban/organization",
            "doccountentity2": 0"targeted, civilian, adult           "frequency": 1from afghanistan",
            "entity2_index": "targeted, civilian, adult from afghanistan/victimtype",
            "relevance": 0,
            "totalfrequencytime_start": -1"2009-07-01T00:00:00",
            "typeverb": "VictimTypeattacked",
        },

 

Sample Output:

Code Block
{
    "associationsverb_category": ["assault/attack"
        {
       }

Anchor
associative
associative
Associative

Additive associations cover the less common case where (eg) 2 entity types have the same number of elements and are ordered "in lock step". For example:

Code Block
"entities": [
	{
      "assoc_typeindex": "Eventalex/person",
	 "index": "craig/person", 
        "entity1	 "index": "talibanbaltimore/city", 
	 "index": "washington dc/city", 
	}
     "entity1_index]

In this case the additive association specification:

Code Block
{
	"iterateOver": "taliban/organizationentity1,entity2", //            note "," instead of "/"
	"entity1": "Person",
	"entity2": "City"targeted,
civilian, adult from afghanistan",
	"verb_category": "lives in",
}

Would generate the 2 associations depicted in the sample output below

Code Block
],
    "associations": [
     "entity2_index": "targeted, civilian, adult from afghanistan/victimtype", {
            "time_startentity1": "2009-07-01T00:00:00Alex/person",
            "verb": "attackedlives in",
            "verb_category": "assault/attack"residence",
          }  

...

Additive associations cover the less common case where (eg) 2 entity types have the same number of elements and are ordered "in lock step". For example:

Code Block
"entities": [
	{ "index": "alex/person", ... },
	{ "index": "craig/person", ... },
	{ "index": "baltimore/city", ... },
	{ "index": "washington dc/city", ...},
	...
]

In this case the additive association specification:

Code Block
{
	"iterateOver": "entity1,entity2", // note "," instead of "/"
	"entity1": "Person",
	"entity2": "City",
	"verb_category": "lives in",
	...
}

Would generate the 2 associations "alex/person lives in baltimore/city" and "craig/person lives in washintgon dc/city".

...

"entity2": "Baltimore/city",
            "assoc_type": "Fact"
        },
		{
			"entity1": "Craig/person",
            "verb": "lives in",
            "verb_category": "residence",
            "entity2": "Washington dc/city",
            "assoc_type": "Fact"
		}

 ],

 

Anchor
creation
creation
creationCriteriaScript

...