Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

学園アイドルマスターのアイドルの名前を追加 #555

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

banjun
Copy link
Member

@banjun banjun commented Apr 28, 2024

まずは、せめて名前だけでも...追加したいと思います。

(直接コミットできる人向け): 他のプロパティ追加コミットを積んでもらっても大丈夫です

参照データ

公式ページ
https://gakuen.idolmaster-official.jp/idol/
https://gakuen.idolmaster-official.jp/idol/temari/
https://gakuen.idolmaster-official.jp/idol/kotone/
https://gakuen.idolmaster-official.jp/idol/mao/
https://gakuen.idolmaster-official.jp/idol/lilja/
https://gakuen.idolmaster-official.jp/idol/china/
https://gakuen.idolmaster-official.jp/idol/sumika/
https://gakuen.idolmaster-official.jp/idol/hiro/
https://gakuen.idolmaster-official.jp/idol/rinami/
https://gakuen.idolmaster-official.jp/idol/ume/
https://gakuen.idolmaster-official.jp/idol/misuzu/
https://gakuen.idolmaster-official.jp/idol/sena/

各ページで↓のようにして名前を取り出してきて入れました。

[last, first] = $(".idol-info__name").text().split(' '); [efirst,elast] = $(".idol-info__eng").text().split(' ')
xml = [
'<rdf:Description rdf:about="$elast_$efirst">',
'<schema:familyName xml:lang="ja">$last</schema:familyName>',
'<schema:familyName xml:lang="en">$elast</schema:familyName>',
'<imas:familyNameKana xml:lang="ja"></imas:familyNameKana>',
'<schema:givenName xml:lang="ja">$first</schema:givenName>',
'<schema:givenName xml:lang="en">$efirst</schema:givenName>',
'<imas:givenNameKana xml:lang="ja"></imas:givenNameKana>',
'<imas:nameKana xml:lang="ja"></imas:nameKana>',
'<schema:name xml:lang="ja">$last$first</schema:name>',
'<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">$last$first</rdfs:label>',
'<schema:name xml:lang="en">$elast $efirst</schema:name>',
'</rdf:Description>',
].join('\n')
    .replaceAll("$last", last).replaceAll("$first", first).replaceAll("$elast", elast).replaceAll("$efirst", efirst)
console.log(xml)

読み仮名はなかったので、そのあと手で入れました。(各アイドルにつき、first・last・fullの読みの三個所)

メタ属性でこの3行も追加しました。

      <imas:Brand xml:lang="en">Gakuen</imas:Brand>
      <schema:memberOf rdf:resource="HatsuboshiGakuen"/>
      <rdf:type rdf:resource="https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#Idol"/>

genderも必須だったので追加しました: #555 (comment)

@banjun
Copy link
Member Author

banjun commented Apr 28, 2024

rdflintでgenderは必須だったので追加します

Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Arimura_Mao - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Kuramoto_China - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Hataya_Misuzu - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Juo_Sena - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Shiun_Sumika - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Fujita_Kotone - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Tsukimura_Temari - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Himesaki_Rinami - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Hanami_Ume - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Katsuragi_Lilja - http://schema.org/gender - ???))
Error: SHACL violation: {1} ("Property needs to have at least 1 values, but found 0" (http://www.w3.org/ns/shacl#MinCountConstraintComponent)(triple: https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Shinosawa_Hiro - http://schema.org/gender - ???))

@banjun banjun requested a review from crssnky April 28, 2024 11:55
@banjun
Copy link
Member Author

banjun commented Apr 28, 2024

他ブランドのデータ眺めてて気付きましたけど、おそらく schema:name の en は first last の順序になっているみたいでした。
ということは、ここで追加するアイドルの名前もfirst lastの順序にしたうえで、
さらに、既存のデータにはなりますが、Hanami SakiもSaki Hanamiに変更したほうがいい気がします。

-    <schema:name xml:lang="en">Hanami Saki</schema:name>
+    <schema:name xml:lang="en">Saki Hanami</schema:name>

bb08d0d で入れ替え済み

@crssnky crssnky merged commit 89f1aaf into master Apr 30, 2024
2 checks passed
@crssnky
Copy link
Member

crssnky commented Apr 30, 2024

咲季の修正もありがとうございます!

@banjun banjun deleted the gakuen-idols branch April 30, 2024 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants