{"id":37127701,"url":"https://github.com/connctd/wotlib","last_synced_at":"2026-01-14T14:52:13.375Z","repository":{"id":98969987,"uuid":"259681300","full_name":"connctd/wotlib","owner":"connctd","description":"Simplify working with WoT Thing Descriptions","archived":false,"fork":false,"pushed_at":"2021-11-08T10:40:40.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-25T04:02:44.730Z","etag":null,"topics":["iot","thing-description","w3c","webofthings"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/connctd/wotlib?tab=doc","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/connctd.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-04-28T15:45:29.000Z","updated_at":"2021-11-08T10:40:43.000Z","dependencies_parsed_at":"2023-04-16T08:47:30.033Z","dependency_job_id":null,"html_url":"https://github.com/connctd/wotlib","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/connctd/wotlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connctd%2Fwotlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connctd%2Fwotlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connctd%2Fwotlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connctd%2Fwotlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/connctd","download_url":"https://codeload.github.com/connctd/wotlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/connctd%2Fwotlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["iot","thing-description","w3c","webofthings"],"created_at":"2026-01-14T14:52:12.453Z","updated_at":"2026-01-14T14:52:13.368Z","avatar_url":"https://github.com/connctd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WoT Lib\n\nThis lib was created to simplify working with [WoT Thing Descriptions](https://www.w3.org/TR/wot-thing-description/).\nIt is coupled to W3C's recommendation from 9 April 2020 (https://www.w3.org/TR/2020/REC-wot-thing-description-20200409/) which means it assumes a certain structure. So far only a subset of the fields are\nimplemented.\n\n## Working principle\n\nRead Thing Description -\u003e Expand -\u003e Perform operations\n\n## Capabilities\n\n- Determine if a thing and its sub elements do match with certain criteria\n- Search for property affordances with specific constraints\n- Search for action affordances with specific constraints\n\n## Example\n\nThe following example reads a td from bytes and retrieves all property affordances that\nmatch a given criteria\n\n```go\n// Define additionally used schema\nvar iotSchema = wotlib.SchemaMapping{\n    Prefix: wotlib.SchemaPrefix(\"iot\"),\n    IRI:    \"http://iotschema.org/\",\n}\n\n// Append it so its used during compaction\nwotlib.AppendSchema(iotSchema)\n\nexpandedTD, err := wotlib.FromBytes(input)\nif err != nil {\n    panic(err)\n}\n\n// Retrieve all property affordances that match given criteria\nprops := expandedTD.GetPropertyAffordances(wotlib.PropertyConstraint{\n    Type: \u0026[]string{iotSchema.IRIPrefix(\"SwitchStatus\")},\n})\n\n// Prints the href of the first match\nfmt.Printf(\"Result: %s\", props[0].Form.Value().Href.Value())\n```\n\nIn case multiple Thing Descriptions have to be processed append them to a set\nand apply the operation\n\n```go\nset := wotlib.NewExpandedThingDescriptionSet(expandedTD)\nset.GetActionAffordances(thingConstraint)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnctd%2Fwotlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconnctd%2Fwotlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconnctd%2Fwotlib/lists"}