Coldfire
Coldfire
ATApache TinkerPop
Created by Coldfire on 12/10/2024 in #questions
Parameterized edges creation in existing graph
I tried to work with the previous script but somehow it doesn't work, I assume it has to do with the fact properties do not have the same name between vertices label. I created a simpler Gremlify with data that looks more like my project data https://gremlify.com/mgvxldbmmz (I need to connect all 'Connection' to corresponding 'Interface' in this example) In the second query tab, I exposed something I don't understand about select() step scope in a projection by() step.
g
.V().hasLabel('connection').as('con')
.project('dev', 'int', 'connection', 'device')
.by('devName')
.by('intName')
.by(select('con'))
.by(
// if I select 'devName', results are correct
//select('con').values('devName')

// using a nested select always give the same 'device'
__.V().hasLabel('device').has('name', select('con').values('devName'))
)
g
.V().hasLabel('connection').as('con')
.project('dev', 'int', 'connection', 'device')
.by('devName')
.by('intName')
.by(select('con'))
.by(
// if I select 'devName', results are correct
//select('con').values('devName')

// using a nested select always give the same 'device'
__.V().hasLabel('device').has('name', select('con').values('devName'))
)
Maybe it's about query optimization but it seems strange it does not use the same 'con' vertex when used inside has() step.
11 replies
ATApache TinkerPop
Created by Alex on 12/11/2024 in #questions
How to create indexes by Label?
I’m testing Janusgraph and have the same label index issue. If I use hasLabel() it performs a full scan. What I did is add a fake ‘label’ property on vertices with a mixed index on it. Then I only use filtering on this property (it’s ok for now with a small graph of 500k nodes)
11 replies
ATApache TinkerPop
Created by Coldfire on 12/10/2024 in #questions
Parameterized edges creation in existing graph
Thanks ! I will try this on Janusgraph. From the complexity of the script I understand it is not something people usually do with Gremlin ? Using a client API I guess it would be simpler by creating multiple queries in a loop but I don’t find that efficient.
11 replies
ATApache TinkerPop
Created by Coldfire on 12/10/2024 in #questions
Parameterized edges creation in existing graph
Yes indeed I want to connect vertices based on common properties. As I said my graph is just a big XML document (so there is only parent/child edges) and I want to use Gremlin as my ‘index’ engine . Direction does not really matter but I don’t think it should be a blocking point ?
11 replies