Code Monkey home page Code Monkey logo

delta-generator-tool's People

Contributors

codermchu avatar kaicode avatar pgwilliams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

delta-generator-tool's Issues

Incorrect path separator within resulting zip file

Hi,

Upon testing the tool, we have found and issue with how path separators are used in the resulting archive.

Generating a delta RF2 using Windows will register the individual file paths like this:

/SnomedCT_InternationalRF2_PRODUCTION_20211130T120000Z\Delta\Terminology\sct2_Concept_Delta_INT_20211130.txt

Whereas the official SNOMED CT release archive uses the standardized format:

/SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z/Delta/Terminology/sct2_Concept_Delta_INT_20210731.txt

This inconsistency most likely comes from using File.separator and ZipEntry, both being system dependant when it comes to path separators.

According to the official ZIP file format specification:

4.4.17.1 The name of the file, with optional relative path.
The path stored MUST NOT contain a drive or
device letter, or a leading slash. All slashes
MUST be forward slashes '/' as opposed to
backwards slashes '' for compatibility with Amiga
and UNIX file systems etc. If input came from standard
input, there is no file name field.

It might seem minor, but in case someone uses this tool to create a delta RF2 archive, which is then eventually fed into another tool expecting UNIX style zip entries, file processing could fail.

Some useful stackoverflow discussions:

Snippet to list path of zip entries:

public static void main(String[] args) throws IOException {
	try (FileSystem zipfs = FileSystems.newFileSystem(Paths.get("C:\\path\\to\\SnomedCT_InternationalRF2_PRODUCTION_20210731T120000Z.zip"), null)) {
		for (final Path path : zipfs.getRootDirectories()) {
			Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
				@Override 
				public FileVisitResult visitFile(final Path path, final BasicFileAttributes attrs) throws IOException {
					System.out.println(path.toAbsolutePath().toString());
					return FileVisitResult.CONTINUE;
				}
			});
		}
	}
}

Regards,

Gábor

DeltaGeneratorTool has been compiled by a more recent version of the Java Runtime

Hi,

I've just installed the newest version of Java and when I try to execute DeltaGeneratorTool I get the following error.

Any help would be most appreciated.

Regards,

C:\Prueba delta>java -jar DeltaGeneratorTool.jar 20210731 SnomedCT_InternationalRF2_PRODUCTION_20220228T120000Z.zip
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/snomed/otf/delta/DeltaGeneratorTool has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Option to create a delta with only the latest state of each component

Background
The current implementation of the delta generation tool creates archives that can contain multiple states of each component. This is like a filtered full file.

For example, between 20210731 and 20220131 the International Edition has 848 relationships that changed more than once (because of internal monthly releases). There are also 438 axioms that have more than one published state between these dates.

Problem
Tools that process RF2 delta files don't expect to receive multiple states of each component. This reduces the usefulness of this tool. Arguably tools that process RF2 deltas should not have to process multiple states for each component. For example if you try to load one of these multi-state delta files into Snowstorm the import will fail silently resulting in multiple concurrent states of components in the same commit.

Enhancement
It would be great to give implementors the choice of creating a delta with only the latest state of each component. That would make this tool really useful for creating deltas that tools expect and can process quickly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.