• Expands a property name to a full IRI

    Handles three cases:

    1. Prefixed properties: "dc:title" with context {"dc": "http://purl.org/dc/elements/1.1/"} → "http://purl.org/dc/elements/1.1/title"
    2. Full IRIs: "http://example.com/prop" → "http://example.com/prop" (passed through)
    3. Local names: "title" with baseIRI "http://schema.org/" → "http://schema.org/title"

    Parameters

    • property: string

      The property name to expand

    • baseIRI: string

      The base IRI to use for local names

    • Optionalcontext: Record<string, string>

      Optional prefix mappings for expansion

    Returns string

    The expanded property IRI

    expandPropertyName("dc:title", "http://schema.org/", {
    dc: "http://purl.org/dc/elements/1.1/"
    }); // → "http://purl.org/dc/elements/1.1/title"

    expandPropertyName("http://example.com/prop", "http://schema.org/", {});
    // → "http://example.com/prop"

    expandPropertyName("name", "http://schema.org/", {});
    // → "http://schema.org/name"