{"id":17273956,"url":"https://github.com/owulveryck/gohaystack","last_synced_at":"2025-06-30T08:02:04.945Z","repository":{"id":92666236,"uuid":"267614310","full_name":"owulveryck/gohaystack","owner":"owulveryck","description":"a library to play with Haystack Project in Go","archived":false,"fork":false,"pushed_at":"2020-07-01T10:35:57.000Z","size":2093,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T22:23:05.078Z","etag":null,"topics":["graph","knowledge-based-systems","ontology","project-haystack"],"latest_commit_sha":null,"homepage":"https://project-haystack.org","language":"Go","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/owulveryck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["owulveryck"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-05-28T14:37:36.000Z","updated_at":"2025-01-14T20:40:09.000Z","dependencies_parsed_at":"2023-03-06T01:30:20.906Z","dependency_job_id":null,"html_url":"https://github.com/owulveryck/gohaystack","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":"0.29166666666666663","last_synced_commit":"a1a8dfd02776eb2d1199773ead85ff2ee1ff2347"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owulveryck%2Fgohaystack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owulveryck%2Fgohaystack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owulveryck%2Fgohaystack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owulveryck%2Fgohaystack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owulveryck","download_url":"https://codeload.github.com/owulveryck/gohaystack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852078,"owners_count":21171838,"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":["graph","knowledge-based-systems","ontology","project-haystack"],"created_at":"2024-10-15T08:52:45.323Z","updated_at":"2025-04-14T08:52:30.877Z","avatar_url":"https://github.com/owulveryck.png","language":"Go","readme":"[![GoDoc](https://godoc.org/github.com/owulveryck/gohaystack?status.svg)](https://pkg.go.dev/github.com/owulveryck/gohaystack?tab=doc) [![Go Report Card](https://goreportcard.com/badge/github.com/owulveryck/gohaystack)](https://goreportcard.com/report/github.com/owulveryck/gohaystack)\n![](https://github.com/owulveryck/gohaystack/workflows/Go/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/owulveryck/gohaystack/badge.svg?branch=master)](https://coveralls.io/github/owulveryck/gohaystack?branch=master)\n\n# gohaystack\n\nThis is a toy library to play with [Project Haystack](https://project-haystack.org/) in Go. It only relies on Go's standard library.\n\n## What is project-haystack?\n\nAs stated in the web site\n\n\u003e \"`Project Haystack`_ is an open-source initiative to streamline\n\u003e working with data from the Internet of Things. We standardize\n\u003e semantic data models and web services with the goal of making\n\u003e it easier to unlock value from the vast quantity of data being\n\u003e generated by the smart devices that permeate our homes, buildings,\n\u003e factories, and cities. Applications include automation, control,\n\u003e energy, HVAC, lighting, and other environmental systems.\"\n\u003e\n\u003e -- Project-Haystack\n\n## What's included\n\nThis library is rather incomplete, as I am using it only for testing purpose (discovering haystack, building a sample server, and transform data from a format to another)\nThis library has a `Grid` structure that can be (de)serialized to and from haystack format in JSON (no zinc yet).\nThe `Grid`  hold an array of `Entity`.\nAn `Entity` has an `id` (format `HaystackID` which is a pointer to a string) a `Dis` field (a string used for display purpose) and a hash map of tags.\n\na tag is a composition of a `*Label` and a `*Value`\n\nPlease, see the API documentation for more information.\n\n| Haystack kind | JSON Serialize | JSON Deserialize | Zinc Serialize | Zinc Deserialize |\n|---------------|----------------|------------------|----------------|------------------|\n| Grid          | x              | x                | x              |                  |\n| List          | x              | x                | x              |                  |\n| Dict          | x              | x                | x              |                  |\n| Null          | x              | x                | x              |                  |\n| Bool          | x              | x                | x              |                  |\n| Marker        | x              | x                | x              |                  |\n| Remove        | x              | x                | x              |                  |\n| NA            | x              | x                | x              |                  |\n| Number        | x              | x                | x              |                  |\n| Ref           | x              | x                | x              |                  |\n| Str           | x              | x                | x              |                  |\n| Date          | x              | x                | x              |                  |\n| Time          | x              | x                | x              |                  |\n| DateTime      | x              | x                | x              |                  |\n| URI           | x              | x                | x              |                  |\n| Coord         | x              | x                | x              |                  |\n| Xstr          |                |                  |                |                  |\n\n## Haystack tags package\n\nthe [`tags`](tags) subpackage contains the label and values definitions of the official haystack project tag list. This package is a commodity.\n\n## Example\n\n### Basic example\n\nGenerate a grid and add simple values:\n\n```go\ng := NewGrid()\nmyTagLabel := NewLabel(\"mytag\")\nmyTagSite := NewLabel(\"site\")\nmyTagLabel.Display = \"the display\"\nmySite := NewHaystackID(\"myreference\")\nentity := g.NewEntity(mySite)\nmyTagValue := NewStr(\"foo\")\nentity.SetTag(myTagLabel, myTagValue)\nentity.SetTag(myTagSite, MarkerValue)\n```\n\n### JSON\n\nGenerate a grid from a json payload:\n```go\ng := grid.NewGrid()\ndec := json.NewDecoder(os.Stdin)\nerr := dec.Decode(\u0026g)\nif err != nil {\n    log.Fatal(err)\n}\n```\n\n## Complete example\n\nthe `example/graph` contains a CLI tool that reads a JSON encoded haystack grid from stdin and generates a dot compatible representation on stdout.\n\n## Caution\n\nThis is a toy project given without any warranty. I made it for my own need to discover haystack.\nIf you want to take over the maintenance, feel free to contact me.\n","funding_links":["https://github.com/sponsors/owulveryck"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowulveryck%2Fgohaystack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowulveryck%2Fgohaystack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowulveryck%2Fgohaystack/lists"}