/[volute]/trunk/projects/vocabularies/src/code/rdf2html.py
ViewVC logotype

Diff of /trunk/projects/vocabularies/src/code/rdf2html.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 669 by alasdair.gray, Thu Jul 3 12:51:12 2008 UTC revision 670 by alasdair.gray, Thu Jul 3 14:11:12 2008 UTC
# Line 109  Line 109 
109              labelled = 1              labelled = 1
110          out.write("<dd>%s</dd> \n" % (n))          out.write("<dd>%s</dd> \n" % (n))
111    
112        # Display definition if it exists
113        definition = model.get_target(subj, skosNS.definition)
114        if definition != None:
115            out.write("<dt>definition:</dt>\n<dd>%s</dd>\n" % definition)
116    
117        # Display scope note if it exists
118        scopeNote = model.get_target(subj, skosNS.scopeNote)
119        if scopeNote != None:
120            out.write("<dt>scope note:</dt>\n<dd>%s</dd>\n" % scopeNote)
121    
122        # Display broader terms
123      labelled = 0      labelled = 0
124      broaderConcepts = model.get_targets(subj, skosNS.broader)      broaderConcepts = model.get_targets(subj, skosNS.broader)
125      for n in broaderConcepts:      for n in broaderConcepts:
# Line 117  Line 128 
128              labelled = 1              labelled = 1
129          nstr = n._get_uri().__str__()[schemenamelen+1:]          nstr = n._get_uri().__str__()[schemenamelen+1:]
130          nLabel = model.get_target(n, skosNS.prefLabel)          nLabel = model.get_target(n, skosNS.prefLabel)
131            if nLabel == None:
132                nLabel = nstr
133          out.write("<dd><a href='#%s'>%s</a></dd>\n" % (nstr,nLabel))          out.write("<dd><a href='#%s'>%s</a></dd>\n" % (nstr,nLabel))
134    
135        # Display narrower terms
136      labelled = 0      labelled = 0
137      narrowerConcepts = model.get_targets(subj, skosNS.narrower)      narrowerConcepts = model.get_targets(subj, skosNS.narrower)
138      for n in narrowerConcepts:      for n in narrowerConcepts:
# Line 127  Line 141 
141              labelled = 1              labelled = 1
142          nstr = n._get_uri().__str__()[schemenamelen+1:]          nstr = n._get_uri().__str__()[schemenamelen+1:]
143          nLabel = model.get_target(n, skosNS.prefLabel)          nLabel = model.get_target(n, skosNS.prefLabel)
144            if nLabel == None:
145                nLabel = nstr
146            out.write("<dd><a href='#%s'>%s</a></dd>\n" % (nstr,nLabel))
147    
148        # Display related terms
149        labelled = 0
150        relatedConcepts = model.get_targets(subj, skosNS.related)
151        for n in relatedConcepts:
152            if not labelled:
153                out.write("<dt>related terms:</dt>\n")
154                labelled = 1
155            nstr = n._get_uri().__str__()[schemenamelen+1:]
156            nLabel = model.get_target(n, skosNS.prefLabel)
157            if nLabel == None:
158                nLabel = nstr
159          out.write("<dd><a href='#%s'>%s</a></dd>\n" % (nstr,nLabel))          out.write("<dd><a href='#%s'>%s</a></dd>\n" % (nstr,nLabel))
160    
161      # Reached the end of the SKOS concept      # Reached the end of the SKOS concept
162      out.write("</dl>\n</div>\n\n")      out.write("</dl>\n</div>\n\n")
163    

Legend:
Removed from v.669  
changed lines
  Added in v.670

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26