diff --git a/OWLTools-Annotation/src/main/java/owltools/gaf/rules/AnnotationRulesFactoryImpl.java b/OWLTools-Annotation/src/main/java/owltools/gaf/rules/AnnotationRulesFactoryImpl.java index ed7084585..d0adbffcf 100644 --- a/OWLTools-Annotation/src/main/java/owltools/gaf/rules/AnnotationRulesFactoryImpl.java +++ b/OWLTools-Annotation/src/main/java/owltools/gaf/rules/AnnotationRulesFactoryImpl.java @@ -72,7 +72,7 @@ public synchronized void init() { Document doc = null; try { URI uri; - if(!(path.startsWith("http://") || path.startsWith("file:///"))){ + if(!(path.startsWith("http://") || path.startsWith("file://") || path.startsWith("https://"))){ File f = new File(path); uri = f.toURI(); } diff --git a/OWLTools-Annotation/src/main/java/owltools/gaf/rules/go/BasicChecksRule.java b/OWLTools-Annotation/src/main/java/owltools/gaf/rules/go/BasicChecksRule.java index 415d6219b..100c0252b 100644 --- a/OWLTools-Annotation/src/main/java/owltools/gaf/rules/go/BasicChecksRule.java +++ b/OWLTools-Annotation/src/main/java/owltools/gaf/rules/go/BasicChecksRule.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Set; +import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.io.LineIterator; import org.apache.log4j.Logger; @@ -68,13 +69,15 @@ private static Set buildAbbreviations(String path){ InputStream is = null; LineIterator it = null; try{ - if(path.startsWith("http://") || path.startsWith("file:/")){ - is = new URL(path).openStream(); + File destination = new File("/tmp/tmp.xrf_abbs"); + destination.deleteOnExit(); + if(path.startsWith("http://") || path.startsWith("https://")){ + FileUtils.copyURLToFile(new URL(path), destination, 10000, 10000); + } else { + destination = new File(path); } - else { - is = new FileInputStream(new File(path)); - } - + // Copy from destination, always a file now. + is = new FileInputStream(destination); it = new LineIterator(new InputStreamReader(is)); while (it.hasNext()) { @@ -95,6 +98,7 @@ private static Set buildAbbreviations(String path){ finally { IOUtils.closeQuietly(is); LineIterator.closeQuietly(it); + } return set; diff --git a/OWLTools-Annotation/src/main/java/owltools/gaf/rules/go/GoAnnotationRulesFactoryImpl.java b/OWLTools-Annotation/src/main/java/owltools/gaf/rules/go/GoAnnotationRulesFactoryImpl.java index 98aa70dc4..72fe06ca1 100644 --- a/OWLTools-Annotation/src/main/java/owltools/gaf/rules/go/GoAnnotationRulesFactoryImpl.java +++ b/OWLTools-Annotation/src/main/java/owltools/gaf/rules/go/GoAnnotationRulesFactoryImpl.java @@ -1,5 +1,6 @@ package owltools.gaf.rules.go; +import java.io.InputStream; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -45,8 +46,8 @@ public GoAnnotationRulesFactoryImpl(String qcfile, String xrfabbslocation, Parse } public GoAnnotationRulesFactoryImpl(OWLGraphWrapper graph, TraversingEcoMapper eco, String taxonModule) { - this("http://www.geneontology.org/quality_control/annotation_checks/annotation_qc.xml", - "http://www.geneontology.org/doc/GO.xrf_abbs", graph, eco, taxonModule); + this("https://raw.githubusercontent.com/owlcollab/owltools/master/docs/legacy/annotation_qc.xml", + "http://current.geneontology.org/metadata/GO.xrf_abbs", graph, eco, taxonModule); } @Override