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

                    How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

                    해남서초등학교 학교 연혁 학교 동문 외부 링크 둘러보기 메뉴북위 34° 34′ 21″ 동경 126° 35′ 50″ / 북위 34.5726385° 동경 126.5972670°  / 34.5726385; 126.5972670해남서초등학교eh