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/elements/1.1/>
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 swrl: <http://www.w3.org/2003/11/swrl#>
PREFIX prov: <http://www.w3.org/ns/prov#>
BASE <https://saref.etsi.org/documentation/>
# See https://www.w3.org/TR/owl2-quick-reference/#Properties
TEMPLATE <term/propertyDescription.rqg>( ?property ) {
# named object property
TEMPLATE {
"<a href='#{fun:prefixedIRI(?property)}' title='{ st:call-template( <term/label.rqg>, ?property ) }: {?commentStr}'>{fun:prefixedIRI(?property)}</a>"
"<sup title='{ fun:property(<en.properties>, 'objectproperty') }' class='type-op'>op</sup>"
}
WHERE {
FILTER(ISURI(?property))
?property a owl:ObjectProperty ;
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
FILTER (?property != owl:topObjectProperty)
FILTER (?property != owl:bottomObjectProperty)
BIND( IF(BOUND(?comment), ?comment, "<<no comment>>") AS ?commentStr )
} .
# universal object property
TEMPLATE {
"<a href='#{fun:prefixedIRI(?property)}' title='{?property}'>{fun:prefixedIRI(?property)}</a>"
"<sup title='{ fun:property(<en.properties>, 'objectproperty') }' class='type-op'>op</sup>"
} WHERE {
FILTER (?property = owl:topObjectProperty)
} .
# empty object property
TEMPLATE {
"<a href='#{fun:prefixedIRI(?property)}' title='{?property}'>{fun:prefixedIRI(?property)}</a>"
"<sup title='{ fun:property(<en.properties>, 'objectproperty') }' class='type-op'>op</sup>"
} WHERE {
FILTER (?property = owl:bottomObjectProperty)
} .
# inverse property
TEMPLATE {
"(<span class='logic'>inverse of</span> "
TEMPLATE <term/propertyDescription.rqg>( ?inverse ) .
")"
}
WHERE {
FILTER(ISBLANK(?property))
?property owl:inverseOf ?inverse .
} .
# named data property
TEMPLATE {
"<a href='#{fun:prefixedIRI(?property)}' title='{?property}'>{fun:prefixedIRI(?property)}</a>"
"<sup title='{ fun:property(<en.properties>, 'dataproperty') }' class='type-dp'>dp</sup>"
}
WHERE {
FILTER(ISURI(?property))
?property a owl:DatatypeProperty
FILTER (?property != owl:topDataProperty)
FILTER (?property != owl:bottomDataProperty)
} .
# universal data property
TEMPLATE {
"<a href='#{fun:prefixedIRI(?property)}' title='{?property}'>{fun:prefixedIRI(?property)}</a>"
"<sup title='{ fun:property(<en.properties>, 'dataproperty') }' class='type-dp'>dp</sup>"
} WHERE {
FILTER (?property = owl:topDataProperty)
} .
# empty data property
TEMPLATE {
"<a href='#{fun:prefixedIRI(?property)}' title='{?property}'>{fun:prefixedIRI(?property)}</a>"
"<sup title='{ fun:property(<en.properties>, 'dataproperty') }' class='type-dp'>dp</sup>"
} WHERE {
FILTER (?property = owl:bottomDataProperty)
} .
# fallback
TEMPLATE {
"<a href='#{fun:prefixedIRI(?property)}' title='{?property}'>{fun:prefixedIRI(?property)}</a><strong>Warning: property not declared</strong>"
}
WHERE {
FILTER(ISURI(?property))
FILTER( NOT EXISTS {?property a owl:ObjectProperty } ) .
FILTER( NOT EXISTS {?property a owl:DatatypeProperty } ) .
FILTER (?property != owl:topObjectProperty)
FILTER (?property != owl:bottomObjectProperty)
FILTER (?property != owl:topDataProperty)
FILTER (?property != owl:bottomDataProperty)
} .
}