--- a/ckanext/datagovau/templates/package/read.rdf +++ b/ckanext/datagovau/templates/package/read.rdf @@ -1,1 +1,92 @@ +<?xml version="1.0" encoding="utf-8"?> +<rdf:RDF + xmlns:py="http://genshi.edgewall.org/" + xmlns:foaf="http://xmlns.com/foaf/0.1/" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:dcat="http://www.w3.org/ns/dcat#" + xmlns:dcam="http://purl.org/dc/dcam/" + xmlns:aglsterms="http://www.agls.gov.au/agls/terms/" + xmlns:agentterms="http://www.agls.gov.au/agls/agentterms/" + xmlns:availterms="http://www.agls.gov.au/agls/availterms/" + xmlns:adminterms="http://www.agls.gov.au/agls/adminterms/" + xmlns:dct="http://purl.org/dc/terms/" + > + <dcat:Dataset rdf:about="${ h.url_for(controller='package',action='read',id=c.pkg_dict['name'], qualified=True)}"> + <dct:identifier>${c.pkg_dict['name']}</dct:identifier> + <dct:title>${c.pkg_dict['title']}</dct:title> + <dct:landingPage rdf:resource="${ h.url_for(controller='package',action='read',id=c.pkg_dict['name'], qualified=True) }"/> + <owl:sameAs rdf:resource="urn:uuid:${c.pkg_dict['id']}"/> + <dct:type>Dataset</dct:type> + <dct:description>${c.pkg_dict['notes']}</dct:description> + <dct:issued>${c.pkg_dict['metadata_created']}</dct:issued> + <dct:modified>${c.pkg_dict['metadata_modified']}</dct:modified> + <dct:language>en</dct:language> + <dct:license>${c.pkg_dict['license_url']}</dct:license> + <py:for each="tag_dict in c.pkg_dict.get('tags',[])"> + <dcat:keyword>${ tag_dict["name"] }</dcat:keyword> + </py:for> + <py:for each="group_dict in c.pkg_dict.get('groups',[])"> + <dcat:theme>${ tag_dict["title"] }</dcat:theme> + </py:for> + <lol>${h.get_action("user_show",{"id":c.author})["display_name"]}</lol> + <lol>${h.get_action("user_show",{"id":c.author})["email"]}</lol> + + <foaf:homepage rdf:resource="${ h.url_for(controller='package',action='read',id=c.pkg_dict['name'], qualified=True)}"/> + <rdfs:label>${c.pkg_dict['name']}</rdfs:label> + + + <py:for each="rsc_dict in c.pkg_dict['resources']"> + <dcat:distribution> + <dcat:Distribution> + <dct:title>${rsc_dict.get('name')}</dct:title> + <owl:sameAs rdf:resource="urn:uuid:${rsc_dict.get('id')}"/> + <dct:description>${rsc_dict.get('description')}</dct:description> + <dcat:accessURL rdf:resource="${ rsc_dict.get('url') }"/> + <dct:created>${rsc_dict.get('revision_timestamp')}</dct:created> + <dct:modified>${rsc_dict.get('revision_timestamp')}</dct:modified> + <dcat:byteSize>${rsc_dict.get('size')}</dcat:byteSize> + <dcat:mediaType>${rsc_dict.get('mimetype')}</dcat:mediaType> + <dct:extent py:if="rsc_dict.get('size')">${rsc_dict.get('size')} bytes</dct:extent> + <dct:format py:if="rsc_dict.get('format')"> + <dct:IMT> + <rdf:value>${rsc_dict.get('format')}</rdf:value> + <rdfs:label>${rsc_dict.get('format')}</rdfs:label> + </dct:IMT> + </dct:format> + <dct:title py:if="rsc_dict.get('name')">${rsc_dict.get('name')}</dct:title> + </dcat:Distribution> + </dcat:distribution> + </py:for> + <dct:publisher py:if="c.pkg_dict.get('organization', None)"> + <rdf:Description> + <foaf:name>${ c.pkg_dict['organization']['title'] }</foaf:name> + </rdf:Description> + </dct:publisher> + <dct:creator py:if="c.pkg_dict.get('author', None)"> + <rdf:Description> + <foaf:name>${ c.pkg_dict['author'] }</foaf:name> + <foaf:mbox py:if="c.pkg_dict.get('maintainer_email', None)" rdf:resource="mailto:${c.pkg_dict['author_email']}"/> + </rdf:Description> + </dct:creator> + <dct:contributor py:if="c.pkg_dict.get('maintainer', None)"> + <rdf:Description> + <foaf:name>${ c.pkg_dict['maintainer'] }</foaf:name> + <foaf:mbox py:if="c.pkg_dict.get('maintainer_email', None)" rdf:resource="mailto:${c.pkg_dict['maintainer_email']}"/> + </rdf:Description> + </dct:contributor> + + <dct:rights py:if="c.pkg_dict.get('license_url', None)" rdf:resource="${c.pkg_dict['license_url']}"/> + <py:for each="extra_dict in c.pkg_dict.get('extras',[])"> + <dct:relation> + <rdf:Description> + <rdfs:label>${extra_dict.get('key','')}</rdfs:label> + <rdf:value>${extra_dict.get('value','')}</rdf:value> + </rdf:Description> + </dct:relation> + </py:for> + </dcat:Dataset> +</rdf:RDF> +