{"id":21107252,"url":"https://github.com/glaivepro/athletics-lv-json-ld","last_synced_at":"2026-01-01T22:44:29.274Z","repository":{"id":158916485,"uuid":"493585269","full_name":"GlaivePro/athletics-lv-json-ld","owner":"GlaivePro","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-18T12:06:47.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-21T03:42:11.488Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GlaivePro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-05-18T08:58:23.000Z","updated_at":"2022-05-18T08:58:23.000Z","dependencies_parsed_at":"2023-05-31T20:31:07.461Z","dependency_job_id":null,"html_url":"https://github.com/GlaivePro/athletics-lv-json-ld","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fathletics-lv-json-ld","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fathletics-lv-json-ld/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fathletics-lv-json-ld/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlaivePro%2Fathletics-lv-json-ld/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GlaivePro","download_url":"https://codeload.github.com/GlaivePro/athletics-lv-json-ld/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243551248,"owners_count":20309300,"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":[],"created_at":"2024-11-20T00:37:23.627Z","updated_at":"2026-01-01T22:44:29.237Z","avatar_url":"https://github.com/GlaivePro.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Datu apmaiņas formāts ar athletics.lv\n\n*athletics.lv* datus nodod un saņem, izmantojot datu struktūras, kas paredzētas\n[Open Athletics Data Model](https://w3c.github.io/opentrack-cg/spec/model/) standartā,\nkurš savukārt izmanto JSON-LD formātu.\n\n## Datu paraugi\n\n- [Skrējiena rezultāti](https://athletics.lv/race/27306.jsonld)\n- [Sportists](https://athletics.lv/athlete/3620.jsonld)\n- [Persona](https://athletics.lv/person/13569.jsonld)\n- [Dalībnieks](https://athletics.lv/competitor/308756.jsonld)\n- [Dalībnieks bez numura](https://athletics.lv/competitor/54044.jsonld)\n- [Rezultāts](https://athletics.lv/result/340065.jsonld)\n\nCitus paraugus var aplūkot OpenTrack grupas [repozitorijā](https://github.com/w3c/opentrack-cg/tree/main/examples).\n\n## Datu struktūra\n\nKatrs objekts (gan atbildes augstākā līmeņa, gan iekšā iekļautie, piemēram, \"sportists\")\nsatur identifikatoru `@id` un objekta tipu `@type`.\n\nKā identifikatoru vislabāk izmantot konkrētā objekta URL. Piemēram, personas, kas atrodama\nadresē https://athletics.lv/person/13569.jsonld identifikators ir `https://athletics.lv/person/13569.jsonld`.\n\nNe vienmēr tas iespējams. Piemēram, rezultātā https://athletics.lv/result/340065.jsonld ir sniegums,\nkurš nav atverams kā atsevišķs objekts. Šādā gadījumā labi izmantot virsējā objekta URL, tam galā\npieliekot `#` un kādu norādi uz apakšobjektu. Šajā gadījumā tas ir rezultāta sniegums (*performance*),\ntāpēc identifikators ir `https://athletics.lv/result/340065.jsonld#performance`. Tieši `#` izmantojam\ntāpēc, ka tas nemaina iegūstamo resursu — pieprasījums uz https://athletics.lv/result/340065.jsonld#performance\natver to pašu https://athletics.lv/result/340065.jsonld, kas satur šo sniegumu.\n\nDaļu aiz `#` var arī veidot detalizētāk, piemēram, ja nav URL individuāliem rezultātiem, tad sacensību\nietvaros rezultāta identifikators var būt `https://athletics.lv/race/3465.jsonld#340065`, bet snieguma\nidentifikators šim rezultātam: `https://athletics.lv/race/3465.jsonld#340065-performance`.\n\nVar izmantot arī fiktīvus URL. Piemēram, athletics.lv pagaidām nav treneru JSON-LD kartiņas, bet vienalga\nvar norādīt treneri, izmantojot personas ID, piemēram, `https://athletics.lv/coach/3620.jsonld`, kaut šāds\nURL ne uz ko neved.\n\nIdentifikatoru `@id` var nenorādīt gadījumos, kad informācijai nav nekādas nozīmes ārpus konteksta.\nPiemēram, vēja ātrums pie kāda no lēcieniem. Bet to obligāti vajag norādīt visiem objektiem, kas var \nparādīties vairākos kontekstos. Piemēram, personas, rezultāti.\n\nDatiem (HTTP atbildei vai failam) jāsatur viens augstākā līmeņa objekts. Šajā objektā \njānorāda arī `@context` parametrs ar vērtību `https://w3c.github.io/opentrack-cg/contexts/opentrack.jsonld`,\nkas norāda, ka datos izmantots Open Athletics Data Model.\n\nAtbildes datu tipam ieteicams būt `application/ld+json` vai `application/json`.\n\n### Skrējiens (`UnitRace`)\n\nStruktūra:\n- `@id` unikāls identifikators\n- `@type` tips `UnitRace`\n- `results` masīvs ar [rezultātiem](#rezultāts-result)\n\nParaugs: https://athletics.lv/race/27306.jsonld\n\n### Rezultāts (`Result`)\n\nStruktūra:\n- `@id` unikāls identifikators\n- `@type` tips `Result`\n- `rank` skrējienā gūtā vieta\n- `competitor` [dalībnieks](#dalībnieks-competitor)\n- `performance` sniegums [laika](#laika-sniegums-timeperformance), \n[punktu](#punktu-sniegums-pointsperformance) vai [attāluma](#attāluma-sniegums-distanceperformance) izteiksmē.\n\nParaugs: https://athletics.lv/result/34064.jsonld\n\n### Dalībnieks (`Competitor`)\n\nStruktūra:\n- `@id` unikāls identifikators\n- `@type` tips `Competitor`\n- `agent` [sportists](#sportists-athlete) vai [komanda](#komanda-team)\n\nParaugs: https://athletics.lv/competitor/308756.jsonld)\n\n### Sportists (`Athlete`)\n\nStruktūra:\n- `@id` unikāls identifikators\n- `@type` tips `Team`\n- (neobligāts) `name` pilns vārds un uzvārds\n- `givenName` vārds\n- `familyName` uzvārds\n- `gender` dzimums `Male` vai `Female`\n- (neobligāts) `nationality` pārstāvētā valsts, ieteicams formātā `countrycode:ZZZ`, kur *ZZZ* — valsts [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) kods. Formāts `countrycode:LVA` ir ekvivalents šādai norādei: `http://publications.europa.eu/resource/authority/country/LVA`.\n- `birthDate` dzimšanas datums ISO 8601 formātā `GGGG-MM-DD`, piemēram, `1988-11-23`.\n\nParaugs: https://athletics.lv/athlete/3620.jsonld\n\n### Komanda (`Team`)\n\nStruktūra:\n- `@id` unikāls identifikators\n- `@type` tips `Team`\n- `name` komandas nosaukums\n- `athlete` masīvs ar komandas [sportistiem](#sportists-athlete)\n\n### Laika sniegums (`TimePerformance`)\n\nStruktūra:\n- `@id` unikāls identifikators\n- `@type` tips `TimePerformance`\n- `time` laiks ISO 8601 formātā `hh:mm:ss.uuu`, piemēram, `01:23:53.000` vai `00:00:12.214`.\n\nParaugs: `performance` atribūtā šajā objektā https://athletics.lv/result/34064.jsonld#performance\n\n### Punktu sniegums (`PointsPerformance`)\n\nStruktūra:\n- `@id` unikāls identifikators\n- `@type` tips `PointsPerformance`\n- `points` gūto punktu skaits\n\n### Distances sniegums (`DistancePerformance`)\n\nStruktūra:\n- `@id` unikāls identifikators\n- `@type` tips `DistancePerformance`\n- `distance` distances [vērtība](#vērtība-quantitativevalue)\n\n### Vērtība (`QuantitativeValue`)\n\nStruktūra:\n- `@type` tips `QuantitativeValue`\n- `unitCode` mērvienība, piemēram MTR (metri) vai KGM (kilogrami)\n- `value` vērtība lielums norādītajās mērvienībās\n\n## Realizācijas paraugi\n\n- Procedurāla koda paraugs valodā PHP: https://github.com/GlaivePro/athletics-lv-json-ld/blob/master/examples/php-proc/export.php\n- Objektorientēta koda paraugs valodā PHP: https://github.com/GlaivePro/athletics-lv-json-ld/blob/master/examples/php-oop/export.php\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaivepro%2Fathletics-lv-json-ld","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglaivepro%2Fathletics-lv-json-ld","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglaivepro%2Fathletics-lv-json-ld/lists"}