Removing a label from Vertex
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Amazon Neptune supports multiple labels for a vertex. While I'm able to add a new label to vertex, I couldn't find a way to remove it.
I found out that
vertex.addLabel('human')
vertex.removeLabel('human')
http://tinkerpop.apache.org/docs/current/reference/#_multi_label
is not supported on AWS Neptune.
Also trying drop()
labels like properties not working.
Neptune documentation says:
gremlin> g.addV('label1').property(id, 'customid')
gremlin> g.addV('label2').property(id, 'customid')
gremlin> g.V('customid').label()
==>label1::label2
But that way you can only add label nothing about the removal of the label.
I am looking for some way like removeLabel()
to remove label without removing the vertex.
gremlin amazon-neptune
add a comment |
Amazon Neptune supports multiple labels for a vertex. While I'm able to add a new label to vertex, I couldn't find a way to remove it.
I found out that
vertex.addLabel('human')
vertex.removeLabel('human')
http://tinkerpop.apache.org/docs/current/reference/#_multi_label
is not supported on AWS Neptune.
Also trying drop()
labels like properties not working.
Neptune documentation says:
gremlin> g.addV('label1').property(id, 'customid')
gremlin> g.addV('label2').property(id, 'customid')
gremlin> g.V('customid').label()
==>label1::label2
But that way you can only add label nothing about the removal of the label.
I am looking for some way like removeLabel()
to remove label without removing the vertex.
gremlin amazon-neptune
add a comment |
Amazon Neptune supports multiple labels for a vertex. While I'm able to add a new label to vertex, I couldn't find a way to remove it.
I found out that
vertex.addLabel('human')
vertex.removeLabel('human')
http://tinkerpop.apache.org/docs/current/reference/#_multi_label
is not supported on AWS Neptune.
Also trying drop()
labels like properties not working.
Neptune documentation says:
gremlin> g.addV('label1').property(id, 'customid')
gremlin> g.addV('label2').property(id, 'customid')
gremlin> g.V('customid').label()
==>label1::label2
But that way you can only add label nothing about the removal of the label.
I am looking for some way like removeLabel()
to remove label without removing the vertex.
gremlin amazon-neptune
Amazon Neptune supports multiple labels for a vertex. While I'm able to add a new label to vertex, I couldn't find a way to remove it.
I found out that
vertex.addLabel('human')
vertex.removeLabel('human')
http://tinkerpop.apache.org/docs/current/reference/#_multi_label
is not supported on AWS Neptune.
Also trying drop()
labels like properties not working.
Neptune documentation says:
gremlin> g.addV('label1').property(id, 'customid')
gremlin> g.addV('label2').property(id, 'customid')
gremlin> g.V('customid').label()
==>label1::label2
But that way you can only add label nothing about the removal of the label.
I am looking for some way like removeLabel()
to remove label without removing the vertex.
gremlin amazon-neptune
gremlin amazon-neptune
asked Jan 3 at 9:33


CagatayCagatay
84
84
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You will find this text in the Apache TinkerPop documentation at [1]
"This is because TinkerPop does not allow the vertex label to be changed after the vertex has been created."
The ability to change a vertex label after it is created is not allowed per the TinkerPop reference documentation and implementation. This as far as I know is honored by most if not all of the TinkerPop enabled Graph DBs.
The example you found is part of the custom support for Neo4J when connected directly (not via a Gremlin Server style of connection) where the vertex object can be directly manipulated.
If you need the concept of an editable label I would suggest using a property instead. The net result will be about the same in terms of looking up by property versus by label and a lot more portable.
[1] http://tinkerpop.apache.org/docs/current/reference/#_graphml_reader_writer
Thank you for your comment I imagined there might be something similar in Neptune because they give some way to add a label. Sadly looks like there is no way to remove labels you added.
– Cagatay
Jan 4 at 7:53
I'm referring this: If you try to create a new vertex using the g.addV() and a vertex with that ID already exists, the operation fails. The exception to this is if you specify a new label for the vertex, the operation succeeds but adds the new label and any additional properties specified to the existing vertex. Nothing is overwritten. A new vertex is not created. The vertex ID does not change and remains unique.
– Cagatay
Jan 4 at 7:59
You can add additional labels using Neptune but you cannot remove existing ones. It's an additive operation. I think the best approach in general is to use a property for something like this rather than the label.
– Kelvin Lawrence
Jan 7 at 18:08
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54019536%2fremoving-a-label-from-vertex%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You will find this text in the Apache TinkerPop documentation at [1]
"This is because TinkerPop does not allow the vertex label to be changed after the vertex has been created."
The ability to change a vertex label after it is created is not allowed per the TinkerPop reference documentation and implementation. This as far as I know is honored by most if not all of the TinkerPop enabled Graph DBs.
The example you found is part of the custom support for Neo4J when connected directly (not via a Gremlin Server style of connection) where the vertex object can be directly manipulated.
If you need the concept of an editable label I would suggest using a property instead. The net result will be about the same in terms of looking up by property versus by label and a lot more portable.
[1] http://tinkerpop.apache.org/docs/current/reference/#_graphml_reader_writer
Thank you for your comment I imagined there might be something similar in Neptune because they give some way to add a label. Sadly looks like there is no way to remove labels you added.
– Cagatay
Jan 4 at 7:53
I'm referring this: If you try to create a new vertex using the g.addV() and a vertex with that ID already exists, the operation fails. The exception to this is if you specify a new label for the vertex, the operation succeeds but adds the new label and any additional properties specified to the existing vertex. Nothing is overwritten. A new vertex is not created. The vertex ID does not change and remains unique.
– Cagatay
Jan 4 at 7:59
You can add additional labels using Neptune but you cannot remove existing ones. It's an additive operation. I think the best approach in general is to use a property for something like this rather than the label.
– Kelvin Lawrence
Jan 7 at 18:08
add a comment |
You will find this text in the Apache TinkerPop documentation at [1]
"This is because TinkerPop does not allow the vertex label to be changed after the vertex has been created."
The ability to change a vertex label after it is created is not allowed per the TinkerPop reference documentation and implementation. This as far as I know is honored by most if not all of the TinkerPop enabled Graph DBs.
The example you found is part of the custom support for Neo4J when connected directly (not via a Gremlin Server style of connection) where the vertex object can be directly manipulated.
If you need the concept of an editable label I would suggest using a property instead. The net result will be about the same in terms of looking up by property versus by label and a lot more portable.
[1] http://tinkerpop.apache.org/docs/current/reference/#_graphml_reader_writer
Thank you for your comment I imagined there might be something similar in Neptune because they give some way to add a label. Sadly looks like there is no way to remove labels you added.
– Cagatay
Jan 4 at 7:53
I'm referring this: If you try to create a new vertex using the g.addV() and a vertex with that ID already exists, the operation fails. The exception to this is if you specify a new label for the vertex, the operation succeeds but adds the new label and any additional properties specified to the existing vertex. Nothing is overwritten. A new vertex is not created. The vertex ID does not change and remains unique.
– Cagatay
Jan 4 at 7:59
You can add additional labels using Neptune but you cannot remove existing ones. It's an additive operation. I think the best approach in general is to use a property for something like this rather than the label.
– Kelvin Lawrence
Jan 7 at 18:08
add a comment |
You will find this text in the Apache TinkerPop documentation at [1]
"This is because TinkerPop does not allow the vertex label to be changed after the vertex has been created."
The ability to change a vertex label after it is created is not allowed per the TinkerPop reference documentation and implementation. This as far as I know is honored by most if not all of the TinkerPop enabled Graph DBs.
The example you found is part of the custom support for Neo4J when connected directly (not via a Gremlin Server style of connection) where the vertex object can be directly manipulated.
If you need the concept of an editable label I would suggest using a property instead. The net result will be about the same in terms of looking up by property versus by label and a lot more portable.
[1] http://tinkerpop.apache.org/docs/current/reference/#_graphml_reader_writer
You will find this text in the Apache TinkerPop documentation at [1]
"This is because TinkerPop does not allow the vertex label to be changed after the vertex has been created."
The ability to change a vertex label after it is created is not allowed per the TinkerPop reference documentation and implementation. This as far as I know is honored by most if not all of the TinkerPop enabled Graph DBs.
The example you found is part of the custom support for Neo4J when connected directly (not via a Gremlin Server style of connection) where the vertex object can be directly manipulated.
If you need the concept of an editable label I would suggest using a property instead. The net result will be about the same in terms of looking up by property versus by label and a lot more portable.
[1] http://tinkerpop.apache.org/docs/current/reference/#_graphml_reader_writer
edited Jan 3 at 15:24
answered Jan 3 at 15:16
Kelvin LawrenceKelvin Lawrence
759411
759411
Thank you for your comment I imagined there might be something similar in Neptune because they give some way to add a label. Sadly looks like there is no way to remove labels you added.
– Cagatay
Jan 4 at 7:53
I'm referring this: If you try to create a new vertex using the g.addV() and a vertex with that ID already exists, the operation fails. The exception to this is if you specify a new label for the vertex, the operation succeeds but adds the new label and any additional properties specified to the existing vertex. Nothing is overwritten. A new vertex is not created. The vertex ID does not change and remains unique.
– Cagatay
Jan 4 at 7:59
You can add additional labels using Neptune but you cannot remove existing ones. It's an additive operation. I think the best approach in general is to use a property for something like this rather than the label.
– Kelvin Lawrence
Jan 7 at 18:08
add a comment |
Thank you for your comment I imagined there might be something similar in Neptune because they give some way to add a label. Sadly looks like there is no way to remove labels you added.
– Cagatay
Jan 4 at 7:53
I'm referring this: If you try to create a new vertex using the g.addV() and a vertex with that ID already exists, the operation fails. The exception to this is if you specify a new label for the vertex, the operation succeeds but adds the new label and any additional properties specified to the existing vertex. Nothing is overwritten. A new vertex is not created. The vertex ID does not change and remains unique.
– Cagatay
Jan 4 at 7:59
You can add additional labels using Neptune but you cannot remove existing ones. It's an additive operation. I think the best approach in general is to use a property for something like this rather than the label.
– Kelvin Lawrence
Jan 7 at 18:08
Thank you for your comment I imagined there might be something similar in Neptune because they give some way to add a label. Sadly looks like there is no way to remove labels you added.
– Cagatay
Jan 4 at 7:53
Thank you for your comment I imagined there might be something similar in Neptune because they give some way to add a label. Sadly looks like there is no way to remove labels you added.
– Cagatay
Jan 4 at 7:53
I'm referring this: If you try to create a new vertex using the g.addV() and a vertex with that ID already exists, the operation fails. The exception to this is if you specify a new label for the vertex, the operation succeeds but adds the new label and any additional properties specified to the existing vertex. Nothing is overwritten. A new vertex is not created. The vertex ID does not change and remains unique.
– Cagatay
Jan 4 at 7:59
I'm referring this: If you try to create a new vertex using the g.addV() and a vertex with that ID already exists, the operation fails. The exception to this is if you specify a new label for the vertex, the operation succeeds but adds the new label and any additional properties specified to the existing vertex. Nothing is overwritten. A new vertex is not created. The vertex ID does not change and remains unique.
– Cagatay
Jan 4 at 7:59
You can add additional labels using Neptune but you cannot remove existing ones. It's an additive operation. I think the best approach in general is to use a property for something like this rather than the label.
– Kelvin Lawrence
Jan 7 at 18:08
You can add additional labels using Neptune but you cannot remove existing ones. It's an additive operation. I think the best approach in general is to use a property for something like this rather than the label.
– Kelvin Lawrence
Jan 7 at 18:08
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54019536%2fremoving-a-label-from-vertex%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown