Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement the read.rdf template lost in genshi purge
Fixes #2063 by re-adding the missing template, but implemented with jinja instead. The accept-header checks have been simplified as the different loaders are no longer required. N3 template is still broken but is included for completeness
- Loading branch information
Showing
7 changed files
with
153 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@prefix : <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix dcat: <http://www.w3.org/ns/dcat#> . | ||
@prefix dct: <http://purl.org/dc/terms/> . | ||
@prefix foaf: <http://xmlns.com/foaf/0.1/> . | ||
@prefix owl: <http://www.w3.org/2002/07/owl#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
|
||
<{{ h.url_for(controller='package',action='read',id=c.pkg_dict['name'], qualified=True)}}> | ||
a dcat:Dataset; | ||
dct:description "{{c.pkg_dict['notes']}}"; | ||
dct:identifier "{{c.pkg_dict['name']}}"; | ||
dct:relation [ | ||
rdf:value ""; | ||
:label "change_note" ], | ||
[ | ||
rdf:value ""; | ||
:label "definition_note" ], | ||
[ | ||
rdf:value ""; | ||
:label "editorial_note" ], | ||
[ | ||
rdf:value ""; | ||
:label "example_note" ], | ||
[ | ||
rdf:value ""; | ||
:label "history_note" ], | ||
[ | ||
rdf:value ""; | ||
:label "scope_note" ], | ||
[ | ||
rdf:value ""; | ||
:label "skos_note" ], | ||
[ | ||
rdf:value ""; | ||
:label "temporal_granularity" ], | ||
[ | ||
rdf:value ""; | ||
:label "type_of_dataset" ], | ||
[ | ||
rdf:value ""; | ||
:label "update_frequency" ]; | ||
dct:title "{{c.pkg_dict['title']}}"; | ||
:label "{{c.pkg_dict['name']}}"; | ||
= <urn:uuid:{{c.pkg_dict['id']}}>; | ||
foaf:homepage <{{ h.url_for(controller='package',action='read',id=c.pkg_dict['name'], qualified=True)}}> . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?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:dct="http://purl.org/dc/terms/" | ||
> | ||
<dcat:Dataset rdf:about="{{ 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:description>{{c.pkg_dict['notes']}}</dct:description> | ||
{% for tag_dict in c.pkg_dict['tags'] %} | ||
<dcat:keyword>{{ tag_dict["name"] }}</dcat:keyword> | ||
{% endfor %} | ||
<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> | ||
|
||
<dct:identifier>{{c.pkg_dict['name']}}</dct:identifier> | ||
<dct:title>{{c.pkg_dict['title']}}</dct:title> | ||
{% for rsc_dict in c.pkg_dict['resources'] %} | ||
<dcat:distribution> | ||
<dcat:Distribution> | ||
<dcat:accessURL rdf:resource="{{ rsc_dict['url'] }}"/> | ||
{% if rsc_dict.get('format')%} | ||
<dct:format> | ||
<dct:IMT> | ||
<rdf:value>{{rsc_dict.get('format')}}</rdf:value> | ||
<rdfs:label>{{rsc_dict.get('format')}}</rdfs:label> | ||
</dct:IMT> | ||
</dct:format> | ||
{% endif %} | ||
{% if rsc_dict.get('name')%}<dct:title>{{rsc_dict.get('name')}}</dct:title>{% endif %} | ||
</dcat:Distribution> | ||
</dcat:distribution> | ||
{% endfor %} | ||
{% if c.pkg_dict.get('author', None) %} | ||
<dct:creator> | ||
<rdf:Description> | ||
<foaf:name>{{ c.pkg_dict['author'] }}</foaf:name> | ||
{% if c.pkg_dict.get('maintainer_email', None)%} | ||
<foaf:mbox rdf:resource="mailto:{{c.pkg_dict['author_email']}}"/> | ||
{% endif %} | ||
</rdf:Description> | ||
</dct:creator> | ||
{% endif %} | ||
{% if c.pkg_dict.get('maintainer', None)%} | ||
<dct:contributor> | ||
<rdf:Description> | ||
<foaf:name>{{ c.pkg_dict['maintainer'] }}</foaf:name> | ||
{% if c.pkg_dict.get('maintainer_email', None) %} | ||
<foaf:mbox rdf:resource="mailto:{{c.pkg_dict['maintainer_email']}}"/> | ||
{% endif %} | ||
</rdf:Description> | ||
</dct:contributor> | ||
{% endif %} | ||
|
||
{% if c.pkg_dict.get('license_url', None) %} | ||
<dct:rights rdf:resource="{{c.pkg_dict['license_url']}}"/> | ||
{% endif %} | ||
|
||
{% for extra_dict in c.pkg_dict.get('extras',None) %} | ||
<dct:relation> | ||
<rdf:Description> | ||
<rdfs:label>{{extra_dict.get('key','')}}</rdfs:label> | ||
<rdf:value>{{extra_dict.get('value','')}}</rdf:value> | ||
</rdf:Description> | ||
</dct:relation> | ||
{% endfor %} | ||
</dcat:Dataset> | ||
</rdf:RDF> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters