Skip to content

Commit

Permalink
added option to use "inheres in part of" instead of "inheres in"
Browse files Browse the repository at this point in the history
changed some BFO-properties to RO-properties
  • Loading branch information
drseb committed Apr 9, 2015
1 parent 94055d6 commit c4a4607
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
24 changes: 19 additions & 5 deletions zpgen/src/main/java/de/charite/zpgen/ZPGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static void main(String[] args) throws OWLOntologyCreationException, IOEx
final String ontologyOutputFilePath = zpCLIConfig.ontologyOutputFilePath;
final String annotFilePath = zpCLIConfig.annotFilePath;
final boolean keepIds = zpCLIConfig.keepIds;
final boolean useInheresInPartOf = zpCLIConfig.useInheresInPartOf;

final boolean addZfaUberonEquivalencies = zpCLIConfig.addZfaUberonEquivalencies;
final String uberonOboFilePath = zpCLIConfig.uberonOboFilePath;
Expand Down Expand Up @@ -137,10 +138,23 @@ public static void main(String[] args) throws OWLOntologyCreationException, IOEx
System.exit(-1);
}

final OWLObjectProperty towards = factory.getOWLObjectProperty(IRI.create(zpIRI + "BFO_0000070"));
// not sure which one to use RO_0002503 or BFO_0000070 ??
final OWLObjectProperty towards = factory.getOWLObjectProperty(IRI.create(zpIRI + "RO_0002503"));

final OWLObjectProperty partOf = factory.getOWLObjectProperty(IRI.create(zpIRI + "BFO_0000050"));
// XXX TODO ... think about this!
final OWLObjectProperty inheresIn = factory.getOWLObjectProperty(IRI.create(zpIRI + "BFO_0000052"));

// I have for now replaced the BFO-properties with the RO-properties
final OWLObjectProperty inheresProperty;
if (useInheresInPartOf) {
// inheres in part of
inheresProperty = factory.getOWLObjectProperty(IRI.create(zpIRI + "RO_0002314"));
}
else {
// inheres in
inheresProperty = factory.getOWLObjectProperty(IRI.create(zpIRI + "RO_0000052"));
// inheresProperty = factory.getOWLObjectProperty(IRI.create(zpIRI + "BFO_0000052"));
}

final OWLObjectProperty hasPart = factory.getOWLObjectProperty(IRI.create(zpIRI + "BFO_0000051"));

/* RO_0002180 = "has qualifier" (previously used) */
Expand Down Expand Up @@ -234,7 +248,7 @@ public boolean visit(ZFINEntry entry) {
/* Pattern is (all-some interpretation): <pato> inheres_in (<cl2> part of <cl1>) AND qualifier abnormal */
OWLClass cl2 = getEntityClassForOBOID(entry.entity1SubtermId);

intersectionList.add(factory.getOWLObjectSomeValuesFrom(inheresIn,
intersectionList.add(factory.getOWLObjectSomeValuesFrom(inheresProperty,
factory.getOWLObjectIntersectionOf(cl2, factory.getOWLObjectSomeValuesFrom(partOf, cl1))));

/*
Expand All @@ -245,7 +259,7 @@ public boolean visit(ZFINEntry entry) {
}
else {
/* Pattern is (all-some interpretation): <pato> inheres_in <cl1> AND qualifier abnormal */
intersectionList.add(factory.getOWLObjectSomeValuesFrom(inheresIn, cl1));
intersectionList.add(factory.getOWLObjectSomeValuesFrom(inheresProperty, cl1));
label = "abnormal(ly) " + entry.patoName + " " + entry.entity1SupertermName;
}

Expand Down
4 changes: 4 additions & 0 deletions zpgen/src/main/java/de/charite/zpgen/ZPGenCLIConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public class ZPGenCLIConfig {
@Parameter(names = { "-s", "--source-information-output-file" }, required = false, description = "Add the source information to the ontology and save is also in a separate file. Implies --add-source-information set to true.")
public String sourceInformationFile = null;

@Parameter(names = { "--use-inheres-in-part-of" }, required = false, description = "If set to true, 'inheres in' is replaced by 'inheres in part of'.")
public boolean useInheresInPartOf = false;

@Parameter(names = { "-h", "--help" }, help = true, description = "Shows this help")
public boolean help;

}

0 comments on commit c4a4607

Please sign in to comment.