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;
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.
I have the following questions:
- Is this possible with a single Cypher query?
- 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?
- Change the datamodel?
Other tips?
thanks
neo4j neo4j-cql
add a comment |
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.
I have the following questions:
- Is this possible with a single Cypher query?
- 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?
- Change the datamodel?
Other tips?
thanks
neo4j neo4j-cql
add a comment |
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.
I have the following questions:
- Is this possible with a single Cypher query?
- 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?
- Change the datamodel?
Other tips?
thanks
neo4j neo4j-cql
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.
I have the following questions:
- Is this possible with a single Cypher query?
- 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?
- Change the datamodel?
Other tips?
thanks
neo4j neo4j-cql
neo4j neo4j-cql
asked Mar 23 at 19:27
Uden VHUden VH
6218
6218
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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
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%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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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%2f55317542%2fneo4j-cypher-how-to-query-inherited-reations-on-a-child-node%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