...
The following code demonstrates how to specify a basic association (Note: The sample event specification and sample event output below is extracted from a a sample MySql Database Source the full content of which can be viewed here.):
Code Block | ||
---|---|---|
| ||
{ //... "associations" : [ { "entity1" : "$metadata.offense,$metadata.method", "verb" : "reported", "verb_category" : "crime", "time_start" : "$metadata.reportdatetime", "geo_index" : "Location", "geotag" : { "lat" : "$metadata.latitude", "lon" : "$metadata.longitude"} }, ], //... } |
...
- event_type
"Event", "Fact", "Summary"
The "assoc_type" field sub-categorizes the "event" object into one of three types, "Event", "Fact", or "Summary". Examples provided below should make the distinction clearer, but it can be simply described as follows:- "Event": link multiple entities (via "entity1_index", "entity2_index", "geo_index") and represent a transient activity (eg travel)
- "Fact": link multiple entities like "Events" but represent (transient or permanent) relationships (eg being president)
- "Summary": generally link 1 entity to a free text (eg a quotation: "Obama says...").
Specifying Additive Events
...
Specifying Multiplicative Associations
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. For example, in the following sample document describing a terrorist attack one terrorist (perpetrator) attacked two different types of victims (police officers and military personnel) 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 (PersonPerpetrator) X * Entity2 (VictimType) X * Geo_index (Location) = Total Number of Associations.
...
Info |
---|
|
...
|
Specifying Additive Associations
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".