Closed laughedelic closed 8 years ago
Actually, looking at the TitanGraphQuery.has
, I see that it takes TitanPredicate
which can be not only primitive Cmp
, but also Contain
, Geo
or Text
, which could be quite useful in general. Among them Tinkerpop supports only the first two, so Titan has defined conversions from Tinkerpop's
Contains
Compare
to TitanPredicate
. See the beautiful code.
@eparejatobes RE https://github.com/bio4j/angulillos-titan/pull/17#issuecomment-196979060:
I vote for depending on TinkerPop 3.x
Look, I've added here two enums, which are equivalent to the Tinkerpop or Titan ones. When you write code with bio4j/angulillos, you either use backend's query mechanism or these methods in the TypedElementIndex
interface, and then it doesn't matter for you, to write
import org.apache.tinkerpop.gremlin.process.traversal.Compare;
GoGraph().goTermIdIndex().query(Compare.eq, "ID12345");
or
import com.bio4j.angulillos.QueryPredicate.Compare;
GoGraph().goTermIdIndex().query(Compare.EQUAL, "ID12345");
Then if you use bio4j-titan, it also doesn't matter to you, because both things will be converted to TitanPredicate
. And https://github.com/bio4j/angulillos-titan/pull/17 is ready for this solution.
I think that it is quite important to keep angulillos-core dependencies-free (without real need), while angulillos-titan is going to depend on it anyway, just because titan-core does.
@laughedelic fair enough.
In #36 it was removed from the
query
method. See https://github.com/bio4j/angulillos-titan/pull/17#issuecomment-196954920.Compare
(which was used here)Compare
Cmp
which are all basically the same thing. I'm going to add here the same thing and in angulillos-titan convert it to the Titan's
Cmp
.