Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/semantic versioning uris #220

Merged
merged 11 commits into from
Dec 6, 2023
Merged

Conversation

ccamel
Copy link
Member

@ccamel ccamel commented Dec 5, 2023

This PR addresses issue #216 (and part #215) and brings a new workflow for ontology publication to Github Pages.

Here's the idea:

build process:

  • A version file holds the ontology's last released semantic version (e.g., 2.0.0).
  • URIs within the OKP4 ontology include a placeholder for the major version, like https://w3id.org/okp4/ontology/v$major/....
  • During the build process (make build), the source files of the ontology undergo processing. The placeholder $major is replaced with the major version from the version file. The processed files are then stored in the ./target/ontology/v$major directory.

release process

  • Update the version file to reflect the new semantic version.
  • Execute a build of the ontology (make build).
  • Commit the change, tag the branch, etc.
  • Publish the newly built assets.

publishing to GitHub Pages

  • For non-tagged publications, the version is bumped to next.
  • The ontology undergoes a build process (make build).
  • The contents of the ./target/ontology/ directory are copied to the gh-pages branch so that the ontology sources become resolvable using the URI: https://ontology.okp4.space/v<major>/<path>.

Summary by CodeRabbit

  • New Features

    • Implemented ontology versioning, adopting Semantic Versioning and incorporating major version numbers into URIs.
    • Added a search functionality with a new search bar in the app interface.
    • Introduced a GitHub Actions workflow for automated publishing to GitHub Pages.
    • Added a version target in the Makefile for displaying the current version.
  • Documentation

    • Updated README.md with a new section on "Ontology versioning" and development target instructions.
  • Refactor

    • Updated RDF/Turtle files to include version identifiers in URIs, reflecting ontology versioning changes.
  • Chores

    • Configured semantic-release to replace version numbers in files during the release process.
    • Modified Makefile to parse version from a file and include it in file names and directory paths.

Copy link
Contributor

coderabbitai bot commented Dec 5, 2023

Walkthrough

The changes introduce versioning to the ontology URIs, ensuring stability and compatibility across updates. A new GitHub Actions workflow for publishing to GitHub Pages is added, and the Makefile, README, and .releaserc.yml are updated to reflect the versioning changes. RDF/Turtle files are modified to include the major version number in their URIs, aligning with the Semantic Versioning strategy.

Changes

File Pattern Change Summary
.github/workflows/publish.yml,
.releaserc.yml,
Makefile,
README.md
Added GitHub Actions workflow for publishing to GitHub Pages. Added @google/semantic-release-replace-plugin for version management. Updated Makefile to parse version, modify destination directories, and add version target. Added "Ontology versioning" section and version target under "Misc" in README.
src/schema/.../*.ttl,
src/thesaurus/.../*.ttl
Updated RDF/Turtle files to include $major version in URIs. Modified RDF ontology declarations to include $major version in URIs.
version Added a new version file with 2.0.0.

Related issues

Poem

In the land of code, where versions reign,
A rabbit hopped, leaving a Semantic trail.
With each major leap, URIs gain,
A stable path, through the digital vale. 🐇💾✨


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@ccamel ccamel force-pushed the refactor/semantic-versioning-uris branch from 36321fc to fb9b7f8 Compare December 5, 2023 19:09
@ccamel ccamel requested a review from amimart December 5, 2023 19:21
@ccamel ccamel self-assigned this Dec 5, 2023
@ccamel ccamel marked this pull request as ready for review December 5, 2023 19:22
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f0a5291 and fb9b7f8.
Files selected for processing (20)
  • .github/workflows/publish.yml (1 hunks)
  • .releaserc.yml (1 hunks)
  • Makefile (3 hunks)
  • README.md (2 hunks)
  • src/schema/digital-resource/credential-dataset-description.ttl (1 hunks)
  • src/schema/digital-resource/credential-digital-resource-declaration.ttl (1 hunks)
  • src/schema/digital-resource/credential-digital-resource-rights.ttl (2 hunks)
  • src/schema/digital-service/credential-digital-service-declaration.ttl (1 hunks)
  • src/schema/digital-service/credential-digital-service-description.ttl (1 hunks)
  • src/schema/digital-service/credential-digital-service-execution-order.ttl (1 hunks)
  • src/schema/digital-service/credential-digital-service-execution-result.ttl (2 hunks)
  • src/schema/governance/credential-governance-text.ttl (1 hunks)
  • src/schema/zone/credential-zone-declaration.ttl (1 hunks)
  • src/schema/zone/credential-zone-description.ttl (1 hunks)
  • src/thesaurus/area-code.ttl (141 hunks)
  • src/thesaurus/digital-service-category.ttl (2 hunks)
  • src/thesaurus/digital-service-execution-status.ttl (1 hunks)
  • src/thesaurus/license.ttl (3 hunks)
  • src/thesaurus/topic.ttl (1 hunks)
  • version (1 hunks)
Files not summarized due to errors (1)
  • src/thesaurus/area-code.ttl: Error: Message exceeds token limit
Files skipped from review due to trivial changes (6)
  • .github/workflows/publish.yml
  • src/schema/digital-resource/credential-digital-resource-declaration.ttl
  • src/schema/digital-service/credential-digital-service-declaration.ttl
  • src/schema/governance/credential-governance-text.ttl
  • src/thesaurus/license.ttl
  • version
Additional comments: 22
.releaserc.yml (1)
  • 9-25: The addition of the @google/semantic-release-replace-plugin plugin to the .releaserc.yml file is correctly configured to replace the version number in the version file with the next release version. Ensure that the version file is correctly formatted to match the from regex pattern ^.+$ and that the build process correctly incorporates this version number where needed.
Makefile (4)
  • 34-37: The extraction of version components from the version file is implemented correctly and aligns with the PR objectives to incorporate semantic versioning.

  • 43-43: The destination directory for ontology files now includes the major version number, which is consistent with the PR objectives for version-specific directory structure.

  • 148-148: The use of sed to replace the $major placeholder with the actual major version number during the build process is correctly implemented.

  • 328-328: The addition of the version phony target to display the current version is a useful feature for developers.

README.md (2)
  • 79-94: The addition of the "Ontology versioning" section provides clear documentation on the importance of URI and content stability, and the adoption of Semantic Versioning in the ontology's URI structure. This aligns with the PR objectives and enhances the understanding of the versioning system for users and contributors.

  • 197-200: The addition of the version target under the "Misc" section in the development targets is a practical update that supports the new versioning workflow, allowing users to easily check the current version of the ontology. This is a useful addition for maintainability and clarity.

src/schema/digital-resource/credential-dataset-description.ttl (1)
  • 4-6: The changes to the : and thesaurus prefixes to include the $major version identifier are consistent with the PR objectives to incorporate semantic versioning into the ontology URIs.
src/schema/digital-resource/credential-digital-resource-rights.ttl (3)
  • 1-4: The update to the @prefix declaration to include the version identifier v$major is consistent with the PR objectives to incorporate semantic versioning into the ontology URIs.

  • 29-32: The update to the schema:rangeIncludes for :hasLicense to reference the updated ontology version is consistent with the PR objectives to ensure that ontology URIs reflect the correct version.

  • 3-3: Ensure that the placeholder $major is correctly replaced with the actual major version number during the build process as intended in the PR objectives.

src/schema/digital-service/credential-digital-service-description.ttl (1)
  • 4-6: The introduction of the $major placeholder in the URIs is consistent with the PR objectives to incorporate semantic versioning into the ontology URIs. Ensure that the build process is correctly configured to replace this placeholder with the actual major version number.
src/schema/digital-service/credential-digital-service-execution-order.ttl (1)
  • 4-4: The update to the prefix declaration to include a version identifier v$major is consistent with the PR objectives to incorporate semantic versioning into the ontology URIs. Ensure that the build process correctly replaces the $major placeholder with the actual major version number.
src/schema/digital-service/credential-digital-service-execution-result.ttl (2)
  • 1-5: The modifications to the @prefix declarations to include the version identifier v$major are consistent with the PR objectives to implement semantic versioning in the ontology URIs.

  • 33-33: The update to the schema:rangeIncludes statement to reference the versioned ontology URI is in line with the PR objectives and ensures that the ontology URIs reflect the correct version.

src/schema/zone/credential-zone-declaration.ttl (1)
  • 3-3: The namespace prefix has been correctly updated to include the version placeholder v$major. Ensure that the build process is properly configured to replace this placeholder with the actual version number.
src/schema/zone/credential-zone-description.ttl (1)
  • 4-6: The changes to the @prefix declarations to include the version identifier v$major are consistent with the PR objectives to incorporate semantic versioning into the ontology URIs. Ensure that the build process is correctly configured to replace the $major placeholder with the actual major version number.
src/thesaurus/area-code.ttl (1)
  • 2631-2634: The rdfs:seeAlso property is correctly used to provide additional information about the concept scheme.
src/thesaurus/digital-service-category.ttl (1)
  • 1-46: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [1-100]

The changes to the URIs in the RDF/Turtle file are consistent with the PR objectives and summaries, systematically incorporating the version placeholder $major. Ensure that the build process correctly replaces this placeholder with the actual version number. No syntax errors or typos are present, and the labels and descriptions remain unchanged. Consumers of the ontology will need to be aware of the versioning scheme to correctly resolve the URIs.

src/thesaurus/digital-service-execution-status.ttl (2)
  • 3-3: The update to the @prefix declaration to include a version identifier v$major aligns with the PR objectives to incorporate semantic versioning into the ontology URIs. Ensure that the build process correctly replaces the $major placeholder with the actual version number.

  • 7-21: The skos:inScheme predicates have been consistently updated across the ontology file to include the version identifier v$major. This systematic change is crucial for the stability and resolvability of the ontology resources. Ensure that all dependent systems are updated to handle these versioned URIs.

src/thesaurus/topic.ttl (1)
  • 3-70: The changes to the URIs in the Turtle file are consistent with the PR objectives to incorporate semantic versioning. The placeholder $major has been introduced correctly in all instances where versioning is required.

src/thesaurus/area-code.ttl Show resolved Hide resolved
src/thesaurus/area-code.ttl Show resolved Hide resolved
src/thesaurus/area-code.ttl Show resolved Hide resolved
@ccamel ccamel force-pushed the refactor/semantic-versioning-uris branch from b6bd79c to 7d7803a Compare December 6, 2023 08:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fb9b7f8 and 7d7803a.
Files selected for processing (3)
  • .releaserc.yml (1 hunks)
  • Makefile (4 hunks)
  • README.md (3 hunks)
Files skipped from review due to trivial changes (1)
  • .releaserc.yml
Additional comments: 7
Makefile (4)
  • 34-43: The version constants and destination directories have been updated to include the major version component, which aligns with the PR objectives to incorporate semantic versioning into the ontology URIs. This change will ensure that the built ontology files are stored in a version-specific directory structure.

  • 54-61: The binary file names have been updated to include the full version number, which is consistent with the PR objectives and ensures that the built assets are clearly identifiable by their version.

  • 145-148: The sed command added here is used to replace the $major placeholder with the actual major version number during the build process. This is a critical part of the new workflow to incorporate semantic versioning into the ontology URIs. Ensure that the placeholder $major is consistently used across all ontology files that require versioning.

  • 326-328: The addition of the version target to display the current version is a good practice for debugging and verification purposes. It allows developers to quickly check the current version of the ontology being used.

README.md (3)
  • 81-94: The addition of the ontology versioning section is clear and aligns with the PR objectives to incorporate semantic versioning into the ontology URIs.

  • 115-121: The updated file structure with versioned filenames is consistent with the PR objectives to store processed ontology files in a version-specific directory structure.

  • 197-203: The addition of the version target in the Makefile is consistent with the PR objectives to update the version file for new releases and rebuilding the ontology.

Makefile Outdated Show resolved Hide resolved
@ccamel ccamel force-pushed the refactor/semantic-versioning-uris branch from 7d7803a to a03e073 Compare December 6, 2023 08:58
@ccamel
Copy link
Member Author

ccamel commented Dec 6, 2023

@coderabbitai pause

Copy link
Contributor

coderabbitai bot commented Dec 6, 2023

This is an invalid command. Please refer to the list of valid keywords below.

CodeRabbit Commands
  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a03e073 and dfd17c6.
Files selected for processing (1)
  • Makefile (10 hunks)
Additional comments: 12
Makefile (12)
  • 34-37: The implementation of version constants is correct and aligns with the PR objectives to incorporate semantic versioning.

  • 43-43: The destination directory DST_ONT correctly includes the major version component, ensuring that processed ontology files are stored in a version-specific directory structure.

  • 57-61: The binary file names have been correctly updated to include the full version number, which is consistent with the PR objectives.

  • 151-151: The sed command correctly replaces the $major placeholder with the actual major version number during the build process, as per the PR objectives.

  • 329-331: The new version target has been added to display the current version, which is a useful addition for maintainability and version tracking.

  • 78-79: The SED_FLAG variable is set up to handle the differences between GNU sed and BSD sed (macOS), which is a good practice for cross-platform compatibility.

  • 192-198: The tar command in the build-ontology-bundle target correctly packages the ontology files into a versioned tarball, which is part of the new publishing workflow.

  • 207-213: The formatting target for Turtle files is correctly implemented and will help maintain code quality.

  • 222-227: The linting target for Turtle files is correctly implemented and will help ensure the ontology adheres to best practices.

  • 238-243: The testing target for Turtle files is correctly implemented and will help ensure the ontology's correctness.

  • 303-307: The caching mechanism for the owl-cli jar file is correctly implemented, which will improve build efficiency.

  • 319-323: The check target is correctly implemented to ensure all required commands are available before proceeding with the build, which is a good practice for build reliability.

@ccamel ccamel force-pushed the refactor/semantic-versioning-uris branch from dfd17c6 to 1efa6b4 Compare December 6, 2023 13:01
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a03e073 and 1efa6b4.
Files selected for processing (1)
  • Makefile (10 hunks)
Additional comments: 7
Makefile (7)
  • 34-37: The implementation of version constants from a version file is correct and follows best practices for maintainability and modularity.

  • 43-43: The inclusion of the major version number in the DST_ONT directory path aligns with the PR's objective to incorporate semantic versioning into the ontology's URI structure.

  • 57-61: The binary file names now include the full version number, which is consistent with the PR's goal of versioning the ontology artifacts.

  • 151-151: The sed command used to replace the placeholder with the major version number in ontology files is correct, but ensure that the placeholder $$major is consistently used across all ontology files.

  • 329-331: The addition of the version target to display the current version is a good practice for quick reference and debugging.

  • 78-79: The SED_FLAG variable is set up to handle differences in sed command syntax between macOS and other operating systems. This is a good practice for cross-platform compatibility.

  • 303-307: The wget command in the cache target correctly fetches the owl-cli jar file. However, ensure that the VERSION_OWL_CLI variable is kept up-to-date with the latest version of owl-cli to avoid potential issues with outdated tools.

Makefile Outdated Show resolved Hide resolved
@ccamel ccamel force-pushed the refactor/semantic-versioning-uris branch from 1efa6b4 to 8fea59d Compare December 6, 2023 13:10
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a03e073 and 8fea59d.
Files selected for processing (1)
  • Makefile (10 hunks)
Additional comments: 11
Makefile (11)
  • 34-37: The implementation of version parsing from a file and splitting into major, minor, and patch components is correct and aligns with the PR objectives.

  • 43-43: The modification of the DST_ONT directory to include the major version component is consistent with the PR's goal of incorporating semantic versioning into directory structures.

  • 57-61: The binary file names now include the version number, which is a good practice for version tracking and aligns with the PR objectives.

  • 75-75: The parameterization of the permission mode for directory creation is a good practice for maintainability and flexibility.

  • 151-151: The use of sed to replace a placeholder with the major version in ontology files is consistent with the PR's goal of updating URIs to include version information.

  • 193-196: The creation of a tarball that includes the ontology in all available formats and the LICENSE file is a good practice for distribution.

  • 211-212: The formatting step for Turtle files using RDF_WRITE is correct and ensures consistent code style.

  • 226-226: Linting Turtle files using the DOCKER_IMAGE_RUBY_RDF image is correct and ensures ontology files adhere to best practices.

  • 242-242: The testing step for ontology files using RDF_SHACL is correct and ensures the ontology conforms to its SHACL shapes.

  • 307-307: The download step for the owl-cli jar file is correct and ensures the required tool is available for ontology processing.

  • 331-331: The version target correctly displays the current version, which is useful for verification and debugging.

Copy link
Member

@amimart amimart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's pray the release process will work 🙏

@ccamel ccamel merged commit bbdf066 into main Dec 6, 2023
7 checks passed
@ccamel ccamel deleted the refactor/semantic-versioning-uris branch December 6, 2023 14:14
@bot-anik
Copy link
Member

bot-anik commented Mar 5, 2024

🎉 This PR is included in version 3.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants