CRISalid-esr / crisalid-ikg

CRISalid institutional knowledge graph
Other
0 stars 0 forks source link

Handle source record subjects #25

Closed jdp1ps closed 3 weeks ago

jdp1ps commented 4 weeks ago

When a subject comes in,

if it has an uri :
    | if the graph contains a concept with this uri :
    |    | for each preflabel:
    |    |    | if the concept has a preflabel in this language:
    |    |    |    | replace the preflabel value
    |    |    | else :
    |    |    |    | add a new preflabel
    |    | for each altlabel:
    |    |    | if the concept has an altlabel with this language and value:
    |    |    |    | do nothing
    |    |    | else :
    |    |    |    | add a new altlabel
    | else:
    |    | create a concept with this uri
    |    |    | for each preflabel:
    |    |    |    | create the preflabel and add it to the concept
    |    |    | for each altlabel:
    |    |    |    | create the altlabel and add it to the concept
else:
    | if the concept has more than one preflabel or has an altlabel:
    |    | discard the concept
    | else if the graph contains a concept with the same preflabel but without uri:
    |    | do nothing
    | else :
    |    | create a new preflabel and attach it to a new concept without uri