{"id":50404132,"url":"https://github.com/aksw/text2sparql-client","last_synced_at":"2026-05-31T01:01:28.175Z","repository":{"id":289343761,"uuid":"969226957","full_name":"AKSW/text2sparql-client","owner":"AKSW","description":"Command Line Client to retrieve SPARQL results from a TEXT2SPARQL conform endpoint.","archived":false,"fork":false,"pushed_at":"2026-04-09T17:16:56.000Z","size":626,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":21,"default_branch":"main","last_synced_at":"2026-04-09T19:23:06.402Z","etag":null,"topics":["cli","python","text2sparql"],"latest_commit_sha":null,"homepage":"https://text2sparql.aksw.org/","language":"Python","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/AKSW.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-19T17:14:20.000Z","updated_at":"2026-04-09T17:17:02.000Z","dependencies_parsed_at":"2025-04-22T20:24:45.034Z","dependency_job_id":"cc749db1-8003-42bb-be21-ae468b42152c","html_url":"https://github.com/AKSW/text2sparql-client","commit_stats":null,"previous_names":["aksw/text2sparql-client"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/AKSW/text2sparql-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Ftext2sparql-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Ftext2sparql-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Ftext2sparql-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Ftext2sparql-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AKSW","download_url":"https://codeload.github.com/AKSW/text2sparql-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Ftext2sparql-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33715211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":["cli","python","text2sparql"],"created_at":"2026-05-31T01:01:25.115Z","updated_at":"2026-05-31T01:01:28.154Z","avatar_url":"https://github.com/AKSW.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text2sparql-client\n\nCommand Line Client to retrieve SPARQL results from a TEXT2SPARQL conform endpoint.\n\n[![workflow](https://github.com/aksw/text2sparql-client/actions/workflows/check.yml/badge.svg)](https://github.com/aksw/text2sparql-client/actions) [![pypi version](https://img.shields.io/pypi/v/text2sparql-client)](https://pypi.org/project/text2sparql-client) [![license](https://img.shields.io/pypi/l/text2sparql-client)](https://pypi.org/project/text2sparql-client)\n[![poetry][poetry-shield]][poetry-link] [![ruff][ruff-shield]][ruff-link] [![mypy][mypy-shield]][mypy-link] [![copier][copier-shield]][copier] \n\n## Development\n\n- Run [task](https://taskfile.dev/) to see all major development tasks.\n- Use [pre-commit](https://pre-commit.com/) to avoid errors before commit.\n- This repository was created with [this copier template](https://github.com/eccenca/cmem-plugin-template).\n\n\n[poetry-link]: https://python-poetry.org/\n[poetry-shield]: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json\n[ruff-link]: https://docs.astral.sh/ruff/\n[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\u0026label=Code%20Style\n[mypy-link]: https://mypy-lang.org/\n[mypy-shield]: https://www.mypy-lang.org/static/mypy_badge.svg\n[copier]: https://copier.readthedocs.io/\n[copier-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json\n\n\n## Commands Reference\n\nThis portion describes all available CLI commands in the text2sparql-client.\n\n\n### serve\n\nProvide a TEXT2SPARQL testing endpoint. Serves as a simple reference implementation for testing purposes.\n\n#### Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--port` | Integer | `8000` | The port to listen on |\n| `--host` | String | `127.0.0.1` | Bind socket to this host. Use `0.0.0.0` to make the endpoint available on your local network |\n| `--sleep` | Integer | `0` | How long to sleep (in seconds) before answering (for testing purposes) |\n\n#### Example\n\n```bash\ntext2sparql serve --port 8000 --host 0.0.0.0\n```\n\n---\n\n\n### ask\n\nQuery a TEXT2SPARQL endpoint using a questions YAML file and send each question to the endpoint. Creates a SQLite database to cache responses.\n\n#### Arguments\n\n| Name | Type | Description |\n|------|------|-------------|\n| `QUESTIONS_FILE` | File | YAML file containing the questions to ask |\n| `URL` | String | TEXT2SPARQL endpoint URL to query |\n\n#### Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--answers-db` | Path | `responses.db` | Where to save the endpoint responses (SQLite database) |\n| `--timeout` | Integer | `600` | Timeout in seconds for each request |\n| `--retries` / `-r` | Integer | `5` | Number of retries for disconnected, http error and timed out requests |\n| `--retry-sleep` | Integer | `15` | Seconds to sleep between retries |\n| `--retries-log` | Path | `retries.log` | File to log retries to |\n| `--output` / `-o` | Path | `-` (stdout) | Save JSON output to this file |\n| `--cache` / `--no-cache` | Boolean | `True` | If possible, return a cached response from the answers database |\n\n#### Example\n\n```bash\ntext2sparql ask questions.yml http://localhost:8000 -o answers.json\n```\n\n---\n\n\n### query\n\nQuery an RDF endpoint with SPARQL queries from the questions file or answers file. Generates result sets for evaluation purposes.\n\n#### Arguments\n\n| Name | Type | Description |\n|------|------|-------------|\n| `QUESTIONS_FILE` | File | YAML file containing the questions with SPARQL queries |\n\n#### Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--answers_file` / `-a` | File | None | File containing automatically generated answers. If provided, generates predicted result set instead of true result set |\n| `--endpoint` / `-e` | String | `http://141.57.8.18:9080/sparql` | RDF endpoint URL for the dataset |\n| `--output` / `-o` | Path | `-` (stdout) | File to save the result set (JSON) |\n| `--languages` / `-l` | List | `['en']` | List of languages represented in the QUESTIONS_FILE |\n\n#### Example\n\n```bash\ntext2sparql query questions.yml -e http://localhost:9080/sparql -o result_set.json\n```\n\n\n---\n\n\n### evaluate\n\nEvaluate results from a TEXT2SPARQL endpoint by comparing predicted answers against a ground truth set.\n\n#### Arguments\n\n| Name | Type | Description |\n|------|------|-------------|\n| `API_NAME` | String | Name/identifier for the API being evaluated |\n| `TRUE_SET` | File | JSON file containing the ground truth result set |\n| `PRED_SET` | File | JSON file containing the predicted result set from the API |\n\n#### Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--output` / `-o` | Path | `-` (stdout) | File to save the evaluation results (JSON) |\n| `--languages` / `-l` | List | `['en']` | List of languages to generate separate metric results for |\n\n#### Example\n\n```bash\ntext2sparql evaluate my-api true_results.json predicted_results.json -o metrics.json -l \"['en', 'es']\"\n```\n\n---\n\n\n### Common Features\n\n#### Output Options\n\nAsk, query and evaluate support the `--output` / `-o` option:\n- Specify a file path to save output to a file\n- Use `-` or omit the option to write to stdout\n- The command will refuse to overwrite existing files\n\n#### Language Support\n\nQuery and evaluate support multiple languages using the `--languages` / `-l` option:\n- Provide a Python-style list string: `\"['en', 'es']\"`\n- Default is English only: `['en']`\n- Used to generate separate metrics per language in evaluation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faksw%2Ftext2sparql-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faksw%2Ftext2sparql-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faksw%2Ftext2sparql-client/lists"}