{"id":14069197,"url":"https://github.com/lvaudor/glitter","last_synced_at":"2025-07-30T05:31:49.034Z","repository":{"id":42570966,"uuid":"366650966","full_name":"lvaudor/glitter","owner":"lvaudor","description":"an R package which writes SPARQL queries","archived":false,"fork":false,"pushed_at":"2024-07-10T07:18:30.000Z","size":15784,"stargazers_count":45,"open_issues_count":53,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-04T10:39:20.878Z","etag":null,"topics":["rstat","sparql"],"latest_commit_sha":null,"homepage":"https://lvaudor.github.io/glitter","language":"Rez","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/lvaudor.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-05-12T08:48:40.000Z","updated_at":"2024-10-24T07:42:28.000Z","dependencies_parsed_at":"2023-09-28T10:56:26.013Z","dependency_job_id":"b23b25e7-1e1b-4489-84a3-8efb0a966027","html_url":"https://github.com/lvaudor/glitter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lvaudor/glitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvaudor%2Fglitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvaudor%2Fglitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvaudor%2Fglitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvaudor%2Fglitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lvaudor","download_url":"https://codeload.github.com/lvaudor/glitter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lvaudor%2Fglitter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267815187,"owners_count":24148356,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["rstat","sparql"],"created_at":"2024-08-13T07:06:42.448Z","updated_at":"2025-07-30T05:31:48.248Z","avatar_url":"https://github.com/lvaudor.png","language":"Rez","funding_links":[],"categories":["Rez"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n# glitter \u003cimg src=\"man/figures/logo_small.png\" align=\"right\"/\u003e\n\n\u003e  DSL for SPARQL in R. :sparkles: `glitter` produces ~~sparkle~~ SPARQL! :sparkles:\n\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/lvaudor/glitter/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/lvaudor/glitter/actions/workflows/R-CMD-check.yaml)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![Codecov test coverage](https://codecov.io/gh/lvaudor/glitter/branch/master/graph/badge.svg)](https://app.codecov.io/gh/lvaudor/glitter?branch=master)\n\u003c!-- badges: end --\u003e\n\nThis package aims at writing and sending SPARQL queries without advanced knowledge of the SPARQL language syntax. \nIt makes the exploration and use of Linked Open Data (Wikidata in particular) easier for those who do not know SPARQL well.\n\nWith glitter, compared to writing SPARQL queries by hand, your code should be easier to write, and easier to read by your peers who do not know SPARQL.\nThe glitter package supports a \"domain-specific language\" (DSL) with function names (and syntax) closer to the tidyverse and base R than to SPARQL.\n\nFor instance, to find a corpus of 5 articles with a title in English and \"wikidata\" in that title, instead of writing SPARQL by hand you can run:\n\n```{r}\nlibrary(\"glitter\")\nquery \u003c- spq_init() %\u003e%\n  spq_add(\"?item wdt:P31 wd:Q13442814\") %\u003e%\n  spq_label(item) %\u003e%\n  spq_filter(str_detect(str_to_lower(item_label), 'wikidata')) %\u003e%\n  spq_head(n = 5)\n\nquery\n```\n\nNote how we were able to use `str_detect()` and `str_to_lower()` (as in the stringr package) instead of SPARQL's functions `REGEX` and `LCASE`.\n\nTo perform the query,\n\n```{r}\nspq_perform(query)\n```\n\nTo get a random subset of movies with the date they were released, you could use\n\n```{r}\nspq_init() %\u003e%\n  spq_add(\"?film wdt:P31 wd:Q11424\") %\u003e%\n  spq_label(film) %\u003e%\n  spq_add(\"?film wdt:P577 ?date\") %\u003e%\n  spq_mutate(date = year(date)) %\u003e%\n  spq_head(10) %\u003e%\n  spq_perform()\n```\n\nNote that we were able to \"overwrite\" the date variable, which is straightforward in dplyr, but not so much in SPARQL.\n\n## Installation\n\nInstall this packages through R-universe:\n\n```r\ninstall.packages(\"glitter\", repos = \"https://lvaudor.r-universe.dev\")\n```\n\nOr through GitHub:\n\n```r\ninstall.packages(\"remotes\") #if remotes is not already installed\nremotes::install_github(\"lvaudor/glitter\")\n```\n\n## Documentation\n\nYou can access the documentation regarding package `glitter`  [on its pkgdown website](http://perso.ens-lyon.fr/lise.vaudor/Rpackages/glitter/).\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvaudor%2Fglitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flvaudor%2Fglitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flvaudor%2Fglitter/lists"}