How to merge two concepts?

56 views
Skip to first unread message

Juli Frey

unread,
Jun 1, 2020, 4:04:16 PM6/1/20
to vocbench-user
Hello~

I have two concepts which are listed separately, but which are actually the same thing:  bacteriophages and phages.  Bacteriophages are listed as a narrower term of phages.  This is incorrect, because "phages" is a shortened version of "bacteriophages."  I created a concept "bacteriophages" on the same hierarchy level as phages, and would like to take all the information contained in the "phages" concept and put it under the "bacteriophages" concept.  How do I do this?
************************************

Armando Stellato

unread,
Jun 1, 2020, 5:25:17 PM6/1/20
to Juli Frey, vocbench-user

Dear July,

 

I didn’t get one thing: you said that they are one narrower of the other, and then you say you created bacteriophages so that they are siblings..what is that you were trying to achieve? Weren’t already both the concepts, just in a wrong relationship among them?

 

If I got it right, you:

  1. explained us the initial issue that you found in the thesaurus (bacteriophages narrower than phages)
  2. Then (a first attempt at fixing it?) you created a further copy of “bacteriophage” as a sibling (then why not simply change the broader concept of the pre-existing “bacteriophages” from “phages” to the broader of “phages” so that the pre-existing “bacteriophages” became a sibling of “phages?”
  3. Then you got that even this is wrong, and you decided to the merge the two concepts, that is to transfer all the information of phages to bacteriophage and make (I suppose) the two terms two different labels of the same concept, then (still I suppose) you will remove the phages concept.

 

If that is correct, I’m sorry currently VB3 does not support merging of concepts. This should be something of the form:

 

WITH <g> DELETE {<phages> ?p ?o } INSERT { <bacteriophages> ?p ?o } WHERE { <bacteriophages> ?p ?o }

 

where:

<g> is the working graph of your thesaurus

<phages> is the IRI of the phages concept

<bacteriophages> is the IRI of the bacteriophages concept

 

However, if you don’t have anybody on your side that can help you with SPARQL looking closely at your thesaurus, I suggest to avoid this path.

 

There’s one alternative. If the name of phages was simply wrong but its concept already had all the relevant information, instead of creating bacteriophages, you could simply rename phages to bacteriophages (I mean, its IRI), make the term “bacteriophages” its new prefLabel and make phages an altLabel.

 

Cheers,

 

Armando

 

 

--
You received this message because you are subscribed to the Google Groups "vocbench-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vocbench-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/d07ee9f7-e00e-4653-aa1a-2f9c38e629e7%40googlegroups.com.

Juli Frey

unread,
Jun 2, 2020, 3:48:25 PM6/2/20
to vocbench-user
Hi Armando~

Ok, I tried to delete the Phages concept. I have partially completed this, by renaming the broader concept, preferred label, etc.

Now, I have two entries for bacteriophages, in 2 different places (see 1st screen shot below.)  The first "bacteriophages (en)" entry, highlighted in light blue, is the previous "phages" entry (you can see this from the URL in the top right.)  But it has been renamed. 

Below that is a narrow concept "bacteriophages" and another "bacteriophages" entry on the same hierarchy level.  Both of these "http://my.site.com/#bacteriophage" entries contain the exact same information.  How do I delete the first 2 bacteriophage entries?  I would like to keep only the 3rd one. 

So, I tried deleting the skos:Concept of the 2nd "bacteriophage" entry, but it deleted both the 2nd and 3rd bacteriophage entries (I guess because they contained the same information.)  After deleting the 2nd "bacteriophage" concept, I am left with only the first one, which still has the "phages" url, and I can't seem to change it.  (see 2nd screen shot.)
















*********************************************************************************
2nd screen shot, after deleting skos:Concept "bacteriophages."  Note URL is still "phages" even though the concept has been renamed.
I can't rename URL to "bacteriophages" because I get an error that says that concept already exists.


It seems I have deleted the wrong skos:Concept.  I guess I should have deleted the Phages concept, not the bacteriophages concept.  Is there any way to fully rename the bacteriophages concept, so the phages URL is not attached to it?

************************************

To unsubscribe from this group and stop receiving emails from it, send an email to vocben...@googlegroups.com.

Armando Stellato

unread,
Jun 3, 2020, 9:52:37 AM6/3/20
to Juli Frey, vocbench-user

Dear Juli,

 

there are too many variables that I cannot see from your case. It’s hard to follow.

One thing clear now is that, exactly as the exception mentioned, there’s still a :bacteriophages concept (I’m not talking about the labels, I’m talking about the URI) so you cannot rename the phages as it would clash with the existing one (and the system is rightly preventing you from doing so).

 

One thing you can try is this one:

Go to the SPARQL editor and perform the following update:

 

DELETE {

                    :bacteriophages       ?p ?o .     

}

WHERE {

                    :bacteriophages       ?p ?o .

}

 

Then try to perform the renaming you already tried to.

 

Kind Regards,

 

Armando

 

P.S. I notice you have a weird baseuri, ending with both /#. Did you manually edit it this way? AFAIK, this should never be set automatically by VB.

 

 

To unsubscribe from this group and stop receiving emails from it, send an email to vocbench-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/16507be0-4009-45d5-a7c5-e9af6dbc1f06%40googlegroups.com.

Juli Frey

unread,
Jun 3, 2020, 10:51:42 AM6/3/20
to vocbench-user
Thanks for the idea, Armando.  As for the concepts listed as URLs, I have no idea how that happened!  I asked our admin to reset VocBench to a previous version, before I made any edits, and I am going to start over.  Now that it has been reset, the concept tree looks "normal", no   /#, just words.

Armando Stellato

unread,
Jun 3, 2020, 11:41:50 AM6/3/20
to Juli Frey, vocbench-user

Dear Juli,

 

just one more thing, to clarify:

 

  1. The fact that concepts were shown as URIs is not a big issue. Consider that this is the “rule of precedence” for what concerns rendering resource names:
    1. If a lexicalization is available (e.g. labels) then, if human-friendly rendering is enabled, it takes precedence over any UI-related info, otherwise go to b:
    2. Use the URI

                                                    i.     If a namespace to prefix mapping is available, create a qname (prefix for namespace : localname). If the namespace of the URI is the default namespace, you will see only :<localname>

                                                   ii.     If a mapping is not available, you will see the full URI

  1. No matter what you see (as you can check from the rule above, if you have lexicalizations, you will see labels) I just pointed out that the format for the URI was weird (the couple /#). I suggest you check that the URIs of your resources do not have that format. Also, you might want to use a meaningful URI space using the one of your organization (which, I guess, is not http://my.site.com :D )

 

Kind Regards,

 

Armando

 

To unsubscribe from this group and stop receiving emails from it, send an email to vocbench-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vocbench-user/82328f5e-3325-41b0-9d22-10cb59417e0a%40googlegroups.com.

Message has been deleted

Anne Massenkeil

unread,
Jul 1, 2025, 6:17:13 AMJul 1
to vocbench-user
Hello Armando,
I have the same general question as Julia. If I have two synonymous concepts in my database (as siblings) and need to merge them. My users won't be using SPARQL. Is there a workaround? 

Thanks,
Anne

This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Message has been deleted

Anne Massenkeil

unread,
Jul 4, 2025, 6:57:36 AMJul 4
to vocbench-user
Please ignore - I just reread the thread and see VB is not currently supporting a merge operation without using SPRQL.
Reply all
Reply to author
Forward
0 new messages