-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schemas): introduce schema generation submodule #5889
- Generate model classes for DataCite 4.5 Metadata Schema - Add a simple test to demonstrate usage and basic validity.
- Loading branch information
1 parent
21538d6
commit cfe5378
Showing
16 changed files
with
1,668 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
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,326 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>edu.harvard.iq</groupId> | ||
<artifactId>dataverse-parent</artifactId> | ||
<version>${revision}</version> | ||
<relativePath>../dataverse-parent</relativePath> | ||
</parent> | ||
|
||
<groupId>io.gdcc</groupId> | ||
<artifactId>dataverse-schemas</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>Dataverse Schema Model Classes</name> | ||
<url>https://dataverse.org</url> | ||
<description> | ||
This package provides model classes compiled from diverse metadata schemas like DataCite and others. | ||
</description> | ||
|
||
<licenses> | ||
<license> | ||
<name>Apache-2.0</name> | ||
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<developers> | ||
<developer> | ||
<name>Dataverse Core Team</name> | ||
<email>support@dataverse.org</email> | ||
</developer> | ||
</developers> | ||
|
||
<issueManagement> | ||
<url>https://github.com/IQSS/dataverse/issues</url> | ||
<system>GitHub Issues</system> | ||
</issueManagement> | ||
|
||
<scm> | ||
<connection>scm:git:git@github.com:IQSS/dataverse.git</connection> | ||
<developerConnection>scm:git:git@github.com:IQSS/dataverse.git</developerConnection> | ||
<url>git@github.com:IQSS/dataverse.git</url> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<ciManagement> | ||
<url>https://github.com/IQSS/dataverse/actions</url> | ||
<system>github</system> | ||
<notifiers> | ||
<notifier> | ||
<address>dataversebot@gdcc.io</address> | ||
</notifier> | ||
</notifiers> | ||
</ciManagement> | ||
|
||
<distributionManagement> | ||
<snapshotRepository> | ||
<id>ossrh</id> | ||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> | ||
</snapshotRepository> | ||
<repository> | ||
<id>ossrh</id> | ||
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url> | ||
</repository> | ||
</distributionManagement> | ||
|
||
<properties> | ||
<javadoc.lint>none</javadoc.lint> | ||
<skipDeploy>false</skipDeploy> | ||
|
||
<jaxb-plugin.version>4.0.6</jaxb-plugin.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>jakarta.xml.bind</groupId> | ||
<artifactId>jakarta.xml.bind-api</artifactId> | ||
<scope>provided</scope> | ||
<!-- no version here as managed by parent --> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.platform</groupId> | ||
<artifactId>jakarta.jakartaee-api</artifactId> | ||
<scope>provided</scope> | ||
<!-- no version here as managed by parent --> | ||
</dependency> | ||
|
||
<!-- Necessary for functionality of generated code --> | ||
<dependency> | ||
<groupId>org.jvnet.jaxb</groupId> | ||
<artifactId>jaxb-plugins-runtime</artifactId> | ||
<version>${jaxb-plugin.version}</version> | ||
</dependency> | ||
|
||
<!-- TESTING --> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>${junit.jupiter.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.sun.xml.bind</groupId> | ||
<artifactId>jaxb-osgi</artifactId> | ||
<scope>test</scope> | ||
<!-- no version here as managed by parent / Payara BOM --> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.xmlunit</groupId> | ||
<artifactId>xmlunit-core</artifactId> | ||
<version>2.9.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.xmlunit</groupId> | ||
<artifactId>xmlunit-matchers</artifactId> | ||
<version>2.9.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<release>${target.java.version}</release> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
</plugin> | ||
|
||
<!-- SCHEMA TO CLASS GENERATION --> | ||
<plugin> | ||
<groupId>org.jvnet.jaxb</groupId> | ||
<artifactId>jaxb-maven-plugin</artifactId> | ||
<version>${jaxb-plugin.version}</version> | ||
<executions> | ||
<execution> | ||
<id>datacite-4.5</id> | ||
<goals> | ||
<goal>generate</goal> | ||
</goals> | ||
<configuration> | ||
<schemas> | ||
<schema> | ||
<fileset> | ||
<directory>${basedir}/src/main/resources/datacite-4.5</directory> | ||
</fileset> | ||
</schema> | ||
</schemas> | ||
<bindings> | ||
<binding> | ||
<fileset> | ||
<directory>${basedir}/src/main/resources/datacite-4.5</directory> | ||
</fileset> | ||
</binding> | ||
</bindings> | ||
<markGenerated>false</markGenerated> | ||
<locale>en</locale> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.jvnet.jaxb</groupId> | ||
<artifactId>jaxb-plugins</artifactId> | ||
<version>${jaxb-plugin.version}</version> | ||
</plugin> | ||
</plugins> | ||
<!-- See https://github.com/highsource/jaxb-tools/wiki/JAXB2-Basic for more --> | ||
<args> | ||
<!-- Must be set and executed first to make the other plugins create compatible code --> | ||
<arg>-XelementWrapper</arg> | ||
<!--<arg>-XelementWrapper:delete</arg>--> | ||
|
||
<arg>-Xfluent-api</arg> | ||
<arg>-Xvalue-constructor</arg> | ||
<arg>-XtoString</arg> | ||
<arg>-XsimpleEquals</arg> | ||
<arg>-XsimpleHashCode</arg> | ||
<arg>-Xdefault-value</arg> | ||
<arg>-XfixJAXB1058</arg> | ||
</args> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<!-- RELEASING --> | ||
<plugin> | ||
<groupId>org.sonatype.plugins</groupId> | ||
<artifactId>nexus-staging-maven-plugin</artifactId> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<serverId>ossrh</serverId> | ||
<nexusUrl>https://s01.oss.sonatype.org</nexusUrl> | ||
<autoReleaseAfterClose>true</autoReleaseAfterClose> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-release-plugin</artifactId> | ||
<configuration> | ||
<useReleaseProfile>false</useReleaseProfile> | ||
<releaseProfiles>release</releaseProfiles> | ||
<autoVersionSubmodules>true</autoVersionSubmodules> | ||
<goals>deploy</goals> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>flatten-maven-plugin</artifactId> | ||
<configuration> | ||
<updatePomFile>true</updatePomFile> | ||
<flattenMode>oss</flattenMode> | ||
<pomElements> | ||
<distributionManagement>remove</distributionManagement> | ||
<repositories>remove</repositories> | ||
</pomElements> | ||
</configuration> | ||
<executions> | ||
<!-- enable flattening --> | ||
<execution> | ||
<id>flatten</id> | ||
<phase>process-resources</phase> | ||
<goals> | ||
<goal>flatten</goal> | ||
</goals> | ||
</execution> | ||
<!-- ensure proper cleanup --> | ||
<execution> | ||
<id>flatten.clean</id> | ||
<phase>clean</phase> | ||
<goals> | ||
<goal>clean</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<configuration> | ||
<skip>${skipDeploy}</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>release</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-gpg-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>sign-artifacts</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>sign</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.kordamp.maven</groupId> | ||
<artifactId>pomchecker-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>process-resources</phase> | ||
<goals> | ||
<goal>check-maven-central</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-javadocs</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<source>${target.java.version}</source> | ||
<detectJavaApiLink>false</detectJavaApiLink> | ||
<doclint>${javadoc.lint}</doclint> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>ct</id> | ||
<properties> | ||
<skipDeploy>true</skipDeploy> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
</project> |
12 changes: 12 additions & 0 deletions
12
modules/dataverse-schemas/src/main/resources/datacite-4.5/bindings.xjb
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,12 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<jaxb:bindings | ||
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" | ||
jaxb:version="3.0"> | ||
|
||
<jaxb:bindings schemaLocation="schema.xsd"> | ||
<jaxb:schemaBindings> | ||
<!-- Define the target name of the package --> | ||
<jaxb:package name="io.gdcc.schemas.datacite45"/> | ||
</jaxb:schemaBindings> | ||
</jaxb:bindings> | ||
</jaxb:bindings> |
35 changes: 35 additions & 0 deletions
35
...dataverse-schemas/src/main/resources/datacite-4.5/include/datacite-contributorType-v4.xsd
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,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Version 1.0 - Created 2011-01-13 - FZ, TIB, Germany | ||
2013-05 v3.0: Addition of ID to simpleType element, added values "ResearchGroup" & "Other" | ||
2014-08-20 v3.1: Addition of value "DataCurator" | ||
2015-05-14 v4.0 dropped value "Funder", use new "funderReference" --> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://datacite.org/schema/kernel-4" targetNamespace="http://datacite.org/schema/kernel-4" elementFormDefault="qualified"> | ||
<xs:simpleType name="contributorType" id="contributorType"> | ||
<xs:annotation> | ||
<xs:documentation>The type of contributor of the resource.</xs:documentation> | ||
</xs:annotation> | ||
<xs:restriction base="xs:string"> | ||
<xs:enumeration value="ContactPerson" /> | ||
<xs:enumeration value="DataCollector" /> | ||
<xs:enumeration value="DataCurator" /> | ||
<xs:enumeration value="DataManager" /> | ||
<xs:enumeration value="Distributor" /> | ||
<xs:enumeration value="Editor" /> | ||
<xs:enumeration value="HostingInstitution" /> | ||
<xs:enumeration value="Other" /> | ||
<xs:enumeration value="Producer" /> | ||
<xs:enumeration value="ProjectLeader" /> | ||
<xs:enumeration value="ProjectManager" /> | ||
<xs:enumeration value="ProjectMember" /> | ||
<xs:enumeration value="RegistrationAgency" /> | ||
<xs:enumeration value="RegistrationAuthority" /> | ||
<xs:enumeration value="RelatedPerson" /> | ||
<xs:enumeration value="ResearchGroup" /> | ||
<xs:enumeration value="RightsHolder" /> | ||
<xs:enumeration value="Researcher" /> | ||
<xs:enumeration value="Sponsor" /> | ||
<xs:enumeration value="Supervisor" /> | ||
<xs:enumeration value="WorkPackageLeader" /> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:schema> |
Oops, something went wrong.