Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused PropertyKeys and Vertex/EdgeLabels #77

Open
laughedelic opened this issue Mar 19, 2016 · 0 comments
Open

Unused PropertyKeys and Vertex/EdgeLabels #77

laughedelic opened this issue Mar 19, 2016 · 0 comments

Comments

@laughedelic
Copy link
Member

I'm reading the code of, say TitanGoGraph.java, and I see:

    private VertexLabel goTermTypeLabel;

    private PropertyKey goTermTypekey;
    private PropertyKey goTermIdKey;
    private PropertyKey goTermNameKey;
    private PropertyKey goTermDefinitionKey;
    private PropertyKey goTermObsoleteKey;
    private PropertyKey goTermCommentKey;
    private PropertyKey goTermSynonymKey;

And these private fields are not used ever. They are assigned in the initTypes method:

  ...
  goTermSynonymKey = raw().createOrGet(mgmt, raw().titanPropertyMakerForVertexProperty( mgmt, GoTerm().synonym ).cardinality(Cardinality.SINGLE));
  goTermTypeLabel = raw().createOrGet(mgmt, goTermType.raw());

But then never used. Except the goTermTypeLabel which is used to create an index:

  goTermIdIndex =  new TitanTypedVertexIndex.DefaultUnique<>(mgmt, this, GoTerm().id);
  goTermIdIndex.makeOrGet(goTermTypeLabel);

There it's not really needed, because you create index once and can just call the same raw().createOrGet(mgmt, goTermType.raw()).

So I think those unused property keys and vertex/edge labels can be removed. Then with bio4j/angulillos#51 there is no much business left in this code and I think it can be made generic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant