- From: Colin Maudry <colin@maudry.com>
- Date: Mon, 12 Oct 2015 15:57:25 +0200
- To: public-csv-wg@w3.org
- Cc: Axel Haustant <axel.haustant@data.gouv.fr>
- Message-ID: <561BBC45.9040507@maudry.com>
Hello, For a given column, we would like to be able to define a fixed list of values that this column is supposed to contain. In SQL terms that's an ENUM type. One of the solutions offered here [1] is to use the "format" property, followed by a regex: "format" : "value1|value2|value3" However, we see several problems with this solution: - it's not easy to reuse somewhere else as a reusable object - the value of "format" requires parsing - we can't document the values with comments A potential and cleaner solution would be to create schema:Enumeration objects. Problem: I don't know how to connect the csvw:Column object with the schema:Enumeration [2] object.Any idea? The thread mentioned above [1] seems to end up recommending using XSD schema files to declare enumerations, but I'm not comfortable with doing so outside of the JSON-LD/RDF realm. I think it would make the validation script more complex because less web-friendly. I'd rather declare them in a separate JSON-LD file. FYI, values of an enumeration and their schema:Enumeration object are expressed this way: ex:Genders rdfs:subClassOf schema:Enumeration . ex:Female rdf:type ex:Genders . ex:Male rdf:type ex:Genders . ex:Other rdf:type ex:Genders . [1] https://github.com/w3c/csvw/issues/223 [2] http://schema.org/Enumeration Thanks! Colin
Received on Monday, 12 October 2015 13:57:59 UTC