w3c / csvw

Documents produced by the CSV on the Web Working Group
Other
163 stars 57 forks source link

Annotation targeting by primary key and column names #807

Open noamross opened 8 years ago

noamross commented 8 years ago

This spec describes cell annotation targeting column and row numbers, but it may also be desirable to annotate data by primary key and column, which would stable when rows are re-arranged or filtered.

Here is how this type of annotation might look:

{
  "@context": "http://www.w3.org/ns/csvw",
  "url": "countries.csv",
  "tableSchema": {
  "columns": [{
    "name": "country",
    "titles": "country"
  },{
    "titles": "country group"
  },{
    "titles": "name (en)"
  },{
    "titles": "name (fr)"
  },{
    "titles": "name (de)"
  },{
    "titles": "latitude"
  },{
    "titles": "longitude"
  }],
  "primaryKey": "country"
}
  "notes": [{
    "@type": "oa:Annotation",
    "oa:hasTarget": { "@id": "countries.csv#primaryKey=bg,fr&column=lattitude,longitude" },
    "oa:hasBody": { "oa:text": "These locations are of representative points." },
    "oa:motivatedBy": { "@id": "oa:commenting" }
  }, {
    "@type": "oa:Annotation",
    "oa:hasTarget": { "@id": "countries.csv#primaryKey=bg&column=name (fr)" },
    "oa:hasBody": { "oa:text": "Corrected." },
    "oa:motivatedBy": { "@id": "oa:editing" }
  }]
}

Cell ranges would not be applicable in this case.

gkellogg commented 8 years ago

I believe what you want to do is set an @aboutUrl, which will set the subject URI for each row, which you can then target from your annotation. As @aboutUrl takes a URI Template, you can add information from whatever columns you need.

(Also, you may want to set the language annotation on columns in different languages, but that's an aside).

JeniT commented 8 years ago

@noamross Yes, that could be useful. It would require a different way of defining the fragment identifiers for CSV files (ie a replacement or update to RFC7111).

iherman commented 8 years ago

Per the response of @JeniT (https://github.com/w3c/csvw/issues/807#issuecomment-183700505) I am tempted to close this issue; it is indeed not in the charter of this Working Group to change RFC71111...

Any objections?

noamross commented 8 years ago

None from me. Thanks for consideration. I'm new to this process; where is the best place to bring this up for RFC7111?

On Sun, Feb 14, 2016, 9:41 AM Ivan Herman notifications@github.com wrote:

Per the response of @JeniT https://github.com/JeniT (#807 (comment) https://github.com/w3c/csvw/issues/807#issuecomment-183700505) I am tempted to close this issue; it is indeed not in the charter of this Working Group to change RFC71111...

Any objections?

— Reply to this email directly or view it on GitHub https://github.com/w3c/csvw/issues/807#issuecomment-183902073.

JeniT commented 8 years ago

Any thoughts @dret?

dret commented 8 years ago

RFC 7111 is about text/csv. this issue is about something else, it talks about primary keys which are not something that text/csv defines. as such, i think that this issue is unrelated to RFC 7111 and text/csv.

GeorgFerdinandSchneider commented 4 years ago

Following the suggestion by @noamross I would like to raise a similar issue.

Coming from relational data bases, the property csvw:primaryKey with domain csvw:Row seems to be akward. One or more columns of a table are typically defined as primary keys of a table.

Despite RFC 7111, it would be great if columns could be annotated to be primary keys or not.

Best

Georg