-
Notifications
You must be signed in to change notification settings - Fork 4
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
WIP: Automate the generation of the examples #123
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
PROJECT_DIR=$(dirname $(dirname "$0")) | ||
JAR="$PROJECT_DIR/target/table2qb.jar" | ||
TABLE2QB="java -jar $JAR" | ||
#TABLE2QB="lein run" | ||
|
||
BASE_URI="http://gss-data.org.uk/" | ||
|
||
EXAMPLE_DIR="$PROJECT_DIR/examples/regional-trade" | ||
CSV_DIR="$EXAMPLE_DIR/csv" | ||
CSVW_DIR="$EXAMPLE_DIR/csvw" | ||
|
||
rm -f "$CSVW_DIR/*" | ||
$TABLE2QB csvw components-pipeline \ | ||
--input-csv "$CSV_DIR/components.csv" \ | ||
--base-uri $BASE_URI \ | ||
--output-directory "$CSVW_DIR" | ||
$TABLE2QB csvw codelist-pipeline \ | ||
--codelist-csv "$CSV_DIR/flow-directions.csv" \ | ||
--codelist-name "Flow Directions Codelist" \ | ||
--codelist-slug "flow-directions" \ | ||
--base-uri $BASE_URI \ | ||
--output-directory "$CSVW_DIR" | ||
$TABLE2QB csvw codelist-pipeline \ | ||
--codelist-csv "$CSV_DIR/sitc-sections.csv" \ | ||
--codelist-name "SITC Sections Codelist" \ | ||
--codelist-slug "sitc-sections" \ | ||
--base-uri $BASE_URI \ | ||
--output-directory "$CSVW_DIR" | ||
$TABLE2QB csvw codelist-pipeline \ | ||
--codelist-csv "$CSV_DIR/units.csv" \ | ||
--codelist-name "Units" \ | ||
--codelist-slug "units" \ | ||
--base-uri $BASE_URI \ | ||
--output-directory "$CSVW_DIR" | ||
$TABLE2QB csvw cube-pipeline \ | ||
--column-config "$EXAMPLE_DIR/columns.csv" \ | ||
--input-csv "$CSV_DIR/input.csv" \ | ||
--dataset-name "Regional Trade" \ | ||
--dataset-slug "regional-trade" \ | ||
--base-uri $BASE_URI \ | ||
--output-directory "$CSVW_DIR" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
component_slug,component_attachment,component_property | ||
date,qb:dimension,http://purl.org/linked-data/sdmx/2009/dimension#refPeriod | ||
sitc_section,qb:dimension,http://gss-data.org.uk/def/dimension/sitc-section | ||
flow,qb:dimension,http://gss-data.org.uk/def/dimension/flow | ||
gbp_total,qb:measure,http://gss-data.org.uk/def/measure/gbp-total | ||
geography,qb:dimension,http://purl.org/linked-data/sdmx/2009/dimension#refArea | ||
measure_type,qb:dimension,http://purl.org/linked-data/cube#measureType | ||
net_mass,qb:measure,http://gss-data.org.uk/def/measure/net-mass | ||
sitc_section,qb:dimension,http://gss-data.org.uk/def/dimension/sitc-section | ||
geography,qb:dimension,http://purl.org/linked-data/sdmx/2009/dimension#refArea | ||
unit,qb:attribute,http://purl.org/linked-data/sdmx/2009/attribute#unitMeasure | ||
net_mass,qb:measure,http://gss-data.org.uk/def/measure/net-mass | ||
gbp_total,qb:measure,http://gss-data.org.uk/def/measure/gbp-total |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1 @@ | ||
{ | ||
"@context": [ | ||
"http://www.w3.org/ns/csvw", | ||
{ | ||
"@language": "en" | ||
} | ||
], | ||
"@id": "http://gss-data.org.uk/def/ontology/components", | ||
"url": "components.csv", | ||
"dc:title": "Components Ontology", | ||
"rdfs:label": "Components Ontology", | ||
"rdf:type": { | ||
"@id": "owl:Ontology" | ||
}, | ||
"tableSchema": { | ||
"columns": [ | ||
{ | ||
"name": "label", | ||
"titles": "label", | ||
"datatype": "string", | ||
"propertyUrl": "rdfs:label" | ||
}, | ||
{ | ||
"name": "description", | ||
"titles": "description", | ||
"datatype": "string", | ||
"propertyUrl": "dc:description" | ||
}, | ||
{ | ||
"name": "component_type", | ||
"titles": "component_type", | ||
"propertyUrl": "rdf:type", | ||
"valueUrl": "{+component_type}" | ||
}, | ||
{ | ||
"name": "codelist", | ||
"titles": "codelist", | ||
"datatype": "string", | ||
"propertyUrl": "qb:codeList", | ||
"valueUrl": "{+codelist}" | ||
}, | ||
{ | ||
"name": "notation", | ||
"titles": "notation", | ||
"datatype": "string", | ||
"propertyUrl": "skos:notation" | ||
}, | ||
{ | ||
"name": "component_type_slug", | ||
"titles": "component_type_slug", | ||
"datatype": "string", | ||
"suppressOutput": true | ||
}, | ||
{ | ||
"name": "property_slug", | ||
"titles": "property_slug", | ||
"datatype": "string", | ||
"suppressOutput": true | ||
}, | ||
{ | ||
"name": "class_slug", | ||
"titles": "class_slug", | ||
"datatype": "string", | ||
"propertyUrl": "rdfs:range", | ||
"valueUrl": "http://gss-data.org.uk/def/{class_slug}" | ||
}, | ||
{ | ||
"name": "parent_property", | ||
"titles": "parent_property", | ||
"datatype": "string", | ||
"propertyUrl": "rdfs:subPropertyOf", | ||
"valueUrl": "{+parent_property}" | ||
}, | ||
{ | ||
"propertyUrl": "rdfs:isDefinedBy", | ||
"virtual": true, | ||
"valueUrl": "http://gss-data.org.uk/def/ontology/components" | ||
}, | ||
{ | ||
"propertyUrl": "rdf:type", | ||
"virtual": true, | ||
"valueUrl": "rdf:Property" | ||
} | ||
], | ||
"aboutUrl": "http://gss-data.org.uk/def/{component_type_slug}/{notation}" | ||
} | ||
} | ||
{"@context":["http:\/\/www.w3.org\/ns\/csvw",{"@language":"en"}],"@id":"http:\/\/gss-data.org.uk\/def\/ontology\/components","url":"components.csv","dc:title":"Components Ontology","rdfs:label":"Components Ontology","rdf:type":{"@id":"owl:Ontology"},"tableSchema":{"columns":[{"name":"label","titles":"label","datatype":"string","propertyUrl":"rdfs:label"},{"name":"description","titles":"description","datatype":"string","propertyUrl":"dc:description"},{"name":"component_type","titles":"component_type","propertyUrl":"rdf:type","valueUrl":"{+component_type}"},{"name":"codelist","titles":"codelist","datatype":"string","propertyUrl":"qb:codeList","valueUrl":"{+codelist}"},{"name":"notation","titles":"notation","datatype":"string","propertyUrl":"skos:notation"},{"name":"component_type_slug","titles":"component_type_slug","datatype":"string","suppressOutput":true},{"name":"property_slug","titles":"property_slug","datatype":"string","suppressOutput":true},{"name":"class_slug","titles":"class_slug","datatype":"string","propertyUrl":"rdfs:range","valueUrl":"http:\/\/gss-data.org.uk\/def\/{class_slug}"},{"name":"parent_property","titles":"parent_property","datatype":"string","propertyUrl":"rdfs:subPropertyOf","valueUrl":"{+parent_property}"},{"propertyUrl":"rdfs:isDefinedBy","virtual":true,"valueUrl":"http:\/\/gss-data.org.uk\/def\/ontology\/components"},{"propertyUrl":"rdf:type","virtual":true,"valueUrl":"rdf:Property"}],"aboutUrl":"http:\/\/gss-data.org.uk\/def\/{component_type_slug}\/{notation}"}} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Label,Notation,Parent Notation | ||
Export,export, | ||
Import,import, | ||
label,notation,parent_notation,sort_priority,description,top_concept_of,has_top_concept,pref_label | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we see the benefit of doing this. We didn't keep this file up-to-date as these extra columns were introduced. |
||
Export,export,,,,yes,yes,Export | ||
Import,import,,,,yes,yes,Import |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1 @@ | ||
{ | ||
"@context": ["http://www.w3.org/ns/csvw", {"@language": "en"}], | ||
"@id": "http://gss-data.org.uk/def/concept-scheme/flow-directions", | ||
"url": "flow-directions-codelist.csv", | ||
"dc:title": "Flow Directions Codelist", | ||
"rdfs:label": "Flow Directions Codelist", | ||
"rdf:type": { "@id": "skos:ConceptScheme" }, | ||
"tableSchema": { | ||
"aboutUrl": "http://gss-data.org.uk/def/concept/flow-directions/{notation}", | ||
"columns": [{ | ||
"name": "label", | ||
"titles": "label", | ||
"datatype": "string", | ||
"propertyUrl": "rdfs:label" | ||
},{ | ||
"name": "notation", | ||
"titles": "notation", | ||
"datatype": "string", | ||
"propertyUrl": "skos:notation" | ||
},{ | ||
"name": "parent_notation", | ||
"titles": "parent_notation", | ||
"datatype": "string", | ||
"propertyUrl": "skos:broader", | ||
"valueUrl": "http://gss-data.org.uk/def/concept/flow-directions/{parent_notation}" | ||
},{ | ||
"name": "sort_priority", | ||
"titles": "sort_priority", | ||
"datatype": "integer", | ||
"propertyUrl": "http://www.w3.org/ns/ui#sortPriority" | ||
},{ | ||
"name": "description", | ||
"titles": "description", | ||
"datatype": "string", | ||
"propertyUrl": "rdfs:comment" | ||
},{ | ||
"name": "top_concept_of", | ||
"titles": "top_concept_of", | ||
"propertyUrl": "skos:topConceptOf", | ||
"valueUrl": "http://gss-data.org.uk/def/concept-scheme/flow-directions" | ||
},{ | ||
"name": "has_top_concept", | ||
"titles" "has_top_concept", | ||
"aboutUrl": "http://gss-data.org.uk/def/concept-scheme/flow-directions", | ||
"propertyUrl": "skos:hasTopConcept", | ||
"valueUrl": "http://gss-data.org.uk/def/concept/flow-directions/{notation}" | ||
}, | ||
{ | ||
"name": "pref_label", | ||
"titles": "pref_label", | ||
"propertyUrl": "skos:prefLabel" | ||
}, | ||
{ | ||
"propertyUrl": "skos:inScheme", | ||
"valueUrl": "http://gss-data.org.uk/def/concept-scheme/flow-directions", | ||
"virtual": true | ||
},{ | ||
"propertyUrl": "rdf:type", | ||
"valueUrl": "skos:Concept", | ||
"virtual": true | ||
}] | ||
} | ||
} | ||
{"@context":["http:\/\/www.w3.org\/ns\/csvw",{"@language":"en"}],"@id":"http:\/\/gss-data.org.uk\/def\/concept-scheme\/flow-directions","url":"flow-directions.csv","dc:title":"Flow Directions Codelist","rdfs:label":"Flow Directions Codelist","rdf:type":{"@id":"skos:ConceptScheme"},"tableSchema":{"aboutUrl":"http:\/\/gss-data.org.uk\/def\/concept\/flow-directions\/{notation}","columns":[{"name":"label","titles":"label","datatype":"string","propertyUrl":"rdfs:label"},{"name":"notation","titles":"notation","datatype":"string","propertyUrl":"skos:notation"},{"name":"parent_notation","titles":"parent_notation","datatype":"string","propertyUrl":"skos:broader","valueUrl":"http:\/\/gss-data.org.uk\/def\/concept\/flow-directions\/{parent_notation}"},{"name":"sort_priority","titles":"sort_priority","datatype":"integer","propertyUrl":"http:\/\/www.w3.org\/ns\/ui#sortPriority"},{"name":"description","titles":"description","datatype":"string","propertyUrl":"rdfs:comment"},{"name":"top_concept_of","titles":"top_concept_of","propertyUrl":"skos:topConceptOf","valueUrl":"http:\/\/gss-data.org.uk\/def\/concept-scheme\/flow-directions"},{"name":"has_top_concept","titles":"has_top_concept","aboutUrl":"http:\/\/gss-data.org.uk\/def\/concept-scheme\/flow-directions","propertyUrl":"skos:hasTopConcept","valueUrl":"http:\/\/gss-data.org.uk\/def\/concept\/flow-directions\/{notation}"},{"name":"pref_label","titles":"pref_label","propertyUrl":"skos:prefLabel"},{"propertyUrl":"skos:inScheme","valueUrl":"http:\/\/gss-data.org.uk\/def\/concept-scheme\/flow-directions","virtual":true},{"propertyUrl":"rdf:type","valueUrl":"skos:Concept","virtual":true}]}} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is basically just an ordering change