imas / imasparql

imasparql's RDFs
https://sparql.crssnky.xyz/imas/
MIT License
94 stars 30 forks source link

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

Closed banjun closed 6 months ago

banjun commented 7 months ago

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

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

参照データ

公式ページ 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も必須だったので追加しました: https://github.com/imas/imasparql/pull/555#issuecomment-2081446304

banjun commented 7 months ago

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 commented 7 months ago

他ブランドのデータ眺めてて気付きましたけど、おそらく 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>

→ bb08d0df51a54587308d9b7bff64970f1db8d606 で入れ替え済み

crssnky commented 6 months ago

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