Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing detailed documentation for some procedures #331

Closed
jexp opened this issue Mar 20, 2017 · 2 comments · Fixed by #1280
Closed

missing detailed documentation for some procedures #331

jexp opened this issue Mar 20, 2017 · 2 comments · Fixed by #1280
Assignees

Comments

@jexp
Copy link
Member

jexp commented Mar 20, 2017

Could I get an example for each of these procedures.

I am able to do 2 and 3 but still don’t understand when to use 1 and when to use 2. If the team could provide some examples of the patterns and patterfull would be really nice.

CALL apoc.create.vNode(['Label'], {key:value,…​})
returns a virtual node
CALL apoc.create.vNodes(['Label'], [{key:value,…​}])
returns virtual nodes
CALL apoc.create.vRelationship(nodeFrom,'KNOWS',{key:value,…​}, nodeTo)
returns a virtual relationship
CALL apoc.create.vPattern({_labels:['LabelA'],key:value},'KNOWS',{key:value,…​}, {_labels:['LabelB'],key:value})
returns a virtual pattern
CALL apoc.create.vPatternFull(['LabelA'],{key:value},'KNOWS',{key:value,…​},['LabelB'],{key:value})
returns a virtual pattern

Can someone explain these commands. I am trying to convert the graphs from neo4j into the dataframes for Vertices and edges so that it can be sent to other graphing programs in R. The first two seem to be the ones I need but not sure.

apoc.graph.from(data,'name',{properties}) yield graph
creates a virtual graph object for later processing it tries its best to extract the graph information from the data you pass in
apoc.graph.fromData([nodes],[relationships],'name',{properties})
creates a virtual graph object for later processing
apoc.graph.fromPaths(path,'name',{properties})
creates a virtual graph object for later processing
apoc.graph.fromPaths([paths],'name',{properties})
creates a virtual graph object for later processing
apoc.graph.fromDB('name',{properties})
creates a virtual graph object for later processing
apoc.graph.fromCypher('statement',{params},'name',{properties})
creates a virtual graph object for later processing

Need some good examples for these refactoring procedures

call apoc.refactor.cloneNodes([node1,node2,…​])
clone nodes with their labels and properties
call apoc.refactor.cloneNodesWithRelationships([node1,node2,…​])
clone nodes with their labels, properties and relationships
call apoc.refactor.mergeNodes([node1,node2])
merge nodes onto first in list
call apoc.refactor.to(rel, endNode)
redirect relationship to use new end-node
call apoc.refactor.from(rel, startNode)
redirect relationship to use new start-node
call apoc.refactor.setType(rel, 'NEW-TYPE')
change relationship-type
call apoc.refactor.extractNode([rel1,rel2,…​], [labels], 'OUT','IN')
extract node from relationships
call apoc.refactor.collapseNode([node1,node2],'TYPE')
collapse node to relationship, node with one rel becomes self-relationship
call apoc.refactor.normalizeAsBoolean(entity, propertyKey, true_values, false_values)
normalize/convert a property to be boolean
call apoc.refactor.categorize(node, propertyKey, type, outgoing, label)
turn each unique propertyKey into a category node and connect to it
DanielBerton pushed a commit to AngeloBusato/neo4j-apoc-procedures that referenced this issue May 5, 2017
DanielBerton pushed a commit to AngeloBusato/neo4j-apoc-procedures that referenced this issue May 5, 2017
DanielBerton pushed a commit to AngeloBusato/neo4j-apoc-procedures that referenced this issue May 6, 2017
DanielBerton pushed a commit to AngeloBusato/neo4j-apoc-procedures that referenced this issue May 6, 2017
@jexp jexp closed this as completed in 610c1b6 May 6, 2017
albertodelazzari pushed a commit to albertodelazzari/neo4j-apoc-procedures that referenced this issue Jun 28, 2017
@gauss1986
Copy link

gauss1986 commented Aug 19, 2019

I found the apoc library documentation (and Neo4j documentation in general) are missing a lot of the NECESSARY details. For an example, the documentation for apoc.text.fuzzyMatch function at this link only have two sentences. And there is no clue what would be the expected behaviour of the function because it is missing

  • On what distance is the string comparison done (Levenshtein/JaroWinkler/SorensenDice)
  • What is the default threshold for the function to output yes/no

And there is basically no other way to understand the function than look at the source code, which is not something I would expect from a commercial product.

@jexp
Copy link
Member Author

jexp commented Aug 19, 2019

Thanks a lot for the report, that's indeed not enough detail.

I guess you have looked at the source code (because it's OSS) and figured it out.

This is not a commercial product but a Neo4j Labs project:

see: https://neo4j.com/labs/#faq

https://github.com/neo4j-contrib/neo4j-apoc-procedures/blob/3.5/src/main/java/apoc/text/Strings.java#L223-L232

  • Levenshtein
  • distance:
    • length < 3 : 0
    • length < 5 : 1
    • else 2

ncordon pushed a commit to ncordon/neo4j-apoc-procedures that referenced this issue Nov 1, 2023
* [bJ4pn0Bj] PeriodicTest.testTerminateCommit is flaky

* [bJ4pn0Bj] removed Ignore in testTerminateCommit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants