Defining file enrichment rules
A file enrichment rule provides additional resource information (via file) that is matched to specific resources via a specified resource identifier (the token).
About this task
Using a GeoPoint file
The GeoPoint format is specific to geolocation data. A file enrichment rule matches a specified resource identifier (the token) to the longitude and latitude (the geographical location) of the resource. Resources that have been enriched with a geographical location can be displayed on the topology resource map.
Before you begin
Create a file that contains the additional geolocation data for your resources.
{
"tokens" : ["clli"],
"fileName" : "example-geopoint.txt",
"format" : "geoPoint,
...
}
- File format
- The file you use must be in the TSV (tab-separated values) format. The values on each line are
'token', 'latitude' and 'longitude':
token longitude latitude
Tip: CLLI (Common Language Location Identifiers) are supported and can be used as tokens. - Example GeoPoint file
- A file enrichment rule allows the value of a token to be used to map that resource to its
location on a map.
- Example TSV file
-
LONDON-CTR-01 -0.120226 51.509287 LONDON-CTR-02 -0.108514 51.485100 MCHSTR-CTR-01 -2.248665 53.482641 LVERPL-CTR-01 -2.996455 53.403925
- Example rule
- name =
serverBuildingLocations
- Example resource
-
{ "uniqueId": "server-001", "name": "server-001", "entityTypes": [ "server" ], "buildingCode": "LONDON-CTR-01" }
Procedure
Details
On the Details section of the New file enrichment rule (or Edit file enrichment rule) page, you define the name, status, tokens and file to be used for the rule.
Conditions
Results
Using a JSON file
The JSON file format lets you enrich resource data with any custom properties required. A file enrichment rule using a JSON file matches a specified resource identifier (the token) as well as a file enrichment key (a second token) in order to provide additional data for specified resources.
Before you begin
Create a file that contains the additional information for your resources.
{
"tokens" : ["uniqueId"],
"fileName" : "example-json.txt",
"format" : "json",
"fileEnrichmentKey":"cityName",
...
}
- File format
- The JSON file format requires separate tokens for the resource and for the file data.
- Example JSON file
- name =
fileEnrichmentKey
- Resources
-
V:{"uniqueId":"Ireland","entityTypes":["country"],"tags":["republic"]} V:{"uniqueId":"UK","entityTypes":["country"]} V:{"uniqueId":"France","entityTypes":["country"]} V:{"uniqueId":"Germany","entityTypes":["country"]} V:{"uniqueId":"Switzerland","entityTypes":["country"]}
- Enriched resources
-
V:{"uniqueId":"Ireland","entityTypes":["country"],"tags":["republic","green","wet"],"capital":"Dublin"} V:{"uniqueId":"UK","entityTypes":["country"],"capital":"London","geolocation":{"geometry":{"type":"Point","coordinates":[0.00000,0.00000]}}} V:{"uniqueId":"France","entityTypes":["country"],"population":70000000,"capital":"Paris"} V:{"uniqueId":"Germany","entityTypes":["country","rave scene"],"capital":"Berlin"} V:{"uniqueId":"Switzerland","entityTypes":["country"],"capital":"Bern"}
Procedure
Details
On the Details section of the New file enrichment rule (or Edit file enrichment rule) page, you define the name, status, tokens and file to be used for the rule.
Conditions