bio4j / bio4j-titan

Titan-specific bio4j implementation
https://github.com/bio4j/bio4j
6 stars 2 forks source link

Bug regarding indices initialization #56

Closed pablopareja closed 9 years ago

pablopareja commented 9 years ago

We need to change how indices are initialized in the current version since the following error is thrown when running ImportUniprot:

SEVERE: null
java.lang.IllegalArgumentException: The property key is already indexed with the same index name and incompatible characteristics
        at com.bio4j.angulillos.titan.TitanTypedVertexIndex$DefaultUnique.<init>(TitanTypedVertexIndex.java:205)
        at com.bio4j.titan.model.uniprot.TitanUniprotGraph.initIndices(TitanUniprotGraph.java:1066)
        at com.bio4j.titan.model.uniprot.TitanUniprotGraph.<init>(TitanUniprotGraph.java:463)
        at com.bio4j.titan.model.uniprot.programs.ImportUniprotTitan.config(ImportUniprotTitan.java:49)
        at com.bio4j.titan.model.uniprot.programs.ImportUniprotTitan.config(ImportUniprotTitan.java:37)
        at com.bio4j.model.uniprot.programs.ImportUniprot.importUniprot(ImportUniprot.java:151)
        at com.bio4j.titan.model.uniprot.programs.ImportUniprotTitan.execute(ImportUniprotTitan.java:58)
        at com.ohnosequences.util.ExecuteFromFile.main(ExecuteFromFile.java:66)
        at com.bio4j.titan.programs.ImportTitanDB.main(ImportTitanDB.java:8)

The exception is thrown when ImportUniprot is executed for the second time, in this case for TrEMBL XML file We should do something equivalent to the createOrGet method for properties....

:space_invader:

pablopareja commented 9 years ago

The error is in this line from TitanTypedVertexIndex

https://github.com/bio4j/angulillos-titan/blob/master/src/main/java/com/bio4j/angulillos/titan/TitanTypedVertexIndex.java#L205

One thing I don't understand is why it's saying:

The property key is already indexed with the same index name and incompatible characteristics

when that's not true... :question:

Perhaps the DefaultUnique constructor should be modified so that when trying to create an index that coincides with one that already exists it just simply does nothing ?

pablopareja commented 9 years ago

I think the problem is originated here:

https://github.com/bio4j/angulillos-titan/blob/master/src/main/java/com/bio4j/angulillos/titan/TitanTypedVertexIndex.java#L193

the part:

alreadyThere.isCompositeIndex()

will always be false in our case, right?

pablopareja commented 9 years ago

@eparejatobes Should I create a new branch in angulillos-titan to fix this :question:

eparejatobes commented 9 years ago

hey sorry I didn't get any notifications about this

eparejatobes commented 9 years ago

moved to bio4j/angulillos-titan#11. In general yes, one needs something like createOrGet for indexes, but it should check that you're getting the same exact thing that you wanted to create. It's a bit frustrating that there's not a real datatype for each of the specifications of Titan types (labels, indexes, properties, etc) with a real structural equality; if there were, createOrGet for all of them would be obvious and safe.

eparejatobes commented 9 years ago

fixed in angulillos, closing