{"action":"closed","issue":{"url":"https://api.github.com/repos/w3c/csvw/issues/455","labels_url":"https://api.github.com/repos/w3c/csvw/issues/455/labels{/name}","comments_url":"https://api.github.com/repos/w3c/csvw/issues/455/comments","events_url":"https://api.github.com/repos/w3c/csvw/issues/455/events","html_url":"https://github.com/w3c/csvw/issues/455","id":66564179,"number":455,"title":"Documenting relationships to the RDB2RDF Direct Mapping","user":{"login":"iherman","id":520723,"avatar_url":"https://avatars.githubusercontent.com/u/520723?v=3","gravatar_id":"","url":"https://api.github.com/users/iherman","html_url":"https://github.com/iherman","followers_url":"https://api.github.com/users/iherman/followers","following_url":"https://api.github.com/users/iherman/following{/other_user}","gists_url":"https://api.github.com/users/iherman/gists{/gist_id}","starred_url":"https://api.github.com/users/iherman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iherman/subscriptions","organizations_url":"https://api.github.com/users/iherman/orgs","repos_url":"https://api.github.com/users/iherman/repos","events_url":"https://api.github.com/users/iherman/events{/privacy}","received_events_url":"https://api.github.com/users/iherman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/w3c/csvw/labels/CSV%20to%20RDF%20mapping","name":"CSV to RDF mapping","color":"009800"},{"url":"https://api.github.com/repos/w3c/csvw/labels/For%20LCCR","name":"For LCCR","color":"fef2c0"},{"url":"https://api.github.com/repos/w3c/csvw/labels/Metadata%20vocabulary%20document","name":"Metadata vocabulary document","color":"5319e7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-06T09:06:09Z","updated_at":"2015-04-17T12:13:55Z","closed_at":"2015-04-17T12:13:55Z","body":"(This issue is for the LCCR, not for the upcoming publication)\r\n\r\nOur [charter](http://www.w3.org/2013/05/lcsv-charter.html) also includes:\r\n\r\n>\"The output of the mapping mechanism for RDF MUST be consistent with either the RDF Direct Mapping or R2RML so that if a table from a relational database is exported as CSV and then mapped it produces semantically identical data.\"\r\n\r\nOur approach turned out to be a bit different than either [R2RML](http://www.w3.org/TR/r2rml/) or the [Direct Mapping](http://www.w3.org/TR/rdb-direct-mapping/). I believe, therefore, that we should document how the examples in the [Direct Mapping](http://www.w3.org/TR/rdb-direct-mapping/) document can be reproduced with a (hopefully simple) metadata. I have created the minimal metadata for the [first example in the Direct Mapping](http://www.w3.org/TR/rdb-direct-mapping/#lead-ex):\r\n\r\n```\r\n{\r\n\t\"@context\": \"http://www.w3.org/ns/csvw\",\r\n\t\"resources\" : [{\r\n\t  \"url\": \"http://foo.example/DB/People.csv\",\r\n\t  \"aboutUrl\" : \"http://foo.example/DB/People/ID={_row}\",\r\n\t  \"propertyUrl\" : \"http://foo.example/DB/People#{_name}\",\r\n\t  \"tableSchema\": {\r\n\t    \"columns\": [{\r\n\t      \"name\": \"ID\",\r\n\t      \"datatype\" : \"integer\"\r\n\t    }, {\r\n\t      \"name\": \"fname\",\r\n\t    }, {\r\n\t      \"name\": \"ref-addr\",\r\n\t      \"aboutUrl\" : \"http://foo.example/DB/Addresses/ID={ref-addr}\"\r\n\t    }, {\r\n\t      \"name\": \"type\",\r\n\t      \"virtual\": \"true\",\r\n\t      \"propertyUrl\": \"rdf:type\",\r\n\t      \"valueUrl\" : \"http://foo.example/DB/People\"\r\n\t  \t}],\r\n\t  }\r\n\t}, {\r\n\t  \"url\": \"http://foo.example/DB//Addresses.csv\",\r\n\t  \"aboutUrl\" : \"http://foo.example/DB/Addresses/ID={_row}\",\r\n\t  \"propertyUrl\" : \"http://foo.example/DB/Addresses#{_name}\",\r\n\t  \"tableSchema\": [{\r\n\t    \"columns\": [{\r\n\t      \"name\": \"ID\",\r\n\t      \"datatype\" : \"integer\"\r\n\t    }, {\r\n\t      \"name\": \"city\",\r\n\t    }, {\r\n\t      \"name\": \"state\",\r\n\t    }],\r\n\t}]\r\n}\r\n```\r\n\r\nActually, it is worth nothing that some additional features can be added that would reflect the original RDB schema, yielding:\r\n\r\n```\r\n{\r\n\t\"@context\": \"http://www.w3.org/ns/csvw\",\r\n\t\"resources\" : [{\r\n\t  \"url\": \"http://foo.example/DB/People.csv\",\r\n\t  \"aboutUrl\" : \"http://foo.example/DB/People/ID={_row}\",\r\n\t  \"propertyUrl\" : \"http://foo.example/DB/People#{_name}\",\r\n\t  \"tableSchema\": {\r\n\t    \"columns\": [{\r\n\t      \"name\": \"ID\",\r\n\t      \"required\": true,\r\n\t    }, {\r\n\t      \"name\": \"fname\",\r\n\t    }, {\r\n\t      \"name\": \"ref-addr\",\r\n\t      \"aboutUrl\" : \"http://foo.example/DB/Addresses/ID={ref-addr}\"\r\n\t    }, {\r\n\t      \"name\": \"type\",\r\n\t      \"virtual\": \"true\",\r\n\t      \"propertyUrl\": \"rdf:type\",\r\n\t      \"valueUrl\" : \"People\"\r\n\t  \t}],\r\n\t    \"primaryKey\": \"ID\",\r\n\t    \"foreignKeys\" : [{\r\n\t    \t\"columnReference\" : \"ref-addr\",\r\n\t    \t\"reference\" : {\r\n\t    \t\t\"resource\" : \"http://example.org/Addresses.csv\",\r\n\t    \t\t\"columnReference\" : \"ID\"\r\n\t    \t}\r\n\t    }]\r\n\t  }\r\n\t}, {\r\n\t  \"url\": \"http://foo.example/DB/Addresses.csv\",\r\n\t  \"aboutUrl\" : \"http://foo.example/DB/Addresses/ID={_row}\",\r\n\t  \"propertyUrl\" : \"http://foo.example/DB/Addresses#{_name}\",\r\n\t  \"tableSchema\": [{\r\n\t    \"columns\": [{\r\n\t      \"name\": \"ID\",\r\n\t      \"required\": true,\r\n\t    }, {\r\n\t      \"name\": \"city\",\r\n\t    }, {\r\n\t      \"name\": \"state\",\r\n\t    }],\r\n\t    \"primaryKey\": \"ID\",\r\n\t}]\r\n}\r\n``` \r\nAlthough these additions are not strictly necessary to reproduce the mapping, they are a \"plus\" considering validation.\r\n\r\n@gkellogg, maybe it is worth testing with your processor that these are correct and produce the right results. I also think that these should be documented somewhere (as a result of the charter); maybe this simple example, and another slightly more complex one could be added in the metadata document.\r\n\r\nB.t.w., if this mapping is correct, note the need for the ``virtual`` column. This may be an argument in favour of a final resolution of #179...\r\n"}}