Skip to content

Commit f016ea1

Browse files
alopezoalopezo
authored andcommitted
Converting as data properties
1 parent 524ae96 commit f016ea1

File tree

5 files changed

+505
-76
lines changed

5 files changed

+505
-76
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ Binaries are also available in the releases section of the [github repository](h
1616

1717
Run the executable from the command line, for example:
1818

19-
`java -jar owl-test-x.x.x-SNAPSHOT-jar-with-dependencies.jar /folder/sct2_Concept_Snapshot_INT_20150131.txt /folder/sct2_StatedRelationship_Snapshot_INT_20150131.txt /folder/outputFile.owl http://snomed.org/`
19+
`java -jar owl-test-x.x.x-SNAPSHOT-jar-with-dependencies.jar /folder/sct2_Concept_Snapshot_INT_20150131.txt /folder/sct2_StatedRelationship_Snapshot_INT_20150131.txt /folder/sct2_Description_Snapshot_INT_20150131.txt /folder/der2_cRefset_LanguageSnapshot-en_INT_20150131 /folder/outputFile.owl http://snomed.org/ TRUE`
2020

2121
Parameters (in this order):
2222
* Path to RF2 Concepts Snapshot file
2323
* Path to RF2 Stated Relationships Snapshot file
24+
* Path to RF2 Stated Descriptons Snapshot file
25+
* Path to RF2 Stated Language Refset Snapshot file
2426
* Path to output file (it will be created or replaced by this process)
2527
* IRI for the resulting ontology
28+
* Boolean value to enable transformation of to concrete domains (Data Properties) ("TRUE"/"FALSE")
2629

2730
## About the conversion
2831

@@ -36,4 +39,23 @@ Parameters (in this order):
3639
* *Has active ingredient*
3740
* *Laterality*
3841
* *Has dose form*
39-
* A sub-property chain is created between *Direct substance* and *Has active ingredient*
42+
* A sub-property chain is created between *Direct substance* and *Has active ingredient*
43+
44+
## Concrete domains conversion
45+
46+
Since the July 2017 release of the international edition, some relationships that specify numerical values are
47+
represented using concepts for the example:
48+
49+
* Source: 318420003 | Product containing atenolol 50 mg/1 each oral tablet (virtual clinical drug) |
50+
* Attribute: 732947008 | Has presentation strength denominator unit (attribute) |
51+
* Destination: 732774003 | 50 (qualifier value) |
52+
53+
If the "Concrete domains conversion" parameter is sent as "TRUE", those relationships are converted into OWL Data
54+
Properties, instead of the normal OWL Object Properties. Classification results should be identical, but having
55+
actual values instead of concept references may allow for more detailed queries and computations.
56+
57+
Attributes that are currently converted as data properties:
58+
59+
* 732944001 | Has presentation strength numerator value (attribute) | - DataType: float
60+
* 732947008 | Has presentation strength denominator unit (attribute) | - DataType: float
61+

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.termmed</groupId>
5-
<artifactId>owl-test</artifactId>
6-
<version>0.0.2-SNAPSHOT</version>
5+
<artifactId>rf2-to-owl</artifactId>
6+
<version>0.0.3-SNAPSHOT</version>
77
<dependencies>
88
<dependency>
99
<groupId>net.sourceforge.owlapi</groupId>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
*
3+
* * Copyright (C) 2014 termMed IT
4+
* * www.termmed.com
5+
* *
6+
* * Licensed under the Apache License, Version 2.0 (the "License");
7+
* * you may not use this file except in compliance with the License.
8+
* * You may obtain a copy of the License at
9+
* *
10+
* * http://www.apache.org/licenses/LICENSE-2.0
11+
* *
12+
* * Unless required by applicable law or agreed to in writing, software
13+
* * distributed under the License is distributed on an "AS IS" BASIS,
14+
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* * See the License for the specific language governing permissions and
16+
* * limitations under the License.
17+
*
18+
*/
19+
20+
package com.termmed.owl;
21+
22+
/**
23+
* Created by alo on 4/6/16.
24+
*
25+
* @author Alejandro Rodriguez
26+
*/
27+
public class DirectRunner {
28+
/**
29+
* The main method.
30+
*
31+
* @param args the arguments
32+
* @throws Exception the exception
33+
*/
34+
public static void main(String[] args) throws Exception {
35+
String conceptFile = "/Users/alo/Downloads/SnomedCT_RF2Release_INT_20170731/Snapshot/Terminology/sct2_Concept_Snapshot_INT_20170731.txt";
36+
String relationshipFile = "/Users/alo/Downloads/SnomedCT_RF2Release_INT_20170731/Snapshot/Terminology/sct2_Relationship_Snapshot_INT_20170731.txt";
37+
String outputFile = "/Users/alo/Downloads/conceptsOwlComplete-cd-alo.xml";
38+
String descriptionFile = "/Users/alo/Downloads/SnomedCT_RF2Release_INT_20170731/Snapshot/Terminology/sct2_Description_Snapshot-en_INT_20170731.txt";
39+
String languageFile = "/Users/alo/Downloads/SnomedCT_RF2Release_INT_20170731/Snapshot/Refset/Language/der2_cRefset_LanguageSnapshot-en_INT_20170731.txt";
40+
// String textDefinitionFile = "/Users/ar/Downloads/SnomedCT_RF2Release_INT_201601731/Snapshot/Terminology/xsct2_TextDefinition_Snapshot-en_INT_20160131.txt";
41+
String textDefinitionFile = null;
42+
String iri = "http://snomed.info/id/";
43+
44+
RF2Parser parser = new RF2Parser(conceptFile, relationshipFile,
45+
descriptionFile,textDefinitionFile,languageFile, outputFile,iri, true);
46+
// RF2Parser parser = new RF2Parser(conceptFile, relationshipFile,
47+
// null,null,null, outputFile,iri);
48+
parser.parse();
49+
System.out.println("Done! The process has generated a new OWL Ontology file: " + outputFile);
50+
}
51+
}

0 commit comments

Comments
 (0)