> On 13 Nov 2024, at 10:15 AM, 'Luis Enrique Ramos García' via TopBraid Suite 
> Users <topbraid-users@googlegroups.com> wrote:
> 
> Dear All,
> 
> I have a spreadsheet with two columns of labels in different languages.
> 
> I have been able to create a prefLabel for a specific language, 
> but when I try to add a preflabel it seems the previous one is overwritten.
> 
> As I know I should be able to create a preflabel per language, 
> and as many labels in a language as I want.
> Thus, I wonder which method I should use to get the expected result?
> 
> Below is the code I have done till now:
> 
> let s = IO.uploadedFile(file).asSpreadsheet();
> //graph.uploadedFile(file).asSpreadsheet()
> //s.row(0)['label 1']
> s.rows().forEach(row => {
>     let concept = skos.createConcept({
>         uri: 'http://example.com/'+ row['id'],
>         notation: row.id <http://row.id/>
>     })
> 
> //creating label in english, if any
> let prefLabelEN =    graph.langString(row['label 1'],'en')
> //creating label in german, if any
> let prefLabelDE =    graph.langString(row['label 2'],'de')
> //adding english label, if any?
> concept.prefLabel= prefLabelEN
> //ading german label, if any
> concept.prefLabel= prefLabelDE

This would overwrite the prefLabel each time.

Instead try

concept.add(skos.prefLabel, prefLabelEN);
concept.add(skos.prefLabel, prefLabelDE);

HTH
Holger


> 
> 
> })
> 
> 
> 
> Best regards
> 
> 
> Luis Ramos
> 
> 
> 
> 
> -- 
> The topics of this mailing list include TopBraid EDG and related technologies 
> such as SHACL.
> To post to this group, send email to topbraid-users@googlegroups.com
> --- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to topbraid-users+unsubscr...@googlegroups.com 
> <mailto:topbraid-users+unsubscr...@googlegroups.com>.
> To view this discussion visit 
> https://groups.google.com/d/msgid/topbraid-users/CABy94XkffkRu9cz3_q_6ARFM%2BO8xPP1rYgBY_Tic20Jhn2vBTw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/CABy94XkffkRu9cz3_q_6ARFM%2BO8xPP1rYgBY_Tic20Jhn2vBTw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to topbraid-users+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/topbraid-users/0A399A8F-6640-4F12-B2DF-C90F72DA4D97%40topquadrant.com.
  • [topbraid-users] scr... 'Luis Enrique Ramos García' via TopBraid Suite Users
    • Re: [topbraid-u... Holger Knublauch

Reply via email to