Skip to content

Commit

Permalink
Added csv loader, removed types from biologicalEntities and Studies, …
Browse files Browse the repository at this point in the history
…removed URI as it is represented through the mongo _id, modified collections
  • Loading branch information
olgavrou committed Aug 11, 2016
1 parent 20b3440 commit 14ef7c4
Show file tree
Hide file tree
Showing 52 changed files with 2,197 additions and 325 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ etc
.idea
# Maven
**/target/**
#Application properties
*.properties

# Mac specific files
.DS_Store
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<modules>
<module>zooma-api</module>
<module>zooma-mongo</module>
<module>zooma-csv-loader</module>
</modules>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ public interface AnnotationFactory {
* @param studyAccession the accession of the study. Unique across this datasource
* @param studyURI the URI of the study that will be created, if present
* @param studyID the ID of the study in the datasource. If present, will be used to generate the URI
* @param studyType the URI that specifies the type of Study e.g. an experiment or pubmed article
* @param bioentityName the name of the bioentity. Should be unique per study in the datasource
* @param bioentityURI the URI of the bioentity that will be created, if present
* @param bioentityID the ID of the bioentity in the datasource. If present, will be used to generate the URI
* @param bioentityTypeURI the URI of the bioentity type in the datasource.
* @param propertyType the property type
* @param propertyValue the property value
* @param propertyURI the URI of the property that will be created, if present
Expand All @@ -67,12 +65,9 @@ Annotation createAnnotation(URI annotationURI,
String studyAccession,
URI studyURI,
String studyID,
URI studyType,
String bioentityName,
URI bioentityURI,
String bioentityID,
String bioentityTypeName,
URI bioentityTypeURI,
String propertyType,
String propertyValue,
URI propertyURI,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,57 +18,46 @@
public interface AnnotationLoadingSession {
String getDatasourceName();

Study getOrCreateStudy(String studyAccession, Collection<URI> studyTypes);
Study getOrCreateStudy(String studyAccession);

Study getOrCreateStudy(String studyAccession, String studyID, Collection<URI> studyTypes);
Study getOrCreateStudy(String studyAccession, String studyID);

Study getOrCreateStudy(String studyAccession, URI studyURI);

Study getOrCreateStudy(String studyAccession, URI studyURI, Collection<URI> studyTypes);

/**
* A method to create a biological entity object based on the bioentity name, types and set of studies
*
* @param bioentityName A name to identity the biological entity
* @param bioentityTypesNames An optional collection of names to represent the type of biological entity
* @param bioentityTypesURIs An optional collection of URIs to represent the type of biological entity
* @param studies A collection of studies linked to the biological entity
* @return BiologicalEntity
*/
BiologicalEntity getOrCreateBiologicalEntity(String bioentityName,
Collection<String> bioentityTypesNames,
Collection<URI> bioentityTypesURIs,
Study... studies);
Collection<Study> studies);

/**
* A method to create a biological entity object based on the bioentity name, types and set of studies
*
* @param bioentityName A name to identity the biological entity
* @param bioentityID An id that can be used to form the URI of the biological entity
* @param bioentityTypesNames An optional collection of names to represent the type of biological entity
* @param bioentityTypesURIs An optional collection of URIs to represent the type of biological entity
* @param studies A collection of studies linked to the biological entity
* @return BiologicalEntity
*/
BiologicalEntity getOrCreateBiologicalEntity(String bioentityName,
String bioentityID,
Collection<String> bioentityTypesNames,
Collection<URI> bioentityTypesURIs,
Study... studies);
Collection<Study> studies);

/**
* A method to create a biological entity object based on the bioentity name, types and set of studies
*
* @param bioentityName A name to identity the biological entity
* @param bioentityURI A URI that will be used to identify the biological entity
* @param bioentityTypesNames An optional collection of names to represent the type of biological entity
* @param bioentityTypesURIs An optional collection of URIs to represent the type of biological entity
* @param studies A collection of studies linked to the biological entity
* @return BiologicalEntity
*/
BiologicalEntity getOrCreateBiologicalEntity(String bioentityName,
URI bioentityURI,
Collection<String> bioentityTypesNames,
Collection<URI> bioentityTypesURIs,
Study... studies);
Collection<Study> studies);

Property getOrCreateProperty(String propertyType, String propertyValue);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @author Tony Burdett
* @date 30/03/12
*/
public interface ZoomaDAO<I extends Identifiable> {
public interface ZoomaDAO<I> {
/**
* Retrieves a name that represents the datasource that this DAO retrieves data from. Although this is not treated
* as a unique key, it is best to take care to ensure that implementations define a reasonably unique name so as to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @author Tony Burdett
* @date 08/03/12
*/
public interface Annotation extends Identifiable {
public interface Annotation {
/**
* Returns a collection of biological entities to which this annotation applies
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author Tony Burdett
* @date 04/10/13
*/
public interface AnnotationSource extends Identifiable {
public interface AnnotationSource {
/**
* Returns the type of this annotation source
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @author Simon Jupp
* @date 07/10/2013 Functional Genomics Group EMBL-EBI
*/
public interface AnnotationTarget extends Identifiable {
public interface AnnotationTarget {
/**
* Returns the type that was assigned to this annotation target entity
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author Tony Burdett
* @date 13/03/12
*/
public interface BiologicalEntity extends AnnotationTarget {
public interface BiologicalEntity {
/**
* Returns the name that was assigned to this biological entity to identify it within the context of the study in
* which it was described.
Expand Down
2 changes: 1 addition & 1 deletion zooma-api/src/main/java/uk/ac/ebi/spot/model/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @author Tony Burdett
* @date 08/03/12
*/
public interface Property extends Identifiable, Comparable<Property> {
public interface Property extends Comparable<Property> {
/**
* Returns the property value for this property.
*
Expand Down
2 changes: 1 addition & 1 deletion zooma-api/src/main/java/uk/ac/ebi/spot/model/Study.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author Tony Burdett
* @date 13/03/12
*/
public interface Study extends TargetSource {
public interface Study {
/**
* An accession attributed to this study, usually unique within the context of the datasource it was derived from.
* This accession may not be globally unique (for instance, in the case of studies present in several datasources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


/**
* A ZOOMA service that indicates the status of backend services. This is used to indicate whether ZOOMA is ready to
* A ZOOMA service that indicates the status of backend service. This is used to indicate whether ZOOMA is ready to
* serve requests, or force a reinitialization of backend infrastructure to ZOOMA.
* <p/>
* Any service implementations that require initialization, startup or indexing should implement this service to only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import java.net.URI;
import java.util.Collection;
import java.util.Map;

/**
* A ZOOMA service that allows searching over the set of {@link Study}s known to ZOOMA. The search facililty on this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Encapsulates rules that allow ZOOMA search strings to be processed. How this processing is performed is up to
* individual implementations.
* <p/>
* Some of the ZOOMA search services declare methods that take property value search strings and use the supplied search
* Some of the ZOOMA search service declare methods that take property value search strings and use the supplied search
* string to query for matching annotations. This class will return processed versions of the search string, allowing,
* for example, partial matches to be evaluated
*
Expand Down
3 changes: 2 additions & 1 deletion zooma-api/src/main/java/uk/ac/ebi/spot/util/ZoomaUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ public static String generateHashEncodedID(MessageDigest messageDigest, boolean
idContent.append(s);
}
try {
String s = idContent.toString();
// encode the content using the supplied message digest
byte[] digest = messageDigest.digest(idContent.toString().getBytes("UTF-8"));
byte[] digest = messageDigest.digest(s.getBytes("UTF-8"));

// now translate the resulting byte array to hex
String idKey = getHexRepresentation(digest);
Expand Down
Binary file added zooma-csv-loader/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
Loading

0 comments on commit 14ef7c4

Please sign in to comment.