Skip to content

Commit

Permalink
Added the licences to be attached to dataset linked to ontologies #2264
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniela Butano committed Jun 2, 2020
1 parent b78a363 commit c4ac57f
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 6 deletions.
Expand Up @@ -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);
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions bio/sources/do/do.properties
Expand Up @@ -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/
1 change: 1 addition & 0 deletions bio/sources/eco/eco.properties
Expand Up @@ -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/
2 changes: 2 additions & 0 deletions bio/sources/go/go.properties
Expand Up @@ -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/
Expand Up @@ -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/

4 changes: 3 additions & 1 deletion bio/sources/psi-mi-ontology/psi-mi-ontology.properties
Expand Up @@ -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/


1 change: 1 addition & 0 deletions bio/sources/so/so.properties
Expand Up @@ -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/

4 changes: 3 additions & 1 deletion bio/sources/uberon/uberon.properties
Expand Up @@ -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/

Expand Up @@ -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())
Expand All @@ -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 ->
Expand Down

0 comments on commit c4ac57f

Please sign in to comment.