OnroerendErfgoed / skosprovider_rdf

Skosprovider implementation backed by RDF
http://skosprovider-rdf.readthedocs.org
MIT License
2 stars 4 forks source link

Better RDF rendering for concepts part of a collection #104

Closed koenedaele closed 2 years ago

koenedaele commented 2 years ago

Currently an RDF dump for a concept that is a member of a collection does not include a reference to that collection since there is no "memberOf" property. However, we could fix this by adding a statement "collection member concept".

goessebr commented 2 years ago

Hi @koenedaele

This is the content of the RDF file:

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
   xmlns:dcterms="http://purl.org/dc/terms/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:skos="http://www.w3.org/2004/02/skos/core#"
   xmlns:void="http://rdfs.org/ns/void#"
>
  <rdf:Description rdf:about="https://id.erfgoed.net/thesauri/erfgoedtypes/1621">
    <skos:prefLabel xml:lang="nl-BE">markeringsbomen</skos:prefLabel>
    <skos:narrower rdf:resource="https://id.erfgoed.net/thesauri/erfgoedtypes/1625"/>
    <skos:narrower rdf:resource="https://id.erfgoed.net/thesauri/erfgoedtypes/1622"/>
    <skos:narrower rdf:resource="https://id.erfgoed.net/thesauri/erfgoedtypes/1624"/>
    <skos:historyNote xml:lang="nl-BE">16/02/2021: scope note licht aangepast bij revisie termen houtige beplantingen.</skos:historyNote>
    <skos:inScheme rdf:resource="https://id.erfgoed.net/thesauri/erfgoedtypes"/>
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
    <dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">1621</dcterms:identifier>
    <skos:narrower rdf:resource="https://id.erfgoed.net/thesauri/erfgoedtypes/1623"/>
    <void:inDataset rdf:resource="https://id.erfgoed.net/datasets/thesauri/erfgoedtypes"/>
    <skos:narrower rdf:resource="https://id.erfgoed.net/thesauri/erfgoedtypes/2245"/>
    <skos:scopeNote xml:lang="nl-BE">Een markeringsboom is een boom of uitzonderlijk een struik die is aangeplant om een welbepaalde plaats aan te duiden.</skos:scopeNote>
    <dcterms:source rdf:nodeID="N26fb971aff134196848b2a609ac2066f"/>
  </rdf:Description>
  <rdf:Description rdf:about="https://id.erfgoed.net/thesauri/erfgoedtypes">
    <skos:prefLabel xml:lang="en">Heritage types</skos:prefLabel>
    <skos:prefLabel xml:lang="nl">Erfgoedtypes</skos:prefLabel>
    <dcterms:identifier>ERFGOEDTYPES</dcterms:identifier>
    <void:inDataset rdf:resource="https://id.erfgoed.net/datasets/thesauri/erfgoedtypes"/>
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#ConceptScheme"/>
  </rdf:Description>
  <rdf:Description rdf:nodeID="N26fb971aff134196848b2a609ac2066f">
    <dcterms:bibliographicCitation>Agentschap Onroerend Erfgoed</dcterms:bibliographicCitation>
    <rdf:type rdf:resource="http://purl.org/dc/terms/BibliographicResource"/>
  </rdf:Description>
</rdf:RDF>

What exactly do you mean by adding a statement "collection member concept" and how does this fit into this content?

koenedaele commented 2 years ago

If you look at the UI, you can see that "markeringsbomen" is a member of the collection "houtige beplantingen naar functie" (ID 1605). But in that RDF file you posted, that information is not present, since there is no "skos:memberOf" property. If there was, we could write

<rdf:Description rdf:about="https://id.erfgoed.net/thesauri/erfgoedtypes/1621">
    <skos:memberOf rdf:resource="https://id.erfgoed.net/thesauri/erfgoedtypes/1605"/>
</rdf:Description>

But there's no such property. There is a skos:member property though, so we can say that 1621 is a member of 1605 by saying that 1605 has a member 1621:

<rdf:Description rdf:about="https://id.erfgoed.neet/thesauri/erfgoedtypes/1605">
    <skos:member rdf:resource="https://id.erfgoed.net/thesauri/erfgoedtypes/1621"/>
</rdf:Description>

It's a bit weird coming from a relation DB background, but in a Graph ecosystem it makes more sense and it's completely valid RDF. So, because there's no word to say that someone is somebody's child, we say that somebody is somebody's parent.

That's the bare minimum. To make it a bit more interesting, I added extra statements to the output about the type of 1605 (collection), it's identifier and that it's part of the same conceptscheme. All of these are optional, but easy for anyone reading the RDF and make it easier to put the above statement in context.