First look at development with DocDigitizer WorldObjects

Get first look how to use DocDigitizer World Objects as Semantic Engine

This chapter will help you to have glance of capabilities DocDigitizer World Objects and how to use it.
Demonstration

Demonstration using "Citizen card" as Business Object

Step 1 - Open Visual Code and login using your Account (for this exercise wher are using Google account)

Step 2 - The "World Objects" source folders should appear

Step 3 – Analyse the following Objects that represents "Citizen card", there properties and references

Step 3.1 - The "Citizen Card" object have reference to "Country"

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

Step 3.3 - The "Language" object have reference to "Dialect" (representation dialect of each language)

Step 4 - Producer Code (add values to Catalog)
In the lesson we are using "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" previous 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.WriteLine();
        c.WriteInfoLine($"{StringLib.Indent(2)}Family         :");
        foreach (var fm in cc.Family)
            c.WriteInfoLine($"{StringLib.Indent(3)}{fm.FamilyMember.Description}: {fm.Name}");
        c.WriteLine();

        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}");
        c.WriteLine();

        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}");

        break;
}

Step 6 - Consumer operation

Step 7 - Changing language dialect

In this example in "Japanese" (JP) there is only have values for properties "Language" & "Country"

For this reason, the values for "Sex" & "FamilyMember" appears in" English".

Step 8 – In "Portuguese" (PT) exist values for all the properties.


Did this page help you?