Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-23-2021 03:52 AM
Hi all,
I am working with neosemantics nodesInCategory algorithm to drive inferences. I have only seen examples where one relationship label for inCatRel was specified. My problem is, that I have two distinct relationship types that need to be considered for inCatRel (one relationship with label “is_a” and a second relationship with label “belongs_to”). I tried to list the two distinct relationship labels like this – but it doesn’t work:
MATCH (n:Resource {label: “test”})
CALL n10s.inference.nodesInCategory(n, {inCatRel, subCatRel: "subClassOf"}) WHERE inCatRel="is_a" XOR "belongs_to" yield node return node
Does anyone have an idea how multiple relationships can be defined for inCatRel? Thanks in advance!
04-29-2021 03:37 PM
Hi @johanna, I'm not sure I understand the structure of the graph you describe.
Is it something like this?
(instance1:Instance)-[:belongs_to]->(cat1:Category)-[:is_a]->(parentcat1:Category)-[]->(grandparentCat1:Category)
instances connecting to their class via belongs_to
and classes organized hierarchically via is_a
?
Or am I getting it wrong?
Maybe you can post a cypher fragment to recreate a bit of your graph so we can try to reproduce it?
Cheers,
JB.
04-28-2022 04:14 AM
Hello @jesus.barrasa, it's no good, tha johanna did'nt respond to your question, but today I have the same inquiry. I would like to use n10s for search similar to what n10s documentation says, but more levels deeper then there.
I adopted the example so I have three labels in. I changed the labelNames from "LCSHTopic" which I did not understand to "ScienceTopic" and added "ArtTopic" and "MechTopic". I also changed the Edge-Types from NARROWER_THEN wich I understand neither to PART_OF and added two other (BELONGS_TO and USES).
When I would add some paper ("Work"), maybe called "the beautyness of diamonds... " and link it to the "Jewelry" node then I want to have an search parametrizable which cound list/find this even when one looks for "Crystals and life" if I allow more "hops" then one.
How to do this?
Regards
--jens
All the sessions of the conference are now available online