{"id":32631010,"url":"https://github.com/danielbeeke/spark","last_synced_at":"2026-04-16T00:31:33.275Z","repository":{"id":281401352,"uuid":"945132724","full_name":"danielbeeke/spark","owner":"danielbeeke","description":"https://www.youtube.com/watch?v=VNeEs1W8asc","archived":false,"fork":false,"pushed_at":"2025-03-26T20:13:05.000Z","size":840,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-01T14:34:32.784Z","etag":null,"topics":["react","sparql"],"latest_commit_sha":null,"homepage":"http://danielbeeke.nl/spark/","language":"TypeScript","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/danielbeeke.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-08T18:24:41.000Z","updated_at":"2025-03-26T20:13:08.000Z","dependencies_parsed_at":"2025-03-08T22:15:28.907Z","dependency_job_id":null,"html_url":"https://github.com/danielbeeke/spark","commit_stats":null,"previous_names":["danielbeeke/spark"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danielbeeke/spark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbeeke%2Fspark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbeeke%2Fspark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbeeke%2Fspark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbeeke%2Fspark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielbeeke","download_url":"https://codeload.github.com/danielbeeke/spark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielbeeke%2Fspark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31866236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: 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":["react","sparql"],"created_at":"2025-10-30T22:55:12.656Z","updated_at":"2026-04-16T00:31:33.259Z","avatar_url":"https://github.com/danielbeeke.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spark\n\nAn experiment to create decoupled React components driven by SPARQL fragments.\nThis approach ensures efficient SPARQL querying while keeping React components modular and declarative.\n\n---\n\n## Installation\n\n- Include `SparkCompiler` in your `vite.config.ts`. This is where you can define prefixes and specify the SPARQL endpoint you want to use. Optionally turn on `discoverDataTypes` to let Spark discover the datatypes via a SPARQL query.\n\n## Usage\n\n### Writing Components\n\n- Use `useSpark('$product rdfs:label $label')` to require a predicate (e.g., `rdfs:label`) for a certain type.\n- After writing this SPARQL fragment, a TypeScript type for `Product` will be generated, which you can use via the type `Spark\u003c'product'\u003e`.\n\n### Property Notation inside the Query fragments\n\n- `$label` denotes a singular property.\n- `?label` denotes a plural property.\n\n### Query Structure\n\n- The first argument of `useSpark()` represents what you would typically write inside the curly brackets of a `SELECT * WHERE {}` SPARQL query.\n- All SPARQL syntax is supported.\n- The `useSpark()` hook returns two properties: `{ items: Item[], item: Item[] }`.\n  - `Items` are all the resources fetched\n  - `Item` is the first resource fetched\n  - Accessing this variable triggers the fetcher.\n  - If the variable is not accessed, the fetch is not executed.\n\n\n### Additional Options\n\n`useSpark()` accepts a second argument: an optional configuration object with the following keys:\n\n- `limit` \u0026 `offset`: For pagination.\n- `orderBy` \u0026 `orderDirection`: For sorting results.\n- `sparql`: Allows execution of dynamic SPARQL queries alongside the requested properties (useful for filtering).\n\n### Type Generation\n\n- The subject in the generated TypeScript type is assigned the variable `iri`.\n\n## TODO\n\n[ ] Add caching for the dataTypes query\n[ ] Support multiple sources\n[ ] Support for multilingual text handling\n    - Could be achieved via dynamic Sparql that according to the data types add a filter\n    - Would not deal with multiple objects with the same language.\n    - Could work with $ but still receives multiple bindings.\n[ ] Improve the handling of optional\n[ ] More support for type casting, such as xsd:date to Date.\n[ ] Support nested objects similar to sparqljson-to-tree.js","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielbeeke%2Fspark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielbeeke%2Fspark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielbeeke%2Fspark/lists"}