Versions Compared

Key

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

...

Code Block
"victim": [
            {
                "child": "No",
                "combatant": "No",
                "deadcount": "1",
                "definingcharacteristic": "Unknown",
                "hostagecount": "0",
                "indicator": "Targeted",
                "nationality": "Afghanistan",
                "targetedcharacteristic": "Unknown",
                "victimtype": "Civilian",
                "woundedcount": "4"
            },
            {
                "child": "Yes",
                "combatant": "No",
                "deadcount": "2",
                "definingcharacteristic": "Unknown",
                "hostagecount": "0",
                "indicator": "Targeted",
                "nationality": "Afghanistan",
                "targetedcharacteristic": "Unknown",
                "victimtype": "Civilian",
                "woundedcount": "0"
            }
        ],

 

Specifying Entity Location

In the example source, the entity block is configured to output an entity using the dimension "where."  The location is determined using javascript, and the scripts are calling on function methods defined in the javascript Globals section.

Code Block
 },                {
                    "dimension": "Where",
                    "disambiguated_name": "$metadata.json.actor.location.displayName",
                    "geotag": {
                        "city": "$SCRIPT( return getAddressVal( _doc.metadata.json[0].actor.location.displayName, 0 ) )",
                        "stateProvince": "$SCRIPT( return getRegion(getAddressVal( _doc.metadata.json[0].actor.location.displayName, 1 )) )",
                        "countryCode": "US",
                        "alternatives": [
                            {
                                "stateProvince": "$SCRIPT( return getRegion(getAddressVal( _doc.metadata.json[0].actor.location.displayName, 1 )) )",
                                "countryCode": "US"
                            }
                        ]
                    },

 

The example source will return output with the dimension of "Where" if the location can be determined by the metadata.

In some cases, it will not be clear what geographical type a field is (eg a freeform field that might be city, state, or country). The geographical specification allows you to specify alternatives.

The alternatives are tried in order until one of them works or there are no more to try.

 

Panel

Footnotes:

Legacy documentation:

Legacy documentation:

...