{"id":20238550,"url":"https://github.com/badetitou/moose2graphjson","last_synced_at":"2026-06-12T09:32:04.907Z","repository":{"id":91711714,"uuid":"238495916","full_name":"badetitou/Moose2GraphJson","owner":"badetitou","description":"Import and export MooseModel in a JSON format that is easy to use with Neo4J","archived":false,"fork":false,"pushed_at":"2024-05-28T17:47:07.000Z","size":104,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T00:18:59.226Z","etag":null,"topics":["metamodel","moose","neo4j"],"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/badetitou.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-05T16:26:45.000Z","updated_at":"2024-05-28T17:47:11.000Z","dependencies_parsed_at":"2024-11-14T08:44:53.042Z","dependency_job_id":null,"html_url":"https://github.com/badetitou/Moose2GraphJson","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/badetitou/Moose2GraphJson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FMoose2GraphJson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FMoose2GraphJson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FMoose2GraphJson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FMoose2GraphJson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badetitou","download_url":"https://codeload.github.com/badetitou/Moose2GraphJson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FMoose2GraphJson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34238713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["metamodel","moose","neo4j"],"created_at":"2024-11-14T08:34:43.615Z","updated_at":"2026-06-12T09:32:04.881Z","avatar_url":"https://github.com/badetitou.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moose2GraphJson\n\nI can export and import any MooseModel in a json format adapted for graph database\n\n## Install\n\n### Stable version\n\n```smalltalk\nMetacello new\n  githubUser: 'badetitou' project: 'Moose2GraphJson' commitish: 'v1.0.0' path: 'src';\n  baseline: 'Moose2GraphJson';\n  load\n```\n\n### Last version\n\n```smalltalk\nMetacello new\n  githubUser: 'badetitou' project: 'Moose2GraphJson' commitish: 'main' path: 'src';\n  baseline: 'Moose2GraphJson';\n  load\n```\n\n## Export a model\n\n```smalltalk\n'D:/test.json' asFileReference writeStreamDo: [ :stream | (M2GJExporter on: stream) writeMooseModel: aMooseModel ]\n```\n\n## Import a model\n\n```smalltalk\n(M2GJImporter on: 'D:/ref/to/model.json' asFileReference readStream) \n  model: MooseModel new;\n  yourself.\nimporter import.\nimporter model name\n```\n\n## Import in neo4j\n\nYou can load the generated json file with this command\n\n```db\nCALL apoc.load.json('file:///test-graph.json') YIELD value\nWITH value.nodes AS nodes, value.relationships AS rels\nUNWIND nodes AS n\nCALL apoc.create.node(n.labels, apoc.map.setKey(n.properties, 'id', n.id)) YIELD node\nWITH rels, apoc.map.fromPairs(COLLECT([n.id, node])) AS nMap\nUNWIND rels AS r\nWITH r, nMap[TOSTRING(r.startNode)] AS startNode, nMap[TOSTRING(r.endNode)] AS endNode\nWHERE startNode IS NOT NULL and endNode IS NOT NULL \nCALL apoc.create.relationship(startNode, r.type, r.properties, endNode) YIELD rel\nRETURN rel\n```\n\n## JSON model format\n\n## Goal\n\nImport and Export Fame model the following format\n\n```json\n{\n  \"name\":\"modelName\",\n  \"nodes\": [\n    {\n      \"id\": 3510982, \n      \"labels\": [\"FAMIX.Class\"],\n      \"properties\": { \"isStub\": false, \"isInterface\": false, \"numberOfLinesOfCode\": 0, \"name\": \"a\" }\n    },\n    {\n      \"id\": 3510983, \n      \"labels\": [\"FAMIX.Attribute\"],\n      \"properties\": { \"name\": \"a1\", \"hasClassScope\": false, \"numberOfLinesOfCode\": -1, \"isStub\": false }\n    },\n    {\n      \"id\": 3510984, \n      \"labels\": [\"FAMIX.Attribute\"],\n      \"properties\": { \"name\": \"a2\", \"hasClassScope\": false, \"numberOfLinesOfCode\": -1, \"isStub\": false }\n    }\n  ],\n  \"relationships\": [\n    { \"type\": \"parentType\", \"startNode\": 3510983, \"endNode\": 3510982, \"properties\": {} },\n    { \"type\": \"parentType\", \"startNode\": 3510984, \"endNode\": 3510982, \"properties\": {} }\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadetitou%2Fmoose2graphjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadetitou%2Fmoose2graphjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadetitou%2Fmoose2graphjson/lists"}