-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update test case for TO-eq template, issue #77
- Loading branch information
Heiko Dietze
committed
Nov 13, 2015
1 parent
aba359f
commit ade8886
Showing
4 changed files
with
79 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...cations/TermGenieWebAppTO/src/main/java/org/bbop/termgenie/servlets/ToOntologyHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.bbop.termgenie.servlets; | ||
|
||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.Map; | ||
import java.util.Properties; | ||
import java.util.Set; | ||
|
||
import org.bbop.termgenie.core.ioc.IOCModule; | ||
import org.bbop.termgenie.ontology.git.CommitGitTokenModule; | ||
import org.bbop.termgenie.ontology.impl.GitAwareOntologyModule; | ||
import org.bbop.termgenie.ontology.impl.FileCachingIgnoreFilter.IgnoresContainsDigits; | ||
import org.semanticweb.owlapi.model.IRI; | ||
|
||
public class ToOntologyHelper { | ||
|
||
public static IOCModule createDefaultOntologyModule(String workFolder, Properties applicationProperties) { | ||
String configFile = "ontology-configuration_to.xml"; | ||
String repositoryURL = "https://github.com/Planteome/plant-trait-ontology.git"; | ||
|
||
Map<IRI, String> mappedIRIs = new HashMap<IRI, String>(); | ||
mappedIRIs.put(IRI.create("http://purl.obolibrary.org/obo/to.owl"), "plant-trait-ontology.obo"); | ||
|
||
String catalogXML = "catalog-v001.xml"; | ||
|
||
final Set<IRI> ignoreIRIs = new HashSet<IRI>(); | ||
ignoreIRIs.add(IRI.create("http://purl.obolibrary.org/obo/TEMP")); | ||
|
||
GitAwareOntologyModule m = GitAwareOntologyModule.createAnonymousGitModule(configFile, applicationProperties); | ||
m.setGitAwareRepositoryURL(repositoryURL); | ||
m.setGitAwareMappedIRIs(mappedIRIs); | ||
m.setGitAwareCatalogXML(catalogXML); | ||
m.setGitAwareWorkFolder(workFolder); | ||
m.setFileCacheFilter(new IgnoresContainsDigits(ignoreIRIs)); | ||
return m; | ||
} | ||
|
||
static IOCModule getCommitModule(Properties applicationProperties) { | ||
String repositoryURL = "https://github.com/Planteome/plant-trait-ontology.git"; | ||
String remoteTargetFile = "plant-trait-ontology.obo"; | ||
return CommitGitTokenModule.createOboModule(repositoryURL, remoteTargetFile, applicationProperties); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters