LogosLink Programmer's Guide · LogosLink Programmer's Interface version 2.0.1

Add Ontology Denotations

The following example shows how to add denotations to an ontology.

To execute this code, you will need a reference to the OntologyEngine package.

    using Incipit.LogosLink.OntologyEngine;

    //load an ontology from a file.
    var onp = new OntologyPersister("MyUserName");
    var on = onp.LoadOntology("C:\\Temp\\Test Models\\Test Ontology.llo").Ontology;

    //cache some concepts from the ontology.
    var atSyria = on.FindAtom("Syria")!;
    var atSpain = on.FindAtom("Spain")!;

    //add some denotations.
    on.AddNewDenotation("Syria", atSyria);
    on.AddNewDenotation("his home country", atSyria);
    on.AddNewDenotation("Spain", atSpain);

In lines 4-5, we load an ontology from disk.

In lines 8-9, we find and store references to some atoms for which we will add denotations. We know that these atoms exist in the ontology, and therefore we can use the null suppresion operator on the FindAtom() method calls.

Finally, in lines 12-14, we add some denotations mapping fragments of text in the ontology to specific atoms. We are using literal strings here for the sake of clarity, but it would be safer to use text ranges in AddNewDenotation() calls.


Contents distributed under a Creative Commons Attribution 4.0 International License · About · Terms of Use · Contact Us · last updated on 21/04/2025 16:01