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

Updating repo so that classes extend/implement those defined at bio4j main repository #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eparejatobes
Copy link
Member

Hey!

We just realized yesterday that we forgot at some point to adapt/update model classes here so that they implement or extends those defined at the main repository by means of the ones in the new and shiny blueprints-specific repository.

So far classes here have been extending those that were defined in the obsolete project BioinfoNeo4j - which were included temporarily in bioinfo-utils repo.

I'm going to create a new set of classes for all this here so that we have something equivalent to what we already got for the Titan implementation.

Let me know if you have any concern/insight on this 😉

@eparejatobes
Copy link
Member

fine but do it on a different branch

@pablopareja
Copy link
Member Author

OK... I like branches so much... 💩

I forgot to ask you, what names should they have?
So far they're called:

  • BasicEntity (for nodes)
  • BasicRelationsihp
  • Neo4jManager

We could keep Neo4jManager name as it is.
For the other two maybe we can change them to: BasicVertex/BasicVertexNeo4j and BasicEdge/BasicEdgeNeo4j ❓

@eparejatobes
Copy link
Member

why not just Vertex and Edge?

@pablopareja
Copy link
Member Author

I'm OK with that but in that case we should probably change those at blueprints repository too:

@pablopareja
Copy link
Member Author

I just realized that the edge class had such a funny name... perhaps it's the perfect time to name all this with some coherence along Bio4j repositories... 😄

@eparejatobes
Copy link
Member

OK

@pablopareja
Copy link
Member Author

@eparejatobes
Copy link
Member

but why this is an issue?

@pablopareja
Copy link
Member Author

Since in principle I need to find a way to go from a Neo4j node as parameter for a constructor to the underlying blueprints Vertex object in the case we're extending the BasicVertex class at blueprints repo...

@eparejatobes
Copy link
Member

mmm I don't know if I understand you. Just make your neo4j nodes Vertices

@pablopareja
Copy link
Member Author

but that would mean that we would have to change everything so that we would be using 100% Blueprints stuff ! 😧

@eparejatobes
Copy link
Member

what? I see two (or more) options here

  1. make the neo4j implement just the abstract model, and forget about blueprints stuff. It could be easy to implement a wrapper on top of it if needed
  2. create a wrapper class implementing both the Blueprints interfaces and the Neo4j stuff
  3. use the Neo4j Blueprints implementation (a bit funky for my taste)

@eparejatobes
Copy link
Member

footnote: I'm bashing Scala a lot lately, but when you see this things in Java, you get some perspective

@pablopareja
Copy link
Member Author

I think I'd go for the first option.
In any case, could you explain a bit more the second one? (I'm not sure I understand what you mean)

@eparejatobes
Copy link
Member

public abstract class Node implements org.neo4j.graphdb.Node, com.tinkerpop.blueprints.Vertex {
  // blahblahblah
}

@pablopareja
Copy link
Member Author

mmm OK
maybe now it'd easier to go for the first option?

@eparejatobes
Copy link
Member

not only easier but it actually makes more sense, we want to make use of funky neo4j stuff just as labels and the like

@laughedelic
Copy link
Member

I'm not sure that I understand your conclusions. The blueprints layer will become useless with neo4j?

@eparejatobes
Copy link
Member

@laughedelic not useless, just not used 👍

@laughedelic
Copy link
Member

why is it ok?

@eparejatobes
Copy link
Member

The thing is that in general we will need to change how things are stored at the graph level when implementing technology-specific distributions; given how closely connected to the store level Blueprints is, I don't know if it is possible to have an abstract works-for-everything Blueprints model. And even if it is, that's more or less what the abstract model is for.

Right now, I think of the Blueprints layer as a default works-for-every-graph-db distribution.

@laughedelic
Copy link
Member

ok

@eparejatobes
Copy link
Member

anyway, I'm open to all sort of suggestions about all this

@pablopareja
Copy link
Member Author

Summing up then, right now we should update neo4j implementation code so that it implements the interfaces defined at bio4j repo. We'll see in the future what we do so that we can have a tighter direct integration with blueprints repo.

Do you both agree on this?

@eparejatobes
Copy link
Member

👍

@laughedelic
Copy link
Member

yes, I do

@pablopareja
Copy link
Member Author

OK, so I get to work with this

@pablopareja pablopareja self-assigned this Feb 24, 2014
@eparejatobes
Copy link
Member

I just updated the package names in line with bio4j/model. I will finish this tomorrow; @pablopareja once I have this we should start checking if everything goes well with the import etc

@pablopareja
Copy link
Member Author

ok 😉

@eparejatobes
Copy link
Member

hey @pablopareja what I just pushed contains the abstract part for interacting with Neo4j. I implemented a node (not completely) and a rel in this style: NewTaxonNode and NewTaxonomyRel. The idea is do the same for all nodes and rels. Take a look at the diff and tell me how do you see this

@pablopareja
Copy link
Member Author

I cannot get the branch contents.... 😕

ppareja@PPAREJATABLET /c/era7/ppareja/proyectos/JAVA/bio4j-neo4jdb (master)
$ git checkout refactor/classes/implement/model
error: pathspec 'refactor/classes/implement/model' did not match any file(s) known to git.

I also executed this command trying to get the contents into that new branch but I might have ended up putting them overriding my master contents?

ppareja@PPAREJATABLET /c/era7/ppareja/proyectos/JAVA/bio4j-neo4jdb (master)
$ git pull origin refactor/classes/implement/model
remote: Counting objects: 24, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 24 (delta 1), reused 19 (delta 1)
Unpacking objects: 100% (24/24), done.
From github.com:bio4j/bio4j-neo4jdb

  • branch refactor/classes/implement/model -> FETCH_HEAD
    Updating 8423e31..9d63c72
    Fast-forward
    build.sbt | 2 +-
    .../java/com/bio4j/neo4j/BasicRelationship.java | 2 +-
    .../com/bio4j/neo4j/Bio4jRelationshipType.java | 9 +
    src/main/java/com/bio4j/neo4j/Neo4jNode.java | 497 ++++++++++++++++++++
    .../com/bio4j/neo4j/Neo4jPropertyContainer.java | 19 +
    .../java/com/bio4j/neo4j/Neo4jRelationship.java | 35 ++
    src/main/java/com/bio4j/neo4j/TypedNeo4jNode.java | 8 +
    .../java/com/bio4j/neo4j/model/nodes/CityNode.java | 2 +-
    .../com/bio4j/neo4j/model/nodes/NewTaxonNode.java | 121 +++++
    .../com/bio4j/neo4j/model/nodes/TaxonNode.java | 3 +-
    .../model/relationships/NewTaxonParentRel.java | 22 +
    .../com/bio4j/neo4j/model/util/Bio4jManager.java | 4 -
    12 files changed, 715 insertions(+), 9 deletions(-)
    create mode 100644 src/main/java/com/bio4j/neo4j/Bio4jRelationshipType.java
    create mode 100644 src/main/java/com/bio4j/neo4j/Neo4jNode.java
    create mode 100644 src/main/java/com/bio4j/neo4j/Neo4jPropertyContainer.java
    create mode 100644 src/main/java/com/bio4j/neo4j/Neo4jRelationship.java
    create mode 100644 src/main/java/com/bio4j/neo4j/TypedNeo4jNode.java
    create mode 100644 src/main/java/com/bio4j/neo4j/model/nodes/NewTaxonNode.java
    create mode 100644 src/main/java/com/bio4j/neo4j/model/relationships/NewTaxonParentRel.java

@eparejatobes
Copy link
Member

git remote update
git checkout <branchname>

And yes, you probably merged that branch into your local master. The fastest way out is (if you don't have any local commits) to make a fresh clone

@laughedelic
Copy link
Member

or git reset --hard <commit before this pull>

@eparejatobes
Copy link
Member

@pablopareja related with #6 what do you think of this? it will go in the next release, but I don't want to delay it

@eparejatobes
Copy link
Member

Anyway, probably better to wait for the abstract model updates in bio4j/bio4j#36

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

Successfully merging this pull request may close these issues.

3 participants