Skip to content

Instantly share code, notes, and snippets.

@JeniT
Created October 28, 2014 23:36
Show Gist options
  • Save JeniT/147021e4408db090326f to your computer and use it in GitHub Desktop.
Save JeniT/147021e4408db090326f to your computer and use it in GitHub Desktop.
Files from CSV F2F
// junior role schema
{
"name": "reporting-to",
"title": "Reporting Senior Post",
"description": "The corresponding unique post reference for the SCS person the junior posts reports to.",
"comment": "Must be valid post unique reference from SCS Data Sheet.",
"required": true,
"urlTemplate": "http://example.org/senior-post/{reporting-to}"
}
[{
"@id": "foo"
},{
"@id": "bar"
"ref": "foo"
}]
{
"foo": {
"@id": "foo"
},
"bar": {
"@id": "bar",
"ref": "foo"
}
}
{
"@id": "tree-ops.csv",
"@context": {
"@language": "en"
}
"dc:title": "Tree Operations",
"dc:keywords": ["tree", "street", "maintenance"],
"dc:publisher": [{
"sch:name": "Example Municipality",
"sch:web": "http://example.org"
}],
"dc:license": "http://opendefinition.org/licenses/cc-by/",
"dc:modified": "2010-12-31",
"schema": {
"columns": [{
"name": "GID",
"title": [
"GID",
"Generic Identifier"
],
"dc:description": "An identifier for the operation on a tree.",
"datatype": "string",
"required": true,
"unique": true
}, {
"name": "on-street",
"title": "On Street",
"dc:description": "The street that the tree is on.",
"datatype": "string"
}, {
"name": "species",
"title": "Species",
"dc:description": "The species of the tree.",
"subjectUrl": "http://example.org/{GID}",
"predicateUrl": "http://example.org/ns/species",
"urlTemplate": "http://example.org/species/{species}",
"datatype": "string"
}, {
"name": "trim-cycle",
"title": "Trim Cycle",
"dc:description": "The operation performed on the tree.",
"datatype": "string"
}, {
"name": "inventory-date",
"title": "Inventory Date",
"dc:description": "The date of the operation that was performed.",
"datatype": "date",
"format": "M/D/YYYY"
}]
"primaryKey": "http://example.org/{GID}"
}
}
1,ADDISON AV,Celtis australis,Large Tree Routine Prune,10/18/2010
GID = "1"
on-street = "ADDISON AV"
species = "Celtis australis"
trim-cycle = "Large Tree Routine Prune"
inventory-date = "2010-10-18"
// metadata? - this could be hard coded in the URL
dc:license = "http://opendefinition.org/licenses/cc-by/"
// rownumber?
_row = "1"
_column = "3" - this could be hard coded in the URL
// schema metadata? - this could all be hard coded in the URL
_datatype = "string"
dc:description
// how do we use url templates when the target is JSON?
// simple URL value:
"species": "http://example.org/species/ash"
// JSON-LD friendly value:
"species": {
"@id": "http://example.org/species/ash"
}
// with predicateUrl
// creating RDF
<http://example.org/1234> <http://example.org/ns/species> <http://example.org/species/ash> .
// creating JSON?
"http://example.org/ns/species": {
"@id": "http://example.org/species/ash"
}
Test types:
- metadata syntax: structural problems with metadata
- CSV syntax: structural problems with CSV
- validation: error report based on CSVs & metadata
- locating metadata (with precedence & importing)
- simple mapping to RDF (n-triples?) with graph comparison (including without external metadata)
- simple mapping to JSON with object comparison (to avoid whitespace serialisation issues) (including without external metadata)
- simple mapping to XML?
Test manifest needs to include:
- whether or not the CSV(s) include a header line
- CSV files conforming to "CSV+"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment