Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated SNOMED CT functionality to current URI standard, 2nd attempt #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>module-extractor_dk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
Binary file added owl-me.jar
Binary file not shown.
15 changes: 7 additions & 8 deletions src/uk/ac/manchester/cs/modularity/owlme/ModuleExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,16 @@ public static Set<OWLEntity> getSignature(OWLOntology ontology, BufferedReader f
// Check entity IRIs for Snomed concepts
loopClasses:
for(OWLClass c : ontology.getClassesInSignature()) {
if(c.getIRI().toString().contains("www.ihtsdo.org")) {
if(c.getIRI().toString().contains("snomed.info")) {
snomed = true;
termsIri += c.getIRI().toString();
termsIri = termsIri.substring(0, termsIri.indexOf(".org/")+5);
termsIri = "http://snomed.info/id/";
break loopClasses;
}
}

if(ontIri.toString().contains("www.ihtsdo.org")) {
if(ontIri.toString().contains("snomed.info")) {
snomed = true;
termsIri = ontIri.toString().substring(0, ontIri.toString().indexOf(".org/")+5);
termsIri = "http://snomed.info/id/";
}

if(snomed) {
Expand All @@ -69,7 +68,7 @@ public static Set<OWLEntity> getSignature(OWLOntology ontology, BufferedReader f
int pos = s.indexOf("|");
if(pos < 0) throw new RuntimeException("There is no '|' in: ");

s = "SCT_" + s.substring(0,pos);
s = s.substring(0,pos).trim();
IRI iri = IRI.create(termsIri + s);
OWLClass cls = df.getOWLClass(iri);
if (ontology.containsClassInSignature(iri)) {
Expand All @@ -82,7 +81,7 @@ public static Set<OWLEntity> getSignature(OWLOntology ontology, BufferedReader f
}
}

IRI roleGroupIRI = IRI.create(ontology.getOntologyID().getOntologyIRI() + "RoleGroup");
IRI roleGroupIRI = IRI.create(termsIri + "609096000");
OWLObjectProperty roleGroup = df.getOWLObjectProperty(roleGroupIRI);

if (ontology.containsObjectPropertyInSignature(roleGroupIRI)) {
Expand Down Expand Up @@ -167,4 +166,4 @@ private static String getManchesterSyntax(OWLObject obj) {
String str = wr.getBuffer().toString();
return str;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ else if(loaded && !ontUriChanged && currentOntology != null)
OWLOntology mod = null;
publish("\n" + prefix("EXTRACTING MODULE ..."));

String moduleName = currentOntology.getOntologyID().getOntologyIRI().toString();
String moduleName = currentOntology.getOntologyID().getOntologyIRI().get().toString();
if(moduleName.contains(".owl"))
moduleName = moduleName.substring(0, moduleName.indexOf(".owl")) + "_module" + modCounter + ".owl";
else
Expand Down