{"id":20957102,"url":"https://github.com/zefrenchwan/patterns","last_synced_at":"2026-04-27T14:31:24.561Z","repository":{"id":254807102,"uuid":"780495684","full_name":"zefrenchwan/patterns","owner":"zefrenchwan","description":"Storage api with extended searches","archived":false,"fork":false,"pushed_at":"2024-08-26T07:09:24.000Z","size":376,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-29T14:22:01.292Z","etag":null,"topics":["api","golang","graphs","json-api","postgresql","referential"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/zefrenchwan.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":"2024-04-01T15:50:26.000Z","updated_at":"2024-09-03T19:40:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"c89fc5d0-9542-4aaf-9d3c-0881c09b027c","html_url":"https://github.com/zefrenchwan/patterns","commit_stats":null,"previous_names":["zefrenchwan/patterns"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zefrenchwan/patterns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Fpatterns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Fpatterns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Fpatterns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Fpatterns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zefrenchwan","download_url":"https://codeload.github.com/zefrenchwan/patterns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Fpatterns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32341447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":["api","golang","graphs","json-api","postgresql","referential"],"created_at":"2024-11-19T01:29:32.440Z","updated_at":"2026-04-27T14:31:24.521Z","avatar_url":"https://github.com/zefrenchwan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Patterns\n\nThe goal of this project is to:\n* store data with no previous model definition\n* store data that depends on time\n* search information based on time\n\n## Concepts\n\nThis project deals with data and metadata:\n* data is elements linked together\n* metadata is data about those elements. **Traits** defines types of elements\n\nLet us give a preminilary example:\n* metadata is \"City\", \"Country\" as traits. \n* Paris is the name of a data object, its trait is \"City\"\n* Same idea, France is a data object, its traits is \"Country\"\n* let us add metadata \"Capital City\" as another trait\n* Capitale(Paris, France) is a data object (a relation, to be precise), its trait is \"Capital City\"\n\n### Data \n\nEach data element is either an entity or a relation:\n* Paris, France are entities\n* CapitalCity(Paris, France) is a relation\n\nBoth contain:\n* an **id** \n* an **activity** that defines the life cycle of the elemnt. For instance, an human life. \n\nFor an entity:\n* **attributes** that are a name and time dependant values\n\nFor a relation:\n* **roles** and **values** as a map. For instance: subject = Paris, Object = Europe\n* values are time-dependent: they may appear in a relation during a given period, not the full relation lifecycle\n\n### Metadata\n\nMetadata is represented as **traits** to define types of elements. \nA relation has traits too. \nA trait is not a simple label to put on elements. \n\n\n\n## Architecture\n\nThis project is a webapp not following REST standard. \n\nIts storage is currently a relational database (postgresql indeed). \n\nThe project contains:\n* **nodes** that defines the data model based on nodes in graphs\n* **graphs** that defines the graph data model based on nodes\n* **storage** that contains the storage system\n* **serving** that contains the webapp part\n\n## Installation\n\n### Prerequisites\n\n* **Go** version 1.22 or higher\n* **Postgresql** installed and accessible\n\n### Procedure\n\n1. `go build` to build the application \n2. launch scripts in `storage/sql`. Execute sql data definition then procedures creations\n3. define `PATTERNS_PORT` as the port to open to access the api, and `PATTERNS_DB_URL` to connect the database (postgresql)\n4. launch go built application\n\n### Create first users\n\nUse procedures to insert users. \n\nFor instance (pay attention to password, change it): \n* call susers.insert_user('root','password so secret that no one would find it');\n* call susers.insert_super_user_roles('root'); \n\n\n## Testing \n\n1. Some unit tests, in packages with a `_test` suffix. It validates basic and local behavior\n2. Some end to end tests. Assuming the api is up, database is up, python code launches tests. This code is located in `tests` folder","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefrenchwan%2Fpatterns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzefrenchwan%2Fpatterns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefrenchwan%2Fpatterns/lists"}