--- a/ontologies/specgen/libvocab.py Tue Oct 18 14:15:51 2011 +0200
+++ b/ontologies/specgen/libvocab.py Tue Oct 18 16:12:58 2011 +0200
@@ -520,12 +520,13 @@
# first classes, then properties
eg = """<div class="specterm" id="%s" about="%s" typeof="%s">
<h4>%s: %s</h4>
- <em property="rdfs:label" >%s</em> - <span property="rdfs:comment" >%s</span> <br /><table style="float: top;">
- <tr><th>Status:</th>
- <td><span property="vs:term_status" >%s</span></td></tr>
+ <em property="rdfs:label" >%s</em> - <span property="rdfs:comment" >%s</span> <br />
+ <dl>
+ <dt>Status:</dt>
+ <dd property="vs:term_status" >%s</dd>
%s
%s
- </table>
+ </dl>
%s
<p style="float: right; font-size: small;">[<a href="#%s">#</a>] <!-- %s --> [<a href="#glance">back to top</a>]</p>
<br/>
@@ -548,7 +549,7 @@
q = 'SELECT ?d ?l WHERE {?d rdfs:domain <%s> . ?d rdfs:label ?l } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Properties include:</th>\n'
+ startStr = '<dt>Properties include:</dt>\n'
contentStr = ''
for (domain, label) in relations:
@@ -556,17 +557,17 @@
# danbri hack 20100101
# termStr = """<a href="#term_%s">%s</a>\n""" % (dom.id, label)
curie = "%s:%s" % (self.vocab.ns_list[dom.ns], dom.id)
- termStr = """<a href="#%s">%s</a>\n""" % (dom.id, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ termStr = '<a href="#%s">%s</a>' % (dom.id, curie)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- domainsOfClass = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ domainsOfClass = "%s \n %s" % (startStr, contentStr)
# class in range of -> only for classes included in this ontology specification
q2 = 'SELECT ?d ?l WHERE {?d rdfs:range <%s> . ?d rdfs:label ?l } ' % (term.uri)
relations2 = g.query(q2)
- startStr = '<tr><th>Used with:</th>\n'
+ startStr = '<dt>Used with:</dt>\n'
contentStr = ''
for (range, label) in relations2:
@@ -574,11 +575,11 @@
# termStr = """<a href="#term_%s">%s</a>\n""" % (ran.id, label)
# danbri hack 20100101 better to use exact IDs here
curie = "%s:%s" % (self.vocab.ns_list[ran.ns], ran.id)
- termStr = """<a href="#%s">%s</a>\n""" % (ran.id, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ termStr = """<a href="#%s">%s</a>""" % (ran.id, curie)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- rangesOfClass = "%s <td> %s</td></tr> " % (startStr, contentStr)
+ rangesOfClass = "%s \n %s " % (startStr, contentStr)
# class sub class of -> handles only "real" super classes
subClassOf = ''
@@ -587,18 +588,18 @@
q = 'SELECT ?sc ?l WHERE {<%s> rdfs:subClassOf ?sc . ?sc rdfs:label ?l } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Sub class of</th>\n'
+ startStr = '<dt>Sub class of</dt>\n'
contentStr = ''
contentStr2 = ''
for (subclass, label) in relations:
sub = Term(subclass)
curie = "%s:%s" % (self.vocab.ns_list[sub.ns], sub.id)
- termStr = """<span rel="rdfs:subClassOf" href="%s"><a href="#%s">%s</a></span>\n""" % (subclass, sub.id, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ termStr = """<span rel="rdfs:subClassOf" href="%s"><a href="#%s">%s</a></span>""" % (subclass, sub.id, curie)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- subClassOf = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ subClassOf = "%s \n %s" % (startStr, contentStr)
else:
q1 = 'SELECT ?sc WHERE {<%s> rdfs:subClassOf ?sc } ' % (term.uri)
@@ -612,8 +613,8 @@
# TODO: handle other sub class types (...) currently owl:Restriction only
colon = subclassnice.find(':')
if colon > 0:
- termStr = """<span rel="rdfs:subClassOf" href="%s"><a href="%s">%s</a></span>\n""" % (subclass, subclass, subclassnice)
- contentStr = "%s %s" % (contentStr, termStr)
+ termStr = """<span rel="rdfs:subClassOf" href="%s"><a href="%s">%s</a></span>""" % (subclass, subclass, subclassnice)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
print "must be super class from another ns"
elif (ordone == False):
# with that query I get all restrictions of a concept :\
@@ -623,7 +624,7 @@
print "try to fetch owl:Restrictions with query ", q2
orrelations = g.query(q2)
- startStr2 = '<tr><th class="restrictions">Restriction(s):</th>\n'
+ startStr2 = '<dt class="restrictions">Restriction(s):</dt>\n'
orpcounter = 0
orsubclass = ''
contentStr3 = ''
@@ -647,7 +648,7 @@
<span about="[_:%s]" rel="owl:onProperty" href="%s"><a href="#%s">%s</a></span> must be set <em>%s</em>
<span about="[_:%s]" property="%s" datatype="xsd:nonNegativeInteger" >%s</span> time(s)""" % (orsubclass, orsubclass, oronproperty, prop.id, prop.type, orscope, orsubclass, orproperty, orpropertyvalue)
- contentStr2 = "%s %s %s %s<br/>" % (contentStr2, termStr1, termStr2, contentStr3)
+ contentStr2 = "%s \n <dd>%s %s %s</dd>" % (contentStr2, termStr1, termStr2, contentStr3)
print "change orsubclass to", orsc
orsubclass = orsc
contentStr3 = ''
@@ -706,33 +707,33 @@
<span about="[_:%s]" rel="owl:onProperty" href="%s"><a href="#%s">%s</a></span> must be set <em>%s</em>
<span about="[_:%s]" property="%s" datatype="xsd:nonNegativeInteger" >%s</span> time(s)""" % (orsubclass, orsubclass, oronproperty, prop.id, prop.type, orscope, orsubclass, orproperty, orpropertyvalue)
- contentStr2 = "%s %s %s %s\n" % (contentStr2, termStr1, termStr2, contentStr3)
+ contentStr2 = "%s \n <dd>%s %s %s</dd>" % (contentStr2, termStr1, termStr2, contentStr3)
ordone = True
print "owl restriction modelling done for", term.uri
if contentStr != "":
- subClassOf = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ subClassOf = "%s \n %s " % (startStr, contentStr)
if contentStr2 != "":
- restriction = "%s <td> %s </td></tr>" % (startStr2, contentStr2)
+ restriction = "%s \n %s " % (startStr2, contentStr2)
# class has sub class -> handles only "real" super classes
hasSubClass = ''
q = 'SELECT ?sc ?l WHERE {?sc rdfs:subClassOf <%s>. ?sc rdfs:label ?l } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Has sub class</th>\n'
+ startStr = '<dt>Has sub class</dt>\n'
contentStr = ''
for (subclass, label) in relations:
sub = Term(subclass)
curie = "%s:%s" % (self.vocab.ns_list[sub.ns], sub.id)
termStr = """<a href="#%s">%s</a>\n""" % (sub.id, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- hasSubClass = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ hasSubClass = "%s \n %s" % (startStr, contentStr)
else:
q = 'SELECT ?sc WHERE {?sc rdfs:subClassOf <%s> } ' % (term.uri)
@@ -745,26 +746,26 @@
colon = subclassnice.find(':')
if colon > 0:
termStr = """<a href="%s">%s</a>\n""" % (subclass, subclassnice)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- hasSubClass = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ hasSubClass = "%s \n %s" % (startStr, contentStr)
# equivalent class
q = 'SELECT ?ec WHERE { <%s> <http://www.w3.org/2002/07/owl#equivalentClass> ?ec } ' % (term.uri)
equivalents = g.query(q)
- startStr = '<tr><th>Equivalent Class:</th>\n'
+ startStr = '<dt>Equivalent Class:</dt>\n'
contentStr = ''
equivalentClass = ''
for (ec) in equivalents:
cls = Term(ec)
curie = "%s:%s" % (self.vocab.ns_list[cls.ns], cls.id)
termStr = """<a href="#%s">%s</a>\n""" % (cls.id, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
if (contentStr != ""):
- equivalentClass = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ equivalentClass = "%s \n %s " % (startStr, contentStr)
# is defined by
@@ -772,15 +773,15 @@
q = 'SELECT ?idb WHERE { <%s> rdfs:isDefinedBy ?idb } ' % (term.uri)
relations = g.query(q)
- startStr = '\n'
+ startStr = '<dt>Is Defined By:</dt>\n'
contentStr = ''
for (isdefinedby) in relations:
- termStr = """<span rel="rdfs:isDefinedBy" href="%s"></span>\n""" % (isdefinedby)
- contentStr = "%s %s" % (contentStr, termStr)
+ termStr = """<a href="%s">%s</a>\n""" % (isdefinedby, isdefinedby)
+ contentStr = '%s \n <dd rel="rdfs:isDefinedBy">%s</dd>' % (contentStr, termStr)
if contentStr != "":
- classIsDefinedBy = "%s <tr><td> %s </td></tr>" % (startStr, contentStr)
+ classIsDefinedBy = "%s \n %s" % (startStr, contentStr)
# disjoint with
@@ -788,15 +789,15 @@
q = 'SELECT ?dj ?l WHERE { <%s> <http://www.w3.org/2002/07/owl#disjointWith> ?dj . ?dj rdfs:label ?l } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Disjoint With:</th>\n'
+ startStr = '<dt>Disjoint With:</dt>\n'
contentStr = ''
for (disjointWith, label) in relations:
- termStr = """<span rel="owl:disjointWith" href="%s"><a href="#%s">%s</a></span>\n""" % (disjointWith, label, label)
- contentStr = "%s %s" % (contentStr, termStr)
+ termStr = """<span rel="owl:disjointWith" href="%s"><a href="#%s">%s</a></span>\n""" % (disjointWith, term.id, label)
+ contentStr = "%s <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- isDisjointWith = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ isDisjointWith = "%s \n %s" % (startStr, contentStr)
# owl class
@@ -805,12 +806,12 @@
q = 'SELECT * WHERE { <%s> rdf:type <http://www.w3.org/2002/07/owl#Class> } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th colspan="2">OWL Class</th>\n'
+ startStr = '<dt>OWL Class</dt>\n'
if (len(relations) > 0):
if (str(term.type) != "owl:Class"):
termStr = """<span rel="rdf:type" href="http://www.w3.org/2002/07/owl#Class"></span>"""
- oc = "%s <td> %s </td></tr>" % (startStr, termStr)
+ oc = "%s \n %s" % (startStr, termStr)
# rdfs class
@@ -819,12 +820,12 @@
q = 'SELECT * WHERE { <%s> rdf:type <http://www.w3.org/2000/01/rdf-schema#Class> } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th colspan="2">RDFS Class</th>\n'
+ startStr = '<dt>RDFS Class</dt>\n'
if (len(relations) > 0):
if (str(term.type) != "rdfs:Class"):
termStr = """<span rel="rdf:type" href="http://www.w3.org/2000/01/rdf-schema#Class"></span>"""
- rc = "%s <td> %s </td></tr>" % (startStr, termStr)
+ rc = "%s \n %s" % (startStr, termStr)
# end
@@ -886,17 +887,17 @@
q = 'SELECT ?d ?l WHERE {<%s> rdfs:domain ?d . ?d rdfs:label ?l } ' % (term.uri)
# print "term.uri before ", term.uri
relations = g.query(q)
- startStr = '<tr><th>Domain:</th>\n'
+ startStr = '<dt>Domain:</dt>\n'
contentStr = ''
for (domain, label) in relations:
dom = Term(domain)
curie = "%s:%s" % (self.vocab.ns_list[dom.ns], dom.id)
termStr = """<span rel="rdfs:domain" href="%s"><a href="#%s">%s</a></span>\n""" % (domain, dom.id, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- domainsOfProperty = "%s <td>%s</td></tr>" % (startStr, contentStr)
+ domainsOfProperty = "%s \n %s" % (startStr, contentStr)
else:
q = 'SELECT ?d WHERE {<%s> rdfs:domain ?d } ' % (term.uri)
@@ -905,25 +906,25 @@
dom = Term(domain)
curie = "%s:%s" % (self.vocab.ns_list[dom.ns], dom.id)
termStr = """<span rel="rdfs:domain" href="%s"><a href="%s">%s</a></span>\n""" % (domain, domain, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- domainsOfProperty = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ domainsOfProperty = "%s \n %s" % (startStr, contentStr)
# range of properties -> handles only simple ranges
q2 = 'SELECT ?r ?l WHERE {<%s> rdfs:range ?r . ?r rdfs:label ?l } ' % (term.uri)
relations2 = g.query(q2)
- startStr = '<tr><th>Range:</th>\n'
+ startStr = '<dt>Range:</dt>\n'
contentStr = ''
for (range, label) in relations2:
ran = Term(range)
curie = "%s:%s" % (self.vocab.ns_list[ran.ns], ran.id)
termStr = """<span rel="rdfs:range" href="%s"><a href="#%s">%s</a></span>\n""" % (range, ran.id, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s \n <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- rangesOfProperty = "%s <td>%s</td> </tr>" % (startStr, contentStr)
+ rangesOfProperty = "%s \n %s" % (startStr, contentStr)
else:
q = 'SELECT ?r WHERE {<%s> rdfs:range ?r } ' % (term.uri)
@@ -937,10 +938,10 @@
colon = rangenice.find(':')
if colon > 0:
termStr = """<span rel="rdfs:range" href="%s"><a href="%s">%s</a></span>\n""" % (range, range, rangenice)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- rangesOfProperty = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ rangesOfProperty = "%s \n %s" % (startStr, contentStr)
# property sub property of -> only for property included in this ontology specification
subPropertyOf = ''
@@ -948,16 +949,16 @@
q = 'SELECT ?sp ?l WHERE {<%s> rdfs:subPropertyOf ?sp . ?sp rdfs:label ?l } ' % (term.uri)
# print "term.uri ", term.uri
relations = g.query(q)
- startStr = '<tr><th>Sub property of</th>\n'
+ startStr = '<dt>Sub property of</dt>\n'
contentStr = ''
for (subproperty, label) in relations:
sub = Term(subproperty)
termStr = """<span rel="rdfs:subPropertyOf" href="%s"><a href="#%s">%s</a></span>\n""" % (subproperty, sub.id, label)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- subPropertyOf = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ subPropertyOf = "%s <\n %s" % (startStr, contentStr)
else:
q1 = 'SELECT ?sp WHERE {<%s> rdfs:subPropertyOf ?sp } ' % (term.uri)
@@ -968,27 +969,27 @@
colon = subpropertynice.find(':')
if colon > 0:
termStr = """<span rel="rdfs:subPropertyOf" href="%s"><a href="%s">%s</a></span>\n""" % (subproperty, subproperty, subpropertynice)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s <dd>%s</dd>" % (contentStr, termStr)
print "must be super property from another ns"
if contentStr != "":
- subPropertyOf = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ subPropertyOf = "%s \n %s" % (startStr, contentStr)
# property has sub property -> only for property included in this ontology specification
hasSubProperty = ''
q = 'SELECT ?sp ?l WHERE {?sp rdfs:subPropertyOf <%s>. ?sp rdfs:label ?l } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Has sub property</th>\n'
+ startStr = '<dt>Has sub property</dt>\n'
contentStr = ''
for (subproperty, label) in relations:
sub = Term(subproperty)
termStr = """<a href="#%s">%s</a>\n""" % (sub.id, label)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- hasSubProperty = "%s <td> %s </td></tr>" % (startStr, contentStr)
+ hasSubProperty = "%s \n %s" % (startStr, contentStr)
# property inverse property of -> only for property included in this ontology specification
@@ -997,7 +998,7 @@
q = 'SELECT ?ip ?l WHERE {<%s> <http://www.w3.org/2002/07/owl#inverseOf> ?ip . ?ip rdfs:label ?l } ' % (term.uri)
# print "term.uri ", term.uri
relations = g.query(q)
- startStr = '<tr><th>Inverse property of</th>\n'
+ startStr = '<dt>Inverse property of</dt>\n'
contentStr = ''
for (inverseproperty, label) in relations:
@@ -1007,7 +1008,7 @@
if colon > 0:
inverse = Term(inverseproperty)
curie = "%s:%s" % (self.vocab.ns_list[inverse.ns], inverse.id)
- termStr = """<span rel="owl:inverseOf" href="%s"><a href="#%s">%s</a></span>\n""" % (inverseproperty, inverse.id, curie)
+ termStr = """<dd><span rel="owl:inverseOf" href="%s"><a href="#%s">%s</a></span></dd>""" % (inverseproperty, inverse.id, curie)
print "inverse property must be explicitly defined"
else:
q2 = 'SELECT ?ipt WHERE {<%s> <http://www.w3.org/2002/07/owl#inverseOf> ?ip . ?ip rdfs:label ?l . ?ip rdf:type ?ipt } ' % (term.uri)
@@ -1042,39 +1043,36 @@
contentStr2 = "(%s)" % (termStr2)
termStr = """<span rel="owl:inverseOf" resource="[_:%s]">the anonymous defined property with the label
\'<em about="[_:%s]" property="rdfs:label">%s</em>\'</span>\n""" % (inverseproperty, inverseproperty, label)
- termStr = "%s %s" % (termStr, contentStr2)
+ termStr = "%s <dd>%s</dd>" % (termStr, contentStr2)
print "inverse property must be anonymous defined"
contentStr = "%s %s" % (contentStr, termStr)
if contentStr != "":
- inverseOf = "%s <td> %s </td></tr>" % (startStr, contentStr)
- # print "write inverse property"
+ inverseOf = "%s \n %s" % (startStr, contentStr)
# property has inverse property -> only for property included in this ontology specification
hasInverseProperty = ''
q = 'SELECT ?ip ?l WHERE {?ip <http://www.w3.org/2002/07/owl#inverseOf> <%s>. ?ip rdfs:label ?l } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Has inverse property</th>\n'
+ startStr = '<dt>Has inverse property</dt>\n'
contentStr = ''
for (inverseproperty, label) in relations:
inverse = Term(inverseproperty)
curie = "%s:%s" % (self.vocab.ns_list[inverse.ns], inverse.id)
termStr = """<a href="#%s">%s</a>\n""" % (inverse.id, curie)
- contentStr = "%s %s" % (contentStr, termStr)
+ contentStr = "%s <dd>%s</dd>" % (contentStr, termStr)
if contentStr != "":
- hasInverseProperty = "%s <td> %s </td></tr>" % (startStr, contentStr)
- # print "write has inverse property"
-
+ hasInverseProperty = "%s \n %s" % (startStr, contentStr)
# is defined by
propertyIsDefinedBy = ''
q = 'SELECT ?idb WHERE { <%s> rdfs:isDefinedBy ?idb } ' % (term.uri)
relations = g.query(q)
- startStr = '\n'
+ startStr = '<dt>Is Defined By:</dt>'
contentStr = ''
for (isdefinedby) in relations:
@@ -1082,7 +1080,7 @@
contentStr = "%s %s" % (contentStr, termStr)
if contentStr != "":
- propertyIsDefinedBy = "%s <tr><td> %s </td></tr>" % (startStr, contentStr)
+ propertyIsDefinedBy = "%s <dd> %s </dd></tr>" % (startStr, contentStr)
# rdf property
@@ -1091,12 +1089,12 @@
q = 'SELECT * WHERE { <%s> rdf:type <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>RDF Property</th>\n'
+ startStr = '<dt>RDF Property</dt>\n'
if (len(relations) > 0):
if (str(term.type) != "rdf:Property"):
- termStr = """<span rel="rdf:type" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"></span>"""
- rp = "%s <td> %s </td></tr>" % (startStr, termStr)
+ termStr = """<dd><span rel="rdf:type" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#Property"></span></dd>"""
+ rp = "%s \n %s " % (startStr, termStr)
# object property
@@ -1105,12 +1103,12 @@
q = 'SELECT * WHERE { <%s> rdf:type <http://www.w3.org/2002/07/owl#ObjectProperty> } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Object Property</th>\n'
+ startStr = '<dt>Object Property</dt>\n'
if (len(relations) > 0):
if (str(term.type) != "owl:ObjectProperty"):
- termStr = """<span rel="rdf:type" href="http://www.w3.org/2002/07/owl#ObjectProperty"></span>"""
- op = "%s <td> %s </td></tr>" % (startStr, termStr)
+ termStr = """<dd><span rel="rdf:type" href="http://www.w3.org/2002/07/owl#ObjectProperty"></span></dd>"""
+ op = "%s \n %s" % (startStr, termStr)
# datatype property
@@ -1119,12 +1117,12 @@
q = 'SELECT * WHERE { <%s> rdf:type <http://www.w3.org/2002/07/owl#DatatypeProperty> } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Datatype Property</th>\n'
+ startStr = '<dt>Datatype Property</dt>\n'
if (len(relations) > 0):
if (str(term.type) != "owl:DatatypeProperty"):
- termStr = """<span rel="rdf:type" href="http://www.w3.org/2002/07/owl#DatatypeProperty"></span>"""
- dp = "%s <td> %s </td></tr>" % (startStr, termStr)
+ termStr = """<dd><span rel="rdf:type" href="http://www.w3.org/2002/07/owl#DatatypeProperty"></span></dd>"""
+ dp = "%s \n %s" % (startStr, termStr)
# inverse functional property
@@ -1133,12 +1131,12 @@
q = 'SELECT * WHERE { <%s> rdf:type <http://www.w3.org/2002/07/owl#InverseFunctionalProperty> } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Inverse Functional Property</th>\n'
+ startStr = '<dt>Inverse Functional Property</dt>\n'
if (len(relations) > 0):
if (str(term.type) != "owl:InverseFunctionalProperty"):
- termStr = """<span rel="rdf:type" href="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"></span>"""
- ifp = "%s <td> %s </td></tr>" % (startStr, termStr)
+ termStr = """<dd><span rel="rdf:type" href="http://www.w3.org/2002/07/owl#InverseFunctionalProperty"></span></dd>"""
+ ifp = "%s \n %s" % (startStr, termStr)
# functonal property
@@ -1146,23 +1144,23 @@
q = 'SELECT * WHERE { <%s> rdf:type <http://www.w3.org/2002/07/owl#FunctionalProperty> } ' % (term.uri)
relations = g.query(q)
- startStr = '<tr><th>Functional Property</th>\n'
+ startStr = '<dt>Functional Property</dt>\n'
if (len(relations) > 0):
if (str(term.type) != "owl:FunctionalProperty"):
- termStr = """<span rel="rdf:type" href="http://www.w3.org/2002/07/owl#FunctionalProperty"></span>"""
- fp = "%s <td> %s </td></tr>" % (startStr, termStr)
+ termStr = """<dd><span rel="rdf:type" href="http://www.w3.org/2002/07/owl#FunctionalProperty"></span></dd>"""
+ fp = "%s \n %s" % (startStr, termStr)
# editorial note
editorialNote = ""
-
- q = 'SELECT ?en WHERE { <%s> <http://www.w3.org/2004/02/skos/core#editorialNote> ?en } ' % (term.uri)
+ startStr = '<dt>Editorial Note</dt>\n'
+
+ q = 'SELECT ?en WHERE { <%s> <http://www.w3.org/2004/02/skos/core#editorialNote> ?en } ' % (term.uri)
editorialNotesResult = g.query(q)
for (en) in editorialNotesResult:
- startStr = '<tr style="vertical-align:text-top;"><th>Editorial Note</th>\n'
- termStr = '<span property="skos:editorialNote">%s</span>' % en
- editorialNote = "%s <td> %s </td></tr>" % (startStr, termStr)
+ termStr = '<dd property="skos:editorialNote">%s</dd>' % en
+ editorialNote = "%s \n %s" % (startStr, termStr)
break # we only want the first editorial note
# end