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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ '11' ]
java: [ '17' ]
os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ '11' ]
java: [ '17' ]
os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ]
steps:
- name: Checkout code
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Setup java
uses: actions/setup-java@v2
with:
java-version: 11
java-version: 17
distribution: 'temurin'
- name: Publish jars
run: ./gradlew publish
Expand Down
69 changes: 57 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ Based on the latest version of the [SDMX 3.0 Specifications](https://sdmx.org/?p
statistical data and metadata among international organizations, central banks, and national statistical institutes.

## Packages
- `sdmx30-infomodel` module contains java classes which represent SDMX 3.0 Information Model (Structure Artifacts) such as Data Structure Definitions (DSDs), Metadata Structure Definitions (MSDs), Code Lists, Concept Schemes, and Data and Metadata flows and others.
- `sdmx30-infomodel` module contains java classes which represent SDMX 3.0 Information Model (Structure Artifacts) such as Data Structure Definitions (DSDs), Metadata Structure Definitions (MSDs), Code Lists, Concept Schemes, and Data and Metadata flows and others.
- `sdmx-json10` module providing serialization to JSON 1.0 format for SDMX 2.1
- `sdmx-json20` module providing serialization to JSON 2.0 format for SDMX 3.0
- `sdmx-ml21` module providing serialization to ML 2.1 format for SDMX 2.1
- `sdmx-ml30` module providing serialization to ML 3.0 format for SDMX 3.0

## Roadmap

The following modules are currently on project's roadmap for 2023:
- `sdmx30-serialization` module providing (de)serialization to SDMX-JSON, SDMX-ML and SDMX-CSV formats for data and metadata.
- `sdmx30-reporting` module with models describing to Data and Metadata Reporting.
- `sdmx30-client` REST client for SDMX registry.

Listed above is a subject for extension and other modules might be implemented as well.

## Requirements

- Java JDK 11 and higher
- Java JDK 17 and higher

## Installation

Expand All @@ -28,11 +24,60 @@ Listed above is a subject for extension and other modules might be implemented a
<dependency>
<groupId>com.epam.jsdmx</groupId>
<artifactId>sdmx30-infomodel</artifactId>
<version>1.0.0</version>
<version>2.0.0</version>
</dependency>

#### Gradle:
compile(group: 'com.epam.jsdmx', name: 'sdmx30-infomodel', version: '2.0.0')

### sdmx-json10

#### Maven:
<dependency>
<groupId>com.epam.jsdmx</groupId>
<artifactId>sdmx-json10</artifactId>
<version>2.0.0</version>
</dependency>

#### Gradle:
compile(group: 'com.epam.jsdmx', name: 'sdmx-json10', version: '2.0.0')

### sdmx-json20

#### Maven:
<dependency>
<groupId>com.epam.jsdmx</groupId>
<artifactId>sdmx-json20</artifactId>
<version>2.0.0</version>
</dependency>

#### Gradle:
compile(group: 'com.epam.jsdmx', name: 'sdmx-json20', version: '2.0.0')

### sdmx-ml21

#### Maven:
<dependency>
<groupId>com.epam.jsdmx</groupId>
<artifactId>sdmx-ml21</artifactId>
<version>2.0.0</version>
</dependency>

#### Gradle:
compile(group: 'com.epam.jsdmx', name: 'sdmx-ml21', version: '2.0.0')


### sdmx-ml30

#### Maven:
<dependency>
<groupId>com.epam.jsdmx</groupId>
<artifactId>sdmx-ml30</artifactId>
<version>2.0.0</version>
</dependency>

#### Gradle:
compile(group: 'com.epam.jsdmx', name: 'sdmx30-infomodel', version: '1.0.0')
compile(group: 'com.epam.jsdmx', name: 'sdmx-ml30', version: '2.0.0')

## License
Project is distributed under the Apache License 2.0. See [LICENSE](LICENSE) for more information.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ subprojects {
showViolations = true
}

sourceCompatibility = 11
targetCompatibility = 11
sourceCompatibility = 17
targetCompatibility = 17

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

Expand Down Expand Up @@ -122,6 +122,9 @@ subprojects {
compileOnly("org.projectlombok:lombok:${lombok_version}")
annotationProcessor("org.projectlombok:lombok:${lombok_version}")

implementation("org.apache.commons:commons-collections4:${org_apache_commons_commons_collections4_version}")
implementation("org.apache.commons:commons-lang3:${org_apache_commons_commons_lang3_version}")

testImplementation("org.junit.jupiter:junit-jupiter-api:${jupiter_version}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${jupiter_version}")
testImplementation("org.assertj:assertj-core:${assertj_version}")
Expand Down
24 changes: 20 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
group=com.epam.jsdmx
version=1.0.0-SNAPSHOT
version=2.0.0-SNAPSHOT

#dependencies
jupiter_version=5.8.2
lombok_version=1.18.24
org_apache_commons_commons_collections4_version=4.4
org_apache_commons_commons_lang3_version=3.12.0
jupiter_version=5.8.2
assertj_version=3.22.0
org_apache_commons_commons_lang3_version=3.18.0
jupiter_api_version=5.11.4
jupiter_engine_version=5.11.4
mockito_version=5.4.0
json_unit_version=4.1.1
spring_version=6.2.11
log4j_version=2.25.3
sdmx_version=2.0.6
mapstruct_version=1.5.3.Final
fasterxml_version=2.18.4
fasterxml_databind_version=2.18.4
guava_version=33.0.0-jre
openc_csv_version=5.12.0
jsonschema2pojo_version=1.2.2
junit_version=4.13.2
assertj_version=3.26.3
xmlunit_legacy_version=2.10.3
xml_bind_jaxb_version=3.0.2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
46 changes: 46 additions & 0 deletions sdmx-json10/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
plugins {
id 'java'
}

repositories {
mavenCentral()
}

dependencies {
implementation project(":sdmx30-serializer")
implementation project(":sdmx30-infomodel")

compileOnly("org.projectlombok:lombok:${lombok_version}")
annotationProcessor("org.projectlombok:lombok:${lombok_version}")

implementation("org.apache.logging.log4j:log4j-slf4j2-impl:${log4j_version}")
implementation("org.apache.logging.log4j:log4j-core:${log4j_version}")
implementation("com.epam.deltix:SdmxDataParser:${sdmx_version}")

implementation("com.fasterxml.jackson.core:jackson-core:${fasterxml_version}")
implementation("com.fasterxml.jackson.core:jackson-databind:${fasterxml_databind_version}")
implementation("com.google.guava:guava:${guava_version}")

testImplementation("org.projectlombok:lombok:${lombok_version}")
testAnnotationProcessor("org.projectlombok:lombok:${lombok_version}")

testImplementation("org.jsonschema2pojo:jsonschema2pojo-core:${jsonschema2pojo_version}")
testImplementation("org.assertj:assertj-core:${assertj_version}")
testImplementation("net.javacrumbs.json-unit:json-unit:${json_unit_version}")
testImplementation("net.javacrumbs.json-unit:json-unit-assertj:${json_unit_version}")
testImplementation("org.mockito:mockito-core:${mockito_version}")

testImplementation("com.epam.deltix:SdmxApi:${sdmx_version}")
testImplementation("com.epam.deltix:SdmxBeans:${sdmx_version}")
testImplementation("com.epam.deltix:SdmxDataParser:${sdmx_version}")
testImplementation("com.epam.deltix:SdmxFileQueryProcessor:${sdmx_version}")
testImplementation("com.epam.deltix:SdmxQueryBuilder:${sdmx_version}")
testImplementation("com.epam.deltix:SdmxSourceUtil:${sdmx_version}")
testImplementation("com.epam.deltix:SdmxStructureParser:${sdmx_version}")
testImplementation("com.epam.deltix:SdmxStructureRetrieval:${sdmx_version}")
testImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.3'
}

test {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.epam.jsdmx.json10.structure.writer;


import java.io.IOException;
import java.util.Set;

import com.epam.jsdmx.infomodel.sdmx30.AgencyScheme;
import com.epam.jsdmx.infomodel.sdmx30.AgencySchemeImpl;
import com.epam.jsdmx.infomodel.sdmx30.Artefacts;

import com.fasterxml.jackson.core.JsonGenerator;

public class AgencySchemeWriter extends MaintainableWriter<AgencyScheme> {

private final OrganisationWriter organisationWriter;

public AgencySchemeWriter(VersionableWriter versionableWriter,
LinksWriter linksWriter,
OrganisationWriter organisationWriter) {
super(versionableWriter, linksWriter);
this.organisationWriter = organisationWriter;
}

@Override
protected void writeFields(JsonGenerator jsonGenerator, AgencyScheme artefact) throws IOException {
AgencySchemeImpl agencyScheme = (AgencySchemeImpl) artefact;
agencyScheme.setId(StructureUtils.AGENCIES_ID);
super.writeFields(jsonGenerator, agencyScheme);
jsonGenerator.writeBooleanField(StructureUtils.IS_PARTIAL, agencyScheme.isPartial());
organisationWriter.writeOrganisation(jsonGenerator, artefact.getItems(), StructureUtils.AGENCIES);
}

@Override
protected Set<AgencyScheme> extractArtefacts(Artefacts artefacts) {
return artefacts.getAgencySchemes();
}

@Override
protected String getArrayName() {
return StructureUtils.AGENCY_SCHEMES;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.epam.jsdmx.json10.structure.writer;

import java.io.IOException;
import java.util.List;

import com.epam.jsdmx.infomodel.sdmx30.AnnotableArtefact;
import com.epam.jsdmx.infomodel.sdmx30.Annotation;

import com.fasterxml.jackson.core.JsonGenerator;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;

@RequiredArgsConstructor
public class AnnotableWriter {

private final LinksWriter linksWriter;

public <T extends AnnotableArtefact> void write(JsonGenerator jsonGenerator, T annotableArtefact) throws IOException {
write(jsonGenerator, annotableArtefact.getAnnotations());
}

protected void write(JsonGenerator jsonGenerator, List<Annotation> annotations) throws IOException {
if (CollectionUtils.isEmpty(annotations)) {
return;
}
jsonGenerator.writeFieldName(StructureUtils.ANNOTATIONS);
jsonGenerator.writeStartArray();
for (Annotation annotation : annotations) {
writeAnnotation(jsonGenerator, annotation);
}
jsonGenerator.writeEndArray();
}

private void writeAnnotation(JsonGenerator jg, Annotation annotation) throws IOException {
jg.writeStartObject();
StructureUtils.writeStringField(jg, StructureUtils.ID, annotation.getId());
StructureUtils.writeStringField(jg, StructureUtils.TITLE, annotation.getTitle());
StructureUtils.writeStringField(jg, StructureUtils.TYPE, annotation.getType());
StructureUtils.writeStringField(jg, StructureUtils.TEXT, (annotation.getText() != null) ? annotation.getText().getForDefaultLocale() : null);
StructureUtils.writeInternationalString(jg, annotation.getText(), StructureUtils.TEXTS);
linksWriter.writeLinks(jg, annotation.getUrl());
jg.writeEndObject();
}
}
Loading