polifonia-project / KG_data_transformation

Script and services to extract data from raw files JSON,csv,tsv and create Polifonia KG
0 stars 0 forks source link

Query with artist birthplace cause test_0.0.2 to fail #2

Closed ccolonna closed 3 years ago

ccolonna commented 3 years ago

Running testbed-0.0.2 on KG output of query-0.0.4

* * * * * * *  * * *
 * * * KGT run * * *
* * * * * * *  * * *

[*] reading testbed .\kg\test\testbed-0.0.2.json
[*] parsing KG .\kg\versions\polifonia-kg-places-0.0.4.ttl

+[*] Running Test 1: Expected Recordings Count
+[+]     Test passed: expected rows count correct 725

-[*] Running Test 2: Expected Artist Count
-[!]     Test failed: expected number of rows 103 found 49

-[*] Running Test 3: Expected Places Count
-[!]     Test failed: expected number of rows 37 found 108

+[*] Running Test 4: Expected Sessions Count
+[+]     Test passed: expected rows count correct 673

-[*] Running Test 5: Expected Song with 2 artists
-[!]     Test failed: expected number of rows 14 found 9

+[*] Running Test 6: Expected Song with 3 artists
+[+]     Test passed: expected rows count correct 1

+[*] Running Test 7: Expected Song with matching attributes (label, titleLabel, ...)
+[+]     Test passed: expected rows [{'performerLabel': 'The Beatles', 'recordingTitleLabel': 'I Saw Her Standing There'}, {'performerLabel': 'Dietrich Fischer-Dieskau', 'recordingTitleLabel': 'Gerald Moore'}, {'performerLabel': 'Thomas Allen', 'recordingTitleLabel': 'Roger Vignoles'}] found rows [{'performerLabel': 'Dietrich Fischer-Dieskau', 'recordingTitleLabel': 'Gerald Moore'}, {'performerLabel': 'Thomas Allen', 'recordingTitleLabel': 'Roger Vignoles'}, {'performerLabel': 'The Beatles', 'recordingTitleLabel': 'I Saw Her Standing There'}]
ccolonna commented 3 years ago

We're now asking for:

            # Recordings with artists
            ?recording  xyz:track%5Fid ?recordingID ;
                    xyz:artists ?artistList .
                    # artist
                    ?artistList ?li ?artist .
                    ?artist xyz:name%5Firi ?artistID ;
                          xyz:name ?artistLabel ;
                          xyz:country ?artistBirthPlaceCode ;
                          xyz:start%5Fplace ?artistCareerStartPlace .

We probably want something like:

    {
        # Recordings with artists
        ?recording  xyz:track%5Fid ?recordingID ;
                xyz:artists ?artistList .
                # artist
                ?artistList ?li ?artist .
                ?artist xyz:name%5Firi ?artistID .
    }
    UNION 
    {
        # Recordings with artists with labels
        ?recording  xyz:track%5Fid ?recordingID ;
                xyz:artists ?artistList .
                # artist
                ?artistList ?li ?artist .
                ?artist xyz:name%5Firi ?artistID ;
                      xyz:name ?artistLabel .
    }
    UNION 
    {
        # Recordings with artists with brithplace and carrer start place
        ?recording  xyz:track%5Fid ?recordingID ;
                xyz:artists ?artistList .
                # artist
                ?artistList ?li ?artist .
                ?artist xyz:name%5Firi ?artistID ;
                      xyz:country ?artistBirthPlaceCode ;
                      xyz:start%5Fplace ?artistCareerStartPlace .
    }
ccolonna commented 3 years ago

Closed with this https://github.com/polifonia-project/KG_data_transformation/commit/ddcb573f46716ab5d4a7aee48069fb202401529b

Working testbed is this