DOREMUS-ANR / knowledge-base

Repository containing controlled vocabularies and data published by DOREMUS
http://data.doremus.org/
Apache License 2.0
16 stars 7 forks source link

[Keys] Adding new terms in the vocabulary or new properties in the ontology? #38

Closed pasqLisena closed 6 years ago

pasqLisena commented 7 years ago

I would like to add few more properties on keys vocabulary.

I am speaking about the tonic and the 'mode' as is done in the Music Ontology keys vocabulary, with the properties keys:tonic and keys:mode.

Moreover, I think it can be useful -- i.e. for recommending purpose, it adds an additional edge between two keys -- to add the relative and parallel keys. Also the closely related key seems to be a nice to add.

For the first two properties we can either 1. use the ones of MO, or 2. declare new properties in DOREMUS ontology. For the others, I think the best solution is adding properties in DOREMUS.

My proposal is so to represent a key in this way :

@prefix keys: <http://purl.org/NET/c4dm/keys.owl#> .

<http://data.doremus.org/vocabulary/key/c> a skos:Concept ;
    skos:prefLabel "Do majeur"@fr ;
        skos:altLabel "Ut majeur"@fr ;
    skos:editorialNote "unimarc: c" ;
    skos:prefLabel "C Major"@en , "Do maggiore"@it , "Do mayor"@es , "C Dur"@de ;
    skos:topConceptOf <http://data.doremus.org/vocabulary/key/> ;
        keys:mode "major";
        keys:tonic keys:C ;
        mus:Uxx_has_relative_key <http://data.doremus.org/vocabulary/key/am> ;
        mus:Uxx_has_parallel_key <http://data.doremus.org/vocabulary/key/cm> ;
        mus:Uxx_has_closely_related_key <http://data.doremus.org/vocabulary/key/f>,
 <http://data.doremus.org/vocabulary/key/g>, <http://data.doremus.org/vocabulary/key/dm>, <http://data.doremus.org/vocabulary/key/em> ;
    skos:exactMatch <http://purl.org/NET/c4dm/keys.owl#CMajor>,
 <http://iflastandards.info/ns/unimarc/terms/key#c> .

Alternatively we can define major/minor as vocabulary entries. I.e. for major:

rtroncy commented 7 years ago

+1 for re-using the keys vocabulary (mode and tonic properties and values).

+1 as well for adding those 3 new properties in the DOREMUS ontology

pasqLisena commented 7 years ago

We will add the 3 new properties in the controlled vocabulary.

rtroncy commented 7 years ago

Hum, you're adding those 3 terms in the key vocabulary. I thought that we need properties defined in the DOREMUS ontology to express relationships between keys, e.g. between 'c' and 'am'. How will http://data.doremus.org/vocabulary/key/relative be able to express this relation?

pasqLisena commented 7 years ago

I would like to take inspiration from what MusicOntology is doing with keys:mode and keys:tonic.

keys:mode a owl:DatatypeProperty ; rdfs:domain keys:Key ; rdfs:range [ a owl:DataRange ; owl:oneOf ( "major"^^xsd:string "minor"^^xsd:string ) ] .

keys:tonic a owl:ObjectProperty ; rdfs:domain keys:Key .



In a nutshell, the properties are not becoming part of the ontology, but they remains at vocabulary level. What do you think?
rtroncy commented 7 years ago

http://purl.org/NET/c4dm/keys.owl is an OWL ontology. The document contains definitions of OWL classes, properties and instances.

http://data.doremus.org/vocabulary/key/ is a SKOS concept scheme. The document contains definitions of SKOS concepts that belong to this concept scheme. Adding definition of OWL properties in this document would be an error. Why don't you want to define those properties in the DOREMUS OWL ontology which is their natural habitat?

pasqLisena commented 7 years ago

Short answer: "bureaucratic problems". :) Adding them to the Ontology means take care of their definition, documentation, creation of the examples, etc.

http://purl.org/NET/c4dm/keys.owl is an OWL ontology. The document contains definitions of OWL classes, properties and instances.

This was not clear to me indeed.

Should we try to propose again it to the modelling group (via mail)? I can prepare all the definitions before doing it (as pull request maybe).

rtroncy commented 7 years ago

Should we try to propose again it to the modelling group (via mail)?

Yes. Re-using straight away http://purl.org/NET/c4dm/keys.owl would make all keys defined in our vocabulary as owl instances in addition to skos:Concept which is not necessarily advisable. I would suggest the modeling group to endorse the creation of those 2? new properties.

pasqLisena commented 7 years ago

those 2? new properties

3 properties:

  1. mus:Uxx_has_relative_key
  2. mus:Uxx_has_parallel_key
  3. mus:Uxx_has_closely_related_key

Or you mean also redefining these ones?

  1. key:tonic
  2. key:mode
rtroncy commented 7 years ago

I meant creating the 3 properties: mus:Uxx_has_relative_key, mus:Uxx_has_parallel_key, mus:Uxx_has_closely_related_key. We don't need tonic and mode, do we?

pasqLisena commented 7 years ago

We don't need tonic and mode, do we?

Yes but I was relying on your previous comment:

+1 for re-using the keys vocabulary (mode and tonic properties and values).

Is it still valid? Or you had a better look to the keys vocabulary?

rtroncy commented 7 years ago

+1 for re-using the keys vocabulary (mode and tonic properties and values).

Is it still valid? Or you had a better look to the keys vocabulary?

OK, I see and I was confused. My starting point is what you exactly proposed in the code snippet in https://github.com/DOREMUS-ANR/knowledge-base/issues/38#issue-255976801

When adding the statements:

<http://data.doremus.org/vocabulary/key/c> keys:mode "major".
<http://data.doremus.org/vocabulary/key/c> keys:tonic keys:C ;

you made the inference that <http://data.doremus.org/vocabulary/key/c> is an instance of keys:Key in addition to be a skos:Concept. Your first statement could therefore be:

<http://data.doremus.org/vocabulary/key/c> a skos:Concept, keys:Key ;

When adding the statement

<http://data.doremus.org/vocabulary/key/c> skos:exactMatch <http://purl.org/NET/c4dm/keys.owl#CMajor>

you're also inferring that <http://purl.org/NET/c4dm/keys.owl#CMajor> is a skos:Concept which is unnecessary. I would use an owl:sameAs relationship for intelinking with keys instances, while keeping skos:exactMatch with ifla definitions (that are skos:Concept). Ultimately, I would define the 3 properties mus:Uxx_has_relative_key, mus:Uxx_has_parallel_key, mus:Uxx_has_closely_related_key and use keys:Key for their domain / range.

The full NEW snippet code will look like (watch all differences):

@prefix keys: <http://purl.org/NET/c4dm/keys.owl#> .

<http://data.doremus.org/vocabulary/key/c> a skos:Concept, keys:Key ;
    skos:prefLabel "Do majeur"@fr ;
        skos:altLabel "Ut majeur"@fr ;
    skos:editorialNote "unimarc: c" ;
    skos:prefLabel "C Major"@en , "Do maggiore"@it , "Do mayor"@es , "C Dur"@de ;
    skos:topConceptOf <http://data.doremus.org/vocabulary/key/> ;
        keys:mode "major";
        keys:tonic keys:C ;
        mus:Uxx_has_relative_key <http://data.doremus.org/vocabulary/key/am> ;
        mus:Uxx_has_parallel_key <http://data.doremus.org/vocabulary/key/cm> ;
        mus:Uxx_has_closely_related_key <http://data.doremus.org/vocabulary/key/f>,
 <http://data.doremus.org/vocabulary/key/g>, <http://data.doremus.org/vocabulary/key/dm>, <http://data.doremus.org/vocabulary/key/em> ;
        owl:sameAs <http://purl.org/NET/c4dm/keys.owl#CMajor> ;
    skos:exactMatch <http://iflastandards.info/ns/unimarc/terms/key#c> .

I hope this is clearer now.