Skip to content

Commit

Permalink
Add Wikipedia to links
Browse files Browse the repository at this point in the history
  • Loading branch information
Arasteh authored Jan 5, 2025
1 parent f960eb7 commit 0a38d18
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
<div class="item-links">
<a :href="getImdbLink(item.imdbID)" target="_blank">T</a>
<a :href="getWikidataLink(item.film)" target="_blank">Q</a>
<a :href="item.faWikipediaLink" target="_blank">W</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -304,27 +305,31 @@
'Accept': 'application/json'
},
body: `
SELECT DISTINCT ?film ?filmLabel (GROUP_CONCAT(DISTINCT ?alias; separator=", ") AS ?aliases) (MIN(?publicationDate) AS ?date) ?imdbID ?poster ?logo ?designer ?designerLabel WHERE {
SELECT DISTINCT ?film ?filmLabel (GROUP_CONCAT(DISTINCT ?alias; separator=", ") AS ?aliases) (MIN(?publicationDate) AS ?date) ?imdbID ?poster ?logo ?designer ?designerLabel ?faWikipediaLink
WHERE {
VALUES ?type { wd:Q11424 wd:Q24862 wd:Q5398426 wd:Q7777570 wd:Q17517379 }
?film wdt:P31 ?type;
wdt:P495 wd:Q794.
?film wdt:P31 ?type; wdt:P495 wd:Q794.
?film p:P3383 ?imageStatement.
?imageStatement ps:P3383 ?poster.
OPTIONAL { ?imageStatement pq:P170 ?designer. }
OPTIONAL { ?film p:P154 ?logoStatement.
?logoStatement ps:P154 ?logo. }
?logoStatement ps:P154 ?logo. }
OPTIONAL { ?film wdt:P577 ?publicationDate. }
OPTIONAL { ?film wdt:P345 ?imdbID. }
OPTIONAL { ?film skos:altLabel ?alias.
FILTER(LANG(?alias) = "fa") }
OPTIONAL { ?wikipedia schema:about ?film;
schema:isPartOf <https://fa.wikipedia.org/>.
BIND(STR(?wikipedia) AS ?faWikipediaLink) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "fa". }
}
GROUP BY ?film ?filmLabel ?imdbID ?poster ?designer ?designerLabel ?logo
GROUP BY ?film ?filmLabel ?imdbID ?poster ?designer ?designerLabel ?logo ?faWikipediaLink
ORDER BY ?publicationDate
`
}
Expand Down

0 comments on commit 0a38d18

Please sign in to comment.