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

Iterate Over a Single Entity Type:

  
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"

 

creationCriteriaScripts

Association fields generated from the entity loop are placed in "_iterator". For example, for "iterateOver"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", an _iterator object with the following fields is available in the Javascript: "_iterator.entity1_index", "_iterator.entity2_index", "_iterator.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

 

 

...

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".

These fields can be usefully used together with "creationCriteriaScript" scriptlets to filter out unwanted associations, eg when looping over entity1 and entity2 with the same entity type, the following script would ensure the association didn't involve the same entity:

...

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",
                    "verb_category": "emailed/communicated"
                }
            ]
        }

Output 

Metadata:

The output displays the association between the sender and receiver in the email correspondenceemail metadata "Message-To" used to generate the associations is included in the source block below.

Code Block
         ],
    "associations    "email_meta": [
        {    [
        "entity1": "cara.semperger@enron.com",        {
      "entity1_index": "cara.semperger@enron.com/account",             "verbCreation-Date": "emailed", [
              "verb_category": "emailed/communicated",          "2001-07-09T18:33:32Z"
             "entity2": "will.smith@enron.com",      ],
      "entity2_index": "will.smith@enron.com/account",             "time_startMessage-To": "2001-07-09T14:33:32",[
            "assoc_type": "Event"         }  "will.smith@enron.com"
  ],

 

...

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
},                  ],
                    "Content-Type": [
                        "message/rfc822"
  {                  ],
  "creationCriteriaScript": "$FUNC( isOrganizationSpecified(); )",               "subject": [
    "entity1": "Organization",                   "RE: Testing "entity2":Preschedule workspace"FacilityType",
                    "geo_index": "Location"],
                    "iterateOverdate": "entity1/entity2/geo_index", [
                        "time_start": "$SCRIPT( return _doc.metadata.incidentdate[0]; )",2001-07-09T18:33:32Z"
                    ],
          "verb": "attacked",         "Author": [
          "verb_category": "assault/attack"             "cara.semperger@enron.com"
   },                 {],
                    "creationCriteriaScriptMessage-From": "$FUNC( isOrganizationSpecified(); )",[
                        "entity1cara.semperger@enron.com":
"Organization",                    ]
"entity2": "VictimType",               }
     "geo_index": "Location",      ]
        ]


Output:

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

Code Block
      "iterateOverassociations": "entity1/entity2/geo_index",[
        {
            "time_startentity1": "$SCRIPT( return _doc.metadata.incidentdate[0]; )cara.semperger@enron.com",
                    "entity1_index": "cara.semperger@enron.com/account",
            "verb": "attackedemailed",
            "verb_category": "emailed/communicated",
        "verb_category    "entity2": "assault/attack"will.smith@enron.com",
            "entity2_index": "will.smith@enron.com/account",
  },          "time_start": "2001-07-09T14:33:32",
            "assoc_type": "Event"
        }
    ],

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
            {
                "assoc_type": "Event",
                "entity1": "$SCRIPT( return _doc.metadata.eventtype[0]; )",
                "entity2": "VictimType",
                "iterateOver": "entity2/dummy",
                "verb_category": "suffered"
            },

The code acts on the following entities in this example

Code Block
    "entities": [
        {
            "actual_name": "Targeted, Paramilitary/Private Security, Adult, Tribal from Pakistan",
            "dimension": "Who",
            "disambiguated_name": "Targeted, Paramilitary/Private Security, Adult, Tribal from Pakistan",
            "doccount": 0,
            "frequency": 3,
            "index": "targeted, paramilitary/private security, adult, tribal from pakistan/victimtype",
            "relevance": 0,
            "totalfrequency": -1,
            "type": "VictimType"
        },
        {
            "actual_name": "Targeted, Non Official Public Figure, Adult, Tribal from Pakistan",
            "dimension": "Who",
            "disambiguated_name": "Targeted, Non Official Public Figure, Adult, Tribal from Pakistan",
            "doccount": 0,
            "frequency": 1,
            "index": "targeted, non official public figure, adult, tribal from pakistan/victimtype",
            "relevance": 0,
            "totalfrequency": -1,
            "type": "VictimType"
        },
        {
            "actual_name": "Targeted, Civilian, Adult, Tribal from Pakistan",
            "dimension": "Who",
            "disambiguated_name": "Targeted, Civilian, Adult, Tribal from Pakistan",
            "doccount": 0,
            "frequency": 2,
            "index": "targeted, civilian, adult, tribal from pakistan/victimtype",
            "relevance": 0,
            "totalfrequency": -1,
            "type": "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
{
    "associations": [
        {
            "assoc_type": "Event",
            "entity1": "Armed Attack",
            "entity1_index": "armed attack/eventtype",
            "entity2": "targeted, paramilitary/private security, adult, tribal from pakistan",
            "entity2_index": "targeted, paramilitary/private security, adult, tribal from pakistan/victimtype",
            "verb": "suffered",
            "verb_category": "suffered"
        },
        {
            "assoc_type": "Event",
            "entity1": "Armed Attack",
            "entity1_index": "armed attack/eventtype",
            "entity2": "targeted, non official public figure, adult, tribal from pakistan",
            "entity2_index": "targeted, non official public figure, adult, tribal from pakistan/victimtype",
            "verb": "suffered",
            "verb_category": "suffered"
        },
        {
            "assoc_type": "Event",
            "entity1": "Armed Attack",
            "entity1_index": "armed attack/eventtype",
            "entity2": "targeted, civilian, adult, tribal from pakistan",
            "entity2_index": "targeted, civilian, adult, tribal from pakistan/victimtype",
            "verb": "suffered",
            "verb_category": "suffered"
        },

 

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
             {
   
                "creationCriteriaScript": "$FUNC( isOrganizationSpecified(); )",
   
                "entity1": "Organization",
                    "entity2": "HostageTypeVictimType",
                    "geo_index": "Location",
                    "iterateOver": "entity1/entity2/geo_index",
                    "time_start": "$SCRIPT( return _doc.metadata.incidentdate[0]; )",
 
                  "verb": "took hostageattacked",
                    "verb_category": "assault/attack"
            },

On the following set of entities:

Code Block
    },
"entities": [
        {
      {      "actual_name": "Taliban",
             "creationCriteriaScriptdimension": "$SCRIPT(Who",
if (isOrganizationSpecified() == false) return true; )",      "disambiguated_name": "Taliban",
             "entity1doccount": "PersonPerpetrator"0,
            "frequency": 1,
            "entity2index": "FacilityTypetaliban/organization",
            "relevance": 0,
            "geo_indextotalfrequency": "Location"-1,
            "type": "Organization"
       "iterateOver": "entity1/entity2/geo_index", },
        {
            "timeactual_startname": "$SCRIPT( return _doc.metadata.incidentdate[0]; )Targeted, Civilian, Adult from Afghanistan",
            "dimension": "Who",
         "verb   "disambiguated_name": "attacked"Targeted, Civilian, Adult      from Afghanistan",
            "verb_category": "assault/attack"doccount": 0,
            "frequency": 1,
   },         "index": "targeted, civilian, adult from afghanistan/victimtype",
     {       "relevance": 0,
            "creationCriteriaScripttotalfrequency": "$SCRIPT( if (isOrganizationSpecified() == false) return true; )",-1,
            "type": "VictimType"
        },

 

Sample Output:

Code Block
{
    "entity1associations": "PersonPerpetrator",[
        {
            "entity2assoc_type": "VictimTypeEvent",
            "entity1": "taliban",
            "geoentity1_index": "Locationtaliban/organization",
      
             "iterateOverentity2": "entity1/entity2/geo_index"targeted, civilian, adult from afghanistan",
            "entity2_index": "targeted, civilian, adult from "time_start": "$SCRIPT( return _doc.metadata.incidentdate[0]; )",afghanistan/victimtype",
            "time_start": "2009-07-01T00:00:00",
            "verb": "attacked",
       
            "verb_category": "assault/attack"
   
            },
                {
                    "creationCriteriaScript": "$SCRIPT( if (isOrganizationSpecified() == false) return true; )",
                    "entity1": "PersonPerpetrator",
                    "entity2": "HostageType",
                    "geo_index": "Location",

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": [
	{
     "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 depicted in the sample output below

Code Block
],
    "associations": [
        {
            "iterateOverentity1": "entity1/entity2/geo_indexAlex/person",
                    "time_start"verb": "$SCRIPT( return _doc.metadata.incidentdate[0]; )",
  lives in",
                 "verb_category": "took hostage",
       residence",
            "verb_categoryentity2": "assaultBaltimore/attackcity",
                }

 

Sample Output:

TODO add sample output.

...

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", ..."assoc_type": "Fact"
        },
		{
			"indexentity1": "craigCraig/person", ... },
	{ "index": "baltimore/city", ... },
	{ "index
            "verb": "washingtonlives dc/cityin",
 ...}, 	... ]

In this case the additive association specification:

Code Block
{ 	"iterateOver": "entity1,entity2", // note "," instead of "/" 	"entity1verb_category": "Personresidence",
	
            "entity2": "CityWashington dc/city",
	"verb_category
            "assoc_type": "lives inFact",
		...
}

...

}

 ],

 

Anchor
creation
creation
creationCriteriaScript

...