RDFLib / prez

Prez is a data-configurable Linked Data API framework that delivers profiles of Knowledge Graph data according to the Content Negotiation by Profile standard.
BSD 3-Clause "New" or "Revised" License
18 stars 7 forks source link

Missing reg-status and vocab-derivation-mode vocabularies #179

Closed edmondchuc closed 5 months ago

edmondchuc commented 7 months ago

These two vocabs are used for labeling and display of colours in the VocPrez system. These were originally added in this PR https://github.com/RDFLib/prez/pull/117 where on start-up, Prez would load the vocabs into the database.

These were then removed when we all agreed to have Prez be a read-only system to be consistent with its name and its purpose.

Since these two vocabularies are core to the display and functionality of VocPrez, we should ensure they exist in the Prez system and can be used as before.

https://github.com/RDFLib/prez/blob/aa2374116e897fe4606a8bebf3760a8c0003aeae/prez/reference_data/profiles/vocprez_default_profiles.ttl#L71

edmondchuc commented 7 months ago

Once this is fixed, notify GSQ and BGS of the new release.

edmondchuc commented 7 months ago

Workaround is to load the vocabularies into the database system. However, I don't think this should be the solution if Prez relies on the data being available.

recalcitrantsupplant commented 7 months ago
* Will this work if we add the two vocabularies to the [`prez/reference_data/context_ontologies`](https://github.com/RDFLib/prez/tree/main/prez/reference_data/context_ontologies)?

Yes that should be all that's required. The profiles are no longer used to define which annotation properties to look at. They're all searched for always based on what's in the pydantic base settings in config.py

I think the things to update are:

edmondchuc commented 7 months ago

Vocab reference data

hjohns commented 7 months ago

Add linked reference data/context ontologies folder, test the data - including reg-status and derivation mode.

lalewis1 commented 7 months ago

I converted and added the reg-status and vocab-derivation RDF to the prez > reference_data > context_ontologies folder, but it has no effect on the display of the reg and derivation status columns in prez-ui.

If the reg-status RDF is imported into the triple store (i.e. placed in the rdf folder and read in to pyoxigraph on startup) then the colors do appear in the reg-status column. The same does not apply for the vocab-derivations.

Notably clicking on the vocab derivations "subsetting-and-extension" label takes leads to a 404? maybe that is why this one is not working?

lalewis1 commented 7 months ago

Looks like Reg-status has the color values supplied in the RDF file. but vocab derivation modes do not.

reg statuses

:accepted a skos:Concept, reg:Status ;
    owl:sameAs reg:statusAccepted ;
    skos:prefLabel "accepted"@en;
    skos:definition "An entry that has been accepted for use and is visible in the default register listing. Includes entries that have seen been retired or superseded."@en;
    skos:topConceptOf cs: ;
    skos:inScheme cs: ;
    skos:topConceptOf cs: ;
    rdfs:isDefinedBy cs: ;
    sdo:color "#1bc13f" ;
.

vocab derivation modes


:subsetting-and-extension
    a skos:Concept ;
    dcterms:provenance "Created for the MER catalogue upgrade project, 2022"@en ;
    reg:status agldwgstatus:original ;
    rdfs:isDefinedBy cs: ;
    skos:definition "Derivation with subsetting and extension"@en ;
    skos:inScheme cs: ;
    skos:prefLabel "Subset & Extension"@en ;
    skos:scopeNote "Use this Concept if the reusing vocabulary both extends and subsets the original vocabulary" ;
    skos:broader
        :extension ,
        :subsetting ;
.

@edmondchuc @recalcitrantsupplant

Should I add in some color declarations? If so, what colors should I use.

edmondchuc commented 7 months ago

I don't think we need to add colours in for vocab derivation mode. We only ever had colours displayed for reg-statuses.

lalewis1 commented 7 months ago

oh, ok well then I think the issue is resolved now I will submit a pull request.

lalewis1 commented 7 months ago

@recalcitrantsupplant

So I realized that the profile tests were all failing now because the removal of this line

vocprez_default_profiles.ttl

    altr-ext:hasLabelPredicate skos:prefLabel ;

and I'm thinking I need to remove the prefLabel declarations from the tests expected data. i.e. so that the tests will pass.

                "@context": {
                    "iri": "@id",
                    "definition": "http://www.w3.org/2004/02/skos/core#definition",
                    "publisher": "http://purl.org/dc/terms/publisher",
                    "status": "http://purl.org/linked-data/registry#status",
                    "prefLabel": "http://www.w3.org/2004/02/skos/core#prefLabel",
                },

Does that sound reasonable? But also, why did I need to remove the hasLabelPredicate line in the first place?

lalewis1 commented 7 months ago

Talked to David, I should not remove prefLabel from the expected data. Thinking we need to change the vocprez_default_profiles so that prefLabels are still returned.

recalcitrantsupplant commented 7 months ago

Hey Lawson, I didn't manage to speak to Edmond regarding this, are you able to create a (new) minimal set of data (should be one or two triples) which tests this issue. The other annotations should be looked for for every uri in an initial response from the triplestore. So if your test data has x sdo:color y, it should get returned if the uri x is part of the initial response.

These tests will be useful even if the backend implementation changes.

lalewis1 commented 7 months ago

Tried adding sh:path skos:prefLabel to each nodeshape fact in the profile but that did not cause the prefLabel to be returned.

lalewis1 commented 5 months ago

completed, PR pending