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

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현