LogosLink Programmer's Guide
·
LogosLink Programmer's Interface version 2.0.1
Create Corpus Ontology
The following example shows how to create an ontology embedded in a corpus.
To execute this code, you will need a reference to the CorpusEngine packages.
using Incipit.LogosLink.OntologyEngine;
using Incipit.LogosLink.CorpusEngine;
//load a corpus.
var cor = CorpusPersister.LoadCorpus("C:\\Temp\\Test Corpus", "MyUserName", AccessMode.ReadWrite).Corpus;
//create a blank corpus ontology.
cor.CreateEmbeddedOntology(CreateDatasetOfCorpusMode.Blank);
//save and release corpus.
cor.Persister.SaveCorpus();
cor.Persister.ReleaseLock();
In line 5, we load a corpus from disk.
Notice that we open it for read/write so that we can modify it.
In line 8, we create an embedded ontology in the corpus.
We choose to create it blank.
If the topics or documents in the corpus had dependent ontologies, we could have chosen to create it from those.
Finally, in lines 11-12, we save the corpus to disk and release it.
Since the ontology is embedded in the corpus, it is saved together with it.
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