-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoap
259 lines (222 loc) · 8.16 KB
/
doap
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdfe="http://redfoot.net/3.0/rdf#"
xmlns:server="http://redfoot.net/3.0/server#"
xmlns:template='http://redfoot.net/3.0/template#'
xmlns:aspect="http://redfoot.net/3.0/aspect#"
xmlns:kid='http://redfoot.net/3.0/kid#'
>
<rdfe:RDFXMLDocument rdf:about="">
</rdfe:RDFXMLDocument>
<aspect:Aspect rdf:ID="aspect">
<rdfs:label>Doap</rdfs:label>
<rdfs:comment>Look into http://kupu.oscom.org/</rdfs:comment>
<aspect:item rdf:resource="#contributors"/>
<aspect:item rdf:resource="#releases"/>
</aspect:Aspect>
<template:Section rdf:ID="contributors">
<aspect:location>/contributors/</aspect:location>
<!-- Change page template to use abstract_uri's rdfs:label -->
<!-- and have this override if present -->
<rdfs:label>Contributors</rdfs:label>
<template:default_section_rank>70.0</template:default_section_rank>
<template:content>
<kid:PagePartHandler rdf:ID="contributors_content">
<kid:template rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
<![CDATA[
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:kid="http://purl.org/kid/ns#">
<?python
FOAF = redfoot.namespace("http://xmlns.com/foaf/0.1/")
DOAP = redfoot.namespace("http://usefulinc.com/ns/doap#")
project = URIRef("%s#" % request.host)
people = []
seen = set()
for property in [DOAP.maintainer, DOAP.developer, DOAP.documenter, DOAP.translator, DOAP.tester, DOAP.helper]:
for person in redfoot.objects(project, property):
if person not in seen:
seen.add(person)
label = redfoot.label(person) or person
relationships = set()
for relationship in redfoot.predicates(project, person):
relationships.add(redfoot.label(relationship))
people.append((label, person, relationships))
people.sort()
?>
<ul>
<li kid:for="label, person, relationships in people">
<a href="${redfoot.value(person, FOAF.homepage)}">${label}</a>,
${redfoot.value(person, FOAF.nick, any=True)},
(${", ".join(relationships)})
</li>
</ul>
</div>
]]>
</kid:template>
</kid:PagePartHandler>
</template:content>
</template:Section>
<template:Section rdf:ID="releases">
<aspect:location>/releases/</aspect:location>
<!-- Change page template to use abstract_uri's rdfs:label -->
<!-- and have this override if present -->
<rdfs:label>Releases</rdfs:label>
<template:default_section_rank>50.0</template:default_section_rank>
<template:content>
<kid:PagePartHandler rdf:ID="releases_content">
<kid:template rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
<![CDATA[
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:kid="http://purl.org/kid/ns#">
<?python
DOAP = redfoot.namespace("http://usefulinc.com/ns/doap#")
format = redfoot.module(URIRef("simple_format#module", base=redfoot.uri)).format
format_uri = redfoot.module(URIRef("simple_format#module", base=redfoot.uri)).format_uri
project = request.host.abstract()
releases = []
for release in redfoot.objects(project, DOAP.release):
created = redfoot.value(release, DOAP.created)
releases.append((created, release))
releases.sort()
releases.reverse()
?>
<ul>
<span kid:strip="" kid:for="created, release in releases">
<li>${XML(format_uri(release))} (${created})</li>
</span>
</ul>
</div>
]]>
</kid:template>
</kid:PagePartHandler>
</template:content>
</template:Section>
<rdf:Description rdf:about="http://usefulinc.com/ns/doap#Project">
<template:content>
<kid:PagePartHandler rdf:ID="project_content">
<rdfs:label>Default main for Redfoot</rdfs:label>
<kid:template rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
<![CDATA[
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:kid="http://purl.org/kid/ns#"
>
<?python
DOAP = redfoot.namespace("http://usefulinc.com/ns/doap#")
format = redfoot.module(URIRef("simple_format#module", base=redfoot.uri)).format
format_uri = redfoot.module(URIRef("simple_format#module", base=redfoot.uri)).format_uri
# releases = []
# for release in redfoot.objects(request.uri.abstract(), DOAP.release):
# created = redfoot.value(request.uri.abstract(), DOAP.created)
# releases.append((created, release))
# releases.sort()
# releases.reverse()
seeAlsoList = redfoot.objects(request.uri.abstract(), RDFS.seeAlso)
?>
<p>${XML(format_uri(request.uri.abstract(), DOAP.description))}</p>
<div style="float: right; width: 40%">
<!--
<div>Download:
<ul>
<li kid:for="download_page in redfoot.objects(request.uri.abstract(), getattr(DOAP, 'download-page'))">
${XML(format_uri(download_page))}
</li>
</ul>
</div>
-->
<div>Browse: ${XML(format_uri(request.uri.abstract(), DOAP.SVNRepository))}</div>
<div>Send feedback to: ${XML(format_uri(request.uri.abstract(), DOAP.maintainer))}</div>
</div>
<!--
<div class="recipe" style="width: 50%">
<h2>Releases</h2>
<dl>
<span kid:strip="" kid:for="created, release in releases[0:3]">
<dt>${XML(format_uri(release))}</dt>
<?python
content_value = redfoot.comment(release)
content_type = content_value.datatype
?>
<dd kid:if="content_type=='http://www.w3.org/1999/xhtml'">${XML(content_value)}</dd>
<dd kid:if="content_type!='http://www.w3.org/1999/xhtml'">${XML(format_uri(content_value))}</dd>
</span>
</dl>
</div>
-->
<div kid:if="seeAlsoList">
<h2>See Also</h2>
<ul>
<li kid:for="seeAlso in seeAlsoList">${XML(format_uri(seeAlso))}</li>
</ul>
</div>
<br style="clear: both"/>
</div>
]]>
</kid:template>
</kid:PagePartHandler>
</template:content>
</rdf:Description>
<rdf:Description rdf:about="http://usefulinc.com/ns/doap#Version">
<template:content>
<kid:PagePartHandler rdf:ID="version_content">
<rdfs:label>Default main for Redfoot</rdfs:label>
<kid:template rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
<![CDATA[
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:kid="http://purl.org/kid/ns#"
>
<?python
release = request.uri.abstract()
DOAP = redfoot.namespace("http://usefulinc.com/ns/doap#")
format = redfoot.module(URIRef("simple_format#module", base=redfoot.uri)).format
format_uri = redfoot.module(URIRef("simple_format#module", base=redfoot.uri)).format_uri
content_value = redfoot.comment(release)
content_type = content_value.datatype
?>
<p kid:if="content_type=='http://www.w3.org/1999/xhtml'">${XML(content_value)}</p>
<p kid:if="content_type!='http://www.w3.org/1999/xhtml'">${content_value}</p>
</div>
]]>
</kid:template>
</kid:PagePartHandler>
</template:content>
</rdf:Description>
<template:Section rdf:ID="projects">
<aspect:location>/projects/</aspect:location>
<rdfs:label>Projects</rdfs:label>
<template:default_section_rank>75.0</template:default_section_rank>
<template:content>
<kid:PagePartHandler rdf:ID="projects_content">
<kid:template rdf:datatype="http://www.w3.org/2001/XMLSchema#string">
<![CDATA[
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:kid="http://purl.org/kid/ns#">
<?python
FOAF = redfoot.namespace("http://xmlns.com/foaf/0.1/")
DOAP = redfoot.namespace("http://usefulinc.com/ns/doap#")
projects = []
seen = set()
CAT = URIRef("/projects#using_rdflib", base=request.host)
for project in redfoot.subjects(DOAP.category, CAT):
if project not in seen:
seen.add(project)
label = redfoot.label(project) or project
projects.append((label, project))
projects.sort()
?>
<p>Have a project you'd like to have listed here? If so, assert that your doap:Project has doap:category of ${CAT} and send us a pointer to your doap (for now leave a comment on this page).
</p>
<ul>
<li kid:for="label, project in projects">
<a href="${redfoot.value(project, DOAP.homepage)}">${label}</a>
<p>${redfoot.value(project, DOAP.description, any=True)}</p>
</li>
</ul>
</div>
]]>
</kid:template>
</kid:PagePartHandler>
</template:content>
</template:Section>
</rdf:RDF>