snapquery


Namesnapquery JSON
Version 0.0.14 PyPI version JSON
download
home_pageNone
Summarysnapquery: Introduce Named Queries and Named Query Middleware to wikidata
upload_time2024-10-28 11:56:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseApache-2.0
keywords sparql blazegraph middleware nicegui qlever query wikidata
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # snapQuery
Just query wikidata by name of query ...
<pre>snapquery cats</pre> is all you need

This endpoint and query detail independent style of querying wikidata and ther SPARQL services
makes your queries future proof. No worries about blazegraph being replaced, the graph being split or timeouts haunting you. snapquery introduces named queries and named query middleware to wikidata and other SPARQL endpoints

snapquery is a tool that simplifies the process of previewing, annotating, rating, commenting, running, and exploring Wikidata
queries across different SPARQL backends. It enhances user experience by storing query results and allowing easy
comparison across various backends and over time.

This tool is designed to assist users in curating and collaborating on queries, ensuring their continued functionality
over time. Developers and data consumers can access data conveniently through APIs, streamlining their workflow.

[![Join the discussion at https://github.com/WolfgangFahl/snapquery/discussions](https://img.shields.io/github/discussions/WolfgangFahl/snapquery)](https://github.com/WolfgangFahl/snapquery/discussions)
[![pypi](https://img.shields.io/pypi/pyversions/snapquery)](https://pypi.org/project/snapquery/)
[![Github Actions Build](https://github.com/WolfgangFahl/snapquery/actions/workflows/build.yml/badge.svg)](https://github.com/WolfgangFahl/snapquery/actions/workflows/build.yml)
[![PyPI Status](https://img.shields.io/pypi/v/snapquery.svg)](https://pypi.python.org/pypi/snapquery/)
[![GitHub issues](https://img.shields.io/github/issues/WolfgangFahl/snapquery.svg)](https://github.com/WolfgangFahl/snapquery/issues)
[![GitHub closed issues](https://img.shields.io/github/issues-closed/WolfgangFahl/snapquery.svg)](https://github.com/WolfgangFahl/snapquery/issues/?q=is%3Aissue+is%3Aclosed)
[![API Docs](https://img.shields.io/badge/API-Documentation-blue)](https://WolfgangFahl.github.io/snapquery/)
[![License](https://img.shields.io/github/license/WolfgangFahl/snapquery.svg)](https://www.apache.org/licenses/LICENSE-2.0)
## Demos

* [wikimedia toolhub](https://toolhub.wikimedia.org/tools/snapquery)
* [BITPlan](https://snapquery.bitplan.com)
* [RWTH Aachen i5](https://snapquery.wikidata.dbis.rwth-aachen.de/)

## Background

In the Wikimedia ecosystem, we now boast several SPARQL engines and backends housing the complete Wikidata graph for
querying purposes.

Over recent years, WDQS has encountered escalating timeouts as the graph expands. Users desire alternative endpoints
without grappling with disparities among SPARQL engines and their impact on query construction.

Recognizing the needs of Wikidata data consumers, we aim to establish a system that simplifies:

- Discovering pre-existing queries
- Facilitating easy forking, sharing, rating, and monitoring of queries
- Executing queries (or their variations) on diverse endpoints
- Comparing query results over time and/or across multiple endpoints
- Cultivating a collaborative community for query construction
- Ensuring the reliability of query results
- Providing alerts if a query no longer yields the expected results
- Developing tools that access data from dependable, middleware-cached
  queries via an accessible API, eliminating delays for downstream users.

# Links

* [Phabricator Task: Introduce Named Queries and Named Query Middleware to wikidata](https://phabricator.wikimedia.org/T363894)
* [Named Queries prototype by Tim Holzheim](https://github.com/tholzheim/named-queries/tree/master)

## Docs

* [Wiki](https://wiki.bitplan.com/index.php/Snapquery)
* [API documentation](https://snapquery.bitplan.com/docs)
* [Wikimedia Hackathon 2024 closing presentation](https://docs.google.com/presentation/d/1hVoIwRHjmA8x2scl7SUpsx4p9CEhdSCN/preview)
* [![Wikimedia Hackathon 2024 video](https://github.com/WolfgangFahl/snapquery/assets/1336221/460756cb-5379-4a93-b465-a5cb26f363bb)](https://youtu.be/-fHTdldf5Xo?t=2612)


### Model

![Class Diagram](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/WolfgangFahl/snapquery/main/snapquery.puml?fmt=svg&version=5)

## Authors

* [Wolfgang Fahl](http://www.bitplan.com/Wolfgang_Fahl)
* [Tim Holzheim](https://rwthcontacts.rwth-aachen.de/person/PER-46LT8TU)

# Features

## Planned

These are the planned features

* support for naming queries ([#9][i9]) ✅
* support for sharing queries (unique identifier) ([#2][i2]) ✅
* query multiple backends simultaneously and repeatedly
* stores queries and adaptations needed for different backends
* support user login
* support for spam protection
* support for rating queries
* support for commenting on queries
* support for detecting when a query returns different results between different backends
* support for query states: reliable, needs investigation, need verification
* support for autodetecting when a query returns fewer results than before (change in underlying data/model in
  Wikidata) -> needs investigation
* support for marking queries as reliable query by users
* support for seeing a state history per query
* support for storing query results so you don’t have to wait
* support for adding metadata to queries
    * add main subject (QID) to query
    * author -> id of author in the system
    * forked from x
* has REST API for data consumers e.g. LLM developers who want to present user-verified queries and data to users to
  increase reliability

## User stories

* as a user I want to know in advance if the query is returning what I expect
* as a user I want to [find all the rock bands starting with 'M'](http://snapquery.bitplan.com/query/wikidata.org/snapquery-examples/bands) in Wikidata without having to know how it is modeled
* as a user I want pay someone to help me get the information from Wikidata that I need
* as a user I want to know how a query performed in the past so I can trust that the underlying model is stable and I
  get the expected results
* as a user I want to comment on a query
* as a user I want to read comments from others on a query so I get and idea how reliable it is
* as a user I want to rate a query with 1-5 stars
* as a user I want to get information from multiple sparql engines at the same time
* as a user I don’t want to wait for a fresh query to finish and just get the information from the latest time a query
  succeeded.
* as a user I want a list of queries in the middleware
* as a user I want to sort the list based on the rate of queries
* as a user I want to annotate a query with a name
* as a user I want to annotate a query with a wikidata item as main subject
* as a user I want to see a list of queries that is tagged with a certain topic (wikidata item)
* as a user I want an API to get information from the middleware about queries
* as a user I want an api endpoint /list that gives me all queries with the main subject=Qxxxx
* as a user I want the system to warn me and annotate a query that no longer returns the data the user expects, ie. if a
  query suddenly start returning no results or fewer results
* as a user I want to see a state on a query
* as a user I want to log in using github to avoid the hassle of creating another account
* as a user I want to log in using gitlab to avoid the hassle of creating another account
* as a user I want to log in using facebook to avoid the hassle of creating another account
* as a user I want to know how many backends a query is working on, so I get an overview
* as a user I want to get query results immediately if possible so I don’t have to wait
* as a user I want to import a query by copy pasting a url from WDQS
* as a user I want to run a query on multiple backends with one click
* as a user I want to fork a query and build on it
* as a user I want an email if a query I'm watching needs investigation
* as a user I want settings to control whether I get email notifications or not for all queries I'm watching
* as a user I want to watch a query
* as a user I want to see the history of actions of other users
* as a user I want to know who created a query
* as a user I want a setting to get email about new comments on queries I'm watching
* as a user I want a setting to get emails about new queries every day, week, month
* as a user I want to star a query
* as a user I want to browse queries and sort by number of stars
* as a user I want to see who starred a query
* as a user I want to see a list of my notifications
* as a wikidata contributor I want to be able to override the “bad query” state
* as a wikidata user I want to be able to log in using my wmf credentials to avoid the hassle of creating another
  account
* as a wikidata user I want to link my current account to my wmf account so others can find me by username
* as a developer I want to expose the data in API endpoints
* as a LLM developer I want to consume the queries and use them to improve my LLM so it can suggest KNOWN GOOD queries
  to users

[i10]: https://github.com/WolfgangFahl/snapquery/issues/10
[i9]: https://github.com/WolfgangFahl/snapquery/issues/9

[i8]: https://github.com/WolfgangFahl/snapquery/issues/8

[i7]: https://github.com/WolfgangFahl/snapquery/issues/7

[i6]: https://github.com/WolfgangFahl/snapquery/issues/6

[i5]: https://github.com/WolfgangFahl/snapquery/issues/5

[i4]: https://github.com/WolfgangFahl/snapquery/issues/4

[i3]: https://github.com/WolfgangFahl/snapquery/issues/3

[i2]: https://github.com/WolfgangFahl/snapquery/issues/2

[i1]: https://github.com/WolfgangFahl/snapquery/issues/1

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "snapquery",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Wolfgang Fahl <wf@WolfgangFahl.com>",
    "keywords": "SPARQL, blazegraph, middleware, nicegui, qlever, query, wikidata",
    "author": null,
    "author_email": "Wolfgang Fahl <wf@WolfgangFahl.com>",
    "download_url": "https://files.pythonhosted.org/packages/6d/a0/ac107a6b21d5b920cb5bc24faa5d16358db3a5f449a5b5ecad5f125264e1/snapquery-0.0.14.tar.gz",
    "platform": null,
    "description": "# snapQuery\nJust query wikidata by name of query ...\n<pre>snapquery cats</pre> is all you need\n\nThis endpoint and query detail independent style of querying wikidata and ther SPARQL services\nmakes your queries future proof. No worries about blazegraph being replaced, the graph being split or timeouts haunting you. snapquery introduces named queries and named query middleware to wikidata and other SPARQL endpoints\n\nsnapquery is a tool that simplifies the process of previewing, annotating, rating, commenting, running, and exploring Wikidata\nqueries across different SPARQL backends. It enhances user experience by storing query results and allowing easy\ncomparison across various backends and over time.\n\nThis tool is designed to assist users in curating and collaborating on queries, ensuring their continued functionality\nover time. Developers and data consumers can access data conveniently through APIs, streamlining their workflow.\n\n[![Join the discussion at https://github.com/WolfgangFahl/snapquery/discussions](https://img.shields.io/github/discussions/WolfgangFahl/snapquery)](https://github.com/WolfgangFahl/snapquery/discussions)\n[![pypi](https://img.shields.io/pypi/pyversions/snapquery)](https://pypi.org/project/snapquery/)\n[![Github Actions Build](https://github.com/WolfgangFahl/snapquery/actions/workflows/build.yml/badge.svg)](https://github.com/WolfgangFahl/snapquery/actions/workflows/build.yml)\n[![PyPI Status](https://img.shields.io/pypi/v/snapquery.svg)](https://pypi.python.org/pypi/snapquery/)\n[![GitHub issues](https://img.shields.io/github/issues/WolfgangFahl/snapquery.svg)](https://github.com/WolfgangFahl/snapquery/issues)\n[![GitHub closed issues](https://img.shields.io/github/issues-closed/WolfgangFahl/snapquery.svg)](https://github.com/WolfgangFahl/snapquery/issues/?q=is%3Aissue+is%3Aclosed)\n[![API Docs](https://img.shields.io/badge/API-Documentation-blue)](https://WolfgangFahl.github.io/snapquery/)\n[![License](https://img.shields.io/github/license/WolfgangFahl/snapquery.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n## Demos\n\n* [wikimedia toolhub](https://toolhub.wikimedia.org/tools/snapquery)\n* [BITPlan](https://snapquery.bitplan.com)\n* [RWTH Aachen i5](https://snapquery.wikidata.dbis.rwth-aachen.de/)\n\n## Background\n\nIn the Wikimedia ecosystem, we now boast several SPARQL engines and backends housing the complete Wikidata graph for\nquerying purposes.\n\nOver recent years, WDQS has encountered escalating timeouts as the graph expands. Users desire alternative endpoints\nwithout grappling with disparities among SPARQL engines and their impact on query construction.\n\nRecognizing the needs of Wikidata data consumers, we aim to establish a system that simplifies:\n\n- Discovering pre-existing queries\n- Facilitating easy forking, sharing, rating, and monitoring of queries\n- Executing queries (or their variations) on diverse endpoints\n- Comparing query results over time and/or across multiple endpoints\n- Cultivating a collaborative community for query construction\n- Ensuring the reliability of query results\n- Providing alerts if a query no longer yields the expected results\n- Developing tools that access data from dependable, middleware-cached\n  queries via an accessible API, eliminating delays for downstream users.\n\n# Links\n\n* [Phabricator Task: Introduce Named Queries and Named Query Middleware to wikidata](https://phabricator.wikimedia.org/T363894)\n* [Named Queries prototype by Tim Holzheim](https://github.com/tholzheim/named-queries/tree/master)\n\n## Docs\n\n* [Wiki](https://wiki.bitplan.com/index.php/Snapquery)\n* [API documentation](https://snapquery.bitplan.com/docs)\n* [Wikimedia Hackathon 2024 closing presentation](https://docs.google.com/presentation/d/1hVoIwRHjmA8x2scl7SUpsx4p9CEhdSCN/preview)\n* [![Wikimedia Hackathon 2024 video](https://github.com/WolfgangFahl/snapquery/assets/1336221/460756cb-5379-4a93-b465-a5cb26f363bb)](https://youtu.be/-fHTdldf5Xo?t=2612)\n\n\n### Model\n\n![Class Diagram](http://www.plantuml.com/plantuml/proxy?src=https://raw.githubusercontent.com/WolfgangFahl/snapquery/main/snapquery.puml?fmt=svg&version=5)\n\n## Authors\n\n* [Wolfgang Fahl](http://www.bitplan.com/Wolfgang_Fahl)\n* [Tim Holzheim](https://rwthcontacts.rwth-aachen.de/person/PER-46LT8TU)\n\n# Features\n\n## Planned\n\nThese are the planned features\n\n* support for naming queries ([#9][i9]) \u2705\n* support for sharing queries (unique identifier) ([#2][i2]) \u2705\n* query multiple backends simultaneously and repeatedly\n* stores queries and adaptations needed for different backends\n* support user login\n* support for spam protection\n* support for rating queries\n* support for commenting on queries\n* support for detecting when a query returns different results between different backends\n* support for query states: reliable, needs investigation, need verification\n* support for autodetecting when a query returns fewer results than before (change in underlying data/model in\n  Wikidata) -> needs investigation\n* support for marking queries as reliable query by users\n* support for seeing a state history per query\n* support for storing query results so you don\u2019t have to wait\n* support for adding metadata to queries\n    * add main subject (QID) to query\n    * author -> id of author in the system\n    * forked from x\n* has REST API for data consumers e.g. LLM developers who want to present user-verified queries and data to users to\n  increase reliability\n\n## User stories\n\n* as a user I want to know in advance if the query is returning what I expect\n* as a user I want to [find all the rock bands starting with 'M'](http://snapquery.bitplan.com/query/wikidata.org/snapquery-examples/bands) in Wikidata without having to know how it is modeled\n* as a user I want pay someone to help me get the information from Wikidata that I need\n* as a user I want to know how a query performed in the past so I can trust that the underlying model is stable and I\n  get the expected results\n* as a user I want to comment on a query\n* as a user I want to read comments from others on a query so I get and idea how reliable it is\n* as a user I want to rate a query with 1-5 stars\n* as a user I want to get information from multiple sparql engines at the same time\n* as a user I don\u2019t want to wait for a fresh query to finish and just get the information from the latest time a query\n  succeeded.\n* as a user I want a list of queries in the middleware\n* as a user I want to sort the list based on the rate of queries\n* as a user I want to annotate a query with a name\n* as a user I want to annotate a query with a wikidata item as main subject\n* as a user I want to see a list of queries that is tagged with a certain topic (wikidata item)\n* as a user I want an API to get information from the middleware about queries\n* as a user I want an api endpoint /list that gives me all queries with the main subject=Qxxxx\n* as a user I want the system to warn me and annotate a query that no longer returns the data the user expects, ie. if a\n  query suddenly start returning no results or fewer results\n* as a user I want to see a state on a query\n* as a user I want to log in using github to avoid the hassle of creating another account\n* as a user I want to log in using gitlab to avoid the hassle of creating another account\n* as a user I want to log in using facebook to avoid the hassle of creating another account\n* as a user I want to know how many backends a query is working on, so I get an overview\n* as a user I want to get query results immediately if possible so I don\u2019t have to wait\n* as a user I want to import a query by copy pasting a url from WDQS\n* as a user I want to run a query on multiple backends with one click\n* as a user I want to fork a query and build on it\n* as a user I want an email if a query I'm watching needs investigation\n* as a user I want settings to control whether I get email notifications or not for all queries I'm watching\n* as a user I want to watch a query\n* as a user I want to see the history of actions of other users\n* as a user I want to know who created a query\n* as a user I want a setting to get email about new comments on queries I'm watching\n* as a user I want a setting to get emails about new queries every day, week, month\n* as a user I want to star a query\n* as a user I want to browse queries and sort by number of stars\n* as a user I want to see who starred a query\n* as a user I want to see a list of my notifications\n* as a wikidata contributor I want to be able to override the \u201cbad query\u201d state\n* as a wikidata user I want to be able to log in using my wmf credentials to avoid the hassle of creating another\n  account\n* as a wikidata user I want to link my current account to my wmf account so others can find me by username\n* as a developer I want to expose the data in API endpoints\n* as a LLM developer I want to consume the queries and use them to improve my LLM so it can suggest KNOWN GOOD queries\n  to users\n\n[i10]: https://github.com/WolfgangFahl/snapquery/issues/10\n[i9]: https://github.com/WolfgangFahl/snapquery/issues/9\n\n[i8]: https://github.com/WolfgangFahl/snapquery/issues/8\n\n[i7]: https://github.com/WolfgangFahl/snapquery/issues/7\n\n[i6]: https://github.com/WolfgangFahl/snapquery/issues/6\n\n[i5]: https://github.com/WolfgangFahl/snapquery/issues/5\n\n[i4]: https://github.com/WolfgangFahl/snapquery/issues/4\n\n[i3]: https://github.com/WolfgangFahl/snapquery/issues/3\n\n[i2]: https://github.com/WolfgangFahl/snapquery/issues/2\n\n[i1]: https://github.com/WolfgangFahl/snapquery/issues/1\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "snapquery: Introduce Named Queries and Named Query Middleware to wikidata",
    "version": "0.0.14",
    "project_urls": {
        "Documentation": "https://wiki.bitplan.com/index.php/snapquery",
        "Home": "https://github.com/WolfgangFahl/snapquery",
        "Source": "https://github.com/WolfgangFahl/snapquery"
    },
    "split_keywords": [
        "sparql",
        " blazegraph",
        " middleware",
        " nicegui",
        " qlever",
        " query",
        " wikidata"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "74a3198f6928460cab0e93c4427ab7dcdf462e5fa2a7d34c3a3f9602ef21150d",
                "md5": "458e9e8541d4ef6578e2326ed4aed701",
                "sha256": "8065feaac406815fd3fa91c8d062d24a04a260e1c2a3f58d42f530a61f0875dc"
            },
            "downloads": -1,
            "filename": "snapquery-0.0.14-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "458e9e8541d4ef6578e2326ed4aed701",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 290264,
            "upload_time": "2024-10-28T11:56:47",
            "upload_time_iso_8601": "2024-10-28T11:56:47.816062Z",
            "url": "https://files.pythonhosted.org/packages/74/a3/198f6928460cab0e93c4427ab7dcdf462e5fa2a7d34c3a3f9602ef21150d/snapquery-0.0.14-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6da0ac107a6b21d5b920cb5bc24faa5d16358db3a5f449a5b5ecad5f125264e1",
                "md5": "580bf2443b0622eeb9f019bf5577d7d2",
                "sha256": "39be9d5e3ff479c092248f2615feaa706404153f85afbcd6c25a67163c9fb5ed"
            },
            "downloads": -1,
            "filename": "snapquery-0.0.14.tar.gz",
            "has_sig": false,
            "md5_digest": "580bf2443b0622eeb9f019bf5577d7d2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 302087,
            "upload_time": "2024-10-28T11:56:49",
            "upload_time_iso_8601": "2024-10-28T11:56:49.061190Z",
            "url": "https://files.pythonhosted.org/packages/6d/a0/ac107a6b21d5b920cb5bc24faa5d16358db3a5f449a5b5ecad5f125264e1/snapquery-0.0.14.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-28 11:56:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "WolfgangFahl",
    "github_project": "snapquery",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "snapquery"
}
        
Elapsed time: 0.33115s