webprotege icon indicating copy to clipboard operation
webprotege copied to clipboard

Cannot use the same rdfs:label for two or more entities

Open joansalasoler opened this issue 8 years ago • 8 comments

On the current master branch, it does not seem to be possible to assign the same label to multiple classes or individuals.

For example, if a class A exists on the ontology with the label X, when I try to create a new object with the same X label, instead of creating a new class the software adds a new rdfs:subClassOf relationship to the class A. The same happens while creating individuals.

It's also not possible to assign the label X to an entity on the class/individual editors if that label is already being used. Instead of setting the rdfs:label on the class a string, the software is linking the rdfs:label to the class A.

Sometimes the error message «An error has occurred. Please try again. pathToRoot must not be empty» is shown on the screen while creating a second class with the same name/label.

joansalasoler avatar Nov 24 '17 15:11 joansalasoler

WebProtege uses the label for looking up entities and this is why you're seeing this behaviour. It's possible that we could change this behaviour though. From a modelling point of view, I think that the perceived wisdom is you should use unique labels where possible.

matthewhorridge avatar Nov 28 '17 00:11 matthewhorridge

Thank you Matthew. Although, I think looking up entries by their label is great and perfectly fits my needs, I can't always use distinct labels for distinct objects, or even the same object (what about multilingual labels? Sometimes they just translate to the same word).

joansalasoler avatar Nov 28 '17 08:11 joansalasoler

These are all good points @joansalasoler. We've got several issues open for multi lingual labels so I need to look at these.

matthewhorridge avatar Nov 28 '17 17:11 matthewhorridge

I’ve imported owl:equivalentProperty (with difficulties) as annotationProperty.

The fact we cannot use same rdfs:label twice induced the following issue:

  1. Add dctermhttp://purl.org/dc/terms/ in prefix table.
  2. Create a property with title as rdfs:label.
  3. Define title as equivalentProperty of http://purl.org/dc/terms/title.
  4. Export the projet.
  5. Import the file as a new project.
  6. External properties and classes are created as internal properties, however the IRI are correct (i.e. title IRI is well http://purl.org/dc/terms/title)
  7. But since there is no prefix and Webprotégé doesn’t support two identical rdfs:label, only one instance of title is kept and the equivalentProperty annotation is removed.

pols12 avatar Jul 11 '18 00:07 pols12

Hi @pols12,

I’ve imported owl:equivalentProperty (with difficulties) as annotationProperty.

You can't directly state that two annotation properties are equivalent in OWL (for some reason it wasn't included in the spec). This is probably why you don't see the axiom preserved in Protege. You can however state that one annotation property is a sub property of another annotation property though, so you could state this in both directions e.g. p rdfs:subPropertyOf q and q rdfs:subPropertyOf p.

matthewhorridge avatar Jul 11 '18 15:07 matthewhorridge

Thank you for your answer, @matthewhorridge,

In my example, title is a Data property, not an annotation property; is that the same?

EDIT: My bad, if I use another label (e.g. myTitle), equivalentProperty annotation is still removed, so it’s not a rdfs:label reuse issue. Should I open a new issue?

pols12 avatar Jul 11 '18 16:07 pols12

My bad, if I use another label (e.g. myTitle), equivalentProperty annotation is still removed, so it’s not a rdfs:label reuse issue. Should I open a new issue?

@pols12, yes, please open another issue. Thanks a lot.

matthewhorridge avatar Jul 12 '18 15:07 matthewhorridge

Faced the same need.

Sometimes a context-sensitivity between classes is needed. When elements of one class are elements of another class with the same name, but the difference between them is in the parent class: the first is general, the second is a special case. But the automatic assignment of rdfs:subClassOf can also be convenient. It would be nice if it would be possible to define the behavior in the ontology settings and when creating a list of classes.

Edited

On the screenshot there are two sets of amino acids, but the first has a context-sensitivity to pumpkin superclass.

sunvis0r avatar Sep 13 '22 16:09 sunvis0r