From cc2fb477e90743519bd10f8bb997299676f907b0 Mon Sep 17 00:00:00 2001 From: tucotuco Date: Sat, 7 Aug 2021 20:21:30 -0300 Subject: [PATCH] Removed dependence of QRG build script on fictitious UseWithIRI class. --- build/build.py | 18 +++++++++++++++++- vocabulary/term_versions.csv | 1 - 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/build/build.py b/build/build.py index fe2f047..9d0cf5f 100644 --- a/build/build.py +++ b/build/build.py @@ -212,16 +212,32 @@ class DwcDigester(object): class_group["terms"] = [] class_group["namespace"] = None + addedUseWithIRI = False for term in self.versions(): # sequence of the terms file used as order term_data = self.get_term_definition(term['term_iri']) - # new class encountered + test = term['term_iri'] + print(f'{test=}') if term_data["rdf_type"] == "http://www.w3.org/2000/01/rdf-schema#Class": + # new class encountered # store previous section in template_data template_data.append(class_group) #start new class group class_group = term_data class_group["terms"] = [] in_class = term_data["label"] # check on the class working in + elif term['term_iri']=='http://purl.org/dc/terms/language': + # Vulnerable to ordering terms in term_versions.csv, but... + # This is the first row of dwciri terms + # store previous section in template_data + print(f'{term=}\n{term_data=}') + template_data.append(class_group) + #start a class group for UseWithIRI + class_group = {"label":"UseWithIRI"} + class_group["terms"] = [] + in_class = "UseWithIRI" # check on the class working in + addedUseWithIRI = True + class_group['terms'].append(term_data) + print(f'{class_group=}') else: class_group['terms'].append(term_data) # save the last class to template_data diff --git a/vocabulary/term_versions.csv b/vocabulary/term_versions.csv index 54409d8..789a339 100644 --- a/vocabulary/term_versions.csv +++ b/vocabulary/term_versions.csv @@ -205,7 +205,6 @@ http://rs.tdwg.org/dwc/terms/version/relationshipOfResource-2021-07-15,relations http://rs.tdwg.org/dwc/terms/version/relationshipAccordingTo-2018-09-06,relationshipAccordingTo,Relationship According To,"The source (person, organization, publication, reference) establishing the relationship between the two resources.",,`Julie Woodruff`,http://rs.tdwg.org/dwc/terms/ResourceRelationship,2018-09-06,recommended,http://rs.tdwg.org/dwc/terms/version/relationshipAccordingTo-2017-10-06,http://www.w3.org/1999/02/22-rdf-syntax-ns#Property,http://rs.tdwg.org/dwc/terms/relationshipAccordingTo,not in ABCD,extension http://rs.tdwg.org/dwc/terms/version/relationshipEstablishedDate-2020-08-12,relationshipEstablishedDate,Relationship Established Date,The date-time on which the relationship between the two resources was established.,Recommended best practice is to use a date that conforms to ISO 8601-1:2019.,`1963-03-08T14:07-0600` (8 Mar 1963 at 2:07pm in the time zone six hours earlier than UTC). `2009-02-20T08:40Z` (20 February 2009 8:40am UTC). `2018-08-29T15:19` (3:19pm local time on 29 August 2018). `1809-02-12` (some time during 12 February 1809). `1906-06` (some time in June 1906). `1971` (some time in the year 1971). `2007-03-01T13:00:00Z/2008-05-11T15:30:00Z` (some time during the interval between 1 March 2007 1pm UTC and 11 May 2008 3:30pm UTC). `1900/1909` (some time during the interval between the beginning of the year 1900 and the end of the year 1909). `2007-11-13/15` (some time in the interval between 13 November 2007 and 15 November 2007).,http://rs.tdwg.org/dwc/terms/ResourceRelationship,2020-08-12,recommended,http://rs.tdwg.org/dwc/terms/version/relationshipEstablishedDate-2018-09-06,http://www.w3.org/1999/02/22-rdf-syntax-ns#Property,http://rs.tdwg.org/dwc/terms/relationshipEstablishedDate,not in ABCD,extension http://rs.tdwg.org/dwc/terms/version/relationshipRemarks-2018-09-06,relationshipRemarks,Relationship Remarks,Comments or notes about the relationship between the two resources.,,"`mother and offspring collected from the same nest`, `pollinator captured in the act`",http://rs.tdwg.org/dwc/terms/ResourceRelationship,2018-09-06,recommended,http://rs.tdwg.org/dwc/terms/version/relationshipRemarks-2017-10-06,http://www.w3.org/1999/02/22-rdf-syntax-ns#Property,http://rs.tdwg.org/dwc/terms/relationshipRemarks,DataSets/DataSet/Units/Unit/Associations/UnitAssociation/Comments,extension -http://rs.tdwg.org/dwc/terms/attributes/UseWithIRI-2017-10-06,UseWithIRI,UseWithIRI,The category of terms that are recommended to have an IRI as a value.,A utility class to organize the dwciri: terms.,,http://www.w3.org/2000/01/rdf-schema#Class,2017-10-06,recommended,,http://www.w3.org/2000/01/rdf-schema#Class,http://rs.tdwg.org/dwc/terms/attributes/UseWithIRI,not in ABCD, http://dublincore.org/usage/terms/history/#languageT-001,language,Language,A language of the resource.,Recommended best practice is to use an IRI from the Library of Congress ISO 639-2 scheme http://id.loc.gov/vocabulary/iso639-2,,http://purl.org/dc/terms/,2008-01-14,recommended,,http://www.w3.org/1999/02/22-rdf-syntax-ns#Property,http://purl.org/dc/terms/language,not in ABCD, http://rs.tdwg.org/dwc/iri/version/inDescribedPlace-2015-03-27,inDescribedPlace,In Described Place,Use to link a dcterms:Location instance subject to the lowest level standardized hierarchically-described resource.,"Recommended best practice is to use an IRI from a controlled registry. A ""convenience property"" that replaces Darwin Core literal-value terms related to locations. See Section 2.7.5 of the Darwin Core RDF Guide for details.",`http://vocab.getty.edu/tgn/1019987`,http://rs.tdwg.org/dwc/terms/attributes/UseWithIRI,2015-03-27,recommended,,http://www.w3.org/1999/02/22-rdf-syntax-ns#Property,http://rs.tdwg.org/dwc/iri/inDescribedPlace,not in ABCD, http://rs.tdwg.org/dwc/iri/version/identifiedBy-2015-03-27,identifiedBy,Identified By (IRI),"A person, group, or organization who assigned the Taxon to the subject.",Terms in the dwciri namespace are intended to be used in RDF with non-literal objects.,,http://rs.tdwg.org/dwc/terms/attributes/UseWithIRI,2015-03-27,recommended,,http://www.w3.org/1999/02/22-rdf-syntax-ns#Property,http://rs.tdwg.org/dwc/iri/identifiedBy,not in ABCD,