Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
name: Java CI
name: Verify

on: [push]
on:
push:
branches-ignore:
- main
- main-who

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
distribution: 'adopt'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
run: mvn --batch-mode package
26 changes: 0 additions & 26 deletions .github/workflows/pub.yaml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Release

on:
push:
branches:
- main
- main-who

jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.actor != 'protegeproject-bot[bot]' }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PROTEGEPROJECT_BOT_APP_ID }}
private-key: ${{ secrets.PROTEGEPROJECT_BOT_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: ${{ github.head_ref }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
gpg-private-key: ${{secrets.GPG_PRIVATE_KEY}}
gpg-passphrase: GPG_PASSPHRASE
- name: Get current version
id: get-version
run: |
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Current version: $current_version"
echo "::set-output name=current_version::$current_version"
- name: Bump version
id: bump
run: |
current_version=${{ steps.get-version.outputs.current_version }}
branch=${GITHUB_REF##*/}
echo "Current branch: $branch"

# Extract the base version without suffix
base_version=$(echo $current_version | sed -E 's/(-.*)?$//')

# Increment the base version (assuming semantic versioning)
IFS='.' read -r -a version_parts <<< "$base_version"
version_parts[2]=$((version_parts[2] + 1))
new_base_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}"

if [[ "$branch" == "main-who" ]]; then
new_version="${new_base_version}-WHO"
else
new_version="$new_base_version"
fi

echo "New version: $new_version"
mvn versions:set -DnewVersion=$new_version -DgenerateBackupPoms=false
echo "::set-output name=new_version::$new_version"
- name: Commit new version
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add pom.xml
git commit -m "Bump version to ${{ steps.bump.outputs.new_version }}"
git tag ${{ steps.bump.outputs.new_version }}
git push origin HEAD:${GITHUB_REF##*/}
git push origin ${{ steps.bump.outputs.new_version }}
- name: Build with Maven
run: mvn --batch-mode -Prelease deploy
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bump.outputs.new_version }}
generate_release_notes: true

env:
GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}}
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}}
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>edu.stanford.protege</groupId>
<artifactId>webprotege-entity-data</artifactId>
<version>0.9.4-SNAPSHOT</version>
<version>0.9.4</version>
<name>webprotege-entity-data</name>
<properties>
<java.version>16</java.version>
Expand Down Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>webprotege-common</artifactId>
<version>0.9.4</version>
<version>0.9.11</version>
</dependency>
<dependency>
<groupId>edu.stanford.protege</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import edu.stanford.protege.webprotege.common.DictionaryLanguage;
import edu.stanford.protege.webprotege.common.ShortForm;
import com.google.common.collect.*;
import edu.stanford.protege.webprotege.common.*;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLEntityVisitorEx;
Expand All @@ -32,19 +30,27 @@ public abstract class OWLClassData extends OWLEntityData {

public static OWLClassData get(@Nonnull OWLClass cls,
@Nonnull ImmutableMap<DictionaryLanguage, String> shortForms) {
return get(cls, shortForms, false);
return get(cls, shortForms, false, ImmutableSet.of());
}

public static OWLClassData get(@Nonnull OWLClass cls,
@Nonnull ImmutableMap<DictionaryLanguage, String> shortForms,
boolean deprecated) {
return get(cls, toShortFormList(shortForms), deprecated);
return get(cls, toShortFormList(shortForms), deprecated, ImmutableSet.of());
}

public static OWLClassData get(@Nonnull OWLClass cls,
@Nonnull ImmutableMap<DictionaryLanguage, String> shortForms,
boolean deprecated,
ImmutableSet<EntityStatus> statuses) {
return get(cls, toShortFormList(shortForms), deprecated, statuses);
}

public static OWLClassData get(@JsonProperty("entity") @Nonnull OWLClass cls,
@JsonProperty("shortForms") @Nonnull ImmutableList<ShortForm> shortForms,
@JsonProperty("deprecated") boolean deprecated) {
return new AutoValue_OWLClassData(shortForms, deprecated, cls);
@JsonProperty("deprecated") boolean deprecated,
@JsonProperty("statuses") ImmutableSet<EntityStatus> statuses) {
return new AutoValue_OWLClassData(shortForms, deprecated, cls, statuses);
}

/**
Expand All @@ -56,9 +62,14 @@ public static OWLClassData get(@JsonProperty("entity") @Nonnull OWLClass cls,
*/
@JsonCreator
protected static OWLClassData get(@JsonProperty("iri") @Nonnull String iri,
@JsonProperty(value = "shortForms") @Nullable ImmutableList<ShortForm> shortForms,
@JsonProperty("deprecated") boolean deprecated) {
return new AutoValue_OWLClassData(Objects.requireNonNullElse(shortForms, ImmutableList.of()), deprecated, new OWLClassImpl(IRI.create(iri)));
@JsonProperty(value = "shortForms") @Nullable ImmutableList<ShortForm> shortForms,
@JsonProperty("deprecated") boolean deprecated,
@JsonProperty("statuses") ImmutableSet<EntityStatus> statuses) {
return new AutoValue_OWLClassData(
Objects.requireNonNullElse(shortForms, ImmutableList.of()),
deprecated,
new OWLClassImpl(IRI.create(iri)),
Objects.requireNonNullElse(statuses, ImmutableSet.of()));
}

@JsonIgnore
Expand All @@ -85,6 +96,9 @@ public PrimitiveType getType() {
return PrimitiveType.CLASS;
}

@Nonnull
public abstract ImmutableSet<EntityStatus> getStatuses();

@Override
public <R, E extends Throwable> R accept(OWLPrimitiveDataVisitor<R, E> visitor) throws E {
return visitor.visit(this);
Expand Down