hi,team,When I build my own glossary-node/term,I f...
# ingestion
c
hi,team,When I build my own glossary-node/term,I found that my urn-address was built with my nodeName
Copy code
def make_glossary_node_urn(path: List[str]) -> str:
    return "urn:li:glossaryNode:" + ".".join(path)


def make_glossary_term_urn(path: List[str]) -> str:
    return "urn:li:glossaryTerm:" + ".".join(path)
I think official cases are a unique sign,Is there any suitable conversion method official->https://demo.datahubproject.io/glossaryTerm/urn:li:glossaryTerm:62a8cfcf-109d-442d-a06c-bf9ece8bbc14/Documentation?is_lineage_mode=false mine->urnliglossaryNode:主题.车辆主题域
b
query the existing term, create a new term with a fixed URN and populate with the information from the existing term, then delete the old term
c
@better-orange-49102 thankyou, want to generate it directly at the first initialization,but in the glossary_node there is only one attribute name
Copy code
class GlossaryNodeConfig(ConfigModel):
    name: str
    description: str
    owners: Optional[Owners]
    terms: Optional[List[GlossaryTermConfig]]
    nodes: Optional[List["GlossaryNodeConfig"]]
how can i make name show 'XXXX' and urn is a unique ID
b
Copy code
from datahub.emitter.mcp import MetadataChangeProposalWrapper

from datahub.ingestion.graph.client import DatahubClientConfig, DataHubGraph
from datahub.metadata.schema_classes import (
    ChangeTypeClass,
    GlossaryNodeInfoClass,
    GlossaryTermInfoClass,
)

termUrn = f"urn:li:glossaryTerm:XXXXX"
mcp = MetadataChangeProposalWrapper(
        entityType="glossaryTerm",
        changeType=ChangeTypeClass.UPSERT,
        entityUrn=termUrn,
        aspectName="glossaryTermInfo",
        aspect=GlossaryTermInfoClass(
            definition="DESCRIPTION",
            name="NAME HERE",
            parentNode=nodeUrn,
            termSource="INTERNAL",
    ),
)
graph.emit(mcp)
c
@better-orange-49102 thankyou l'll try
@better-orange-49102 hi,I can set urn and name separately for glossary term,Can the glossary node be set like this
Copy code
GlossaryNodeInfoClass
Copy code
self.definition = definition
self.parentNode = parentNode
there only has definition and parentNode
b
There should be a name field in nodeinfo. Or you could just set in via UI