Development with DocDigitizer WorldObjects

Get a First Look at How to Use DocDigitizer World Objects as a Semantic Engine

This chapter will give you a glance at the capabilities of DocDigitizer World Objects and how to use it.

Demonstration using "Citizen card" as a Business Object

Step 1 — Open Visual Code and log in using your account (for this exercise we are using a Google account)


Step 2 — The “World Objects” source folders should appear


Step 3 — Analyse the following Objects that represent "Citizen card," their properties, and references


Step 3.1 — The "Citizen Card" object has a reference to "Country"


Step 3.2 — The "Country" object has a reference to "Language" (permit to have the name of the country in a different language/dialect)


Step 3.3 — The "Language" object has a reference to "Dialect" (representation dialect of each language)


Step 4 — Producer Code (add values to Catalog)
In this lesson, we are using the "CitizenCard" Object

CitizenCard cc = new();

cc.Name = "António Paiva";
cc.Id = "12567893";
cc.NIF = "155331639";
cc.BirthDate = new DateTimeOffset(new DateTime(1965, 9, 25));
cc.Sex = Sex.FromCatalog(Sex.Constants.Male_);
cc.Nacionality = Country.FromCatalog(Country.Constants.JP_);

cc.Address.Street = "R. em Lisboa";
cc.Address.ZipCode.Code = "1500-297";
cc.Address.ZipCode.City = "Lisboa";
cc.Address.Country = Country.FromCatalog("PT");
cc.Address.ZipCode.Details = ZipCodeDetails.FromCatalog($"{Country.Constants.PT_}:{cc.Address.ZipCode.Code}");

cc.Family.Add(new() { FamilyMember = FamilyMember.FromCatalog(FamilyMember.Constants.Father_), Name = "Father of António" });
cc.Family.Add(new() { FamilyMember = FamilyMember.FromCatalog(FamilyMember.Constants.Mother_), Name = "Mother of António" });

Step 5 — Consumer Code (show values from Catalog)
Consuming the Object "CitizenCard" previously created

switch (r.Structured.ObjectType)
    case CitizenCard.ObjectTypeCase:
        CitizenCard cc = r.GetStructured<CitizenCard>();

        c.WriteInfoLine($"{StringLib.Indent(2)}Name           : {cc.Name}");
        c.WriteInfoLine($"{StringLib.Indent(2)}Id             : {cc.Id}");
        c.WriteInfoLine($"{StringLib.Indent(2)}NIF            : {cc.NIF}");
        c.WriteInfoLine($"{StringLib.Indent(2)}Nacionality    : {cc.Nacionality.Name}");
        c.WriteInfoLine($"{StringLib.Indent(2)}Language       : {cc.Nacionality.PrimaryLanguage.Name}");
        c.WriteInfoLine($"{StringLib.Indent(2)}Sex            : {cc.Sex.Description}");
        c.WriteInfoLine($"{StringLib.Indent(2)}Family         :");
        foreach (var fm in cc.Family)
            c.WriteInfoLine($"{StringLib.Indent(3)}{fm.FamilyMember.Description}: {fm.Name}");

        c.WriteInfoLine($"{StringLib.Indent(2)}Address        : {cc.Address.Street}");
        c.WriteInfoLine($"{StringLib.Indent(2)}               : {cc.Address.ZipCode.Code} {cc.Address.ZipCode.City}");
        c.WriteInfoLine($"{StringLib.Indent(2)}               : {cc.Address.Country.Name}");

        string[] detailLines = StringLib.ToString(cc.Address.ZipCode.Details.Detail).Split(Environment.NewLine);

        c.WriteInfoLine($"{StringLib.Indent(2)}ZipCode Detail :");
        foreach(string l in detailLines) c.WriteInfoLine($"{StringLib.Indent(3)}{l}");


Step 6 — Consumer operation


Step 7 — Changing language dialect

In this example, in “Japanese” (JP) there are only values for properties “Language” & “Country”

For this reason, the values for “Sex” & “FamilyMember” appears in ”English." In “Portuguese” (PT), values for all the properties exist.

566566 567567

Did this page help you?