{"id":15107675,"url":"https://github.com/mumez/scyphergraph","last_synced_at":"2025-10-23T02:31:28.966Z","repository":{"id":44589788,"uuid":"302923850","full_name":"mumez/SCypherGraph","owner":"mumez","description":"Object wrapper of Neo4j graph database using SmallBolt and SCypher","archived":false,"fork":false,"pushed_at":"2022-02-06T13:15:36.000Z","size":79,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-25T21:40:54.035Z","etag":null,"topics":["neo4j","neo4j-graph-database","pharo","pharo-smalltalk"],"latest_commit_sha":null,"homepage":"","language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mumez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-10T14:48:17.000Z","updated_at":"2024-05-16T23:23:08.000Z","dependencies_parsed_at":"2022-09-16T14:21:28.528Z","dependency_job_id":null,"html_url":"https://github.com/mumez/SCypherGraph","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FSCypherGraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FSCypherGraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FSCypherGraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mumez%2FSCypherGraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mumez","download_url":"https://codeload.github.com/mumez/SCypherGraph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871956,"owners_count":16554471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["neo4j","neo4j-graph-database","pharo","pharo-smalltalk"],"created_at":"2024-09-25T21:40:58.025Z","updated_at":"2025-10-23T02:31:28.627Z","avatar_url":"https://github.com/mumez.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SCypherGraph\nHigh-level object wrapper of [Neo4j](https://neo4j.com/) graph database using [SmallBolt](https://github.com/mumez/SmallBolt) and [SCypher](https://github.com/mumez/SCypher)\n\n# Installation\n\nCurrently Pharo 8 and Pharo 9 are supported.\n\n```smalltalk\nMetacello new\n  baseline: 'SCypherGraph';\n  repository: 'github://mumez/SCypherGraph:main/src';\n  load.\n```\n\n# Examples\n\nPlease see [Interacting with Neo4j from Pharo Smalltalk](https://hashnode.com/post/interacting-with-neo4j-from-pharo-smalltalk-ckltglsqq085o10s14bkhfhke) for details.\n\n## Basic\n\n```smalltalk\ndb := SgGraphDb default.\ndb settings username: 'neo4j'; password: 'neoneo'.\ndb allLabels. \"Get all node labels\"\n\n\"Print 'Movie' node properties\"\n(db nodesLabeled: 'Movie') \n   do: [ :each | self traceCr: each properties ].\n```\n\n## Get node with where:\n\n```smalltalk\nmatrix := (db nodesLabeled: 'Movie' where: [:each | each @ 'title' = 'The Matrix']) first.\nmatrix properties.\n```\n\n## Get relationships\n\n```smalltalk\nmatrix inRelationships.\nmatrix outRelationships.\n\n(matrix inRelationshipsTyped: 'ACTED_IN')\n  collect: [:each | each endNode @ 'name']. \n```\n\n## Get relationships with where:\n\n```smalltalk\n(matrix inRelationshipsTyped: 'ACTED_IN' where: [ :start :rel :end | (rel @ 'roles') = #('Neo') ])\n  collect: [ :each | each endNode properties ].\n```\n\n## Create nodes\n\n```smalltalk\nsf := db mergeNodeLabeled: 'Genre' properties: {'name'-\u003e'SF'. 'description'-\u003e'Science Fiction'}.\naction := db mergeNodeLabeled: 'Genre' properties: {'name'-\u003e'Action'. 'description'-\u003e'Exciting Actions'}. \n```\n\n## Create relationships\n\n```smalltalk\nmatrixToSf := matrix relateOneTo: sf typed: 'HAS_GENRE' properties: {'score'-\u003e 6}.\nmatrixToAction := matrix relateTo: action typed: 'HAS_GENRE' properties: {'score'-\u003e 7}. \n```\n\n## Execute Cypher directly\n\n```smalltalk\ndb runCypher: 'UNWIND range(1, 10) AS n RETURN n*n'. \"inspect it\"\n\ndb runCypher: 'UNWIND range($from, $to) AS n RETURN n*n' \n   arguments: {'from'-\u003e2. 'to'-\u003e5}. \"inspect it\"\n```\n\n## Execute dynamically generated Cypher\n\n```smalltalk\nm := 'm' asCypherObject. \"Movie\"\np := 'p' asCypherObject. \"Person\"\no := 'o' asCypherObject. \"Other person\"\n\npathPattern := (p node: 'Person') - ('act1' asCypherObject rel: 'ACTED_IN' ) -\u003e (m node: 'Movie' props: {'released'-\u003e2000})  \u003c- ('act2' asCypherObject rel: 'ACTED_IN' ) - (o node: 'Person').\n\nactorNameParam := 'actorName' asCypherParameter.\nwhere := (p @ 'name') starts: actorNameParam.\n\"where := ((p @ 'born') \u003e 1970) and: ((o @ 'born') \u003e 1970). \" \" \u003c= try changing\"\n\nreturn := (p @ 'name'), (o @ 'name'), (m @ 'title').\n\nquery := CyQuery match: pathPattern where: where return: return orderBy: (p @ 'name') skip: 0 limit: 100. \"print it\"\n\nresult := db runCypher: query arguments: { actorNameParam -\u003e 'Tom' }.\n(result fieldValues groupedBy: [ :each | each at: 1 ]). \"inspect it\"\n```\n\n## Changing IP and port\n\n```smalltalk\ndb settings targetUri: 'bolt://127.0.0.1:7687'.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumez%2Fscyphergraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmumez%2Fscyphergraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmumez%2Fscyphergraph/lists"}