entity.dictionaryLoad( path as String, uri as String, [options as String[]] ) as null
Load an entity dictionary from the filesystem into the database in the appropriate format.
// Assume "/data/example.txt" contains the following data: // // 11208172 Nixon Nixon person:head of state // 11208172 Nixon Richard Nixon person:head of state // 11208172 Nixon Richard M. Nixon person:head of state // 11208172 Nixon Richard Milhous Nixon person:head of state // 11208172 Nixon President Nixon person:head of state:person // 08932568 Paris Paris administrative district:national capital // 09145751 Paris Paris administrative district:town // 09500217 Paris Paris imaginary being:mythical being declareUpdate(); const entity = require('/MarkLogic/entity'); entity.dictionaryLoad('/space/rest/ent-dict.txt','/ontology/people'); // The URI "/ontology/people" now contain an entity dictionary with // four entities (11208172 with 5 alternative matching texts, and the // three entities 08932568, 09145751, and 09500217 with the same matching text.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.