{"id":16853576,"url":"https://github.com/sim51/noqm","last_synced_at":"2026-05-16T22:01:41.183Z","repository":{"id":142401820,"uuid":"94229006","full_name":"sim51/NOQM","owner":"sim51","description":"Neo4j Object Query Mapper","archived":false,"fork":false,"pushed_at":"2017-07-15T16:09:09.000Z","size":3183,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-20T16:44:04.112Z","etag":null,"topics":["cypher","java","neo4j","orm","query"],"latest_commit_sha":null,"homepage":"https://sim51.github.io/NOQM","language":"Java","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/sim51.png","metadata":{"files":{"readme":"README.adoc","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":"2017-06-13T15:36:50.000Z","updated_at":"2017-07-12T16:42:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7c7647b-2319-4e30-bb13-04804f295e60","html_url":"https://github.com/sim51/NOQM","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sim51/NOQM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sim51%2FNOQM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sim51%2FNOQM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sim51%2FNOQM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sim51%2FNOQM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sim51","download_url":"https://codeload.github.com/sim51/NOQM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sim51%2FNOQM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33120450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cypher","java","neo4j","orm","query"],"created_at":"2024-10-13T13:52:07.795Z","updated_at":"2026-05-16T22:01:41.165Z","avatar_url":"https://github.com/sim51.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Neo4j Object Query Mapper\nBenoit Simard \u003cgithub@bsimard.com\u003e\n:experimental:\n:outfilesuffix-old: {outfilesuffix}\nifdef::env-github[:outfilesuffix: .adoc]\nifndef::env-github[]\n:idprefix:\n:idseparator: -\nendif::[]\n\nhttps://sim51.github.io/NOQM\n\nimage:https://travis-ci.org/sim51/NOQM.svg?branch=master[\"Build Status\", link=\"https://travis-ci.org/sim51/NOQM\"]\nimage:https://coveralls.io/repos/github/sim51/NOQM/badge.svg?branch=master[\"Coverage Status, link=\"https://coveralls.io/github/sim51/NOQM?branch=master\"]\n\n== Why this project ?\n\nIt's not an OGM (object graph mapper), this project is just a stupid client on top of the neo4j java driver.\n\n* Simple and small Neo4j client\n* Singleton for the Neo4j Driver (as needed)\n* Simple and single configuration file\n* Easy to switch from single to cluster architecture\n* Using java stream (for now the neo4j java driver doesn't used it, but it should appears in a future)\n* Stupid query object mapping, via a projection system\n\n== Limitation\n\n* You can use only one Neo4j database.\n* You can't make multi-transaction on the same session. This can be useful on cluster mode, but you can manage it with bookmarkId.\n\n== Installation\n\nFirstly you have to add the maven repository of the project to your *pom.xml* :\n\n[source,xml]\n----\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003eNOQM-mvn-repo\u003c/id\u003e\n        \u003curl\u003ehttps://raw.github.com/sim51/NOQM/mvn-repo/\u003c/url\u003e\n        \u003csnapshots\u003e\n            \u003cenabled\u003etrue\u003c/enabled\u003e\n            \u003cupdatePolicy\u003ealways\u003c/updatePolicy\u003e\n        \u003c/snapshots\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n----\n\nThen you can add the dependency :\n\n[source,xml]\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.neo4j.contrib\u003c/groupId\u003e\n    \u003cartifactId\u003eNOQM\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\n== Configuration\n\nAll the configuration comes from one file : **neo4j-driver.properties**\nThis should be at the root of the classpath.\n\n[source,properties]\n----\n# Neo4j driver url\nneo4j.url=bolt://localhost\n\nneo4j.user=neo4j\nneo4j.password=test\n\n# (int) Max number of idle connection into the pool\n#neo4j.maxIdleConnectionPoolSize=5\n\n# (long) Threshold of idle time from which we test a connection (in seconds)\n#neo4j.idleTimeBeforeConnectionTest=0\n\n# (boolean) Do we log leaked session ?\n#neo4j.logLeakedSessions=true\n\n# (boolean) Traffic encrypted ?\n#neo4j.encrypted=false\n\n# Valid values are :\n#  - ALL : Trust strategy for certificates that can be verified through the local system store.\n#  - SYSTEM : Trust strategy for certificates that can be verified through the local system store.\n#  - A certificate file (ex: /etc/ssl/mycert.cet)\n#neo4j.trustStrategy=ALL\n\n# Specify socket connection timeout in millisecond\n#neo4j.connectionTimeoutMillis=5000\n----\n\nNOTE: To make this configuration dynamic, you can use some maven filters\n\nIMPORTANT: You can override those properties, with a second files named : **neo4j-driver-ext.properties** . This file must be also at the root of the classpath, like into the **shared/classes/** folder of a tomcat server.\n\n== How to use it ?\n\n=== Auto-commit mode\n\nJust call it like this for a read query\n\n[source,java]\n----\nimport org.neo4j.driver.*\nimport static org.neo4j.driver.v1.Values.parameters;\n...\ntry(Stream\u003cRecord\u003e rs = Neo4jClient.read(\"MATCH (n:Person { name:$name, born:$born }) RETURN n\", parameters( \"name\", \"Keanu Reeves\", \"born\", 1964 ))) {\n    rs.forEach((record) -\u003e {\n       System.out.println(record);\n   });\n}\n----\n\nAnd for a write query :\n\n[source,java]\n----\nNeo4jClient\n    .write(\"CREATE (n:Person { name:$name, born:$born }) RETURN n\", parameters( \"name\", \"Keanu Reeves\", \"born\", 1964 ))\n    .close();\n----\n\nIMPORTANT: It's important to notice, that you have to close the stream (underlying, it's closing the session), with a `try-with-resource` or by calling the the stream's `close` method.\n\n=== Transaction mode\n\nFirstly you have to create a read or write `Transaction` within a `try-with-resource` block.\nThen you can make some queries.\n\n[source,java]\n----\nString bookmarkId = null;\ntry ( Neo4jTransaction tx = Neo4jClient.getWriteTransaction()) {\n    tx.run(\"CREATE (me:Person { name:$name, born:$born }) RETURN me\", parameters( \"name\", \"Benoit\", \"born\", 1983 )).close();\n}\n----\n\n=== Projection system\n\nIf you don't want to have a stream of `Record`, you can use the *Projection System*.\nIt's just a list of some *Map* functions to transform a record to some class.\n\nTo use it, you have to *map* the stream with : `Projections.as(MyClass.class)`\n\n[source,java]\n----\nList\u003cMovie\u003e movies = Neo4jClient\n    .read(\"MATCH (n:Movie) RETURN n.title AS title, n.tagline AS tagline, n.released AS released\")\n    .map(Projections.as(Movie.class))\n    .collect(Collectors.toList())\n----\n\nWhere `Movie` is a simple object :\n\n[source,java]\n----\npackage org.neo4j.driver.projection.pojo;\n\nimport lombok.Data;\n\n@Data\npublic class Movie {\n    public String title;\n    public String tagline;\n    public Integer released;\n}\n----\n\nOn this example, I use the https://projectlombok.org[lombok project] to generate all setters of this class.\n\nThe projection system is entirely based on *setter*. It search a method that :\n\n* match the name of a column (for `movie`, it search for `setMovie`)\n* without any return ( a void method)\n* with only one argument\n\nWhen found, it tries to cast from the driver type to the argument type.\n\nTake a look at this test for more example : `src/text/java/org/neo4j/driver/projection/ProjectionTest`.\n\n== Test requirement\n\nThis project has a dependency on https://github.com/neo4j-contrib/boltkit[Boltkit] for the test.\nSo you have to install it before to launch tests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsim51%2Fnoqm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsim51%2Fnoqm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsim51%2Fnoqm/lists"}