Module:ConfigRepository: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
 
(42 intermediate revisions by the same user not shown)
Line 50: Line 50:


     -- IMPORTANT: "Logo" is processed automatically whenever it is called as a key by the Template Blueprint, in such a way that it does not need to be declared for any templates in this repository
     -- IMPORTANT: "Logo" is processed automatically whenever it is called as a key by the Template Blueprint, in such a way that it does not need to be declared for any templates in this repository
}
-- Global field patterns used in multiple templates
p.fieldPatterns = {
    itemDelimiter = ";%s*",  -- Matches semicolon followed by optional whitespace
    websitePattern = "^https?://[^%s]+"  -- Matches URLs starting with http:// or https://
}
-- Global field processors for reusable field definitions
p.fieldProcessors = {
    website = {
        list = { mode = 'bullet_custom', bulletChar = '🔗', postProcess = 'website' }
    }
}
}


Line 99: Line 112:
p.dateFormatting = {
p.dateFormatting = {
     useShortMonthNames = true
     useShortMonthNames = true
}
-- Global campaigns configuration
-- Campaigns are defined centrally and specify which templates they can be applied to
p.campaigns = {
    ASP2025 = {
        name = "ASP 2025 Pro Bono Service Provider",
        applicable_templates = {"Person", "Organization"},
        json_config = "ASP2025"
    }
}
-- Global page creator fields for TemplateStarter form generation
p.pageCreatorFields = {
    PAGE_NAME = {
        key = "PAGE_NAME",
        label = "Page Name",
        placeholder = "Enter page name...",
        required = true
    },
    COUNTRY = {
        key = "COUNTRY",
        label = "Country",
        placeholder = "Enter country (optional)...",
        required = false
    },
    YEAR = {
        key = "YEAR",
        label = "Year",
        placeholder = "Enter year (optional)...",
        required = false
    },
    ORGANIZATION_TYPE = {
        key = "ORGANIZATION_TYPE",
        label = "Organization Type",
        placeholder = "Enter organization type (optional)...",
        required = false
    },
    OCCUPATION = {
        key = "OCCUPATION",
        label = "Occupation",
        placeholder = "Enter occupation (optional)...",
        required = false
    },
    NORM_TYPE = {
        key = "NORM_TYPE",
        label = "Type of Norm",
        placeholder = "Enter norm type (optional)...",
        required = false
    }
}
}


Line 126: Line 189:
         end
         end
     end,
     end,
     raw = function(value) return value end,
     raw = function(value)
     string = function(value) return tostring(value or "") end
        return value
    end,
     string = function(value)
        return tostring(value or "")
    end
}
}


Line 143: Line 210:
             description = "Event template"
             description = "Event template"
         },
         },
       
         categories = { -- Default categories
         categories = { -- Default categories
             base = {"Events"}
             base = {"Events"}
         },
         },
 
        boilerplate = {
            intro = "'''$PAGE_NAME$''' was an event that took place in $COUNTRY$ in $YEAR$."
        },
        creatorFields = {"PAGE_NAME", "COUNTRY", "YEAR"},
         mappings = {
         mappings = {
             -- Process (Property:Has process connection)
             -- Process (Property:Has process connection)
             process = p.mappings.process
             process = p.mappings.process
         },
         },
         patterns = {
         patterns = {
             -- Patterns for event navigation detection
             -- Patterns for event navigation detection
             seriesNumber = "^([%w%s]+)%s+(%d+)$",    -- e.g., "ICANN 76"
             seriesNumber = "^([%w%s]+)%s+(%d+)$",    -- e.g., "ICANN 76"
             seriesYear = "^([%w%s]+)%s+(%d%d%d%d)$"  -- e.g., "IGF 2023"
             seriesYear = "^([%w%s]+)%s+(%d%d%d%d)$", -- e.g., "IGF 2023"
            itemDelimiter = p.fieldPatterns.itemDelimiter,
            websitePattern = p.fieldPatterns.websitePattern
         },
         },
         fields = {
         fields = {
             {key="process", label=p.fieldLabels.process, autoWikiLink=true},
             {key="process", label=p.fieldLabels.process, autoWikiLink=true},
Line 168: Line 237:
             {key="venue", label="Venue"},
             {key="venue", label="Venue"},
             {key="organizer", label="Organizer"},
             {key="organizer", label="Organizer"},
             {keys={"website", "url"}, label=p.fieldLabels.website},
             {keys={"website", "url"}, label=p.fieldLabels.website, list=p.fieldProcessors.website.list},
         },
         },
         semantics = {
         semantics = {
             properties = {
             properties = {
Line 180: Line 248:
                 ["Has event organizer"] = "organizer"
                 ["Has event organizer"] = "organizer"
             },
             },
             -- Normalizations applied
             -- Normalizations applied
             transforms = {
             transforms = {
Line 196: Line 263:
------------------------------------------------------------------------------
------------------------------------------------------------------------------


LibraryInterview = {
    LibraryInterview = {
    meta = {
        meta = {
        description = "Library Interview template"
            description = "Library Interview template",
    },
            page_creator = false
   
        },
    categories = { -- Default categories
        categories = { -- Default categories
        base = {
            base = {
            "Internet & Digital Governance Library",
                "Internet & Digital Governance Library",
            "ICANNWiki Interviews"
                "ICANNWiki Interviews"
        }
            }
    },
   
    constants = { -- REVIEW
        title = "Internet & Digital Governance Library",
        tableClass = "library-box"
    },
   
    fields = {
        {key="title", label="Title"},
        {key="format_interview", label="Format"},
        {key="date", label=p.fieldLabels.date},
        {key="interviewer", label="Interviewer", autoWikiLink=true},
        {key="interviewee", label="Interviewee", autoWikiLink=true},
        {key="id", label="Permanent ID"}
    },
   
    semantics = {
        -- Direct property mappings (1:1 relationship between property and field)
        properties = {
            ["Has interview format"] = "format_interview",
            ["Has date"] = "date",
            ["Has interviewer"] = "interviewer",
            ["Has interviewee"] = "interviewee",
            ["Permanent ID"] = "id"
         },
         },
          
         constants = { -- REVIEW
        -- Properties that map to multiple possible fields
             title = "Internet & Digital Governance Library",
        additionalProperties = {
            tableClass = "library-box"
             ["Has person"] = {"interviewer", "interviewee"} -- Links interviews to person pages
         },
         },
          
         fields = {
        -- Normalizations applied
            {key="title", label="Title"},
        transforms = {
            {key="format_interview", label="Format"},
             ["Has date"] = "date",
            {key="date", label=p.fieldLabels.date},
             ["Permanent ID"] = "string"
            {key="interviewer", label="Interviewer", autoWikiLink=true},
             {key="interviewee", label="Interviewee", autoWikiLink=true},
             {key="id", label="Permanent ID"}
         },
         },
         fixedProperties = {
         semantics = {
            ["Has entity type"] = "Library"
            -- Direct property mappings (1:1 relationship between property and field)
            properties = {
                ["Has interview format"] = "format_interview",
                ["Has date"] = "date",
                ["Has interviewer"] = "interviewer",
                ["Has interviewee"] = "interviewee",
                ["Permanent ID"] = "id"
            },
            -- Properties that map to multiple possible fields
            additionalProperties = {
                ["Has person"] = {"interviewer", "interviewee"} -- Links interviews to person pages
            },
            -- Normalizations applied
            transforms = {
                ["Has date"] = "date",
                ["Permanent ID"] = "string"
            },
            fixedProperties = {
                ["Has entity type"] = "Library"
            }
         }
         }
     }
     },
},


------------------------------------------------------------------------------
------------------------------------------------------------------------------
Line 259: Line 321:
             base = {"Norms"}
             base = {"Norms"}
         },
         },
        boilerplate = {
            intro = "'''$PAGE_NAME$''' is a $NORM_TYPE$ proposed in $YEAR$."
        },
        creatorFields = {"PAGE_NAME", "NORM_TYPE", "YEAR"},
         mappings = {
         mappings = {
             norm_type = {
             norm_type = {
                 {canonical = "Act", category = "Acts"},
                 {canonical = "Act", category = "Acts"},
                {canonical = "Agreement", category = "Agreements"},
                {canonical = "Framework", category = "Frameworks"},
                 {canonical = "Law", category = "Laws"},
                 {canonical = "Law", category = "Laws"},
                 {canonical = "Regulation", category = "Regulations"},
                 {canonical = "Regulation", category = "Regulations"},
Line 295: Line 363:
             {key="issuing_body", label="Issuing body", autoWikiLink=true},
             {key="issuing_body", label="Issuing body", autoWikiLink=true},
             {key="scope_geo", label="Geographic scope"},
             {key="scope_geo", label="Geographic scope"},
             {key="country", label=p.fieldLabels.country,},
             {key="country", label=p.fieldLabels.country},
             {key="norm_status", label="Status"}, -- Key used in templatedata
             {key="norm_status", label="Status"}, -- Key used in templatedata
             {key="official_text", label="Official text"},
             {key="official_text", label="Official text"},
             {key="related_norm", label="Related Norms",},
             {key="related_norm", label="Related Norms", list="bullet"},
             {key="parent_framework", label="Parent legal framework", autoWikiLink=true},
             {key="parent_framework", label="Parent legal framework", autoWikiLink=true},
             {key="norm_language", label="Language"}
             {key="norm_language", label="Language"}
Line 308: Line 376:
                 ["Has issuing body"] = "issuing_body",
                 ["Has issuing body"] = "issuing_body",
                 ["Has geographic scope"] = "scope_geo",
                 ["Has geographic scope"] = "scope_geo",
                 ["Has status"] = "norm_status",  
                 ["Has status"] = "norm_status",
                 ["Links to official text"] = "official_text",
                 ["Links to official text"] = "official_text",
                 ["Is related to norm"] = "related_norm",
                 ["Is related to norm"] = "related_norm",
Line 317: Line 385:
                 ["Has norm type"] = "normalize",
                 ["Has norm type"] = "normalize",
                 ["Has geographic scope"] = "normalize",
                 ["Has geographic scope"] = "normalize",
                 ["Has status"] = "normalize",  
                 ["Has status"] = "normalize",
                 ["Has issuing body"] = "semantic",
                 ["Has issuing body"] = "semantic",
                 ["Is related to norm"] = "semantic",
                 ["Is related to norm"] = "semantic",
Line 334: Line 402:
------------------------------------------------------------------------------
------------------------------------------------------------------------------


Organization = {
    Organization = {
    meta = {
        meta = {
        description = "Organization template"
            description = "Organization template"
    },
        },
   
        categories = { -- Default categories
    boilerplate = {
            base = {"Organization"}
        intro = "'''{{PAGENAME}}''' is an organization in the internet governance space.",
        },
         outro = "More information about this organization will be added as it becomes available."
        boilerplate = {
    },
            intro = "'''$PAGE_NAME$''' is a $ORGANIZATION_TYPE$ founded in $YEAR$."
   
         },
    categories = { -- Default categories
         creatorFields = {"PAGE_NAME", "ORGANIZATION_TYPE", "YEAR"},
         base = {"Organization"}
        mappings = {
    },
            organization_type = {
 
             -- organization_type (Property:Has organization type)
    mappings = {
                {canonical = "Academic institution",
        organization_type = {
                    synonyms = {"university", "college", "academia", "institute", "school"},
             {canonical = "Academic institution",
                    category = "Academic institution"},
                synonyms = {"university", "college", "academia", "institute", "school"},
                {canonical = "ALS",
                category = "Academic institution"},
                    synonyms = {"at-large structure", "at large structure", "at-large", "at large"},
 
                    category = "ALS"},
            {canonical = "ALS",
                {canonical = "Commercial",
                synonyms = {"at-large structure", "at large structure", "at-large", "at large"},
                    synonyms = {"for-profit", "for profit", "business", "private", "private company", "privately held", "company", "publicly held", "public", "joint stock company", "corporation", "corp", "firm", "enterprise", "limited liability", "llc", "gmbh"},
                category = "ALS"},
                    category = "Commercial"},
 
                {canonical = "Community network",
            {canonical = "Commercial",
                    synonyms = {"community"},
                synonyms = {"for-profit", "for profit", "business", "private", "private company", "privately held", "company", "publicly held", "joint stock company", "corporation", "corp", "firm", "enterprise", "limited liability", "llc", "gmbh"},
                    category = "Community network"},
                category = "Commercial"},
                {canonical = "Consortium",
 
                    synonyms = {"alliance", "joint venture", "joint-venture"},
            {canonical = "Community network",
                    category = "Consortium"},
                synonyms = {"community"},
                {canonical = "Cooperative",
                category = "Community network"},
                    synonyms = {"co-op", "coop", "co-operative"},
 
                    category = "Cooperative"},
            {canonical = "Consortium",
                {canonical = "Government agency",
                synonyms = {"alliance", "joint venture", "joint-venture"},
                    synonyms = {"government", "govt", "regulator", "regulatory authority", "nra", "bureau"},
                category = "Consortium"},
                    category = "Government agency"},
 
                {canonical = "Industry association",
            {canonical = "Cooperative",
                    synonyms = {"trade association", "industry group", "trade group"},
                synonyms = {"co-op", "coop", "co-operative"},
                    category = "Industry association"},
                category = "Cooperative"},
                {canonical = "Intergovernmental organization",
 
                    synonyms = {"igo", "ingo"},
            {canonical = "Government agency",
                    category = "Intergovernmental organization"},
                synonyms = {"government", "govt", "regulator", "regulatory authority", "nra", "bureau"},
                {canonical = "Internet Society Chapter",
                category = "Government agency"},
                    synonyms = {"isoc chapter"},
 
                    category = "Internet Society Chapter"},
            {canonical = "Industry association",
                {canonical = "Non-profit",
                synonyms = {"trade association", "industry group", "trade group"},
                    synonyms = {"nonprofit", "not-for-profit", "not for profit", "charity", "foundation", "economic forum", "ngo", "association", "non-profit organization"},
                category = "Industry association"},
                    category = "Non-profit"},
 
                {canonical = "Public-private partnership",
            {canonical = "Intergovernmental organization",
                    synonyms = {"public-private partnership", "ppp"},
                synonyms = {"igo", "ingo"},
                    category = "Public-private partnership"},
                category = "Intergovernmental organization"},
                {canonical = "Research institute",
 
                    synonyms = {"research", "institute", "think tank"},
            {canonical = "Internet Society Chapter",
                    category = "Research institute"},
                synonyms = {"isoc chapter"},
                {canonical = "Standards development organization",
                category = "Internet Society Chapter"},
                    synonyms = {"sdo", "standards body", "standards organisation, standards"},
 
                    category = "Standards development organization"}
            {canonical = "Non-profit",
            }
                synonyms = {"nonprofit", "not-for-profit", "not for profit", "charity", "foundation", "economic forum", "ngo", "association", "non-profit organization"},
         },
                category = "Non-profit"},
         patterns = {
 
            itemDelimiter = p.fieldPatterns.itemDelimiter,
            {canonical = "Public-private partnership",
             websitePattern = p.fieldPatterns.websitePattern
                synonyms = {"public-private partnership", "ppp"},
                category = "Public-private partnership"},
 
            {canonical = "Standards development organization",
                synonyms = {"sdo", "standards body", "standards organisation"},
                category = "Standards development organization"}
        }
    },
   
    fields = {
        {key="organization_type", label="Type"},
        {key="focus", label="Focus"},
        {key="region", label=p.fieldLabels.region},
        {key="country", label=p.fieldLabels.country},
        {key="city", label=p.fieldLabels.city},
        {key="date_founded", label="Founded"},
         {key="founders", label="Founders"},
         {key="ownership", label="Ownership", autoWikiLink=true},
        {key="subsidiaries", label="Subsidiaries"},
        {keys={"website", "url"}, label=p.fieldLabels.website},
    },
   
    semantics = {
        properties = {
             ["Has organization type"] = "organization_type",
            ["Has focus"] = "focus",
            ["Has city"] = "city",
            ["Date founded"] = "date_founded",
            ["Has owner"] = "ownership",
            ["Has subsidiary"] = "subsidiaries"
         },
         },
 
        fields = {
        -- Normalizations applied
            {key="organization_type", label="Type"},
        transforms = {
            {key="focus", label="Focus"},
             -- None
            {key="region", label=p.fieldLabels.region},
            {key="country", label=p.fieldLabels.country},
            {key="city", label=p.fieldLabels.city},
            {key="date_founded", label="Founded"},
            {key="founders", label="Founders", autoWikiLink=true, list="bullet"},
            {key="ownership", label="Ownership", autoWikiLink=true},
            {key="subsidiaries", label="Subsidiaries", list="bullet"},
             {keys={"website", "url"}, label=p.fieldLabels.website, list=p.fieldProcessors.website.list},
         },
         },
         fixedProperties = {
         semantics = {
            ["Has entity type"] = "Organization"
            properties = {
                ["Has organization type"] = "organization_type",
                ["Has focus"] = "focus",
                ["Has city"] = "city",
                ["Date founded"] = "date_founded",
                ["Has owner"] = "ownership",
                ["Has subsidiary"] = "subsidiaries"
            },
            -- Normalizations applied
            transforms = {
                -- None
            },
            fixedProperties = {
                ["Has entity type"] = "Organization"
            }
         }
         }
     }
     },
},


------------------------------------------------------------------------------
------------------------------------------------------------------------------
Line 445: Line 503:
             description = "Person template"
             description = "Person template"
         },
         },
       
         categories = { -- Default categories
         categories = { -- Default categories
             base = {"Person"}
             base = {"Person"}
         },
         },
          
         boilerplate = {
            intro = "'''$PAGE_NAME$''' is a $OCCUPATION$ based in $COUNTRY$."
        },
        creatorFields = {"PAGE_NAME", "OCCUPATION", "COUNTRY"},
         mappings = {
         mappings = {
             -- REVIEW Community (Property:Has governance community)
             -- REVIEW Community (Property:Has governance community)
             community = {
             community = {
                -- Broad definition
                {canonical = "Internet Governance Community",
                    synonyms = {"ig", "internet governance"},
                    category = "Internet Governance Community"},
                 -- ICANN-related communities
                 -- ICANN-related communities
                 {canonical = "ICANN Community",
                 {canonical = "ICANN Community",
                synonyms = {"icann", "community"},
                    synonyms = {"icann", "community"},
                category = "ICANN Community"},
                    category = "ICANN Community"},
                 {canonical = "ICANN Staff",
                 {canonical = "ICANN Staff", -- Category provided via "badge-icann-staff"
                synonyms = {"staff", "icann org"},
                    synonyms = {"staff", "icann org"},},
                category = "ICANN Staff"},
               
                 -- Technical communities
                 -- Technical communities
                 {canonical = "Technical Community",
                 {canonical = "Technical Community",
                synonyms = {"technical"},
                    synonyms = {"technical"},
                category = "Technical Community"},
                    category = "Technical Community"},
                 {canonical = "Root Server Operator Community",
                 {canonical = "Root Server Operator Community",
                synonyms = {"root server operator", "rso"},
                    synonyms = {"root server operator", "rso"},
                category = "Root Server Operator Community"},
                    category = "Root Server Operator Community"},
                 {canonical = "RIR Community",
                 {canonical = "RIR Community",
                synonyms = {"rir"},
                    synonyms = {"rir"},
                category = "RIR Community"},
                    category = "RIR Community"},
                 {canonical = "Universal Acceptance Community",
                 {canonical = "Universal Acceptance Community",
                synonyms = {"universal acceptance", "ua", "uasg", "idn", "idn community"},
                    synonyms = {"universal acceptance", "ua", "uasg", "idn", "idn community"},
                category = "Universal Acceptance Community"},
                    category = "Universal Acceptance Community"},
               
                 -- Internet governance organizations
                 -- Internet governance organizations
                 {canonical = "ISOC Community",
                 {canonical = "ISOC Community",
                synonyms = {"isoc", "internet society", "isoc member"},
                    synonyms = {"isoc", "internet society", "isoc member"},
                category = "ISOC Community"},
                    category = "ISOC Community"},
                 {canonical = "IETF Community",
                 {canonical = "IETF Community",
                synonyms = {"ietf", "ietf member"},
                    synonyms = {"ietf", "ietf member"},
                category = "IETF Community"},
                    category = "IETF Community"},
                 {canonical = "IGF Community",
                 {canonical = "IGF Community",
                synonyms = {"igf", "nri", "youth igf"},
                    synonyms = {"igf", "nri", "youth igf"},
                category = "IGF Community"},
                    category = "IGF Community"},
                 {canonical = "W3C Community",
                 {canonical = "W3C Community",
                synonyms = {"w3c", "w3c member"},
                    synonyms = {"w3c", "w3c member"},
                category = "W3C Community"},
                    category = "W3C Community"},
               
                 -- Government-related
                 -- Government-related
                 {canonical = "Governmental",
                 {canonical = "Governmental",
                synonyms = {"government", "public sector"},
                    synonyms = {"government", "public sector", "gac"},
                category = "Governmental"},
                    category = "Governmental"},
                 {canonical = "Intergovernmental",
                 {canonical = "Intergovernmental",
                synonyms = {"igo", "ingo"},
                    synonyms = {"igo", "ingo"},
                category = "Intergovernmental"}
                    category = "Intergovernmental"}
             }
             }
         },
         },
       
         fields = {
         fields = {
             {key="community", label="Community"},
             {key="community", label="Community"},
             {key="icann_group", label="ICANN group", autoWikiLink=true}, -- (Property:Has ICANN affiliation)
             {key="icann_group", label="ICANN SO/AC", autoWikiLink=true}, -- (Property:Has ICANN affiliation)
             {key="organization", label="Organization", autoWikiLink=true},
             {key="organization", label="Organization", autoWikiLink=true, list="bullet"},
             {key="region", label=p.fieldLabels.region},
             {key="region", label=p.fieldLabels.region, list="bullet"},
             {key="country", label=p.fieldLabels.country},
             {key="country", label=p.fieldLabels.country},
             {key="languages", label="Languages"},
             {key="languages", label="Languages", list = { mode = 'bullet_custom', bulletChar = '🗣️', postProcess = 'language' }},
             {key="website", label=p.fieldLabels.website},
             {key="website", label=p.fieldLabels.website, list=p.fieldProcessors.website.list},
             {key="soi", label="SOI"},
             {key="soi", label="SOI"},
             {key="userbox", label="Achievements"},
             {key="userbox", label="Achievements"},
             {key="user", label="User", hidden=true}
             {key="user", label="User", hidden=true}
         },
         },
         patterns = {
         patterns = {
             itemDelimiter = ";%s*", -- Matches semicolon followed by optional whitespace; used for splitting multi-value fields
             itemDelimiter = p.fieldPatterns.itemDelimiter,
             websitePattern = "^https?://[^%s]+"  -- Matches URLs starting with http:// or https:// followed by non-whitespace chars
             websitePattern = p.fieldPatterns.websitePattern
         },
         },
       
         semantics = {
         semantics = {
             properties = {
             properties = {
Line 524: Line 581:
                 ["Has username"] = "user"
                 ["Has username"] = "user"
             },
             },
           
             -- Normalizations applied
             -- Normalizations applied
             transforms = {
             transforms = {
                 ["Has governance community"] = "normalize",
                 ["Has governance community"] = "normalize"
                ["Knows language"] = "raw"
             },
             },
             fixedProperties = {
             fixedProperties = {
Line 545: Line 600:
             templateId = "process"
             templateId = "process"
         },
         },
       
         categories = {
         categories = {
             base = {"Processes", "Events"}
             base = {"Processes", "Events"}
         },
         },
          
         boilerplate = {
            intro = "'''$PAGE_NAME$''' is a process started in $YEAR$."
        },
        creatorFields = {"PAGE_NAME", "YEAR"},
         mappings = {
         mappings = {
             -- Process (Property:Has process connection)
             -- Process (Property:Has process connection)
Line 556: Line 613:
             model = {
             model = {
                 {canonical = "Multistakeholder",
                 {canonical = "Multistakeholder",
                synonyms = {"multi-stakeholder", "multi stakeholder"},
                    synonyms = {"multi-stakeholder", "multi stakeholder"},
                category = "Multistakeholder Processes"},
                    category = "Multistakeholder Processes"},
                 {canonical = "Single stakeholder",
                 {canonical = "Single stakeholder",
                synonyms = {"single-stakeholder", "intergovernmental"},
                    synonyms = {"single-stakeholder", "intergovernmental"},
                category = "Single Stakeholder Processes"}
                    category = "Single Stakeholder Processes"}
             },
             },
           
             -- Status (Property:Has process status)
             -- Status (Property:Has process status)
             status = {
             status = {
                 {canonical = "Active",  
                 {canonical = "Active",
                synonyms = {"ongoing"},
                    synonyms = {"ongoing"},
                category = "Active Processes"},
                    category = "Active Processes"},
                 {canonical = "Paused",
                 {canonical = "Paused",
                synonyms = {"inactive", "dormant"},
                    synonyms = {"inactive", "dormant"},
                category = "Dormant Processes"},
                    category = "Dormant Processes"},
                 {canonical = "Concluded",
                 {canonical = "Concluded",
                synonyms = {"completed", "ended", "finished"},
                    synonyms = {"completed", "ended", "finished"},
                category = "Concluded Processes"}
                    category = "Concluded Processes"}
             },
             },
           
             -- Frequency (Property:Has frequency)
             -- Frequency (Property:Has frequency)
             frequency = {
             frequency = {
                 {canonical = "One-off",
                 {canonical = "One-off",
                synonyms = {"one off", "single"},
                    synonyms = {"one off", "single"},
                category = "One-off Processes"},
                    category = "One-off Processes"},
                 {canonical = "Ad-hoc",
                 {canonical = "Ad-hoc",
                synonyms = {"ad hoc", "eventual"},
                    synonyms = {"ad hoc", "eventual"},
                category = "Ad-hoc Processes"},
                    category = "Ad-hoc Processes"},
                 {canonical = "Periodic",
                 {canonical = "Periodic",
                synonyms = {"recurring", "regular", "annual", "yearly"},
                    synonyms = {"recurring", "regular", "annual", "yearly"},
                category = "Periodic Processes"},
                    category = "Periodic Processes"},
                 {canonical = "Continuous",
                 {canonical = "Continuous",
                synonyms = {"permanent"},
                    synonyms = {"permanent"},
                category = "Continuous Processes"}
                    category = "Continuous Processes"}
             },
             },
           
             -- Scope (Property:Has geographic scope)
             -- Scope (Property:Has geographic scope)
             scope_geo = {
             scope_geo = {
                 {canonical = "Global",
                 {canonical = "Global",
                synonyms = {"worldwide", "world", "international"},
                    synonyms = {"worldwide", "world", "international"},
                category = "Global Processes"},
                    category = "Global Processes"},
                 {canonical = "Regional",
                 {canonical = "Regional",
                synonyms = {"continent", "continental"},
                    synonyms = {"continent", "continental"},
                category = "Regional Processes"},
                    category = "Regional Processes"},
                 {canonical = "National",
                 {canonical = "National",
                synonyms = {"country", "domestic"},
                    synonyms = {"country", "domestic"},
                category = "National Processes"}
                    category = "National Processes"}
             }
             }
         },
         },
       
         fields = {
         fields = {
             {key="process", label=p.fieldLabels.process, autoWikiLink=true},
             {key="process", label=p.fieldLabels.process, autoWikiLink=true},
Line 622: Line 675:
             {key="has_next", label="Succeeded By", hidden=true},
             {key="has_next", label="Succeeded By", hidden=true},
         },
         },
       
         semantics = {
         semantics = {
             properties = {
             properties = {
                 ["Has start date"] = "start",
                 ["Has start date"] = "start",
                 ["Has end date"] = "ending",
                 ["Has end date"] = "ending",
Line 636: Line 687:
                 ["Has process connection"] = "process"
                 ["Has process connection"] = "process"
             },
             },
           
             additionalProperties = {
             additionalProperties = {
                 ["Has process connection"] = {"process", "has_previous", "has_next"}
                 ["Has process connection"] = {"process", "has_previous", "has_next"}
             },
             },
           
             -- Normalizations applied
             -- Normalizations applied
             transforms = {
             transforms = {
Line 665: Line 714:
             description = "TLD Template"
             description = "TLD Template"
         },
         },
       
         categories = {
         categories = {
             base = {}, -- No default category for TLDs as they use type-based categories
             base = {}, -- No default category for TLDs as they use type-based categories
Line 674: Line 722:
             },
             },
         },
         },
          
         boilerplate = {
            intro = "'''$PAGE_NAME$''' is a TLD proposed in $YEAR$."
        },
        creatorFields = {"PAGE_NAME", "YEAR"},
         mappings = {
         mappings = {
             -- Type (Property:Has TLD type)
             -- Type (Property:Has TLD type)
             tld_type = {
             tld_type = {
                 {canonical = "gTLD",
                 {canonical = "gTLD",
                synonyms = {"generic", "tld", "generic top level domain", "generic top-level domain", "generic tld"},
                    synonyms = {"generic", "tld", "generic top level domain", "generic top-level domain", "generic tld"},
                category = "gTLD"},
                    category = "gTLD"},
                 {canonical = "ccTLD",
                 {canonical = "ccTLD",
                synonyms = {"country", "cc", "country code top level domain", "country code top-level domain", "country tld"},
                    synonyms = {"country", "cc", "country code top level domain", "country code top-level domain", "country tld"},
                category = "ccTLD"}
                    category = "ccTLD"}
             },
             },
             -- Subtype (Property:Has TLD subtype)
             -- Subtype (Property:Has TLD subtype)
             tld_subtype = {
             tld_subtype = {
                 {canonical="geoTLD",
                 {canonical="geoTLD",
                synonyms={"geo tld","geo","geographic","geographical","geographic top level domain","geographic top-level domain","geographic tld"},
                    synonyms={"geo tld","geo","geographic","geographical","geographic top level domain","geographic top-level domain","geographic tld"},
                css="tld-template-subtype-geotld",
                    css="tld-template-subtype-geotld",
                category="geoTLD"},
                    category="geoTLD"},
                 {canonical="dotBrand",
                 {canonical="dotBrand",
                synonyms={"brand","brandtld","brand tld","brand top level domain","brand top-level domain"},
                    synonyms={"brand","brandtld","brand tld","brand top level domain","brand top-level domain"},
                css="tld-template-subtype-brandtld",
                    css="tld-template-subtype-brandtld",
                category="dotBrand"},
                    category="dotBrand"},
                 {canonical="Sponsored TLD",
                 {canonical="Sponsored TLD",
                synonyms={"sponsored","sponsored top level domain","sponsored top-level domain"},
                    synonyms={"sponsored","sponsored top level domain","sponsored top-level domain"},
                css="tld-template-subtype-sponsored",
                    css="tld-template-subtype-sponsored",
                category="Sponsored TLD"},
                    category="Sponsored TLD"},
                 {canonical="Legacy TLD",
                 {canonical="Legacy TLD",
                synonyms={"legacy","legacy top level domain","legacy top-level domain"},
                    synonyms={"legacy","legacy top level domain","legacy top-level domain"},
                css="tld-template-subtype-legacytld",
                    css="tld-template-subtype-legacytld",
                category="Legacy TLD"},
                    category="Legacy TLD"},
                 {canonical="2012 gTLD Round",
                 {canonical="2012 gTLD Round",
                synonyms={"gtld round 2012","2012 ngtld round","2012 ngtld","ngtld 2012","ngtld","2012"},
                    synonyms={"gtld round 2012","2012 ngtld round","2012 ngtld","ngtld 2012","ngtld","2012"},
                css="tld-template-subtype-ngtld-round-2012",
                    css="tld-template-subtype-ngtld-round-2012",
                category="2012 gTLD Round"}
                    category="2012 gTLD Round"}
             }
             }
         },
         },
         patterns = {
         patterns = {
             tldExtension="%.([^%.]+)$",  -- Extracts the TLD part after the last dot (e.g., "com" from "example.com")
             tldExtension="%.([^%.]+)$",  -- Extracts the TLD part after the last dot (e.g., "com" from "example.com")
             countryDelimiter="([^;]+)"  -- Matches any sequence of characters not containing semicolons; used for country parsing
             countryDelimiter="([^;]+)",   -- Matches any sequence of characters not containing semicolons; used for country parsing
            itemDelimiter = p.fieldPatterns.itemDelimiter,
            websitePattern = p.fieldPatterns.websitePattern
         },
         },
       
         fields = {
         fields = {
             {key="tld_type", label="Type"},
             {key="tld_type", label="Type"},
Line 728: Line 779:
             {key="ascii", label="Punycode"},
             {key="ascii", label="Punycode"},
             {key="registry", label="Registry", autoWikiLink=true},
             {key="registry", label="Registry", autoWikiLink=true},
             {key="website", label=p.fieldLabels.website},
             {key="website", label=p.fieldLabels.website, list=p.fieldProcessors.website.list},
             {keys={"RVC", "PIC"}, label = "PIC/RVC"}
             {keys={"RVC", "PIC"}, label = "PIC/RVC"}
         },
         },
       
         semantics = {
         semantics = {
             properties = {
             properties = {
Line 745: Line 795:
                 ["Is IDN"] = "idn", -- Boolean
                 ["Is IDN"] = "idn", -- Boolean
             },
             },
             additionalProperties = {
             additionalProperties = {
                 ["Has PIC or RVC"] = {"RVC", "PIC"}
                 ["Has PIC or RVC"] = {"RVC", "PIC"}
             },
             },
           
             -- Normalizations applied
             -- Normalizations applied
        transforms = {
            transforms = {
                 ["Has TLD type"] = "normalize",
                 ["Has TLD type"] = "normalize",
                 ["Has TLD subtype"] = "normalize",
                 ["Has TLD subtype"] = "normalize",
Line 879: Line 927:
     -- Create a standard config
     -- Create a standard config
     return p.createStandardConfig(baseConfig, customOverrides, templateType)
     return p.createStandardConfig(baseConfig, customOverrides, templateType)
end
function p.getSemanticPropertyName(propertyKey)
    for templateName, templateConfig in pairs(p.templates) do
        if templateConfig.semantics and templateConfig.semantics.additionalProperties then
            if templateConfig.semantics.additionalProperties[propertyKey] then
                return propertyKey
            end
        end
    end
    return nil
end
end


return p
return p