Git Product home page Git Product logo

snomedctparser's Introduction

SnomedCTParser

Build Dependency Status

ANTLR 4 parser for the draft 2014 SNOMED CT Compositional Grammar.

OWL API 4.x compliant classes for loading and storing SNOMED CT Compositional Grammar statements or expressions.

File format is a sequence of Compositionl Grammar statements.

Installation

From source

mvn install

From Maven Central

<dependency>
    <groupId>se.liu.imt.mi.snomedct</groupId>
    <artifactId>SnomedCTParser</artifactId>
    <version>0.4</version>
</dependency>

Additionally, there are some utility methods in the se.liu.imt.mi.snomedct.expression.tools package.

SNOMEDCTTranslator

Usage:

java -jar SnomedCTParser-0.4-jar-with-dependencies.jar <input file> [-f [turtle|owlf|sct] -s <SNOMED CT OWL file> -n [stated|distribution|flat] -l]

The input file is any OWL file or a SNOMED CT Compositional grammar file (using the file format described above).

The flag -f selects the format for the output file.

The flag -n selects any processing of the ontology in the input file. "stated" means no processing. "distribution" means that the ontology is classified and that a Distribution Normal Form transformation is applied. [Only applicable to the SNOMED CT Observables model: "flat" means that any classes based on the nested version of the Obseravbles model is translated into the flat version of the Obseravbles model.]

The -s flag is used to supply a SNOMED CT OWL file (or possibly a module) which is imported into the ontology from the input file before classification (if applicable).

The -l flag, when present, labels are added to OWL classes/Compositional Grammar expressions.

SNOMEDCTSignatureGenerator

Generates signature files for OWL module extraction by e.g. https://github.com/rsgoncalves/module-extractor

Usage:

java -cp SnomedCTParser-0.4-jar-with-dependencies.jar se.liu.imt.mi.snomedct.expression.tools.SNOMEDCTSignatureGenerator <input file> [-f <format>] [<output file>]

The input file is a Compositional Grammar file as e.g. generated by the tool above.

The flag -f selects the format for the output file, either:

  • url for a file with lines on the form "http://snomed.info/id/<SCTID>"
  • | for a file with lines on the form "<SCTID>|"

snomedctparser's People

Contributors

danka74 avatar darmbrust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snomedctparser's Issues

Do-not-role-group list

The do-not-role-group list in OWLVisitor is mos t probably not complete, especially since not all Observables model attributes are in SNOMED CT (yet)

Release to Maven Central?

Hi,

It would be really nice if your code was release on maven central, so we can easily pull it into other projects without having to first set up a local maven repo.

I've done this in the past via sonatype:
http://central.sonatype.org/pages/ossrh-guide.html
http://central.sonatype.org/pages/requirements.html
http://central.sonatype.org/pages/apache-maven.html

Its a little tedious the first time through, but once configured, you can just do a fairly standard mvn release command, and the end result will be signed and pushed to maven central.

I'm happy to help do the config if interested.

File format for Compositional Grammar expressions needs review

Currently, the file format for CG expressions is very simple and was based on the previous version of CG (before 2014). Requirements differ and there seem to be (at least) two case:

  1. having the definiens and the definiendum in the file as in the new CG language: (1234|definiens|)===(3456|definiendum|)
  2. having only the definiendum in the file (possibly with a label) as in the existing format. URIs for new classes will have to be generated (possibly with namespace provided, UUIDs, numbers??)

Case 1 is fairly clear, but case 2 would need further elaboration, e.g. if it is needed at all.

Maven test fails because of missing test resource

2014-04-30 12:42:21,654 [main] INFO test.TestSCTExpressionParser - Loading SNOMED CT ontology...
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.35 sec <<< FAILURE!
testConvertToOWL(test.TestSCTExpressionParser) Time elapsed: 0.106 sec <<< ERROR!
org.semanticweb.owlapi.io.OWLOntologyInputSourceException: java.io.FileNotFoundException: src/test/resources/snomed.owl (No such file or directory)
at org.semanticweb.owlapi.io.FileDocumentSource.getInputStream(FileDocumentSource.java:91)
at org.semanticweb.owlapi.io.FileDocumentSource.getReader(FileDocumentSource.java:103)
at org.semanticweb.owlapi.io.AbstractOWLParser.getInputSource(AbstractOWLParser.java:223)
at org.coode.owlapi.rdfxml.parser.RDFXMLParser.parse(RDFXMLParser.java:118)
at uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:206)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:829)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:775)
at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:788)
at test.TestSCTExpressionParser.testConvertToOWL(TestSCTExpressionParser.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.io.FileNotFoundException: src/test/resources/snomed.owl (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:146)
at org.semanticweb.owlapi.io.FileDocumentSource.getInputStream(FileDocumentSource.java:89)
... 38 more

Running test.TestSNOMEDCTOWLParser
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.034 sec

Results :

Tests in error:
testConvertToOWL(test.TestSCTExpressionParser): java.io.FileNotFoundException: src/test/resources/snomed.owl (No such file or directory)

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.