Giter VIP home page Giter VIP logo

wikidata-complete-gadget's Introduction

Wikidata Complete Gadget

📌Introduction

The WikidataComplete Gadget is a Wikidata gadget that is intended to help users in adding more facts to the Wikidata knowledge base. The tool is fetching suggestions from an API and shows them to the user directly within the Wikidata Web frontend, s.t., adding more facts is becoming convenient. The suggestions are computed automatically from other sources (e.g., Web Content, Knowledge Bases). This project was the part of Google Summer of Code Program 2021 (GSoC'21).

⚡Installation

Step 1: Create a Wikidata account

Step 2: After logging in create your own common.js

Step 3: Now add the following line of code to your common.js:

importScript('User:Data-Complete-Gadget/WikidataComplete.js');

Step 4: Now visit any random item at Wikidata and start editing 🥳

📷 Video Guide:

Check out the video guide

💻 Maintainers

🎆 Contribution Guide

Check out the contribution guide

wikidata-complete-gadget's People

Contributors

dhairya3124 avatar lalit97 avatar anbo-de avatar perevalov avatar d063520 avatar lucaswerkmeister avatar

Stargazers

 avatar Nizo Priskorn avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wikidata-complete-gadget's Issues

problem that text is not necessarily label of the object entity

Check this example.

https://www.wikidata.org/wiki/Q15716313#

The text is "american" but the object entity should be "United States of America":

Screenshot 2021-08-22 at 22 04 51

the backend API should call the endpoint and retrieve the label of the entity. In this case:

http://www.wikidata.org/entity/Q30

the query is:

select ?label ?disambiguation where {
OPTIONAL {http://www.wikidata.org/entity/Q30 http://www.w3.org/2000/01/rdf-schema#label ?label .
FILTER (lang(?label)="en")}

OPTIONAL { http://www.wikidata.org/entity/Q30 http://schema.org/description ?disambiguation . FILTER (lang(?disambiguation)="en") . }
}

I suggest also that the object entity should be "United States of America (sovereign state in North America)" so that it is more clear for ambiguous entities

ON reject no need to reload the page

while when approving the statement we really need to reload the page, when rejecting we should not, we should just remove it from the list ....

merge UI elements

I do not like this ...

Screenshot 2021-08-19 at 08 21 09

I propose to put everything in the grey box, more or less like this:

Screenshot 2021-08-19 at 08 50 09

but with nicer css ...

some problem with css

The boarder of the box with the statements to approve is slightly off.

Screenshot 2021-08-19 at 08 37 59

To debug maybe it helps to unset the boarder, then the box is not looking as expected. I guess the problem starts from there.

Reject an item [API]

# one example to reject the fact (id: 3410)
curl -X POST \
  'https://qanswer-svc3.univ-st-etienne.fr/fact/correct?userCookie=c51f3c6f-ef1c-41ff-b1ca-7a994666b93e&factId=3410&correction=2' 

The API is used to reject an item.
URL: https://qanswer-svc3.univ-st-etienne.fr/fact/correct
POST HTTP REQUEST
3 query params:
userCookie: c51f3c6f-ef1c-41ff-b1ca-7a994666b93e (String type) [Fixed]
factId: The 'id' field you will get from the API of #8 (Integer type)
correction: 2 (Integer type)

Create installation documentation

Definition of Done

  • a Wiki page was created providing a step-by-step (easy-to-follow) description of the installation process
    • each step as described
    • for important steps, a screenshot is provided too
  • update the repository with an up-to-date script required for the installation

Create animation for approve/reject

When user clicks on the approve or reject button an animation should appear.

DoD (definition of done):

  • Make animations available from technical side (any animation can be used in this step)
  • Agree on the exact approve/reject animations that will be used

avoid reloading the page

copy here some notes of guo

For the new statement, use jquery find the statement list and !temporarily add the approved statement.
same for delete the statement in the proposed list and decrease the number by one.

ASK if you need more help! it's not a problem!

fix publish fact operation in Gadget

the claim is not getting created because of empty numeric-id in payload

uri: https://www.wikidata.org/w/api.php

Payload:

action: wbcreateclaim
format: json
entity: Q16161947
property: P136
snaktype: value
value: {"entity-type":"item","numeric-id":""}
summary: Edited with Wikidatacomplete
token: sampletoken+\

Response:

{
    "error": {
        "code": "invalid-snak",
        "info": "Invalid snak data.",
        "messages": [
            {
                "name": "wikibase-api-invalid-snak",
                "parameters": [],
                "html": {
                    "*": "Invalid snak data."
                }
            }
        ],
        "*": "See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
    },
    "servedby": "mw1421"
}

Creating a new UI for WikidataComplete

Definition of Done

  • a visualization of the Wikidata complete suggestions was established that looks very similar (or equal) to the property visualization of Wikidata (see the following screenshot)
    • the CSS classes of the Wikidata visualization was used
    • the suggestion box should have a border to indicate to users that this is not a statement but a suggestion to create a new statement
    • the buttons "approve" and "reject" are shown below the box reusing the border color (s.t., people can easily recognize that the buttons serve the purpose of interacting with the suggestion box)

image

image
image

Allow uses to change the text of the proposed fact

Example: https://www.wikidata.org/wiki/Q1248738 (see below)

There the proposed fact is correct. However, the evidence is wrong. The correct evidence would be:
"Gitanas is a Mexican telenovela which aired in 2004."
However, the text of the evidence is not changeable. A better option would be to allow users to change the values.

See the following screenshot regarding the described problem:

image

DoD

  • As user, I would like to edit all suggested values
    • proposed solution: there should be an edit symbol besides the values. If clicked, the value is put into an input attribute and the value can be changed by the user.
      • see the following screenshot regarding the described solution:

image

after approving a statement the statement is still suggested

this should not happen.

  1. Since you currently refresh the page it means that it is given back again by the API. So probably you call the API only when the statement is rejected and not when it is accepted ..... please check this!

  2. When not refreshing the page (next step where guo is helping) then you can reduce the counter and you remove the statement, but still you need to call the API otherwise then when you reload the page we will have the same problem.

Singular plural

If only one statement write:

There is 1 statement to approve.

Screenshot 2021-08-19 at 08 24 23

integrate chrome api

when clicking on the reference we would like to have this:

https://en.wikipedia.org/wiki/Gakuen_Alice#:~:text=Hotaru%20Imai

(try it out in google chome!) The text containing the answer is marked. We would like to have this, i.e. the user clicks on the reference and gets there. To do this you can use a code that is similar to this. This generated the URL:

<a target="_blank" rel="noreferrer" href={${url}#:~:text=${encodeURIComponent(evidence.slice(0, offset_start))}-,${answer.answer}}>

Use on Gratisdata, a non-WMF wiki

Hello, @Dhairya3124 I hope you're doing great, I just want to let you guys know that, this gadget is a very wonderful tool, at least I've used it several times on Wikidata, and it's amazing using it.
Thanks to all the dev team members.

Can this gadget be used on a non-WMF wiki? it's Gratisdata and it's also a wiki like Wikidata, which uses the same software (MediaWiki, Wikibase) as Wikidata.

I am very much interested in hearing from you, thank you for your anticipated cooperation in this matter.

change the text

from: You have these number of statements to approve: 1
to: "There are N statements to approve".

If there is none then put the text and the link to:

"Go to entity with statements to approve"

Chrome highlight not working when there is comma in prefix

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.