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

Review the "deviation from the charter" page #503

Closed
iherman opened this issue Apr 17, 2015 · 6 comments
Closed

Review the "deviation from the charter" page #503

iherman opened this issue Apr 17, 2015 · 6 comments

Comments

@iherman
Copy link
Member

iherman commented Apr 17, 2015

I have prepared a wiki page on the subject, concentrating mostly on the relationship to the Direct Mapping and R2RML (see also #455). This topic (ie, document) will be necessary when we go for the LCCR transition).

A review from all of you would be good, closing the issue when everybody is happy...

/Cc @JeniT @gkellogg @danbri @6a6d74

@gkellogg
Copy link
Member

A couple of notes:

In CSV case with simple metadata, you use {_row} in the aboutUrl, which will not, in fact, reproduce the example, as it uses row number, not row IDs. In the version I put in examples, I used {ID} instead.

This might also provide an example of using SPARQL as a transformation. In example2, I faked the "ref" column to use a valueUrl really just as a place holder. If that virtual column were eliminated from the schema, we might get it's effect using a transformation. I might have the target/source formats wrong, but it could be something like the following:

{
  "@context": "http://www.w3.org/ns/csvw",
  "null": "",
  "transformations": [{
    "url": "dm-example-2-xform.sparql",
    "scriptFormat": "http://www.iana.org/assignments/media-types/sparql-query",
    "targetFormat": "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-graph",
    "source": "rdf"
  }],
  "tables" : [{
    "url": "dm-example-2/people.csv",
    "aboutUrl" : "http://foo.example/DB/People/ID={ID}",
    "propertyUrl" : "http://foo.example/DB/People#{_name}",
    "tableSchema": {
      "columns": [
        {"name": "ID", "required": true, "datatype": "integer"},
        {"name": "fname"},
        {"name": "addr", "datatype": "integer"},
        {"name": "deptName"},
        {"name": "deptCity"},
        {
          "name": "type",
          "virtual": true,
          "propertyUrl": "rdf:type",
          "valueUrl" : "http://foo.example/DB/People"
        }
      ],
      "primaryKey": "ID",
      "foreignKeys" : [{
        "columnReference" : "addr",
        "reference" : {
            "resource" : "dm-example-2/addresses.csv",
            "columnReference" : "ID"
        }
      }, {
        "columnReference" : ["deptName", "deptCity"],
        "reference" : {
            "resource" : "dm-example-2/department.csv",
            "columnReference" : ["name", "city"]
        }
      }]
    }
  }, {
    "url": "dm-example-2/addresses.csv",
    "aboutUrl" : "http://foo.example/DB/Addresses/ID={ID}",
    "propertyUrl" : "http://foo.example/DB/Addresses#{_name}",
    "tableSchema": {
      "columns": [
        {"name": "ID", "required": true, "datatype": "integer"},
        {"name": "city"},
        {"name": "state"},
        {
          "name": "type",
          "virtual": true,
          "propertyUrl": "rdf:type",
          "valueUrl" : "http://foo.example/DB/Addresses"
        }
      ],
      "primaryKey": "ID"
    }
  }, {
    "url": "dm-example-2/department.csv",
    "aboutUrl" : "http://foo.example/DB/Departent/ID={ID}",
    "propertyUrl" : "http://foo.example/DB/Departent#{_name}",
    "tableSchema": {
      "columns": [
        {"name": "ID", "required": true, "datatype": "integer"},
        {"name": "name"},
        {"name": "city"},
        {"name": "manager", "datatype": "integer"},
        {
          "name": "ref",
          "virtual": true,
          "propertyUrl": "http://foo.example/DB/Departent#ref-manager",
          "valueUrl" : "http://foo.example/DB/People/ID={manager}"
        },
        {
          "name": "type",
          "virtual": true,
          "propertyUrl": "rdf:type",
          "valueUrl" : "http://foo.example/DB/Department"
        }
      ],
      "primaryKey": "ID"
    }
  }]
}

The script at dm-example-2-xform.sparql could then be the following:

BASE <http://foo.example/DB/>
CONSTRUCT {
  ?person <People#ref-deptName;deptCity> ?ref .
}
WHERE {
  ?person a <People>; <People#deptCity> ?city;  <People#deptName> ?name .
  [ a <Department>; <Department#city> ?city; <Department#name> ?name; <Department#ref-manager> ?departmentId ] .
  BIND (IRI("http://foo.example/DB/Department/ID=" + ?departmentId) as ?ref)
}

It might be better as an UPDATE, but would need a more explicit reference to the graph. As a CONSTRUCT, it probably also needs to wild-card all other triples to reflect them in the result.

gkellogg added a commit that referenced this issue Apr 17, 2015
@iherman
Copy link
Member Author

iherman commented Apr 17, 2015

Gregg,

can you change the wiki page? You are right about the usage of _row... Thanks.

As for the usage of SPARQL: yes, maybe it is worth making a note that the output could be changed in a second pass on the data; but that is not really relevant for the charter issue...

Thanks!

Ivan


Ivan Herman
Tel:+31 641044153
http://www.ivan-herman.net

(Written on mobile, sorry for brevity and misspellings...)

On 17 Apr 2015, at 19:14, Gregg Kellogg notifications@github.com wrote:

A couple of notes:

In CSV case with simple metadata, you use {_row} in the aboutUrl, which will not, in fact, reproduce the example, as it uses row number, not row IDs. In the version I put in examples, I used {ID} instead.

This might also provide an example of using SPARQL as a transformation. In example2, I faked the "ref" column to use a valueUrl really just as a place holder. If that virtual column were eliminated from the schema, we might get it's effect using a transformation. I might have the target/source formats wrong, but it could be something like the following:

{
"@context": "http://www.w3.org/ns/csvw",
"null": "",
"transformations": [{
"url": "dm-example-2-xform.sparql",
"scriptFormat": "http://www.iana.org/assignments/media-types/sparql-query",
"targetFormat": "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-graph",
"source": "rdf"
}],
"tables" : [{
"url": "dm-example-2/people.csv",
"aboutUrl" : "http://foo.example/DB/People/ID={ID}",
"propertyUrl" : "http://foo.example/DB/People#{_name}",
"tableSchema": {
"columns": [
{"name": "ID", "required": true, "datatype": "integer"},
{"name": "fname"},
{"name": "addr", "datatype": "integer"},
{"name": "deptName"},
{"name": "deptCity"},
{
"name": "type",
"virtual": true,
"propertyUrl": "rdf:type",
"valueUrl" : "http://foo.example/DB/People"
}
],
"primaryKey": "ID",
"foreignKeys" : [{
"columnReference" : "addr",
"reference" : {
"resource" : "dm-example-2/addresses.csv",
"columnReference" : "ID"
}
}, {
"columnReference" : ["deptName", "deptCity"],
"reference" : {
"resource" : "dm-example-2/department.csv",
"columnReference" : ["name", "city"]
}
}]
}
}, {
"url": "dm-example-2/addresses.csv",
"aboutUrl" : "http://foo.example/DB/Addresses/ID={ID}",
"propertyUrl" : "http://foo.example/DB/Addresses#{_name}",
"tableSchema": {
"columns": [
{"name": "ID", "required": true, "datatype": "integer"},
{"name": "city"},
{"name": "state"},
{
"name": "type",
"virtual": true,
"propertyUrl": "rdf:type",
"valueUrl" : "http://foo.example/DB/Addresses"
}
],
"primaryKey": "ID"
}
}, {
"url": "dm-example-2/department.csv",
"aboutUrl" : "http://foo.example/DB/Departent/ID={ID}",
"propertyUrl" : "http://foo.example/DB/Departent#{_name}",
"tableSchema": {
"columns": [
{"name": "ID", "required": true, "datatype": "integer"},
{"name": "name"},
{"name": "city"},
{"name": "manager", "datatype": "integer"},
{
"name": "ref",
"virtual": true,
"propertyUrl": "http://foo.example/DB/Departent#ref-manager",
"valueUrl" : "http://foo.example/DB/People/ID={manager}"
},
{
"name": "type",
"virtual": true,
"propertyUrl": "rdf:type",
"valueUrl" : "http://foo.example/DB/Department"
}
],
"primaryKey": "ID"
}
}]
}
The script at dm-example-2-xform.sparql could then be the following:

BASE http://foo.example/DB/
CONSTRUCT {
?person <People#ref-deptName;deptCity> ?ref .
}
WHERE {
?person a ; <People#deptCity> ?city; <People#deptName> ?name .
[ a ; <Department#city> ?city; <Department#name> ?name; <Department#ref-manager> ?departmentId ] .
BIND (IRI("http://foo.example/DB/Department/ID=" + ?departmentId) as ?ref)
}
It might be better as an UPDATE, but would need a more explicit reference to the graph. As a CONSTRUCT, it probably also needs to wild-card all other triples to reflect them in the result.


Reply to this email directly or view it on GitHub.

@danbri
Copy link
Contributor

danbri commented Apr 17, 2015

The word "abandoned" is a little harsh. "Is not being proposed for the REC
track" maybe?

We should be careful that we do not undermine perceptions of R2RML's value.
It just wasn't a great fit for the needs/focus of this group.

On 17 April 2015 at 13:12, Ivan Herman notifications@github.com wrote:

I have prepared a wiki page
https://github.com/w3c/csvw/wiki/Deviations-from-the-charter on the
subject, concentrating mostly on the relationship to the Direct Mapping and
R2RML (see also #455 #455). This
topic (ie, document) will be necessary when we go for the LCCR transition).

A review from all of you would be good, closing the issue when everybody
is happy...

/Cc @JeniT https://github.com/JeniT @gkellogg
https://github.com/gkellogg @danbri https://github.com/danbri @6a6d74
https://github.com/6a6d74


Reply to this email directly or view it on GitHub
#503.

@iherman
Copy link
Member Author

iherman commented Apr 17, 2015

Dan,

that is fine. Will you update the wiki page? Otherwise I will do it sometimes the week end

Thanks

Ivan


Ivan Herman
Tel:+31 641044153
http://www.ivan-herman.net

(Written on mobile, sorry for brevity and misspellings...)

On 17 Apr 2015, at 19:33, Dan Brickley notifications@github.com wrote:

The word "abandoned" is a little harsh. "Is not being proposed for the REC
track" maybe?

We should be careful that we do not undermine perceptions of R2RML's value.
It just wasn't a great fit for the needs/focus of this group.

On 17 April 2015 at 13:12, Ivan Herman notifications@github.com wrote:

I have prepared a wiki page
https://github.com/w3c/csvw/wiki/Deviations-from-the-charter on the
subject, concentrating mostly on the relationship to the Direct Mapping and
R2RML (see also #455 #455). This
topic (ie, document) will be necessary when we go for the LCCR transition).

A review from all of you would be good, closing the issue when everybody
is happy...

/Cc @JeniT https://github.com/JeniT @gkellogg
https://github.com/gkellogg @danbri https://github.com/danbri @6a6d74
https://github.com/6a6d74


Reply to this email directly or view it on GitHub
#503.


Reply to this email directly or view it on GitHub.

@gkellogg
Copy link
Member

I updated the metadata, and the form of the properties created in the expect output (e.g., <People#ID> vs <People/#ID>).

In the next round, it may be worth adding examples to the Transformations Definitions using these examples, and something like the SPARQL I used to show how the transformation might work. As it stands, there are no examples of templates.

@danbri
Copy link
Contributor

danbri commented Apr 17, 2015

On 17 April 2015 at 19:26, Ivan Herman notifications@github.com wrote:

Dan,

that is fine. Will you update the wiki page? Otherwise I will do it
sometimes the week end

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants