Skip to content

Commit

Permalink
Update metadata during build (#1001)
Browse files Browse the repository at this point in the history
* Insert placeholders

* Replace version and date placeholders

* add id for property generation via groovy and document it in the comments

* Remove version numbers from filenames

* Add release-body.md file

* Update the README and provided release body text file

---------

Co-authored-by: Steve Ray <steve@steveray.com>
  • Loading branch information
fkleedorfer and steveraysteveray authored Nov 14, 2024
1 parent 63ee96b commit b2abdab
Show file tree
Hide file tree
Showing 27 changed files with 12,524 additions and 15,042 deletions.
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
.gitattributes export-ignore
community export-ignore
docs export-ignore
schema/SCHEMA_QUDT-CITATION-v2.1.ttl export-ignore
schema/SCHEMA_QUDT-DATA-v2.1.ttl export-ignore
schema/SCHEMA_QUDT-CITATION.ttl export-ignore
schema/SCHEMA_QUDT-DATA.ttl export-ignore
submissions export-ignore
vocab/codes export-ignore
vocab/currency/VOCAB_QUDT-UNITS-CURRENCY-sDEPRECATED-v2.1.ttl export-ignore
vocab/currency/VOCAB_QUDT-UNITS-CURRENCY-sDEPRECATED.ttl export-ignore
vocab/disciplines export-ignore
vocab/nidr export-ignore
vocab/quantitykinds/to-be-deprecated-quantitykinds export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
with:
name: Latest snapshot release
tag_name: snapshot
body: Snapshot release triggered by an update of the main branch.
body_path: src/build/release/release-body.md
files: target/qudt-public-repo-*.zip
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: src/build/release/release-body.md
files: target/qudt-public-repo-*.zip

# Read version changelog
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project is in the process of adopting [Semantic Versioning](https://sem
### Changed

- Changed the name of the `collections` folder to `validation`.
- Remove all version suffixes from all source files, i.e., `-v2.1.ttl` becomes `.ttl`


### Fixed

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
QUDT - Quantities, Units, Dimensions and dataTypes - public repository
======================================================================

## Quick-Start Guide
There are three ways to bring the QUDT ontology into your environment.
1. Download the latest GitHub Release [here](https://github.com/qudt/qudt-public-repo/releases).
2. Use the resolved graph and instance URIs available [here](https://www.qudt.org/2.1/catalog/qudt-catalog.html).
3. Use GitHub pull to get the sources and build them using the instructions [here](https://github.com/qudt/qudt-public-repo#building).

Overview
--------

Expand All @@ -26,7 +32,7 @@ We encourage you to get involved. If you have particular needs or see errors, pl
Installation / Configuration instructions
-----------------------------------------

The QUDT ontology is provided in two forms: OWL and SHACL. By default, the vocabularies are configured to use the SHACL schema. To configure it to use the OWL schema instead, just make the following single change in the file schema/SHEMA-FACADE_QUDT-v2.1.ttl. You can see in the imports closure diagram above how all the vocabularies import this single "facade" file to make it easy to switch the ontology.
The QUDT ontology is provided in two forms: OWL and SHACL. By default, the vocabularies are configured to use the SHACL schema. To configure it to use the OWL schema instead, just make the following single change in the file schema/SDHEMA-FACADE_QUDT.ttl. You can see in the imports closure diagram above how all the vocabularies import this single "facade" file to make it easy to switch the ontology.

```
Change this line:
Expand Down Expand Up @@ -139,4 +145,4 @@ QUDT.org is a member of the World Wide Web Consortium (W3C)

Last updated by: Steve Ray (steve.ray@qudt.org)

Last updated: August 4, 2022
Last updated: November 14, 2024
127 changes: 103 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
The build is executed as a series of 'lifecycle phases': https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)
Each plugin has an <execution> section that binds its execution to a lifecycle phase. (or it has a default lifecycle phase in which it runs)
Here are the phases and the execution ids that are linked to them (executed in the order they appear in this file):
validate
validate defineAdditionalProperties, check-source-format
initialize delete-applicable-units, format-sources, copy-rdf, copy-docs, copy-root-files
generate-sources
process-sources replace-version-placeholder
Expand All @@ -60,30 +60,35 @@
deploy
-->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<id>replace-version-placeholder</id>
<phase>process-sources</phase>
<id>defineAdditionalProperties</id>
<phase>validate</phase>
<goals>
<goal>replace</goal>
<goal>execute</goal>
</goals>
<configuration>
<source>import java.time.OffsetDateTime
def majorMinorVersion = "${project.version}".replaceAll('^(\\w+.\\w+).*\$', '\$1')
project.properties.setProperty('project.version.majorminor', majorMinorVersion)
project.properties.setProperty('qudt.versioned.iri.prefix', "http://qudt.org/${majorMinorVersion}/")
def now = OffsetDateTime.now()
project.properties.setProperty('qudt.build.date', "${now}")
</source>
</configuration>
</execution>
</executions>
<configuration>
<basedir>target</basedir>
<includes>
<include>dist/**/*</include>
</includes>
<replacements>
<replacement>
<token>\$\$QUDT_VERSION\$\$</token>
<value>${project.version}</value>
</replacement>
</replacements>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.1.0-jre</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>io.github.qudtlib</groupId>
Expand Down Expand Up @@ -124,7 +129,7 @@
<validation>
<!--skip>true</skip-->
<shapes>
<include>target/dist/validation/COLLECTION_QUDT_QA_TESTS_ALL-v2.1.ttl</include>
<include>target/dist/validation/COLLECTION_QUDT_QA_TESTS_ALL.ttl</include>
</shapes>
<data>
<include>
Expand Down Expand Up @@ -154,15 +159,15 @@
<singleFile>
<input>
<include>
src/main/rdf/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL-v2.1.ttl
src/main/rdf/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL.ttl
</include>
</input>
<filters>
<exclude>
<predicate>qudt:applicableUnit</predicate>
</exclude>
</filters>
<outputFile>src/main/rdf/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL-v2.1.ttl</outputFile>
<outputFile>src/main/rdf/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL.ttl</outputFile>
</singleFile>
</products>
</configuration>
Expand All @@ -179,10 +184,10 @@
<input>
<include>
target/inferred/applicableUnits.ttl
target/dist/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL-v2.1.ttl
target/dist/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL.ttl
</include>
</input>
<outputFile>target/dist/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL-v2.1.ttl</outputFile>
<outputFile>target/dist/vocab/quantitykinds/VOCAB_QUDT-QUANTITY-KINDS-ALL.ttl</outputFile>
</singleFile>
</products>
</configuration>
Expand All @@ -200,6 +205,21 @@
<includes>
<include>src/main/rdf/**/*.ttl</include>
<include>src/build/inference/**/*.ttl</include>
</includes>
<format>
<failOnWarning>false</failOnWarning>
<verify>true</verify>
<turtleFormatterVersion>1.2.14</turtleFormatterVersion>
<turtle>
<predicateOrder>rdf:type,owl:imports</predicateOrder>
<firstPredicateInNewLine>true</firstPredicateInNewLine>
</turtle>
</format>
</rdf>
<rdf>
<!-- you can define as many formats as you want, each is independent -->
<!-- define the files to apply to -->
<includes>
<include>target/**/*.ttl</include>
</includes>
<format>
Expand All @@ -211,7 +231,65 @@
<firstPredicateInNewLine>true</firstPredicateInNewLine>
</turtle>
</format>
<replaceRegex>
<name>full version replacement</name>
<searchRegex>\$\$QUDT_VERSION\$\$</searchRegex>
<replacement>${project.version}</replacement>
</replaceRegex>
<replaceRegex>
<name>major.minor version replacement</name>
<searchRegex>\$\$QUDT_MAJOR_MINOR_VERSION\$\$</searchRegex>
<replacement>${project.version.majorminor}</replacement>
</replaceRegex>
<replace>
<name>publish date replacement</name>
<search>1234-12-12T12:34:56Z</search>
<replacement>${qudt.build.date}</replacement>
</replace>
<replaceRegex>
<name>versioned IRI replacement</name>
<searchRegex>http://qudt.org/\d+.\d+/</searchRegex>
<replacement>${qudt.versioned.iri.prefix}</replacement>
</replaceRegex>
</rdf>
<formats>
<format>
<includes>
<include>target/dist/**/*.*</include>
</includes>
<excludes>
<include>target/**/*.ttl</include>
<include>target/**/*.xlsx</include>
<include>target/**/*.xls</include>
<include>target/**/*.gif</include>
<include>target/**/*.zip</include>
<include>target/**/*.pdf</include>
<include>target/**/*.ppt</include>
<include>target/**/*.pptx</include>
</excludes>
<replaceRegex>
<name>full version replacement</name>
<searchRegex>\$\$QUDT_VERSION\$\$</searchRegex>
<replacement>${project.version}</replacement>
</replaceRegex>
<replaceRegex>
<name>major.minor version replacement</name>
<searchRegex>\$\$QUDT_MAJOR_MINOR_VERSION\$\$</searchRegex>
<replacement>${project.version.majorminor}</replacement>
</replaceRegex>
<replace>
<name>publish date replacement</name>
<search>1234-12-12T12:34:56Z</search>
<replacement>${qudt.build.date}</replacement>
</replace>
<replaceRegex>
<name>versioned IRI replacement</name>
<searchRegex>http://qudt.org/\d+.\d+/</searchRegex>
<replacement>${qudt.versioned.iri.prefix}</replacement>
</replaceRegex>
</format>
</formats>

<!-- define a language-specific format -->
</configuration>
<executions>
Expand Down Expand Up @@ -301,6 +379,7 @@
</execution>
</executions>
</plugin>

</plugins>
</build>
<profiles>
Expand Down
7 changes: 7 additions & 0 deletions src/build/release/release-body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Breaking Changes
With this Release, we have migrated to an automated release mechanism.
This includes reorganizing our directory structure.
Please read our updated README.md file (scroll to the bottom) for many of the details.

We hope this does not create too much of an incovenience. We invite you to submit GitHub Issues with any problems you encounter.

2 changes: 1 addition & 1 deletion src/main/rdf/community/extensions/loop3d/voc.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
owl:imports <http://www.w3.org/2004/02/skos/core> ;
dcterms:created "2020-12-04"^^xsd:date ;
dcterms:creator <https://orcid.org/0000-0002-8742-7730> ;
dcterms:modified "2020-12-04"^^xsd:date ;
dcterms:modified "1234-12-12T12:34:56Z"^^xsd:date ;
dcterms:publisher <http://qudt.org> ;
skos:definition "A vocabulary of Units from the QUDT ontology used by the Loop3D ontology."@en ;
skos:hasTopConcept unit:DEG ;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3615,7 +3615,7 @@ dtype:GMD_DTYPE
<http://qudt.org/schema/datatype/GMD_datatype>
a vaem:GraphMetaData ;
dcterms:description "The QUDT 'Datatype' ontology is a specification of scalar and structured data types. Scalar data types are defined for all the commonly encountered forms of numbers, characters and booleans, with their representations in a number of vendor and industry specific technologies. Structured data types cover arrays, lists, trees and many other forms of composite data elements. Specification of coordinate systems is also covered." ;
dcterms:modified "2024-10-26T12:12:23.149-04:00"^^xsd:dateTime ;
dcterms:modified "1234-12-12T12:34:56Z"^^xsd:dateTime ;
dcterms:rights "The QUDT Ontologies are issued under a Creative Commons Attribution 4.0 International License (CC BY 4.0), available at https://creativecommons.org/licenses/by/4.0/. Attribution should be made to QUDT.org" ;
dcterms:subject "Datatypes" ;
rdfs:label "QUDT Schema for Datatypes - Version $$QUDT_VERSION$$" ;
Expand All @@ -3631,7 +3631,7 @@ dtype:GMD_DTYPE
vaem:previousPublishedVersion "https://qudt.org/doc/2024/09/DOC_SCHEMA-DATATYPES-v2.1.html"^^xsd:anyURI ;
vaem:publishedDate "2017-05-10"^^xsd:date ;
vaem:releaseDate "2016-05-09"^^xsd:date ;
vaem:revision "2.1" ;
vaem:revision "$$QUDT_MAJOR_MINOR_VERSION$$" ;
vaem:title "QUDT Schema for Datatypes - Version $$QUDT_VERSION$$" ;
vaem:turtleFileURL "http://qudt.org/2.1/schema/datatype.ttl"^^xsd:anyURI ;
vaem:usesNonImportedResource dcterms:abstract ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3195,7 +3195,7 @@ vaem:GMD_QUDT-SCHEMA
<p class="lm-para">Except for unit prefixes, all units are specified in separate vocabularies. Descriptions are provided in both HTML and LaTeX formats. A quantity is a measure of an observable phenomenon, that, when associated with something, becomes a property of that thing; a particular object, event, or physical system. </p>
<p class="lm-para">A quantity has meaning in the context of a measurement (i.e. the thing measured, the measured value, the accuracy of measurement, etc.) whereas the underlying quantity kind is independent of any particular measurement. Thus, length is a quantity kind while the height of a rocket is a specific quantity of length; its magnitude that may be expressed in meters, feet, inches, etc. Or, as stated at Wikipedia, in the language of measurement, quantities are quantifiable aspects of the world, such as time, distance, velocity, mass, momentum, energy, and weight, and units are used to describe their measure. Many of these quantities are related to each other by various physical laws, and as a result the units of some of the quantities can be expressed as products (or ratios) of powers of other units (e.g., momentum is mass times velocity and velocity is measured in distance divided by time).</p>"""^^rdf:HTML ;
dcterms:modified "2024-10-26T12:11:04.059-04:00"^^xsd:dateTime ;
dcterms:modified "1234-12-12T12:34:56Z"^^xsd:dateTime ;
dcterms:rights """
This product includes all or a portion of the UCUM table, UCUM codes, and UCUM definitions or is derived from it, subject to a license from Regenstrief Institute, Inc. and The UCUM Organization. Your use of the UCUM table, UCUM codes, UCUM definitions also is subject to this license, a copy of which is available at ​http://unitsofmeasure.org. The current complete UCUM table, UCUM Specification are available for download at ​http://unitsofmeasure.org. The UCUM table and UCUM codes are copyright © 1995-2009, Regenstrief Institute, Inc. and the Unified Codes for Units of Measures (UCUM) Organization. All rights reserved.
Expand Down Expand Up @@ -3225,7 +3225,7 @@ THE UCUM TABLE (IN ALL FORMATS), UCUM DEFINITIONS, AND SPECIFICATION ARE PROVIDE
vaem:namespacePrefix "qudt" ;
vaem:owner "qudt.org" ;
vaem:previousPublishedVersion "https://qudt.org/doc/2024/09/DOC_SCHEMA-QUDT-v2.1.html"^^xsd:anyURI ;
vaem:revision "2.1" ;
vaem:revision "$$QUDT_MAJOR_MINOR_VERSION$$" ;
vaem:turtleFileURL "http://qudt.org/2.1/schema/qudt"^^xsd:anyURI ;
vaem:usesNonImportedResource dcterms:abstract ;
vaem:usesNonImportedResource dcterms:contributor ;
Expand Down
Loading

0 comments on commit b2abdab

Please sign in to comment.