Skip to content

Commit

Permalink
committ
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Kimball committed Aug 19, 2015
1 parent 99be0de commit ae253c3
Show file tree
Hide file tree
Showing 10 changed files with 479 additions and 259 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

670 changes: 431 additions & 239 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Parser.iml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="commons-lang3-3.4" level="project" />
<orderEntry type="library" name="super-csv" level="application" />
<orderEntry type="library" name="commons-lang3-3" level="application" />
</component>
</module>
Binary file removed src/TestsFacetMatches.xlsx
Binary file not shown.
6 changes: 3 additions & 3 deletions src/org/healthwise/quantumleap/parsing/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Runner {
// Boilerplate RDF to append at the top
private final String RDF_HEADER_FILENAME = "rdf_header.txt";
// Outtput filename
private final String RDF_OUTPUT_FILENAME = "/Users/akimball/dev/onto-out/hwcv-generated-tests.rdf";
private final String RDF_OUTPUT_FILENAME = "/Users/akimball/dev/onto-out/HW_Concept.rdf";

Map<Integer, Concept> idToConcepts;
Map<String, Concept> conceptIdToConcepts;
Expand Down Expand Up @@ -106,10 +106,10 @@ private void merge() throws Exception {
System.out.println("Error");
}
if (currentTFM.getRdLabel() != null) {
c.addToScopeNotes("RD Label is " + currentTFM.getRdLabel());
c.setRdLabel(currentTFM.getRdLabel());
}
if (currentTFM.getRdType() != null) {
c.addToScopeNotes("RD Type is " + currentTFM.getRdType());
c.setRdType(currentTFM.getRdType());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public List<TestsFacetMatches> readWithCsvBeanReader() throws Exception {
TestsFacetMatches tfm;
while( (tfm = beanReader.read(TestsFacetMatches.class, header, processors)) != null ) {
lines.add(tfm);
System.out.println(String.format("conceptId=%s, conceptName=%s", beanReader.getLineNumber(),
beanReader.getRowNumber(), tfm));
//System.out.println(String.format("conceptId=%s, conceptName=%s", beanReader.getLineNumber(),
// beanReader.getRowNumber(), tfm));
}

}
Expand Down
46 changes: 36 additions & 10 deletions src/org/healthwise/quantumleap/parsing/beans/Concept.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@
public class Concept {



private final String HWNS = "hwcv_sc";
private final String CONCEPT_ID = "concept_id";
private final String RD_ID = "rd_id";
private final String FACET_VALUE_ID = "facet_value_id";
private final String RD_ID = "legacy_rd_id";
private final String RD_TYPE = "legacy_rd_type";
private final String RD_LABEL = "legacy_rd_label";
private final String FACET_VALUE_ID = "legacy_facet_id";
private final String SYNONYM = "legacy_synonym";

private Integer id;
private String label;
private List broader = new ArrayList();
private List narrower = new ArrayList();
private List related = new ArrayList();
private List scopeNotes = new ArrayList();
private List<String> altLabel = new ArrayList<String>();
private List<String> legacySynonym = new ArrayList<String>();
private String rdId;
private String rdLabel;
private String rdType;
private String facetId;
private String definition;

Expand Down Expand Up @@ -110,12 +116,28 @@ public void setFacetId(String facetId) {
}


public List<String> getAltLabel() {
return altLabel;
public List<String> getLegacySynonym() {
return legacySynonym;
}

public String getRdType() {
return rdType;
}

public void setRdType(String rdType) {
this.rdType = rdType;
}

public String getRdLabel() {
return rdLabel;
}

public void setRdLabel(String rdLabel) {
this.rdLabel = rdLabel;
}

public void addToAltLabel(String altLabel) {
this.altLabel.add(altLabel);
this.legacySynonym.add(altLabel);
}

public String render() {
Expand All @@ -138,11 +160,11 @@ public String render() {
out.append(" <skos:narrower rdf:resource=\"#HWCV_"+narrowerId+"\"/>\n");
}
}
if (this.getAltLabel().size() > 0) {
iter = this.getAltLabel().iterator();
if (this.getLegacySynonym().size() > 0) {
iter = this.getLegacySynonym().iterator();
while (iter.hasNext()) {
String altLabel = (String) iter.next();
out.append(" <skos:altLabel>"+altLabel+"</skos:altLabel>\n");
String someSynonym = (String) iter.next();
out.append(" <hwcv_sc:"+SYNONYM+">"+someSynonym+"</hwcv_sc:"+SYNONYM+">\n");
}
}
if (this.getScopeNote().size() > 0) {
Expand All @@ -164,6 +186,10 @@ public String render() {
out.append(" <"+HWNS+":"+FACET_VALUE_ID+">"+getFacetId()+"</"+HWNS+":"+FACET_VALUE_ID+">\n");
}

if (this.getRdLabel() != null) {
out.append(" <"+HWNS+":"+RD_LABEL+">"+getRdLabel()+"</"+HWNS+":"+RD_LABEL+">\n");
}


out.append(" </skos:Concept>\n\n");

Expand Down
4 changes: 2 additions & 2 deletions src/rdf_header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
>
<owl:Ontology rdf:about="">
<owl:versionInfo>$Id: HW_Concept_Data.owl, Ver 1.0, July 04, 2015, Mohamed Keshk. $</owl:versionInfo>
<owl:imports rdf:resource="file:/C:/1HW/HW_Concept_Schema.owl"/>
<owl:imports rdf:resource="file:/C:/1HW/skos.owl"/>
<owl:imports rdf:resource="HW_Concept_Schema.owl"/>
<owl:imports rdf:resource="skos.owl"/>
</owl:Ontology>

<skos:Concept rdf:ID="HWCV_00000">
Expand Down
2 changes: 1 addition & 1 deletion src/tfm.csv

Large diffs are not rendered by default.

0 comments on commit ae253c3

Please sign in to comment.