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

Is there an efficient way to map the reconciled CSV to the unreconciled RDF? #222

Open
Yueqiao12Zhang opened this issue Nov 15, 2024 · 1 comment

Comments

@Yueqiao12Zhang
Copy link
Contributor

Yueqiao12Zhang commented Nov 15, 2024

Example JSON to RDF in one record
Note: all predicate maps are made-up

{
    "genres": [],
    "video": false,
    "title": "Suck",
    "artist-credit": [
        {
            "artist": {
                "type-id": "e431f5f6-b5d2-343d-8b36-72607fffb74b",
                "aliases": [],
                "name": "Pigface",
                "sort-name": "Pigface",
                "genres": [
                    {
                        "name": "electronic",
                        "count": 1,
                        "disambiguation": "",
                        "id": "89255676-1f14-4dd8-bbad-fca839d6aff4"
                    },
                    {
                        "disambiguation": "",
                        "count": 4,
                        "id": "ffbc9907-c9be-4ace-876b-b7fd5b9d51f9",
                        "name": "industrial rock"
                    }
                ],
                "tags": [
                    {
                        "count": 1,
                        "name": "american"
                    },
                    {
                        "count": 1,
                        "name": "electronic"
                    },
                    {
                        "name": "industrial rock",
                        "count": 4
                    },
                    {
                        "name": "supergroup",
                        "count": 2
                    }
                ],
                "id": "11137c88-a9a2-4ffa-a97d-fb058c6d6ce2",
                "disambiguation": "industrial supergroup",
                "type": "Group"
            },
            "joinphrase": "",
            "name": "Pigface"
        }
    ],
    "rating": {
        "value": null,
        "votes-count": 0
    },
    "disambiguation": "",
    "annotation": null,
    "aliases": [],
    "length": null,
    "tags": [],
    "relations": [
        {
            "end": null,
            "attributes": [],
            "attribute-values": {},
            "attribute-ids": {},
            "work": {
                "attributes": [],
                "title": "Suck",
                "type": "Song",
                "disambiguation": "",
                "id": "20309de2-2847-3753-8a7a-d0e335f57176",
                "type-id": "f061270a-2fd6-32f1-a641-f0f8676d14e6",
                "language": "eng",
                "iswcs": [
                    "T-070.172.108-5",
                    "T-900.245.777-4",
                    "T-905.188.140-4",
                    "T-905.318.598-1",
                    "T-926.281.906-7"
                ],
                "languages": [
                    "eng"
                ]
            },
            "direction": "forward",
            "type-id": "a3005666-a872-32c3-ad06-98af558e99b0",
            "target-type": "work",
            "ended": false,
            "target-credit": "",
            "source-credit": "",
            "type": "performance",
            "begin": null
        }
    ],
    "id": "10b9c34b-821d-4cc8-9587-5c7d0cb68865",
}

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix wdt: <http://www.wikidata.org/prop/direct/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<10b9c34b-821d-4cc8-9587-5c7d0cb68865> wdt:P17 [ wdt:P87 "Pigface" ;
            wdt:P96 [ wdt:P106 "e431f5f6-b5d2-343d-8b36-72607fffb74b" ;
                    wdt:P119 "11137c88-a9a2-4ffa-a97d-fb058c6d6ce2" ;
                    wdt:P45 [ wdt:P49 2 ;
                            wdt:P87 "supergroup" ],
                        [ wdt:P49 4 ;
                            wdt:P87 "industrial rock" ],
                        [ wdt:P49 1 ;
                            wdt:P87 "electronic" ],
                        [ wdt:P49 1 ;
                            wdt:P87 "american" ] ;
                    wdt:P57 "Pigface" ;
                    wdt:P72 "industrial supergroup" ;
                    wdt:P79 "Group" ;
                    wdt:P87 "Pigface" ;
                    wdt:P97 [ wdt:P119 "89255676-1f14-4dd8-bbad-fca839d6aff4" ;
                            wdt:P49 1 ;
                            wdt:P87 "electronic" ],
                        [ wdt:P119 "ffbc9907-c9be-4ace-876b-b7fd5b9d51f9" ;
                            wdt:P49 4 ;
                            wdt:P87 "industrial rock" ] ] ] ;
    wdt:P22 "Suck" ;
    wdt:P23 [ wdt:P106 "a3005666-a872-32c3-ad06-98af558e99b0" ;
            wdt:P11 [ ] ;
            wdt:P14 "work" ;
            wdt:P51 "forward" ;
            wdt:P6 [ ] ;
            wdt:P79 "performance" ;
            wdt:P84 [ wdt:P106 "f061270a-2fd6-32f1-a641-f0f8676d14e6" ;
                    wdt:P111 "eng" ;
                    wdt:P119 "20309de2-2847-3753-8a7a-d0e335f57176" ;
                    wdt:P13 [ rdf:value "T-900.245.777-4" ],
                        [ rdf:value "T-070.172.108-5" ],
                        [ rdf:value "T-926.281.906-7" ],
                        [ rdf:value "T-905.318.598-1" ],
                        [ rdf:value "T-905.188.140-4" ] ;
                    wdt:P22 "Suck" ;
                    wdt:P68 [ rdf:value "eng" ] ;
                    wdt:P79 "Song" ] ] .

@Yueqiao12Zhang
Copy link
Contributor Author

Current idea: import to OpenRefine, delete all data except the ones that I want to reconcile, merge them to one or a few columns, reconcile, then map them back to RDF.

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