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

Reusing Attributes from VertexType #46

Open
alberskib opened this issue Jul 27, 2014 · 22 comments
Open

Reusing Attributes from VertexType #46

alberskib opened this issue Jul 27, 2014 · 22 comments

Comments

@alberskib
Copy link
Contributor

@bio4j/dynamograph
After investiagtion it looks like it is more difficult than I thought to reuse those attributes.
Solution that comes to my mind is to create special VertexItem for vertexType which will be similar to item from tabula but it will not take Table as input argument. Aditionally to this change Tabula item should be modified in order to take table and VertexItem as constructor arguments.

@eparejatobes
Copy link
Member

hey @alberskib what kind of problems did you encounter? could you push or write something?

@alberskib
Copy link
Contributor Author

Problem is similar to one that we have with edges. In next hour I will push sth because now I must go out.

@alberskib
Copy link
Contributor Author

Sorry for long waiting but I think that I am closer to proper solution than I was when I create this issue.
Now I should convert Map[String, AttributeValue] to the specific item and everything will work correctly.
Pushed change is not reusing attributes from scarph model but solve almost all problems that stop me form doing this.

@laughedelic
Copy link
Member

@alberskib
Copy link
Contributor Author

Unfortunatelly there is still problem that for me is hard to solve:
Can't map ohnosequences.tabula.impl.ImplicitConversions.fromSDKRep.type over As (maybe the resulting types are not distinct)

@eparejatobes
Copy link
Member

code? where?

@alberskib
Copy link
Contributor Author

@bio4j/dynamograph
Hello

Sorry for constantly asking you for help but I try several things and none of them are worked properly (I spent too much time on it). I will appreciate any clues or general idea how to solve next problems:

Can't prove that P ∈ AnyDynamoVertex.this.tpe.record.Properties
[error]       def apply(rep: dynamoVertex.Rep): p.Raw = rep.get(p)
[error]                                                        ^

/src/main/scala/com/bio4j/dynamograph/AnyDynamoVertex.scala:28: Can't prove that com.bio4j.dynamograph.model.GeneralSchema.id.type ∈ AnyDynamoVertex.this.tpe.record.Properties
[error]       val it = dao.getOutRelationships(rep.get(id), e).asInstanceOf[List[e.Rep]]
scala/com/bio4j/dynamograph/mapper/GoMapper.scala:26: type mismatch;
[error]  found   : Int
[error]  required: a.Value
[error]     (which expands to)  a.Raw
[error]  Note: implicit method caseN is not applicable here because it comes after the application point and it lacks an explicit result type
[error]       at[A]( a => (a is vertexAttrs(a.label).toInt): A#Rep )

and

/src/main/scala/com/bio4j/dynamograph/writer/VertexWriter.scala:28: could not find implicit value for parameter transf: ohnosequences.typesets.FromProperties[V#Record#Properties,scala.collection.immutable.Map[String,com.amazonaws.services.dynamodbv2.model.AttributeValue]]{type Reps = _1502.i.record.Raw}
[error]       ThroughputStatus(1, 1))) putItem vertexTable.vertexItem withValue (vertexTable.vertexItem ->> rep))
[error]                                                               ^

@alberskib
Copy link
Contributor Author

Ok, now I am closer to the solution, but I still face last error.

@eparejatobes
Copy link
Member

Hey @alberskib I was out this weekend. I'm reviewing everything here, I think it'll take one hour or two.

@alberskib
Copy link
Contributor Author

Hey @eparejatobes. Did you find time to take a look?

@eparejatobes
Copy link
Member

I'm on it, it involves fixing a lot of signatures and stuff, it's taking a bit more than I expected :)

don't push to this branch in the meantime, I'm close to finishing it

@alberskib
Copy link
Contributor Author

Ok. Thanks for help :)

@eparejatobes
Copy link
Member

hey @alberskib mostly done for vertices; but once you see the pattern is really easy to do for edges. I know this is pretty tricky but once it is finished we will have a pretty nice generic DynamoDB graph db :)

@alberskib
Copy link
Contributor Author

@eparejatobes Great. I will take a look and try to write the same thing for edges. One more time sorry for constantly asking for help.

@eparejatobes
Copy link
Member

No problem, all of this is actually pretty tricky, there's a lot of compiler bugs etc. I'll work on making things easier tomorrow afternoon in scarph and tabula.

@alberskib
Copy link
Contributor Author

Hey @eparejatobes. How things are going with scarph and tabula?

@alberskib
Copy link
Contributor Author

Hey @bio4j/dynamograph What do you think about Either for error handling?
ie:

def read(identifier : vertexTable.VertexId#Value) : Either[String,Item#Record#Rep] = {
 val getResult = ServiceProvider.service please (FromHashKeyTable(table, Active (
      table,
      ServiceProvider.service.account,
      ThroughputStatus(1, 1)
    )) getItem item withKeys (identifier))
    getResult.output match {
      case success: GetItemSuccess[Item] => Right(record ->> success.item)
      case failure : GetItemFailure[Item] => Left(failure.msg)
    }

@alberskib
Copy link
Contributor Author

Hey @eparejatobes Any progress?

@eparejatobes
Copy link
Member

yes, I want to discuss with you tomorrow the final shape of this. the sooner the better, when are you free tomorrow?

@alberskib
Copy link
Contributor Author

Hm 7 am 8am eventually 9 am? or you prefer 2pm?

@eparejatobes
Copy link
Member

14:00 is fine, maybe I can find the time to do some stuff in scarph and tabula before. Take a look at #48 and see you tomorrow 👍

@laughedelic
Copy link
Member

I'll try to join you guys, maybe I won't be very useful, but I'll try to catch up what's going on ")

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

3 participants