-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cf5b7ca
Showing
107 changed files
with
21,251 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build on Java ${{ matrix.java-version }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java-version: [8] | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: ${{ matrix.java-version }} | ||
|
||
- name: Store or retrieve Gradle caches | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: ${{ runner.os }}-gradle- | ||
|
||
- name: Build and test | ||
run: ./gradlew check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout latest code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 8 | ||
|
||
- name: Cache Gradle Wrapper | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }} | ||
|
||
- name: Cache Gradle Caches | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: ${{ runner.os }}-gradle-cache | ||
|
||
- name: Get tag version | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
- name: Publish artifacts to GitHub Packages | ||
run: | | ||
echo "New version: ${{ steps.get_version.outputs.version-without-v }}" | ||
echo "Github username: ${GITHUB_ACTOR}" | ||
./gradlew -Pversion=${{ steps.get_version.outputs.version-without-v }} publish | ||
env: | ||
PROJECT_URL: ${{ github.event.repository.url }} | ||
MAVEN_PUBLISH_URL: https://maven.pkg.github.com/${{ github.repository }} | ||
MAVEN_PUBLISH_USERNAME: ${{ github.actor }} | ||
MAVEN_PUBLISH_PASSWORD: ${{ github.token }} | ||
|
||
- name: Release with Changelog | ||
uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: false | ||
title: "ONE.Record Ontology-Model Library ${{ steps.get_version.outputs.version }}" | ||
files: | | ||
build/libs/*.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/build/ | ||
*.iml | ||
.idea/ | ||
.gradle/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Copyright (c) 2021 Riege Software International GmbH, https://www.riege.com | ||
|
||
The Universal Permissive License (UPL), Version 1.0 | ||
|
||
Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both | ||
|
||
(a) the Software, and | ||
|
||
(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software (each a “Larger Work” to which the Software is contributed by such licensors), | ||
|
||
without restriction, including without limitation the rights to copy, create derivative works of, display, perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms. | ||
|
||
This license is subject to the following condition: | ||
|
||
The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# one-record-ontologymodel | ||
|
||
## Introduction | ||
|
||
This repository contains **Java POJO classes for IATA ONE Record** (1R), as per | ||
official IATA Ontology on GitHub at https://github.com/IATA-Cargo/ONE-Record. | ||
|
||
Note that the deliverable of this project contains POJO classes from the | ||
Ontologies for "API-Security" _and_ "Data-Model". | ||
|
||
This repository additionally contains some assisting classes e.g., | ||
in package `org.iata.cargo.codelists` which are not generated from the | ||
Ontology but might be useful for fields where values are limited to code | ||
lists. Please note the `codelists` packages are incomplete and do not | ||
mirror all cods from the Ontology. | ||
See also https://github.com/IATA-Cargo/ONE-Record/issues/92 for details about | ||
"Standard values of enumerations". | ||
|
||
## How to use / Dependencies | ||
|
||
This repository aims use the most minimal dependencies, therefore also `build.gradle` | ||
comes with disabled transitive dependency resolution. The declared project | ||
dependencies resolve the POJO annocations. | ||
|
||
See these examples about the POJOs used in projects: | ||
|
||
* https://github.com/riege/one-record-converter (using this library) | ||
* https://github.com/IATA-Cargo/one-record-server-java (original from IATA) | ||
|
||
## Used Ontology / Data model version | ||
|
||
In general, the official IATA Ontology determines the 1R data model. The IATA Ontology is available in various versions at GitHub. | ||
The IATA Cargo Operations and Technology Board (COTB, https://www.iata.org/en/programs/workgroups/cotb/) | ||
approved various Ontology versions. | ||
|
||
Ontologies prior version 1.1 | ||
(<a href="https://github.com/IATA-Cargo/ONE-Record/tree/master/June-2021-standard-COTB-endorsed">https://github.com/IATA-Cargo/ONE-Record/tree/master/June-2021-standard-COTB-endorsed</a>) | ||
have not been covered enought data fields required used by forwarders in the CargoIMP/XMP (X)FWB. | ||
|
||
This project aims to keeps it's releases and versioning in synchronization with the IATA Ontologies, starting with IATA ONE Record Ontology version 1.1. | ||
|
||
## Question and Feedback | ||
|
||
For any issues or questions with the ONE Record Ontology and data model as such, | ||
please refer to or create new issues with the IATA-Cargo project on GitHub under | ||
https://github.com/IATA-Cargo/ONE-Record/issues. | ||
|
||
## Generation from a new Ontology | ||
|
||
Generation of Java domain classes from the Ontology is part of the IATA Sandbox implementation, see https://github.com/IATA-Cargo/one-record-server-java/blob/master/README.md. | ||
|
||
Updating file `iata.ttl` in this project and applying step "Generate ONE Record cargo related data model" from the README generates the POJOs. | ||
|
||
It is recommended to remove directory `src/main/generated-sources/org/iata/cargo` prior generation. | ||
|
||
Example for generation from IATA-Cargo/one-record-server-java main directory on Linux/macOS with Ontology 1.1 (June 2021): | ||
|
||
rm -rf src/main/generated-sources/org/iata/cargo | ||
curl -o iata.ttl https://raw.githubusercontent.com/IATA-Cargo/ONE-Record/master/June-2021-standard-COTB-endorsed/Data-Model/IATA-1R-DM-Ontology-vCOTB-Jun2021.ttl | ||
mvn package -Dbuild=cargo | ||
|
||
Compile might fail now but ```src/main/generated-sources/org/iata/cargo``` contains the freshly generated POJO files which required adoption of annotations | ||
prior updating this the one-record-ontologymodel project with them. | ||
|
||
P.S.: As per 2021-Mar-18, the Ontology has various open issues which are likely to be adopted in upcoming versions e.g., https://github.com/IATA-Cargo/ONE-Record/issues/85 or https://github.com/IATA-Cargo/ONE-Record/issues/111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Developer internal info for release strategy | ||
|
||
This library project started with the "latest" working draft which was developed out of Ontology version 1.0. | ||
Therefore first release got tagged as `v1.0-workingdraft2021mar`. | ||
|
||
Further releases should follow the IATA versioning pattern of IATA approved ONE Record Ontogogies, e.g. `v1.1`. | ||
|
||
Prior a new release the project should be checked to generate javadoc without errors via | ||
|
||
./gradlew javadoc | ||
|
||
Reason is that the Ontology might contain characters which are invalid in Javadoc, e.g. the & character. | ||
|
||
A new release requires to be branched and tagged with `v<VERSIONNUMBER>`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
plugins { | ||
id 'java' | ||
id 'maven-publish' | ||
id 'idea' | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
|
||
group 'com.riege' | ||
version '1.1.0' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
configurations.all { | ||
// Disabling transitive resolution of dependencies | ||
// https://docs.gradle.org/current/userguide/resolution_rules.html#sec:disabling_resolution_transitive_dependencies | ||
transitive = false | ||
} | ||
|
||
dependencies { | ||
implementation "com.fasterxml.jackson.core:jackson-annotations:2.11.4" | ||
implementation "cz.cvut.kbss.jopa:jopa-api:0.16.5" | ||
implementation "net.sourceforge.owlapi:owlapi-api:5.1.17" | ||
implementation "org.apache.commons:commons-rdf-api:0.5.0" | ||
implementation "io.swagger:swagger-annotations:1.5.24" | ||
implementation "org.springframework.data:spring-data-mongodb:3.0.9.RELEASE" | ||
implementation "org.springframework.data:spring-data-commons:2.3.9.RELEASE" | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2' | ||
} | ||
|
||
java { | ||
withSourcesJar() // to get a "sourcesJar" task | ||
withJavadocJar() // to get a "javadocJar" task | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
from components.java | ||
pom { | ||
name = "Riege Software International ONE.Record Ontology-Model Library" | ||
url = System.getenv("PROJECT_URL") | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
url = System.getenv("MAVEN_PUBLISH_URL") | ||
credentials { | ||
username = System.getenv("MAVEN_PUBLISH_USERNAME") | ||
password = System.getenv("MAVEN_PUBLISH_PASSWORD") | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.