From 62c3e7f3bc4166117ce8cc97d1d5c22863110db8 Mon Sep 17 00:00:00 2001 From: Lawson Lewis <151585421+lalewis1@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:48:50 +1000 Subject: [PATCH] fix for reg-status and voc-der-modes (#191) * changes to readme and add file for testing sparql endpoint. * Add support for the sparql endpoint on the pyoxigraph client. supports select, construct and ask. * integrate changes with updated fix from edmond * remove commented code and update base class sparql method signature * add tests for sparql endpoint * added reg status and vocab derivation modes needed for rendering colors in prez ui. might need to add some color declarations to the derivations. peding advice from david / edmond * add skos:prefLabel to vocprez default profiles. Davids recommendation to get the prefLabels returning. but it doesn't work so further changes required. * add prefLabel to all vocprez profiles. * still some failing tests * all tests passing --- .gitignore | 1 + .../context_ontologies/reg_statuses.nq | 167 ++++++++++++++++++ .../vocab_derivation_modes.nq | 86 +++++++++ .../profiles/vocprez_default_profiles.ttl | 21 ++- 4 files changed, 269 insertions(+), 6 deletions(-) create mode 100644 prez/reference_data/context_ontologies/reg_statuses.nq create mode 100644 prez/reference_data/context_ontologies/vocab_derivation_modes.nq diff --git a/.gitignore b/.gitignore index 02f11d33..331dca0c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ __pycache__/ .pytest_cache/ .env* !.env-template +rdf/ diff --git a/prez/reference_data/context_ontologies/reg_statuses.nq b/prez/reference_data/context_ontologies/reg_statuses.nq new file mode 100644 index 00000000..a7a7153e --- /dev/null +++ b/prez/reference_data/context_ontologies/reg_statuses.nq @@ -0,0 +1,167 @@ + "reg-status"@en . + . + . + . + "https://www.epimorphics.com"^^ . + . + . + . + "#ad5b24" . + "An entry that is not seen as having a reasonable measure of stability. This status is expected to be allocated to entries that were once Stable but have become Unstable, due to a management or technical mishap, rather than being allocated to resources before they become Stable. Those resources should be allocated Experimental."@en . + . + "#9b8d79" . + . + . + "Status"@en . + "experimental"@en . + . + . + "This vocabulary is a re-published and only marginally changed version of the Registry Ontology's (http://epimorphics.com/public/vocabulary/Registry.html) *Status* vocabulary (online in RDF: http://purl.org/linked-data/registry). The only real change to content has been the addition of the term `unstable`. This re-publication has been performed to allow the IRIs of each vocab term (skos:Concept) to resolve to both human-readable and machine-readable forms of content (HTML and RDF), using HTTP content negotiation.\n\nNote that just like the original form of this vocabulary, while it is a SKOS vocabulary implemented as a single skos:ConceptScheme, it is also an OWL Ontology and that each *Status* is both a skos:Concept and a reg:Status individual."@en . + "An entry that has been Retired or Superseded or has become Unstable and is no longer to be used."@en . + "#ad7624" . + . + . + . + . + "#248bad" . + . + "An entry which has been invalidated due to serious flaws, distinct from retrirement."@en . + "#2e8c09" . + . + "1.0 - 2018-06 - as per Registry Ontology original" . + . + . + . + "2018-07-23"^^ . + "2.0 - 2023-01 - addition of Concepts addition & original, as per updated Registry Item status codes" . + . + "addition"@en . + "#4ac11b" . + . + . + . + . + . + "An entry that is seen as having a reasonable measure of stability, may be used to mark the full adoption of a previously 'experimental' entry."@en . + "1.2 - 2021-11 - changes IRI to reg-statuses; added unstable" . + "superseded"@en . + "notAccepted"@en . + "Registry Status Vocabulary"@en . + . + . + "#36a80d" . + . + . + "(c) Commonwealth of Australia 2021"@en . + "An entry that has been accepted into the register temporarily and may be subject to change or withdrawal."@en . + "https://linked.data.gov.au/def/reg-status/"^^ . + . + "#ea3c2c" . + "An entry that should not be visible in the default register listing."@en . + "invalid"@en . + "An entry that has been accepted into the register and is deemed fit for use."@en . + . + . + . + "replaced"@en . + . + "provisional"@en . + . + "The item's status is stable and was supplied to the registry after initial creation"@en . + . + . + . + . + "2023-05-26"^^ . + . + "stable"@en . + . + . + "1.1 - 2020-06 - altered structure & metadata, not content, to conform to Vocab Publication Profile" . + . + . + . + . + . + "Epimorphics" . + "Australian Government Linked Data Working Group" . + . + . + . + "#678c09" . + . + . + "stable"@en . + . + . + . + "#38a30e" . + "A proposed entry which is not yet approved for use for use."@en . + . + . + "SURROUND Australia Pty Ltd" . + . + "#a86a0d" . + . + . + . + "deprecated"@en . + . + . + . + "#eae72c" . + "accepted"@en . + "#ea9e2c" . + "http://www.linked.data.gov.au"^^ . + . + "nicholas.car@surroundaustralia.com"^^ . + . + . + . + . + . + . + "Dr" . + . + . + "An entry that has been replaced by a new alternative which should be used instead."@en . + . + . + . + "submitted"@en . + . + . + "2.1 - 2023-05 - added colours" . + . + "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 . + "The item's status is stable and was supplied to the registry after initial creation."@en . + . + . + . + "Open set of status code for entries in a register"@en . + "https://surroundaustralia.com"^^ . + . + . + . + "Nicholas J. Car" . + . + . + . + . + "stable"@en . + "valid"@en . + . + . + "An entry that has been withdrawn from use."@en . + . + "reserved"@en . + . + . + "retired"@en . + "#1bc13f" . + . + . + "withdrawn"@en . + . + . + "A reserved entry allocated for some as yet undetermined future use."@en . diff --git a/prez/reference_data/context_ontologies/vocab_derivation_modes.nq b/prez/reference_data/context_ontologies/vocab_derivation_modes.nq new file mode 100644 index 00000000..8eaee2a0 --- /dev/null +++ b/prez/reference_data/context_ontologies/vocab_derivation_modes.nq @@ -0,0 +1,86 @@ + "Use this Concept if the reusing vocabulary extends the original vocabulary but does not subset it" . + . + . + "Vocabulary Derivation Modes"@en . + . + "2022-12-05"^^ . + . + . + . + . + . + . + "Derivation with extension"@en . + "Use this Concept if the reusing vocabulary both extends and subsets the original vocabulary" . + "Created for the MER catalogue upgrade project, 2022"@en . + . + . + . + . + . + "Derivation mode is not applicable to this vocabulary"@en . + . + . + "Created for the MER catalogue upgrade project, 2022"@en . + "Subsetting"@en . + "Use this Concept if the vocabulary is known not to reuse any other vocabularies" . + . + . + . + . + . + "Use this Concept if the vocabulary is known to not reuse any other vocabularies" . + . + . + . + . + "https://kurrawong.ai"^^ . + "Created for the MER catalogue upgrade project, 2022"@en . + . + . + . + "https://www.energymining.sa.gov.au/industry/geological-survey"^^ . + "Derivation with subsetting and extension"@en . + "Added to this vocabulary for multiple projects in 2023"@en . + . + "Not Applicable"@en . + "Use this Concept if the reusing vocabulary only subsets the original but does not extend it" . + "None"@en . + . + . + "Relabelling"@en . + . + "Direct"@en . + . + "Derivation with relabelling"@en . + . + . + "Extension"@en . + "SA Minerals and Energy Resources" . + "Created for the MER catalogue upgrade project, 2022"@en . + . + "Subset & Extension"@en . + "2023-05-22"^^ . + . + "Derivation without alteration"@en . + "Created for the MER catalogue upgrade project, 2022"@en . + . + "Created for the MER catalogue upgrade project, 2022"@en . + . + "Use this Concept if the reusing vocabulary only relabels Concepts in the original vocabulary but does not alter their place in the Concept hierarchy or their definitions" . + . + "2022-12-05"^^ . + "Derivation with subsetting"@en . + "This vocabulary does not derive from another"@en . + "Created for the MER catalogue upgrade project, 2022"@en . + . + . + . + "KurrawongAI" . + . + "The modes by which one vocabulary may derive from another"@en . + . + . + . + . + . diff --git a/prez/reference_data/profiles/vocprez_default_profiles.ttl b/prez/reference_data/profiles/vocprez_default_profiles.ttl index 86fc7372..837c68c6 100644 --- a/prez/reference_data/profiles/vocprez_default_profiles.ttl +++ b/prez/reference_data/profiles/vocprez_default_profiles.ttl @@ -25,22 +25,27 @@ prez:VocPrezProfile altr-ext:hasDefaultResourceFormat "text/anot+turtle" ; altr-ext:hasNodeShape [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass prez:SchemesList ; altr-ext:hasDefaultProfile ] , [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass prez:VocPrezCollectionList ; altr-ext:hasDefaultProfile ] , [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass skos:Collection ; altr-ext:hasDefaultProfile ] , [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass skos:Concept ; altr-ext:hasDefaultProfile ] , [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass skos:ConceptScheme ; altr-ext:hasDefaultProfile ] @@ -68,7 +73,6 @@ prez:VocPrezProfile dcterms:description "This is a profile of the taxonomy data model SKOS - i.e. SKOS with additional constraints." ; dcterms:identifier "vocpub"^^xsd:token ; dcterms:title "VocPub" ; - altr-ext:otherAnnotationProps schema:color, reg:status ; altr-ext:constrainsClass skos:ConceptScheme , skos:Concept , @@ -83,6 +87,7 @@ prez:VocPrezProfile "text/turtle" ; altr-ext:hasNodeShape [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass skos:ConceptScheme ; altr-ext:focusToChild skos:hasTopConcept ; ] ; @@ -93,11 +98,13 @@ prez:VocPrezProfile ] ; altr-ext:hasNodeShape [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass skos:ConceptScheme ; altr-ext:childToFocus skos:inScheme ; ] ; altr-ext:hasNodeShape [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass skos:ConceptScheme ; altr-ext:relativeProperties skos:broader , skos:narrower ; ] ; @@ -108,6 +115,7 @@ prez:VocPrezProfile ] ; altr-ext:hasNodeShape [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass prez:SchemesList ; sh:path dcterms:publisher, reg:status ; sh:sequencePath ( @@ -121,6 +129,7 @@ prez:VocPrezProfile ] ; altr-ext:hasNodeShape [ a sh:NodeShape ; + sh:path skos:prefLabel ; sh:targetClass prez:VocPrezCollectionList ; sh:path skos:definition ; ] ; @@ -153,30 +162,30 @@ prez:VocPrezProfile prez:VocPrezCollectionList , skos:ConceptScheme , skos:Collection ; - altr-ext:hasLabelPredicate skos:prefLabel ; altr-ext:hasNodeShape [ a sh:NodeShape ; sh:targetClass skos:ConceptScheme ; altr-ext:childToFocus skos:inScheme ; - altr-ext:relativeProperties skos:broader ; + altr-ext:relativeProperties skos:broader, skos:prefLabel ; ] ; altr-ext:hasNodeShape [ a sh:NodeShape ; + sh:path rdf:type ; sh:targetClass skos:Collection ; altr-ext:focusToChild skos:member ; - altr-ext:relativeProperties skos:definition ; + altr-ext:relativeProperties skos:definition, skos:prefLabel ; ] ; altr-ext:hasNodeShape [ a sh:NodeShape ; sh:targetClass prez:SchemesList ; altr-ext:containerClass skos:ConceptScheme ; - altr-ext:relativeProperties skos:definition, dcterms:publisher, reg:status ; + altr-ext:relativeProperties skos:definition, dcterms:publisher, reg:status, skos:prefLabel ; ] ; altr-ext:hasNodeShape [ a sh:NodeShape ; sh:targetClass prez:VocPrezCollectionList ; altr-ext:containerClass skos:Collection ; - altr-ext:relativeProperties skos:definition, dcterms:publisher, reg:status ; + altr-ext:relativeProperties skos:definition, dcterms:publisher, reg:status, skos:prefLabel; ] ; altr-ext:hasDefaultResourceFormat "application/json" ; altr-ext:hasResourceFormat