universAAL / ontology

Collection of "official" ontologies of universAAL, which play the role of data model
13 stars 11 forks source link

get and set Resource Label are not syncronized correctly #379

Closed Alfiva closed 7 years ago

Alfiva commented 7 years ago

Originally Opened: @amedranogil (2013-10-13 13:00:37) Originally Closed: 2015-08-19 15:15:06

when setting a resourceLabel, this is traditionally done in the ontology (ie to the ontInforSetup) but there are several issues when retrieving the label:

1) the getOrConstructLabel method uses the multilanguage functionality (maybe setResourceLabel should enable that too)

2) the getOrConstructLabel method calls getResourceLabel with defaultLanguage, maybe it should allow to select the language

3) the getOrConstructLabel method calls getResourceLabel on the Resource instance, when we said the label is set in the OntClassInfoSetup, thus it always constructs the Label with the URI and not the human readable label set.

--

From: this issue has been automatically imported from our old issue tracker

Alfiva commented 7 years ago

Original author: @Alfiva (2015-08-05 13:13:33)

Just a small news about multilanguage: One of the last RDF specs updates included support for multilanguage string values. I don't know what we should do about that in this aspect.

Alfiva commented 7 years ago

Original author: @cstockloew (2015-08-19 15:15:06)

To Alvaro:

Not sure which spec you mean but we are already supporting multilang strings with the class LangString and the methods Resource.addMultiLangProp and Resource.getMultiLangProp. Example:

String p = Resource.PROP_RDFS_LABEL; // just some property r.addMultiLangProp(p, new LangString("hello", LangString.LANG_ENGLISH)); r.addMultiLangProp(p, new LangString("hallo", LangString.LANG_GERMAN));

Serialized:

@prefix : <http://www.w3.org/2001/XMLSchema#&gt; . _:BN000000 <http://www.w3.org/2000/01/rdf-schema#label&gt; ( "hello"@en "hallo"@de ) .

To Alejandro:

The label can be set for every resource. That means that a class can have a label and an individual can have a label. Those should be different as they describe different things. For example, the class LightSource could have the label "Light Source" and an individual could have the label "kitchen lamp".

(1) done, added method getResourceLabel(String lang)

(2) done, added method getOrConstructLabel(String type, String lang). Still remains open where and how to configure the default language (which is currently hardcoded as english)

(3) not right, as described above. The label should be set for every instance. The method getOrConstructLabel first tries to retrieve the label of the instance. If none is set, it tries to create one either by using the optional String given to the method or, as last resort, from the URI (URI of instance or of type).

I'm closing this tracker item. Please re-open if my understanding of your questions was not correct.

Alfiva commented 7 years ago

issue cloed on 2015-08-19 15:15:06