Skip to content

Unused PropertyKeys and Vertex/EdgeLabels #77

@laughedelic

Description

@laughedelic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions