Newer
Older
PREFIX st: <http://ns.inria.fr/sparql-template/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX fun: <http://w3id.org/sparql-generate/fn/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX schema: <http://schema.org/>
TEMPLATE <ontology/main.rqg>( ?versionIRI ) {
TEMPLATE <header.rqg>( st:call-template(<ontology/title.rqg>, ?onto ) , ?pathToStatic , true ) .
"""
<header id="g-header">
<div class="g-container">
<div class="g-block size-100">
<div class="g-content g-particle">
<h1><a href="{?onto}">{ st:call-template(<ontology/title.rqg>, ?onto ) }</a></h1>
<dl>
<dt>Latest version:</dt><dd><a href='{?onto}'>{?onto}</a></dd>
{
TEMPLATE { "<dt>Permanent IRI for this version (" ?versionInfo ")</dt><dd><a href='{?versionIRI}'>{?versionIRI}</a></dd>" }
WHERE { ?onto owl:versionInfo ?versionInfo ; owl:versionIRI ?versionIRI } .
}
{
TEMPLATE { "<dt>" fun:property(<en.properties>, 'previousversion') "</dt><dd><a href='{?onto}'>{?onto}</a></dd>" }
WHERE {
?onto owl:priorVersion ?o
} .
}
{
TEMPLATE { "<dt>" fun:property(<en.properties>, 'etsiSource') "</dt><dd>" ?source "</dd>" }
WHERE {
?onto dcterms:source ?source
}
{
TEMPLATE { "<dt>" fun:property(<en.properties>, 'publicationDate') "</dt><dd>" ?date "</dd>" }
WHERE {
?onto dcterms:issued ?date
}
{
TEMPLATE { "<dt>" fun:property(<en.properties>, 'modificationDate') "</dt><dd>" ?date "</dd>" }
WHERE {
?onto dcterms:modified ?date
} ORDER BY DESC(?date) .
}
{
TEMPLATE {
before="<dt>{fun:property(<en.properties>, 'creators')}</dt><dd>\n" ;
TEMPLATE <ontology/contributor.rqg>(?uri) .
; separator = "<br/>\n"
; after = "</dd>"
} WHERE {
?onto dcterms:creator ?uri
OPTIONAL {
{ ?uri schema:familyName ?contributorName }
UNION { ?uri foaf:name ?contributorName }
}
} ORDER BY ?contributorName ?uri .
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
}
{
TEMPLATE {
before="<dt>{fun:property(<en.properties>, 'contributors')}</dt><dd>\n" ;
TEMPLATE <ontology/contributor.rqg>(?uri) .
; separator = "<br/>\n"
; after = "</dd>"
} WHERE {
?onto dcterms:contributor ?uri
OPTIONAL {
{ ?uri schema:familyName ?contributorName }
UNION { ?uri foaf:name ?contributorName }
}
} ORDER BY ?contributorName ?uri .
}
{
TEMPLATE {
before="<dt>{fun:property(<en.properties>, 'importedontologies')}</dt><dd>\n" ;
"""<a href="{?o}"><{?o}&ht;</a>"""
; separator="\n"
; after = "</dd>"
} WHERE {
?onto owl:imports ?o
} .
}
<dt>Prefix and namespace declaration:<dt>
<dd>Turtle: <code>@prefix {?prefix} <{?onto}> .</code><dd>
<dd>SPARQL: <code>PREFIX {?prefix} <{?onto}></code><dd>
<dt>License</dt><dd><a href='https://forge.etsi.org/etsi-software-license'>https://forge.etsi.org/etsi-software-license</a></dd>
</dl>
</div>
</div>
</div>
</header>
<section>
<div class="container">
{
TEMPLATE {
TEMPLATE {
before = "<h2>{ fun:property(<en.properties>, 'abstract') }</h2>\n" ;
TEMPLATE <function/formatText.rqg>(?abstract) .
; separator = "\n"
; after = "\n"
}
WHERE {
?subject dcterms:abstract ?abstract .
} .
"<div id='toc2'>" BOX {
"\n<h2>{ fun:property(<en.properties>, 'toc') }</h2>"
"\n<ol>" BOX {
"\n<li><a href='#introduction'>{ fun:property(<en.properties>, 'introduction') }</a></li>"
TEMPLATE {
"\n<li><a href='#classes'>{ fun:property(<en.properties>, 'classes') }</a></li>"
}
WHERE {
{?class a owl:Class} UNION {?class a rdfs:Class}
} LIMIT 1 .
TEMPLATE {
"\n<li><a href='#objectproperties'>{ fun:property(<en.properties>, 'objectproperties') }</a></li>"
}
WHERE {
?op a owl:ObjectProperty
} LIMIT 1 .
TEMPLATE {
"\n<li><a href='#dataproperties'>{ fun:property(<en.properties>, 'dataproperties') }</a></li>"
}
WHERE {
?dp a owl:DatatypeProperty
} LIMIT 1 .
TEMPLATE {
"\n<li><a href='#namedindividuals'>{ fun:property(<en.properties>, 'namedindividuals') }</a></li>"
}
WHERE {
?ni a owl:NamedIndividual
} LIMIT 1 .
TEMPLATE {
"\n<li><a href='#annotationproperties'>{ fun:property(<en.properties>, 'annotationproperties') }</a></li>"
}
WHERE {
?ap a owl:AnnotationProperty
} LIMIT 1 .
TEMPLATE {
"\n<li><a href='#generalaxioms'>{ fun:property(<en.properties>, 'generalaxioms') }</a></li>"
}
WHERE {
{?ga a owl:AllDisjointClasses}
UNION {
{ ?class a owl:Class}
UNION { ?class a rdfs:Class}
UNION { ?class a owl:Restriction }
FILTER( ISBLANK( ?class) )
{ ?class rdfs:subClassOf []}
UNION { ?class owl:equivalentClass []}
}
} LIMIT 1 .
"\n<li><a href='#namespacedeclarations'>{ fun:property(<en.properties>, 'namespaces') }</a></li>"
"\n<li><a href='#toc'>Hierarchies of Terms</a></li>"
} "\n</ol>"
} "\n</div>"
TEMPLATE {
before = "<h2>{ fun:property(<en.properties>, 'introduction') }</h2>\n" ;
TEMPLATE <function/formatText.rqg>(?description) .
; separator = "\n"
; after = "\n"
}
WHERE {
?subject dcterms:description ?description .
} .
"\n\n\n" TEMPLATE <ontology/classes.rqg>()
WHERE {
{?c a owl:Class} UNION {?c a rdfs:Class}
} LIMIT 1 .
"\n\n\n" TEMPLATE <ontology/objectProperties.rqg>()
WHERE {
?op a owl:ObjectProperty
} LIMIT 1 .
"\n\n\n" TEMPLATE <ontology/dataProperties.rqg>()
WHERE {
?op a owl:DatatypeProperty
} LIMIT 1 .
"\n\n\n" TEMPLATE <ontology/namedIndividuals.rqg>( ) .
"\n\n\n" TEMPLATE <ontology/namespaces.rqg>() .
}.
}
</div>
</section>
<section>
<div class="container">
<nav id="toc">
<h2 class="introductory" id="table-of-contents">Term hierarchy</h2>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="classes-toc-tab" data-toggle="tab" href="#classes-toc" role="tab" aria-controls="classes-toc" aria-selected="true">Classes</a>
</li>
<li class="nav-item">
<a class="nav-link" id="objectproperties-toc-tab" data-toggle="tab" href="#objectproperties-toc" role="tab" aria-controls="profile" aria-selected="false">ObjectProperties</a>
</li>
<li class="nav-item">
<a class="nav-link" id="dataproperties-toc-tab" data-toggle="tab" href="#dataproperties-toc" role="tab" aria-controls="profile" aria-selected="false">DataProperties</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane show active" id="classes-toc" role="tabpanel" aria-labelledby="classes-toc-tab">
{
# toc
TEMPLATE <ontology/toc-bar.rqg>( ?class , rdfs:subClassOf )
DISTINCT WHERE {
?class a owl:Class
FILTER( ISURI(?class) )
FILTER NOT EXISTS { ?class rdfs:subClassOf ?super FILTER( ISURI(?super) ) }
FILTER( ?class != owl:Thing )
} ORDER BY ?class
.
}
</div>
<div class="tab-pane" id="objectproperties-toc" role="tabpanel" aria-labelledby="objectproperties-toc-tab">
{
# toc
TEMPLATE <ontology/toc-bar.rqg>( ?property , rdfs:subPropertyOf )
WHERE {
?property a owl:ObjectProperty
FILTER( ISURI(?property) )
FILTER NOT EXISTS { ?property rdfs:subPropertyOf ?super FILTER( ISURI(?super) ) }
} ORDER BY ?property .
}
</div>
<div class="tab-pane" id="dataproperties-toc" role="tabpanel" aria-labelledby="dataproperties-toc-tab">
{
# toc
TEMPLATE <ontology/toc-bar.rqg>( ?property , rdfs:subPropertyOf )
WHERE {
?property a owl:DatatypeProperty
FILTER( ISURI(?property) )
FILTER NOT EXISTS { ?property rdfs:subPropertyOf ?super FILTER( ISURI(?super) ) }
} ORDER BY ?property .
}
</div>
</div>
</nav>
</div>
</section>
"""
TEMPLATE <footer.rqg>( ?pathToStatic , true ) .
} FROM ?versionIRI
WHERE {
BIND( fun:regex( str(?versionIRI), "^https://saref.etsi.org/([a-z4]+)/([^/]+)/$", 1 ) AS ?ext )
BIND( IF( ?ext = "core" , "saref" , "s{SUBSTR(?ext,6)}" ) AS ?short )
BIND( UCASE( ?short ) AS ?name )
BIND( "{?short}:" AS ?prefix )
BIND( fun:regex( str(?versionIRI), "^https://saref.etsi.org/([a-z4]+)/(v[0-9]+\\.[0-9]+\\.[0-9]+)/$", 2 ) AS ?versionInfo )
BIND( IRI( fun:regex( str(?versionIRI), "^(https://saref.etsi.org/[a-z4]+/)", 1 ) ) AS ?onto )
BIND( "../../static" AS ?pathToStatic )