{"id":15037691,"url":"https://github.com/cosmicmind/graph","last_synced_at":"2025-05-16T13:04:27.791Z","repository":{"id":27185937,"uuid":"30655979","full_name":"CosmicMind/Graph","owner":"CosmicMind","description":"Graph is a semantic database that is used to create data-driven applications.","archived":false,"fork":false,"pushed_at":"2022-10-17T04:57:15.000Z","size":33755,"stargazers_count":874,"open_issues_count":8,"forks_count":70,"subscribers_count":33,"default_branch":"development","last_synced_at":"2025-04-09T08:05:30.255Z","etag":null,"topics":["coredata","cosmicmind","data","data-driven","data-driven-design","data-driven-workflows","database","graph","graph-theory","icloud","icloud-sync","semantic-database","swift","swift-3"],"latest_commit_sha":null,"homepage":"http://cosmicmind.com","language":"Swift","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/CosmicMind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-11T16:02:02.000Z","updated_at":"2025-03-22T05:35:56.000Z","dependencies_parsed_at":"2022-08-17T17:10:50.440Z","dependency_job_id":null,"html_url":"https://github.com/CosmicMind/Graph","commit_stats":null,"previous_names":["cosmicmind/graphkit","graphkit/gkgraphkit"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicMind%2FGraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicMind%2FGraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicMind%2FGraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CosmicMind%2FGraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CosmicMind","download_url":"https://codeload.github.com/CosmicMind/Graph/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999859,"owners_count":21031046,"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":["coredata","cosmicmind","data","data-driven","data-driven-design","data-driven-workflows","database","graph","graph-theory","icloud","icloud-sync","semantic-database","swift","swift-3"],"created_at":"2024-09-24T20:35:21.393Z","updated_at":"2025-04-09T08:05:35.218Z","avatar_url":"https://github.com/CosmicMind.png","language":"Swift","readme":"![Graph](http://www.cosmicmind.com/graph/github/graph-logo.png)\n\n## Welcome to Graph\n\nGraph is a semantic database that is used to create data-driven applications.\n\n![Material Sample](http://cosmicmind.com/samples/github/page-tab-bar-controller-2.png)\n\n* [Download the latest sample](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/CardTableView).\n\n## Features\n\n- [x] iCloud Support\n- [x] Multi Local \u0026 Cloud Graphs\n- [x] Thread Safe\n- [x] Store Any Data Type, Including Binary Data\n- [x] Relationship Modeling\n- [x] Action Modeling For Analytics\n- [x] Model With Graph Theory and Set Theory\n- [x] Asynchronous / Synchronous Search\n- [x] Asynchronous / Synchronous Saving\n- [x] Data-Driven Architecture\n- [x] Data Model Observation\n- [x] Comprehensive Unit Test Coverage\n- [x] Example Projects\n\n## Requirements\n\n* iOS 8.0+ / Mac OS X 10.10+\n* Xcode 8.0+\n\n## Communication\n\n- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/cosmicmind). (Tag 'cosmicmind')\n- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/cosmicmind).\n- If you **found a bug**, _and can provide steps to reliably reproduce it_, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Installation\n\n\u003e **Embedded frameworks require a minimum deployment target of iOS 8.**\n\u003e - [Download Graph](https://github.com/CosmicMind/Graph/archive/master.zip)\n\n## CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate Graph's core features into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '8.0'\nuse_frameworks!\n\npod 'Graph', '~\u003e 3.1.0'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n## Carthage\n\nCarthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with Homebrew using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\nTo integrate Graph into your Xcode project using Carthage, specify it in your Cartfile:\n\n```bash\ngithub \"CosmicMind/Graph\"\n```\n\nRun `carthage update` to build the framework and drag the built `Graph.framework` into your Xcode project.\n\n## Changelog\n\nGraph is a growing project and will encounter changes throughout its development. It is recommended that the [Changelog](https://github.com/CosmicMind/Graph/wiki/Changelog) be reviewed prior to updating versions.\n\n# Samples\n\nThe following are samples to see how Graph may be used within your applications.\n\n* Visit the [Samples](https://github.com/CosmicMind/Samples) repo to see example projects using Graph.\n\n## Creating an Entity for an ImageCard\n\nAn **Entity** is a model (data) object that represents a **person**, **place**, or **thing**. It may store property values, be a member of groups, and can be tagged.\n\nIn the following example, we create an ImageCard view using Material and populate it's properties with an Entity that stores the data for that view.\n\n![Material ImageCard](http://www.cosmicmind.com/gifs/white/image-card.gif)\n\n#### Creating data\n\n```swift\nlet graph = Graph()\n\nlet entity = Entity(type: \"ImageCard\")\nentity[\"title\"] = \"Graph\"\nentity[\"detail\"] = \"Build Data-Driven Software\"\nentity[\"content\"] = \"Graph is a semantic database that is used to create data-driven applications.\"\nentity[\"author\"] = \"CosmicMind\"\nentity[\"image\"] = UIImage.load(contentsOfFile: \"frontier\", ofType: \"jpg\")\n\ngraph.sync()\n```\n\n#### Setting the view's properties\n\n```swift\nimageCard.toolbar?.title = entity[\"title\"] as? String\nimageCard.toolbar?.detail = entity[\"detail\"] as? String\nimageCard.imageView?.image = entity[\"image\"] as? UIImage\n\nlet contentLabel = UILabel()\ncontentLabel.text = entity[\"content\"] as? String\nimageCard.contentView = contentLabel\n\nlet authorLabel = UILabel()\nauthorLabel.text = entity[\"author\"] as? String\nimageCard.bottomBar?.centerViews = [authorLabel]\n```\n\n* Download the complete [ImageCard example](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/ImageCard).\n* Learn more about [Material's ImageCard](http://cosmicmind.com/material/imagecard).\n\n## Searching a list of users in realtime\n\nUsing the **Search** API is incredibly flexible. In the following example, Search is used to create a live search on user names with a dynamic UI provided by [Material's SearchBar](http://cosmicmind.com/material/searchbar).\n\n![Material SearchBar](http://www.cosmicmind.com/gifs/shared/search-bar-controller.gif)\n\n#### Preparing the search criteria\n\n```swift\nlet graph = Graph()\n\nlet search = Search\u003cEntity\u003e(graph: graph).for(types: \"User\").where(properties: \"name\")\n```\n\n#### Asynchronously searching graph\n\n```swift        \nsearch.async { [weak self, pattern = pattern] (users) in\n\n\tguard let regex = try? NSRegularExpression(pattern: pattern, options: []) else {\n\t    return\n    }\n\n\tvar data = [Entity]()\n\n\tfor user in users {\n\t\tif let name = user[\"name\"] as? String {\n\t\t\tlet matches = regex.matches(in: name, range: NSRange(location: 0, length: name.utf16.count))\n\n\t\t\tif 0 \u003c matches.count {\n\t\t\t\tdata.append(user)\n\t\t\t}\n\t\t}\n\t}\n\n\tself?.tableView.data = data\n}\n```\n\n* Download the complete [Search example](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/Search).\n* Learn more about [Material's SearchBar](http://cosmicmind.com/material/searchbar).\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (C) 2019, CosmicMind, Inc. \u003chttp://cosmicmind.com\u003e.\nAll rights reserved.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicmind%2Fgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmicmind%2Fgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmicmind%2Fgraph/lists"}