lingua-libre / SignIt

🌻 Lingua Libre SignIt web-browser extension translates selected word in French Sign Language via an elegant pop up so you learn sign language while reading online.
https://addons.mozilla.org/en-US/firefox/addon/lingua-libre-signit/
MIT License
11 stars 13 forks source link

Change endppoints for better resilience #66

Open hugolpz opened 1 month ago

hugolpz commented 1 month ago

See : https://github.com/lingua-libre/SignIt/blob/master/background-script.js#L32-L53

sparqlSignLanguagesQuery

Current LL SPARQL

SELECT ?id ?idLabel ?wikidata WHERE { ?id prop:P2 entity:Q4 . ?id prop:P24 entity:Q88890 . ?id prop:P12 ?wikidata SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en". } }

Wikidata SPARQL

https://w.wiki/APHP

SELECT ?signLanguage ?LinguaLibreID ?practicians ?iso ?signLanguageLabel ?signLanguageNative
WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?signLanguage wdt:P31 wd:Q34228;
    wdt:P10369 ?LinguaLibreID.
  OPTIONAL { ?signLanguage wdt:P1098 ?practicians. }
  OPTIONAL { ?signLanguage wdt:P1705 ?signLanguageNative. }
  OPTIONAL { ?signLanguage wdt:P220 ?iso. }
}

sparqlSignVideosQuery

Current LL SPARQL

    'SELECT ?word ?filename ?speaker WHERE { ?record prop:P2 entity:Q2 . ?record prop:P4 entity:$(lang) . ?record prop:P7 ?word . ?record prop:P3 ?filename . ?record prop:P5 ?speakerItem . ?speakerItem rdfs:label ?speaker filter ( lang( ?speaker ) = "en" ) . }';

sparqlFilesInCategoryQuery

Current LL SPARQL

SELECT ?file ?url ?title
WHERE {
  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Generator" ;
                    wikibase:endpoint "commons.wikimedia.org" ;
                    mwapi:gcmtitle "Category:Videos Langue des signes française" ;
                    mwapi:generator "categorymembers" ;
                    mwapi:gcmtype "file" ;
                    mwapi:gcmlimit "max" .
    ?title wikibase:apiOutput mwapi:title .
    ?pageid wikibase:apiOutput "@pageid" .
  }
  BIND (URI(CONCAT('https://commons.wikimedia.org/entity/M', ?pageid)) AS ?file)
  BIND (URI(CONCAT('https://commons.wikimedia.org/wiki/', ?title)) AS ?url)
}

Suggested JS

Based on :

// Playground : https://jsfiddle.net/hugolpz/7fkdsmu5/

Listing media :

ishqDehlvi commented 1 month ago

Hey there can I try this issue?? as far as I am getting the issue is about the discrepancies with the language parameters as well as the queries. lack of query import too I guess. Am I correct??

hugolpz commented 3 weeks ago

Hello @ishqDehlvi , @kabir-afk is currently in a summer internship on SignIt so he has the priority to allow him to experiences the whole web extension's challenges. I will discuss this with him. What I can let you know is we will need lightly involved volunteers this Automn 2024 to review and maintain the enhanced code currently committed by Kabir. As Kabir will fly to new adventures by then. I will still be around to guide the new comers.