Coder Social home page Coder Social logo

jakobw / wd-query-builder Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 0.0 81 KB

Prototype of the Wikidata Query Builder for generating lists from Wikidata

Home Page: https://tools.wmflabs.org/wd-query-builder/

License: GNU General Public License v2.0

HTML 0.40% Vue 65.78% JavaScript 32.74% SCSS 1.07%

wd-query-builder's People

Contributors

jakobw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wd-query-builder's Issues

Support combining conditions with OR

Currently, it is already possible to combine multiple values for a property, e.g. using the "any item matching" option in the dropdown menu.

It would be nice to have a way to also combine properties using such an "any" relationship, i.e. combining different properties with OR rather than AND.

For example, I'd like to query for items that have either the "country" or "country of origin" property set to a specific country.

Deleting property/value pairs does not work

When "x" (delete) a property value pair, nothing happens and console shows an error of Error in event handler for "remove": "TypeError: _vm.statements.splice is not a function

Getting properties not working

The autosuggest for properties results in "No properties found" and spawns an error on the console: Loading failed for the <script> with source “https://www.wikidata.org/w/api.php?action=wbsearchentities&continue=0&format=json&language=en&search=a&type=property&uselang=en&callback=__jp0”.

(Firefox 56, Linux, npm run dev)

Add link to this repo and vice-versa

There should be a link on the tool's page (https://tools.wmflabs.org/wd-query-builder/) to this repository, and likewise, the README in the repo and the url (editable in the settings in the github interface) should link to the live tool page.

I can contribute the changes to the README and to the html page, but the repository settings can only be changed by the repo owner.

Add option to clear current query

There's no easy way currently to clear the current query. I think there would be two options to make this possible:

  1. An easy way: make the title of the query builder link to the root (wd-query-builder.toolforge.org) so you can just click it and it will automatically clear the query (this is how i do it in VizQuery)
  2. A more advanced way with a button somewhere near the 'Share Query' button that clears the current query. This should probably give a warning / alert to confirm the deletion of the current query.

Filter for “qualifier does not exist” doesn’t work

  1. Add a filter for any statement, e. g. “instance of: Wikidata”.
  2. Add a qualifier filter for any property, e. g. “end time”.
  3. For the qualifier value, select “does not exist”.
  4. Click “show results”.

Expected: results show up. (In this case, 0 results, but something should still happen.)

Actual: Nothing happens (no WDQS embed), and there are two errors in the console:

  1. When you select “does not exist”:

    [Vue warn]: Error in callback for watcher "valueType": "TypeError: specialValue.classConstructor is not a constructor"

    found in

    ---> at src/components/ValueSelector.vue
    at src/components/Qualifier.vue
    at src/components/Statement.vue
    at src/components/StatementList.vue
    at src/App.vue

    vue.esm.js:578
    TypeError: specialValue.classConstructor is not a constructor
    Stack trace:
    newValue@webpack-internal:///22:21:16
    valueType@webpack-internal:///41:126:26
    run@webpack-internal:///1:3207:11
    flushSchedulerQueue@webpack-internal:///1:2955:5
    nextTick/<@webpack-internal:///1:1814:9
    flushCallbacks@webpack-internal:///1:1735:5

  2. When you click “show results”:

    [Vue warn]: Error in nextTick: "TypeError: qualifier.getValue(...) is undefined"
    vue.esm.js:578
    TypeError: qualifier.getValue(...) is undefined
    Stack trace:
    addQualifierTriples@webpack-internal:///142:59:87
    generateQuery@webpack-internal:///142:25:7
    generateQuery@webpack-internal:///51:56:14
    boundFn@webpack-internal:///1:192:9
    showResults/<@webpack-internal:///51:72:24
    nextTick/<@webpack-internal:///1:1814:9
    flushCallbacks@webpack-internal:///1:1735:5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.