oneliner
curl 'https://prismdb.takanakahiko.me/sparql?default-graph-uri=&query=PREFIX+prism%3A+%3Chttps%3A%2F%2Fprismdb.takanakahiko.me%2Fprism-schema.ttl%23%3E%0D%0A%0D%0ASELECT+concat%28%22%5Cn%3B%3B+okuri-ari+entries.%5Cn%3B%3B+okuri-nasi+entries.%5Cn%5Cn%22%2C%0D%0Agroup_concat%28concat%28replace%28%3Fckana%2C+%22+%22%2C+%22%22%29%2C+%22+%2F%22%2C+replace%28%3Fcname%2C+%22+%22%2C+%22%22%29%2C+%22%3B%22%2C+%3Fcclass%2C+if%28bound%28%3Fccv%29%2C+concat%28%22+CV%3A%22%2C+%3Fccv%29%2C+%22%22%29%2C+%22%2F%22%29%3B+separator%3D%22%5Cn%22%29%29%0D%0AWHERE+%7B%0D%0A++++%3Fc+a+prism%3ACharacter%3B%0D%0A++++++++prism%3Aname+%3Fcname%3B%0D%0A++++++++prism%3Aname_kana+%3Fckana%3B%0D%0A++++++++a%2Frdfs%3Alabel+%3Fcclass.%0D%0A++++optional+%7B%3Fc+prism%3Acv+%3Fccv.%7D%0D%0A++++bind%28%22%22+as+%3Fg%29%0D%0A%7D%0D%0Agroup+by+%3Fg&format=text%2Fcsv' | tail +3 | LC_ALL=C sort > prismdb-characters.jisyo
SPARQL
PREFIX prism: <https://prismdb.takanakahiko.me/prism-schema.ttl#>
SELECT concat("\n;; okuri-ari entries.\n;; okuri-nasi entries.\n\n",
group_concat(concat(replace(?ckana, " ", ""), " /", replace(?cname, " ", ""), ";", ?cclass, if(bound(?ccv), concat(" CV:", ?ccv), ""), "/"); separator="\n"))
WHERE {
?c a prism:Character;
prism:name ?cname;
prism:name_kana ?ckana;
a/rdfs:label ?cclass.
optional {?c prism:cv ?ccv.}
bind("" as ?g)
}
group by ?g
refs
- sanbox: https://prismdb.takanakahiko.me/sparql?qtxt=PREFIX+prism%3A+%3Chttps%3A%2F%2Fprismdb.takanakahiko.me%2Fprism-schema.ttl%23%3E%0D%0A%0D%0ASELECT+concat%28%22%5Cn%3B%3B+okuri-ari+entries.%5Cn%3B%3B+okuri-nasi+entries.%5Cn%5Cn%22%2C%0D%0Agroup_concat%28concat%28replace%28%3Fckana%2C+%22+%22%2C+%22%22%29%2C+%22+%2F%22%2C+replace%28%3Fcname%2C+%22+%22%2C+%22%22%29%2C+%22%3B%22%2C+%3Fcclass%2C+if%28bound%28%3Fccv%29%2C+concat%28%22+CV%3A%22%2C+%3Fccv%29%2C+%22%22%29%2C+%22%2F%22%29%3B+separator%3D%22%5Cn%22%29%29%0D%0AWHERE+%7B%0D%0A++++%3Fc+a+prism%3ACharacter%3B%0D%0A++++++++prism%3Aname+%3Fcname%3B%0D%0A++++++++prism%3Aname_kana+%3Fckana%3B%0D%0A++++++++a%2Frdfs%3Alabel+%3Fcclass.%0D%0A++++optional+%7B%3Fc+prism%3Acv+%3Fccv.%7D%0D%0A++++bind%28%22%22+as+%3Fg%29%0D%0A%7D%0D%0Agroup+by+%3Fg&format=text%2Fcsv
- result: https://prismdb.takanakahiko.me/sparql?default-graph-uri=&query=PREFIX+prism%3A+%3Chttps%3A%2F%2Fprismdb.takanakahiko.me%2Fprism-schema.ttl%23%3E%0D%0A%0D%0ASELECT+concat%28%22%5Cn%3B%3B+okuri-ari+entries.%5Cn%3B%3B+okuri-nasi+entries.%5Cn%5Cn%22%2C%0D%0Agroup_concat%28concat%28replace%28%3Fckana%2C+%22+%22%2C+%22%22%29%2C+%22+%2F%22%2C+replace%28%3Fcname%2C+%22+%22%2C+%22%22%29%2C+%22%3B%22%2C+%3Fcclass%2C+if%28bound%28%3Fccv%29%2C+concat%28%22+CV%3A%22%2C+%3Fccv%29%2C+%22%22%29%2C+%22%2F%22%29%3B+separator%3D%22%5Cn%22%29%29%0D%0AWHERE+%7B%0D%0A++++%3Fc+a+prism%3ACharacter%3B%0D%0A++++++++prism%3Aname+%3Fcname%3B%0D%0A++++++++prism%3Aname_kana+%3Fckana%3B%0D%0A++++++++a%2Frdfs%3Alabel+%3Fcclass.%0D%0A++++optional+%7B%3Fc+prism%3Acv+%3Fccv.%7D%0D%0A++++bind%28%22%22+as+%3Fg%29%0D%0A%7D%0D%0Agroup+by+%3Fg&format=text%2Fcsv&timeout=0&debug=on
https://github.com/banjun/skk-jisyo-prismdb