Neo4j Cypher - how to query 'inherited' reations on a child-node?neo4j: optional 'steps' in Cypher queryhow to find root parents in tree using neo4j?Neo4j cypher query is too slow(too many dbhits) in bidirectional relationshipNeo4j: hierarchy finding cypher queryCypher query doesn't return all the expected nodesNeo4j Cypher Lowest Common Ancestor performance issueXOR, AND Tree in Neo4j CypherNeo4j web client fails with large Cypher CREATE query. 144000 linesHow to include specific relationship counts in Cypher queryHow to query extended path between nodes with Cypher in Neo4J?

How can I use 400 ASA film in a Leica IIIf, which does not have options higher than 100?

What Species of Trees are These?

Is there a word for pant sleeves?

How to become an Editorial board member?

How to counter "I don't like your tone" in a work conversation?

Is my company merging branches wrong?

How do you cope with rejection?

Was murdering a slave illegal in American slavery, and if so, what punishments were given for it?

If the Charles SSL Proxy shows me sensitive data, is that data insecure/exposed?

Is there any mention of ghosts who live outside the Hogwarts castle?

Managing heat dissipation in a magic wand

Don't understand notation of morphisms in Monoid definition

What to call a small, open stone or cement reservoir that supplies fresh water from a spring or other natural source?

1950s or earlier book with electrical currents living on Pluto

Why was Harry at the Weasleys' at the beginning of Goblet of Fire but at the Dursleys' after?

Keeping the dodos out of the field

Circuit construction for execution of conditional statements using least significant bit

Are CTRL+C and <esc> the same?

Is there a way to generate a mapping graph like this?

How does the +1 Keen Composite Longbow (+2 Str) work?

What city and town structures are important in a low fantasy medieval world?

Ribbon Cable Cross Talk - Is there a fix after the fact

Good examples of "two is easy, three is hard" in computational sciences

Eigenvalues of the Laplace-Beltrami operator on a compact Riemannnian manifold



Neo4j Cypher - how to query 'inherited' reations on a child-node?


neo4j: optional 'steps' in Cypher queryhow to find root parents in tree using neo4j?Neo4j cypher query is too slow(too many dbhits) in bidirectional relationshipNeo4j: hierarchy finding cypher queryCypher query doesn't return all the expected nodesNeo4j Cypher Lowest Common Ancestor performance issueXOR, AND Tree in Neo4j CypherNeo4j web client fails with large Cypher CREATE query. 144000 linesHow to include specific relationship counts in Cypher queryHow to query extended path between nodes with Cypher in Neo4J?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I want to use Cypher to query all specifications that are valif for a product, but with the specifications defined at different parent levels of the product.



I have a data model that represents a product categorisation tree with levels C1, C2, C3, ... and at the lowest level products P. To simplify the maintenance and data-entry of product specifications, the validity of product specifications is defined at the categorisation levels. The products 'inherit' the specifications that are valid for all their parent categories, up to the root of the categorisation tree.



The (simplified) data-model is shown in the image. In this case product specifications are defined for categorisation levels C1, C2 and C3. The product is connected to the lowest categorisation level C3.
My objective is to query all specifications that are valid for product P, based on their relations to the categorisation levels C1, C2 and C3.



graph model



I have the following questions:



  1. Is this possible with a single Cypher query?

  2. What is the best query strategy in a large database? Use a query? Create real relations for all valid specifications for a product instead of querying the 'inherited' specifications?

  3. Change the datamodel?

Other tips?



thanks










share|improve this question




























    0















    I want to use Cypher to query all specifications that are valif for a product, but with the specifications defined at different parent levels of the product.



    I have a data model that represents a product categorisation tree with levels C1, C2, C3, ... and at the lowest level products P. To simplify the maintenance and data-entry of product specifications, the validity of product specifications is defined at the categorisation levels. The products 'inherit' the specifications that are valid for all their parent categories, up to the root of the categorisation tree.



    The (simplified) data-model is shown in the image. In this case product specifications are defined for categorisation levels C1, C2 and C3. The product is connected to the lowest categorisation level C3.
    My objective is to query all specifications that are valid for product P, based on their relations to the categorisation levels C1, C2 and C3.



    graph model



    I have the following questions:



    1. Is this possible with a single Cypher query?

    2. What is the best query strategy in a large database? Use a query? Create real relations for all valid specifications for a product instead of querying the 'inherited' specifications?

    3. Change the datamodel?

    Other tips?



    thanks










    share|improve this question
























      0












      0








      0








      I want to use Cypher to query all specifications that are valif for a product, but with the specifications defined at different parent levels of the product.



      I have a data model that represents a product categorisation tree with levels C1, C2, C3, ... and at the lowest level products P. To simplify the maintenance and data-entry of product specifications, the validity of product specifications is defined at the categorisation levels. The products 'inherit' the specifications that are valid for all their parent categories, up to the root of the categorisation tree.



      The (simplified) data-model is shown in the image. In this case product specifications are defined for categorisation levels C1, C2 and C3. The product is connected to the lowest categorisation level C3.
      My objective is to query all specifications that are valid for product P, based on their relations to the categorisation levels C1, C2 and C3.



      graph model



      I have the following questions:



      1. Is this possible with a single Cypher query?

      2. What is the best query strategy in a large database? Use a query? Create real relations for all valid specifications for a product instead of querying the 'inherited' specifications?

      3. Change the datamodel?

      Other tips?



      thanks










      share|improve this question














      I want to use Cypher to query all specifications that are valif for a product, but with the specifications defined at different parent levels of the product.



      I have a data model that represents a product categorisation tree with levels C1, C2, C3, ... and at the lowest level products P. To simplify the maintenance and data-entry of product specifications, the validity of product specifications is defined at the categorisation levels. The products 'inherit' the specifications that are valid for all their parent categories, up to the root of the categorisation tree.



      The (simplified) data-model is shown in the image. In this case product specifications are defined for categorisation levels C1, C2 and C3. The product is connected to the lowest categorisation level C3.
      My objective is to query all specifications that are valid for product P, based on their relations to the categorisation levels C1, C2 and C3.



      graph model



      I have the following questions:



      1. Is this possible with a single Cypher query?

      2. What is the best query strategy in a large database? Use a query? Create real relations for all valid specifications for a product instead of querying the 'inherited' specifications?

      3. Change the datamodel?

      Other tips?



      thanks







      neo4j neo4j-cql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 23 at 19:27









      Uden VHUden VH

      6218




      6218






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You could find all specifications of a product by MATCHing patterns of variable length.



          Assuming you have a parameter productId, you would use something like this



          MATCH (p:PRODUCT {productId:$productiId)-[:BELONGS_TO*]->(c:Category)<-[:VALID_FOR]-(s:Specification)
          RETURN s


          to retrieve the relevant specifications.



          Since you seem to be working on bills of materials, some things you may want to look at:



          Management of complex product specifications by splitting it up in "atoms" https://www.slideshare.net/neo4j/graphtour-neo4j-murrelektronik



          and



          An example of how you can keep track of versions of your BOM :
          https://www.youtube.com/watch?v=7iMraBHtTqE



          Disclosure : I'm a member of the Graphileon team, and involved in what is shown in the slide deck and video.






          share|improve this answer























          • Thanks! The '*' behind the "BELONGS_TO" relation, indicating a Variable-length pattern matching, did the trick. I need to take some time to read through the whole Cypher manual :)

            – Uden VH
            Mar 25 at 19:38











          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%2f55317542%2fneo4j-cypher-how-to-query-inherited-reations-on-a-child-node%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









          1














          You could find all specifications of a product by MATCHing patterns of variable length.



          Assuming you have a parameter productId, you would use something like this



          MATCH (p:PRODUCT {productId:$productiId)-[:BELONGS_TO*]->(c:Category)<-[:VALID_FOR]-(s:Specification)
          RETURN s


          to retrieve the relevant specifications.



          Since you seem to be working on bills of materials, some things you may want to look at:



          Management of complex product specifications by splitting it up in "atoms" https://www.slideshare.net/neo4j/graphtour-neo4j-murrelektronik



          and



          An example of how you can keep track of versions of your BOM :
          https://www.youtube.com/watch?v=7iMraBHtTqE



          Disclosure : I'm a member of the Graphileon team, and involved in what is shown in the slide deck and video.






          share|improve this answer























          • Thanks! The '*' behind the "BELONGS_TO" relation, indicating a Variable-length pattern matching, did the trick. I need to take some time to read through the whole Cypher manual :)

            – Uden VH
            Mar 25 at 19:38















          1














          You could find all specifications of a product by MATCHing patterns of variable length.



          Assuming you have a parameter productId, you would use something like this



          MATCH (p:PRODUCT {productId:$productiId)-[:BELONGS_TO*]->(c:Category)<-[:VALID_FOR]-(s:Specification)
          RETURN s


          to retrieve the relevant specifications.



          Since you seem to be working on bills of materials, some things you may want to look at:



          Management of complex product specifications by splitting it up in "atoms" https://www.slideshare.net/neo4j/graphtour-neo4j-murrelektronik



          and



          An example of how you can keep track of versions of your BOM :
          https://www.youtube.com/watch?v=7iMraBHtTqE



          Disclosure : I'm a member of the Graphileon team, and involved in what is shown in the slide deck and video.






          share|improve this answer























          • Thanks! The '*' behind the "BELONGS_TO" relation, indicating a Variable-length pattern matching, did the trick. I need to take some time to read through the whole Cypher manual :)

            – Uden VH
            Mar 25 at 19:38













          1












          1








          1







          You could find all specifications of a product by MATCHing patterns of variable length.



          Assuming you have a parameter productId, you would use something like this



          MATCH (p:PRODUCT {productId:$productiId)-[:BELONGS_TO*]->(c:Category)<-[:VALID_FOR]-(s:Specification)
          RETURN s


          to retrieve the relevant specifications.



          Since you seem to be working on bills of materials, some things you may want to look at:



          Management of complex product specifications by splitting it up in "atoms" https://www.slideshare.net/neo4j/graphtour-neo4j-murrelektronik



          and



          An example of how you can keep track of versions of your BOM :
          https://www.youtube.com/watch?v=7iMraBHtTqE



          Disclosure : I'm a member of the Graphileon team, and involved in what is shown in the slide deck and video.






          share|improve this answer













          You could find all specifications of a product by MATCHing patterns of variable length.



          Assuming you have a parameter productId, you would use something like this



          MATCH (p:PRODUCT {productId:$productiId)-[:BELONGS_TO*]->(c:Category)<-[:VALID_FOR]-(s:Specification)
          RETURN s


          to retrieve the relevant specifications.



          Since you seem to be working on bills of materials, some things you may want to look at:



          Management of complex product specifications by splitting it up in "atoms" https://www.slideshare.net/neo4j/graphtour-neo4j-murrelektronik



          and



          An example of how you can keep track of versions of your BOM :
          https://www.youtube.com/watch?v=7iMraBHtTqE



          Disclosure : I'm a member of the Graphileon team, and involved in what is shown in the slide deck and video.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 24 at 8:38









          GraphileonGraphileon

          792719




          792719












          • Thanks! The '*' behind the "BELONGS_TO" relation, indicating a Variable-length pattern matching, did the trick. I need to take some time to read through the whole Cypher manual :)

            – Uden VH
            Mar 25 at 19:38

















          • Thanks! The '*' behind the "BELONGS_TO" relation, indicating a Variable-length pattern matching, did the trick. I need to take some time to read through the whole Cypher manual :)

            – Uden VH
            Mar 25 at 19:38
















          Thanks! The '*' behind the "BELONGS_TO" relation, indicating a Variable-length pattern matching, did the trick. I need to take some time to read through the whole Cypher manual :)

          – Uden VH
          Mar 25 at 19:38





          Thanks! The '*' behind the "BELONGS_TO" relation, indicating a Variable-length pattern matching, did the trick. I need to take some time to read through the whole Cypher manual :)

          – Uden VH
          Mar 25 at 19:38



















          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%2f55317542%2fneo4j-cypher-how-to-query-inherited-reations-on-a-child-node%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