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

csv2rdf の変換設定に default という項目を追加したい #197

Open
takanakahiko opened this issue Nov 19, 2019 · 0 comments
Open

Comments

@takanakahiko
Copy link
Member

takanakahiko commented Nov 19, 2019

モチベーション

  • 現在 rdfTypelabel といった項目がある
  • 今後もこういった項目は増えていく可能性が高い
  • そのたびにソースコードを冗長にするのは大変
  • 冗長になりづらい設計にしたい

実際に

例えば prichan-characters-setting.json

{
    "subjectBaseUrl": "$BASE_URL/rdfs/character/",
    "PredicateBaseUrl": "$BASE_URL/prism-schema.ttl#",
    "dataCsvPath": "../_data/character/prichan-characters.csv",
    "columnsCsvPath": "../_data/character/prichan-characters-columns.csv",
    "rdfType": "$BASE_URL/prism-schema.ttl#Character",
    "label": {"keys": ["name"], "pattern": "$0"}
}

これをこんなかんじにしたい

{
    "subjectBaseUrl": "$BASE_URL/rdfs/character/",
    "PredicateBaseUrl": "$BASE_URL/prism-schema.ttl#",
    "dataCsvPath": "../_data/character/prichan-characters.csv",
    "columnsCsvPath": "../_data/character/prichan-characters-columns.csv",
    "default": [
        {
            "predicate": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
            "object": "$BASE_URL/prism-schema.ttl#Character"
        },
        {
            "predicate": "http://www.w3.org/2000/01/rdf-schema#label",
            "object": {"keys": ["name"], "pattern": "$0"}
        }
    ]
}

懸念

  • 設定JSONがシンプルだったのに入れ子が発生してしまった
  • 列の定義をするCSVの責務な気もする
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant