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;








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.










share|improve this question
































    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.










    share|improve this question




























      0












      0








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          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 other LIKED
          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.







          share|improve this answer


























            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
            );



            );













            draft saved

            draft discarded


















            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









            0
















            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 other LIKED
            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.







            share|improve this answer































              0
















              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 other LIKED
              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.







              share|improve this answer





























                0














                0










                0









                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 other LIKED
                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.







                share|improve this answer















                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 other LIKED
                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.








                share|improve this answer














                share|improve this answer



                share|improve this answer








                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





















                    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.



















                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript