/
read.rdf
71 lines (68 loc) · 2.86 KB
/
read.rdf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
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',[]) %}
<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>