theodi/open-data-certificate — pull request #459 by pezholio (2013-08-06 20:03:32+00:00)
Title: Publish data for certificates

Fixes theodi/shared#54

I've now got Turtle, RDF/XML and JSON being generated for certificates. Example Turtle is as follows:

@prefix cert: .
@prefix dcat: .
@prefix dct: .
@prefix foaf: .
@prefix jurisdiction: .
@prefix odrs: .
@prefix rdf: .
@prefix rdfs: .
@prefix skos: .
@prefix xsd: .

a dcat:Dataset;
dct:title "Defence Infrastructure Organisation Disposals Database House of Commons Report";
dct:publisher [ a foaf:Organization;
foaf:name "Defence Infrastructure Organisation"];
dct:rights [ a odrs:RightsStatement;
odrs:contentLicence ;
odrs:dataLicence ];
cert:certificate ;
foaf:homepage .

a cert:Certificate,
cert:BasicCertificate;
rdfs:label "Open Data Certificate for Defence Infrastructure Organisation Disposals Database House of Commons Report";
dct:published "2013-08-02Z"^^xsd:date;
cert:answer [ a cert:Answer;
rdfs:label "Where is it described?";
cert:question ;
cert:response ],
[ a cert:Answer;
rdfs:label "Who publishes this data?";
cert:question ;
cert:response "This data is published by Defence Infrastructure Organisation"],
[ a cert:Answer;
rdfs:label "Was all this data originally created or gathered by you?";
cert:question ;
cert:response "This data was originally created or generated by its curator"],
[ a cert:Answer;
rdfs:label "Under which licence can people reuse this data?";
cert:question ;
cert:response "This data is available under UK Open Government Licence"],
[ a cert:Answer;
rdfs:label "Under which licence can others reuse content?";
cert:question ;
cert:response "The content is available under UK Open Government Licence"],
[ a cert:Answer;
rdfs:label "Can individuals be identified from this data?";
cert:question ;
cert:response "This data contains no data about individuals"],
[ a cert:Answer;
rdfs:label "Is this data machine-readable?";
cert:question ;
cert:response "This data is machine-readable"],
[ a cert:Answer;
rdfs:label "Is this data in a standard open format?";
cert:question ;
cert:response "The format of this data is a standard open format"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for title"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for description"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for release date"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for modification date"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for release frequency"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for publisher"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for temporal coverage"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for keyword(s) or tag(s)"],
[ a cert:Answer;
rdfs:label "Does your data documentation include machine-readable data for:";
cert:question ;
cert:response "The documentation includes machine-readable data for distribution(s)"],
[ a cert:Answer;
rdfs:label "Who should people email with questions about this data?";
cert:question ;
cert:response "Send questions about this data to DIO SEC-Groupmailbox@mod.uk"];
cert:badge ;
cert:embeddable ;
cert:jurisdiction jurisdiction:gb .

a skos:ConceptScheme;
dct:title "Categories of questions in Open Data Certificates" .

a cert:Question;
rdfs:label "Where is it described?";
dct:subject .

a cert:Question;
rdfs:label "Who publishes this data?";
dct:subject .

a cert:Question;
rdfs:label "Was all this data originally created or gathered by you?";
dct:subject .

a cert:Question;
rdfs:label "Under which licence can people reuse this data?";
dct:subject .

a cert:Question;
rdfs:label "Under which licence can others reuse content?";
dct:subject .

a cert:Question;
rdfs:label "Can individuals be identified from this data?";
dct:subject .

a cert:Question;
rdfs:label "Is this data machine-readable?";
dct:subject .

a cert:Question;
rdfs:label "Is this data in a standard open format?";
dct:subject .

a cert:Question;
rdfs:label "Who should people email with questions about this data?";
dct:subject .

a cert:Question;
rdfs:label "Does your data documentation include machine-readable data for:";
dct:subject .

a skos:Concept;
skos:inScheme ;
skos:prefLabel "General Information" .

And here's the JSON:

{
"certificate": {
"title": "Defence Infrastructure Organisation Disposals Database House of Commons Report",
"jurisdiction": {
"label": "GB",
"uri": "https://certificates.theodi.org/jurisdictions/gb"
},
"level": {
"label": "Basic",
"uri": "http://schema.theodi.org/certificate#BasicCertificate"
},
"created_at": "2013-08-02T10:40:44Z",
"responses": [
{
"question": {
"text": "Where is it described?",
"uri": "https://certificates.theodi.org/surveys/questions/7438"
},
"answer": {
"text": "This data is described at http://courses.dev/open-data-in-practice"
}
},
{
"question": {
"text": "Who publishes this data?",
"uri": "https://certificates.theodi.org/surveys/questions/7442"
},
"answer": {
"text": "This data is published by Defence Infrastructure Organisation"
}
},
{
"question": {
"text": "Was all this data originally created or gathered by you?",
"uri": "https://certificates.theodi.org/surveys/questions/7447"
},
"answer": {
"text": "This data was originally created or generated by its curator"
}
},
{
"question": {
"text": "Under which licence can people reuse this data?",
"uri": "https://certificates.theodi.org/surveys/questions/7469"
},
"answer": {
"text": "This data is available under UK Open Government Licence"
}
},
{
"question": {
"text": "Under which licence can others reuse content?",
"uri": "https://certificates.theodi.org/surveys/questions/7477"
},
"answer": {
"text": "The content is available under UK Open Government Licence"
}
},
{
"question": {
"text": "Can individuals be identified from this data?",
"uri": "https://certificates.theodi.org/surveys/questions/7486"
},
"answer": {
"text": "This data contains no data about individuals"
}
},
{
"question": {
"text": "Is this data machine-readable?",
"uri": "https://certificates.theodi.org/surveys/questions/7579"
},
"answer": {
"text": "This data is machine-readable"
}
},
{
"question": {
"text": "Is this data in a standard open format?",
"uri": "https://certificates.theodi.org/surveys/questions/7581"
},
"answer": {
"text": "The format of this data is a standard open format"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for title"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for description"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for release date"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for modification date"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for release frequency"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for publisher"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for temporal coverage"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for keyword(s) or tag(s)"
}
},
{
"question": {
"text": "Does your data documentation include machine-readable data for:",
"uri": "https://certificates.theodi.org/surveys/questions/7613"
},
"answer": {
"text": "The documentation includes machine-readable data for distribution(s)"
}
},
{
"question": {
"text": "Who should people email with questions about this data?",
"uri": "https://certificates.theodi.org/surveys/questions/7642"
},
"answer": {
"text": "Send questions about this data to DIO SEC-Groupmailbox@mod.uk"
}
}
]
}
}

Thoughts welcome, on code and data!