Force relationships from a node label X to a node label Y to have specific propertiescreate relationships between nodes in parallelHow to create and retrieve a node by its label in Neo4j 2.0.0M5Adding relationship to existing nodes with CypherClone nodes and relationships with Cypherneo4j - labels vs properties vs relationship + nodeHow to use relationship index in CypherFind Nodes with the same properties in Neo4JCreate relationships using Node csv and Relationship csvHow to validate an update cypher query against a schema?Neo4j: Query for a path between two nodes in a specific order of relationships and knowing only label of the last node
Life post thesis submission is terrifying - Help!
Never make public members virtual/abstract - really?
Why are all volatile liquids combustible
Why there is no wireless switch?
Shoes for commuting
Why is a pressure canner needed when canning?
How were the names on the memorial stones in Avengers: Endgame chosen, out-of-universe?
How do I stop making people jump at home and at work?
How does the UK House of Commons think they can prolong the deadline of Brexit?
What's this constructed number's starter?
Professor refuses to write a recommendation letter to students who haven't written a research paper with him
Can anyone find an image of Henry Bolingbroke's Sovereygne Feather Seal?
Why do we need explainable AI?
Bidirectional Dictionary
What drugs were used in England during the High Middle Ages?
A magician's sleight of hand
If I have an accident, should I file a claim with my car insurance company?
Project Euler Problem 45
Why there are construction cranes on apparently completed buildings in New York?
Is directly echoing the user agent in PHP a security hole?
Dissuading my girlfriend from a scam
Is the Levitate spell supposed to basically disable a melee-based enemy?
Why would a hard-tail guitar need a locking nut?
Is the interior of a Bag of Holding actually an extradimensional space?
Force relationships from a node label X to a node label Y to have specific properties
create relationships between nodes in parallelHow to create and retrieve a node by its label in Neo4j 2.0.0M5Adding relationship to existing nodes with CypherClone nodes and relationships with Cypherneo4j - labels vs properties vs relationship + nodeHow to use relationship index in CypherFind Nodes with the same properties in Neo4JCreate relationships using Node csv and Relationship csvHow to validate an update cypher query against a schema?Neo4j: Query for a path between two nodes in a specific order of relationships and knowing only label of the last node
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm aware that using the "relationship property existence constraint" available in Neo4j Enterprise I can force relationships of a given label to have some properties, for example:
(Relationships of label "LIKED" always have a "day" property)
CREATE CONSTRAINT ON ()-[like:LIKED]-() ASSERT exists(like.day)
But is it possible to force relationships from a node label X to a node label Y to have specific properties? An example of what I would like to do would be:
(Relationships of label "BOUGHT" from/to nodes label "Person" to/from nodes label "Book" always have a "day" property)
CREATE CONSTRAINT ON (p:Person)-[bo:BOUGHT]-(b:Book) ASSERT exists(b.day)
But that isn't considered a valid Cypher command. Is there a way to achieve this effect at a schema level or would I need to implement it in the application layer? Thank you.
database graph neo4j cypher schema
add a comment |
I'm aware that using the "relationship property existence constraint" available in Neo4j Enterprise I can force relationships of a given label to have some properties, for example:
(Relationships of label "LIKED" always have a "day" property)
CREATE CONSTRAINT ON ()-[like:LIKED]-() ASSERT exists(like.day)
But is it possible to force relationships from a node label X to a node label Y to have specific properties? An example of what I would like to do would be:
(Relationships of label "BOUGHT" from/to nodes label "Person" to/from nodes label "Book" always have a "day" property)
CREATE CONSTRAINT ON (p:Person)-[bo:BOUGHT]-(b:Book) ASSERT exists(b.day)
But that isn't considered a valid Cypher command. Is there a way to achieve this effect at a schema level or would I need to implement it in the application layer? Thank you.
database graph neo4j cypher schema
add a comment |
I'm aware that using the "relationship property existence constraint" available in Neo4j Enterprise I can force relationships of a given label to have some properties, for example:
(Relationships of label "LIKED" always have a "day" property)
CREATE CONSTRAINT ON ()-[like:LIKED]-() ASSERT exists(like.day)
But is it possible to force relationships from a node label X to a node label Y to have specific properties? An example of what I would like to do would be:
(Relationships of label "BOUGHT" from/to nodes label "Person" to/from nodes label "Book" always have a "day" property)
CREATE CONSTRAINT ON (p:Person)-[bo:BOUGHT]-(b:Book) ASSERT exists(b.day)
But that isn't considered a valid Cypher command. Is there a way to achieve this effect at a schema level or would I need to implement it in the application layer? Thank you.
database graph neo4j cypher schema
I'm aware that using the "relationship property existence constraint" available in Neo4j Enterprise I can force relationships of a given label to have some properties, for example:
(Relationships of label "LIKED" always have a "day" property)
CREATE CONSTRAINT ON ()-[like:LIKED]-() ASSERT exists(like.day)
But is it possible to force relationships from a node label X to a node label Y to have specific properties? An example of what I would like to do would be:
(Relationships of label "BOUGHT" from/to nodes label "Person" to/from nodes label "Book" always have a "day" property)
CREATE CONSTRAINT ON (p:Person)-[bo:BOUGHT]-(b:Book) ASSERT exists(b.day)
But that isn't considered a valid Cypher command. Is there a way to achieve this effect at a schema level or would I need to implement it in the application layer? Thank you.
database graph neo4j cypher schema
database graph neo4j cypher schema
edited Mar 28 at 4:11
Telmo Trooper
asked Mar 28 at 3:43
Telmo TrooperTelmo Trooper
1,0419 silver badges19 bronze badges
1,0419 silver badges19 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Unfortunately, It's not possible to achieve this effect at a schema level at the moment.
You need to figure it out, how to implement this in the application layer.
If this
LIKED
relationship is different from otherLIKED
relationship( i.e. LIKED relationship between other node labels pair)
then you can name it anything else and create "relationship property
existence constraint" on it.
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%2f55389843%2fforce-relationships-from-a-node-label-x-to-a-node-label-y-to-have-specific-prope%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
Unfortunately, It's not possible to achieve this effect at a schema level at the moment.
You need to figure it out, how to implement this in the application layer.
If this
LIKED
relationship is different from otherLIKED
relationship( i.e. LIKED relationship between other node labels pair)
then you can name it anything else and create "relationship property
existence constraint" on it.
add a comment |
Unfortunately, It's not possible to achieve this effect at a schema level at the moment.
You need to figure it out, how to implement this in the application layer.
If this
LIKED
relationship is different from otherLIKED
relationship( i.e. LIKED relationship between other node labels pair)
then you can name it anything else and create "relationship property
existence constraint" on it.
add a comment |
Unfortunately, It's not possible to achieve this effect at a schema level at the moment.
You need to figure it out, how to implement this in the application layer.
If this
LIKED
relationship is different from otherLIKED
relationship( i.e. LIKED relationship between other node labels pair)
then you can name it anything else and create "relationship property
existence constraint" on it.
Unfortunately, It's not possible to achieve this effect at a schema level at the moment.
You need to figure it out, how to implement this in the application layer.
If this
LIKED
relationship is different from otherLIKED
relationship( i.e. LIKED relationship between other node labels pair)
then you can name it anything else and create "relationship property
existence constraint" on it.
edited Mar 28 at 4:50
answered Mar 28 at 4:44


RajRaj
2,7061 gold badge6 silver badges19 bronze badges
2,7061 gold badge6 silver badges19 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
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%2f55389843%2fforce-relationships-from-a-node-label-x-to-a-node-label-y-to-have-specific-prope%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