diff --git a/bio/core/src/main/java/org/intermine/bio/dataconversion/OboConverter.java b/bio/core/src/main/java/org/intermine/bio/dataconversion/OboConverter.java index 67aef58e9db..711694c0611 100644 --- a/bio/core/src/main/java/org/intermine/bio/dataconversion/OboConverter.java +++ b/bio/core/src/main/java/org/intermine/bio/dataconversion/OboConverter.java @@ -199,7 +199,7 @@ private void storeDataset(Item ontology) throws ObjectStoreException { Item datasetItem = createItem("DataSet"); datasetItem.setAttribute("name", dataset); if (licence != null) { - datasetItem.setAttribute("licence", licence); + datasetItem.setAttributeIfNotNull("licence", licence); } datasetItem.setReference("dataSource", datasourceItem); store(datasetItem); diff --git a/bio/core/src/main/java/org/intermine/bio/task/OboConverterTask.java b/bio/core/src/main/java/org/intermine/bio/task/OboConverterTask.java index 73b467624d7..a5bcef96b4a 100644 --- a/bio/core/src/main/java/org/intermine/bio/task/OboConverterTask.java +++ b/bio/core/src/main/java/org/intermine/bio/task/OboConverterTask.java @@ -75,7 +75,14 @@ public void setTermClass(String termClass) { this.termClass = termClass; } - + /** + * Set the licence retrieved from the {bio-source}.properties file + * + * @param licence the licence + */ + public void setLicence(String licence) { + this.licence = licence; + } /** * Run the task @@ -106,6 +113,9 @@ public void execute() { OboConverter converter; if (file.endsWith(".obo")) { converter = new OboConverter(writer, model, file, ontologyName, url, termClass); + if (licence != null) { + converter.setLicence(licence); + } } else { throw new IllegalArgumentException("Don't know how to deal with file " + file); } diff --git a/bio/sources/do/do.properties b/bio/sources/do/do.properties index 1f215521f27..9fc51f5fb17 100644 --- a/bio/sources/do/do.properties +++ b/bio/sources/do/do.properties @@ -14,3 +14,4 @@ obo.ontology.url = http://www.disease-ontology.org # this class in a do_additions.xml file for this source obo.term.class = DOTerm +obo.ontology.licence = https://creativecommons.org/publicdomain/zero/1.0/ \ No newline at end of file diff --git a/bio/sources/eco/eco.properties b/bio/sources/eco/eco.properties index 18300bc7b87..16834cd4d83 100644 --- a/bio/sources/eco/eco.properties +++ b/bio/sources/eco/eco.properties @@ -14,3 +14,4 @@ obo.ontology.url = http://www.evidenceontology.org/ # this class in a eco_additions.xml file for this source obo.term.class = ECOTerm +obo.ontology.licence = https://creativecommons.org/publicdomain/zero/1.0/ \ No newline at end of file diff --git a/bio/sources/go/go.properties b/bio/sources/go/go.properties index cd864d0c34a..11c600f0c68 100644 --- a/bio/sources/go/go.properties +++ b/bio/sources/go/go.properties @@ -2,3 +2,5 @@ have.file.obo = true obo.ontology.name=GO obo.ontology.url=http://www.geneontology.org obo.term.class=GOTerm + +obo.ontology.licence = https://creativecommons.org/licenses/by/4.0/ diff --git a/bio/sources/mammalian-phenotype-ontology/mammalian-phenotype-ontology.properties b/bio/sources/mammalian-phenotype-ontology/mammalian-phenotype-ontology.properties index 85b50187534..7c1dc0965e7 100644 --- a/bio/sources/mammalian-phenotype-ontology/mammalian-phenotype-ontology.properties +++ b/bio/sources/mammalian-phenotype-ontology/mammalian-phenotype-ontology.properties @@ -8,9 +8,11 @@ have.file.obo = true obo.ontology.name = Mammalian Phenotype Ontology # set a URL at which more information on the ontology can be found -obo.ontology.url = http://www.obofoundry.org/cgi-bin/detail.cgi?id=mammalian_phenotype +obo.ontology.url = http://www.informatics.jax.org/vocab/mp_ontology # set the class name for terms that will be created, you may need to define # this class in a mammalian-phenotype-ontology_additions.xml file for this source obo.term.class = MammalianPhenotypeTerm +obo.ontology.licence = http://creativecommons.org/licenses/by/4.0/ + diff --git a/bio/sources/psi-mi-ontology/psi-mi-ontology.properties b/bio/sources/psi-mi-ontology/psi-mi-ontology.properties index dc70f37aa9d..05e25eca7d4 100644 --- a/bio/sources/psi-mi-ontology/psi-mi-ontology.properties +++ b/bio/sources/psi-mi-ontology/psi-mi-ontology.properties @@ -4,7 +4,9 @@ compile.dependencies = intermine/objectstore/main,\ have.file.obo = true obo.ontology.name=PSI Molecular Interactions -obo.ontology.url=http://psidev.sourceforge.net/ +obo.ontology.url=https://github.com/HUPO-PSI/psi-mi-CV obo.term.class=InteractionTerm +obo.ontology.licence = https://creativecommons.org/licenses/by/4.0/ + diff --git a/bio/sources/so/so.properties b/bio/sources/so/so.properties index 78b07fe94d1..d3023536180 100644 --- a/bio/sources/so/so.properties +++ b/bio/sources/so/so.properties @@ -7,4 +7,5 @@ obo.ontology.name=Sequence Ontology obo.ontology.url=http://www.sequenceontology.org obo.term.class=SOTerm +obo.ontology.licence = https://creativecommons.org/licenses/by/4.0/ diff --git a/bio/sources/uberon/uberon.properties b/bio/sources/uberon/uberon.properties index c7b34c31929..0c10b78f14e 100644 --- a/bio/sources/uberon/uberon.properties +++ b/bio/sources/uberon/uberon.properties @@ -8,9 +8,11 @@ have.file.obo = true obo.ontology.name = Uber Anatomy Ontology # set a URL at which more information on the ontology can be found -obo.ontology.url = http://obofoundry.org/wiki/index.php/UBERON:Main_Page +obo.ontology.url = http://uberon.org/ # set the class name for terms that will be created, you may need to define # this class in a uberon_additions.xml file for this source obo.term.class = AnatomyTerm +obo.ontology.licence = http://creativecommons.org/licenses/by/3.0/ + diff --git a/plugin/src/main/groovy/org/intermine/plugin/integrate/IntegrateUtils.groovy b/plugin/src/main/groovy/org/intermine/plugin/integrate/IntegrateUtils.groovy index 370d19a9717..30881219f28 100644 --- a/plugin/src/main/groovy/org/intermine/plugin/integrate/IntegrateUtils.groovy +++ b/plugin/src/main/groovy/org/intermine/plugin/integrate/IntegrateUtils.groovy @@ -240,6 +240,9 @@ class IntegrateUtils { } } + String licence = (bioSourceProperties.getProperty("obo.ontology.licence") != null) ? + bioSourceProperties.getProperty("obo.ontology.licence") : "" + ant.taskdef(name: "convertOBO", classname: "org.intermine.bio.task.OboConverterTask") { classpath { dirset(dir: gradleProject.getBuildDir().getAbsolutePath()) @@ -251,7 +254,8 @@ class IntegrateUtils { osName: "osw." + COMMON_OS_PREFIX + "-tgt-items", modelName: "genomic", ontologyName: bioSourceProperties.getProperty("obo.ontology.name"), url: bioSourceProperties.getProperty("obo.ontology.url"), - termClass: bioSourceProperties.getProperty("obo.term.class")) + termClass: bioSourceProperties.getProperty("obo.term.class"), + licence: licence) } def loadSingleSource = { source ->