national-gallery / NG-CIIM

Development of Gallery-instigated CIIM configurations and plugins; not the Gallery's CIIM itself.
0 stars 0 forks source link

Concepts #21

Open RGShepherd opened 11 months ago

RGShepherd commented 11 months ago

I'm afraid these are looking quite thin now: just a URI and a prefLabel. And I believe the value of @context should be https://gbv.github.io/jskos/context.json (according to https://gbv.github.io/jskos/jskos.html#resource)?

richardofsussex commented 11 months ago

Ah thanks - as it happens I've just moved onto concepts. I agree about the thinness - but that's what all my examples look like from earlier this year. Hopefully I can do a better job with XSLT than I could do with Jolt. And thanks for the URL: I had assumed I would (once again) have to provide a home-grown address for the context document.

richardofsussex commented 11 months ago

How does http://richardofsussex.me.uk/ng/ciim7-output/concept-39977.json look? I've reversed the order in broader and ancestors so it goes from specific to general, and dropped the last entry so it doesn't mis-represent the current concept as being its own ancestor.

The one thing I haven't worked out how to do is to populate broader with all the broader concepts. The problem is that you aren't allowed to repeat a URI within the set, and the same broader concept appears in both hierarchies. I can come back to that next week if it's an issue.

RGShepherd commented 11 months ago

Hmm. But should all the broader contexts actually be in broader, or is it just for parents? Having looked at the SKOS Primer, particularly section 4.5, it looks as though we only need the parents there, not the ancestors. (And should we also be using broaderTransitive rather than broader, because our thesauri are based on the principle that all descendants are included in a given concept?)

richardofsussex commented 11 months ago

Thanks: I was looking at the JSKOS spec, which isn't so helpful. However, it did point out that we don't have the option of broaderTransitive in this serialization of SKOS. The other little challenge was that in this case both hierarchies have the same broader term, and it should therefore only appear once. I think I have now sorted that out: see http://richardofsussex.me.uk/ng/ciim7-output/concept-39977.json

RGShepherd commented 11 months ago

Yep, that looks good - thanks! My only other comment would be that, as they're all web texts, our scopeNotes should probably be definitions - see the SKOS primer, 2.4. We may get as far as scope notes in due course, but we can cross that bridge when we come to it.

richardofsussex commented 11 months ago

OK: done.

RGShepherd commented 11 months ago

Thanks! Then if @jpadfield's happy with concepts, I'd say they're done?

jpadfield commented 11 months ago

Hi - I had a question about the formatting, is there meant to be a difference between the formatting for "prefLabel" and "definition" - one has a simple string as the value and one has an array:

"prefLabel": {
"en": "oil"
},
"definition": {
"en": [
"In oil paint the pigment is mixed with the medium of oil. It was used in Northern Europe in the 13th and 14th centuries for panel painting as well as wall painting and its properties were further exploited by Van Eyck and Campin whose innovations were subsequently introduced to Italy in the early 15th century. \r\n\r\nOils of different kinds can be used: linseed, walnut and poppy. Oil paint dries slowly and is a more flexible medium than egg tempera. It allowed a wide range of optical effects and a broader and more detailed application of paint, and so extended the range of new expressive possibilities for artists."
]
},
jpadfield commented 11 months ago

The default model for the example comes out as:

flowchart TB
classDef object stroke:#2C5D98,fill:#2C5D98,color:white,rx:5px,ry:5px;
classDef url stroke:#2C5D98,fill:white,color:#2C5D98,rx:5px,ry:5px;
classDef literal stroke:black,fill:#f0f0e0,color:black,rx:2px,ry:2px,max-width:100px;

O0("This Model")
class O0 object;

O1("https://gbv.github.io/jskos/context.json")
class O1 url;
click O1 "https://gbv.github.io/jskos/context.json"
O0["This Model"] ---->|has context|O1["https://gbv.github.io/jskos/context.json"]

O2("_#-0")
class O2 object;

O3("ng:0FLK-0008-0000-0000")
class O3 url;
click O3 "https://data.ng-london.org.uk/0FLK-0008-0000-0000" "Link to: https: ..."; 
click O3 "https://data.ng.ac.uk/0FLK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O2["_"] ---->|uri|O3["ng:0FLK-0008-0000-0000"]

O4("_#-1")
class O4 literal;
O2["_"] ---->|prefLabel|O4["_"]

O5("oil")
class O5 literal;
O4["_"] ---->|en|O5["oil"]

O6("_#-2")
class O6 literal;
O2["_"] ---->|definition|O6["_"]

O7("In oil paint the pigment is mixed with the medium of oil. It was used in Northern Europe in the 13th and 14th centuries for panel painting as well as wall painting and its properties were further exploited by Van Eyck and Campin whose innovations were subsequently introduced to Italy in the early 15th century. \n\nOils of different kinds can be used: linseed, walnut and poppy. Oil paint dries slowly and is a more flexible medium than egg tempera. It allowed a wide range of optical effects and a broader and more detailed application of paint, and so extended the range of new expressive possibilities for artists.")
class O7 literal;
O6["_"] ---->|en|O7["In oil paint the pigment is mixed with the medium of oil. It<br>was used in Northern Europe in the 13th and 14th centuries<br>for panel painting as well as wall painting and its<br>properties were further exploited by Van Eyck and Campin<br>whose innovations were subsequently introduced to Italy in<br>the early 15th century. \n\nOils of different kinds can be<br>used: linseed, walnut and poppy. Oil paint dries slowly and<br>is a more flexible medium than egg tempera. It allowed a<br>wide range of optical effects and a broader and more<br>detailed application of paint, and so extended the range of<br>new expressive possibilities for artists."]

O8("_#-3")
class O8 literal;
O2["_"] ---->|broader|O8["_"]

O9("ng:0F1V-0008-0000-0000")
class O9 url;
click O9 "https://data.ng-london.org.uk/0F1V-0008-0000-0000" "Link to: https: ..."; 
click O9 "https://data.ng.ac.uk/0F1V-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O8["_"] ---->|uri|O9["ng:0F1V-0008-0000-0000"]

O10("_#-4")
class O10 literal;
O8["_"] ---->|prefLabel|O10["_"]

O11("media")
class O11 literal;
O10["_"] ---->|en|O11["media"]

O12("_#-5")
class O12 literal;
O2["_"] ---->|ancestors|O12["_"]
click O9 "https://data.ng.ac.uk/0F1V-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O12["_"] ---->|uri|O9["ng:0F1V-0008-0000-0000"]

O13("_#-6")
class O13 literal;
O12["_"] ---->|prefLabel|O13["_"]
O13["_"] ---->|en|O11["media"]

O14("_#-7")
class O14 literal;
O2["_"] ---->|ancestors|O14["_"]

O15("ng:0FSQ-0008-0000-0000")
class O15 url;
click O15 "https://data.ng-london.org.uk/0FSQ-0008-0000-0000" "Link to: https: ..."; 
click O15 "https://data.ng.ac.uk/0FSQ-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O14["_"] ---->|uri|O15["ng:0FSQ-0008-0000-0000"]

O16("_#-8")
class O16 literal;
O14["_"] ---->|prefLabel|O16["_"]

O17("materials")
class O17 literal;
O16["_"] ---->|en|O17["materials"]

O18("_#-9")
class O18 literal;
O2["_"] ---->|ancestors|O18["_"]

O19("ng:0FAK-0008-0000-0000")
class O19 url;
click O19 "https://data.ng-london.org.uk/0FAK-0008-0000-0000" "Link to: https: ..."; 
click O19 "https://data.ng.ac.uk/0FAK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O18["_"] ---->|uri|O19["ng:0FAK-0008-0000-0000"]

O20("_#-10")
class O20 literal;
O18["_"] ---->|prefLabel|O20["_"]

O21("Materials and techniques")
class O21 literal;
O20["_"] ---->|en|O21["Materials and techniques"]

O22("_#-11")
class O22 literal;
O2["_"] ---->|inScheme|O22["_"]
click O19 "https://data.ng.ac.uk/0FAK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O22["_"] ---->|uri|O19["ng:0FAK-0008-0000-0000"]

O23("_#-12")
class O23 literal;
O22["_"] ---->|prefLabel|O23["_"]
O23["_"] ---->|en|O21["Materials and techniques"]
;

But I have now adjusted the modeller code to spot the "https://gbv.github.io/jskos/context.json" context and it comes out as:

flowchart TB
classDef object stroke:#2C5D98,fill:#2C5D98,color:white,rx:5px,ry:5px;
classDef url stroke:#2C5D98,fill:white,color:#2C5D98,rx:5px,ry:5px;
classDef name stroke:#563800,fill:#FEF3BA,color:#563800,rx:20px,ry:20px;
classDef note stroke:#2C5D98,fill:#D8FDFF,color:#2C5D98,rx:5px,ry:5px;

O0("This Model")
class O0 object;

O1("https://gbv.github.io/jskos/context.json")
class O1 url;
click O1 "https://gbv.github.io/jskos/context.json"
O0["This Model"] ---->|has context|O1["https://gbv.github.io/jskos/context.json"]

O2("ng:0FLK-0008-0000-0000")
class O2 object;
click O2 "https://data.ng-london.org.uk/0FLK-0008-0000-0000" "Link to: https: ..."; 

O3("oil@en")
class O3 name;
click O2 "https://data.ng.ac.uk/0FLK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O2["ng:0FLK-0008-0000-0000"] ---->|prefLabel|O3["oil@en"]

O4("In oil paint the pigment is mixed with the medium of oil. It was used in Northern Europe in the 13th and 14th centuries for panel painting as well as wall painting and its properties were further exploited by Van Eyck and Campin whose innovations were subsequently introduced to Italy in the early 15th century. \n\nOils of different kinds can be used: linseed, walnut and poppy. Oil paint dries slowly and is a more flexible medium than egg tempera. It allowed a wide range of optical effects and a broader and more detailed application of paint, and so extended the range of new expressive possibilities for artists.@en")
class O4 note;
click O2 "https://data.ng.ac.uk/0FLK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O2["ng:0FLK-0008-0000-0000"] ---->|definition|O4["In oil paint the pigment is mixed with the medium of oil. It<br>was used in Northern Europe in the 13th and 14th centuries<br>for panel painting as well as wall painting and its<br>properties were further exploited by Van Eyck and Campin<br>whose innovations were subsequently introduced to Italy in<br>the early 15th century. \n\nOils of different kinds can be<br>used: linseed, walnut and poppy. Oil paint dries slowly and<br>is a more flexible medium than egg tempera. It allowed a<br>wide range of optical effects and a broader and more<br>detailed application of paint, and so extended the range of<br>new expressive possibilities for artists.@en"]

O5("ng:0F1V-0008-0000-0000")
class O5 url;
click O5 "https://data.ng-london.org.uk/0F1V-0008-0000-0000" "Link to: https: ..."; 
click O2 "https://data.ng.ac.uk/0FLK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
click O5 "https://data.ng.ac.uk/0F1V-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O2["ng:0FLK-0008-0000-0000"] ---->|broader|O5["ng:0F1V-0008-0000-0000"]

O6("media@en")
class O6 name;
click O5 "https://data.ng.ac.uk/0F1V-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O5["ng:0F1V-0008-0000-0000"] ---->|prefLabel|O6["media@en"]
click O2 "https://data.ng.ac.uk/0FLK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
click O5 "https://data.ng.ac.uk/0F1V-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O2["ng:0FLK-0008-0000-0000"] ---->|ancestors|O5["ng:0F1V-0008-0000-0000"]

O7("ng:0FSQ-0008-0000-0000")
class O7 url;
click O7 "https://data.ng-london.org.uk/0FSQ-0008-0000-0000" "Link to: https: ..."; 
click O2 "https://data.ng.ac.uk/0FLK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
click O7 "https://data.ng.ac.uk/0FSQ-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O2["ng:0FLK-0008-0000-0000"] ---->|ancestors|O7["ng:0FSQ-0008-0000-0000"]

O8("materials@en")
class O8 name;
click O7 "https://data.ng.ac.uk/0FSQ-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O7["ng:0FSQ-0008-0000-0000"] ---->|prefLabel|O8["materials@en"]

O9("ng:0FAK-0008-0000-0000")
class O9 url;
click O9 "https://data.ng-london.org.uk/0FAK-0008-0000-0000" "Link to: https: ..."; 
click O2 "https://data.ng.ac.uk/0FLK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
click O9 "https://data.ng.ac.uk/0FAK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O2["ng:0FLK-0008-0000-0000"] ---->|ancestors|O9["ng:0FAK-0008-0000-0000"]

O10("Materials and techniques@en")
class O10 name;
click O9 "https://data.ng.ac.uk/0FAK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O9["ng:0FAK-0008-0000-0000"] ---->|prefLabel|O10["Materials and techniques@en"]
click O2 "https://data.ng.ac.uk/0FLK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
click O9 "https://data.ng.ac.uk/0FAK-0008-0000-0000" "Link to: https://data.ng.ac.uk ..."; 
O2["ng:0FLK-0008-0000-0000"] ---->|inScheme|O9["ng:0FAK-0008-0000-0000"]
;
jpadfield commented 11 months ago

Do we have a description of how we are using broader, ancestor and inScheme (I was just thinking would be good to include in any documentation)? Do we have a model for how the "schemes" will be defined?

richardofsussex commented 11 months ago

As regards map vs. list, the JSKOS spec has: image I don't see an example for definition, but altLabel looks like this: image Essentially, SKOS mandates a single preferred term per language, but all other fields can have multiple values per language.

RGShepherd commented 9 months ago

Do we have a description of how we are using broader, ancestor and inScheme (I was just thinking would be good to include in any documentation)? Do we have a model for how the "schemes" will be defined?

This is as now documented in https://github.com/national-gallery/NG-CIIM/issues/23#issuecomment-1725337347:

The source data is contained in @hierarchy, which contains all ancestors in each hierarchy, one array per hierarchy if the entry is polyhierarchical. In this case, therefore, there are two arrays, because there are two hieararchies. These include all ancestors up to and including the top-level entry, and indeed the concept scheme as well. On mapping to JSKOS, we:

RGShepherd commented 9 months ago

So I think now we're just waiting for some external IDs in the source data to sign off how they will be mapped, as discussed in https://github.com/national-gallery/NG-CIIM/issues/23#issuecomment-1742616236

RGShepherd commented 9 months ago

I've just run a CIIM extraction which has added some external IDs to concept-41477.

richardofsussex commented 9 months ago

See http://richardofsussex.me.uk/ng/ciim7-output/concept-41477.json, which uses the same code I have written for place records.

RGShepherd commented 9 months ago

Looking good, and JSKOS-like, but:

Thanks!

richardofsussex commented 9 months ago

Have a look now ... (Ditto for place-39582). (Just updated the JSKOS context URL to the correct one: thanks!)

RGShepherd commented 9 months ago

Thanks! As per https://github.com/national-gallery/NG-CIIM/issues/23#issuecomment-1749295670 :wink: