diff options
author | David Robillard <d@drobilla.net> | 2020-03-22 19:30:23 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-03-28 17:10:05 +0100 |
commit | e171a9564dc6477f21710fad61469119904e5193 (patch) | |
tree | 49da598e36f788371c9f317a2ec0acbeed2f67b5 | |
parent | 5fbf0fd403f206269bdb146985f2d85d2492f2d5 (diff) | |
download | lv2-e171a9564dc6477f21710fad61469119904e5193.tar.xz |
lv2specgen: Show label in metadata table for all resources
-rwxr-xr-x | lv2specgen/lv2specgen.py | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 509f8ff..b9f458c 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -394,6 +394,10 @@ def rdfsPropertyInfo(term, m): range = "" domain = "" + label = getLabel(m, term) + if label != '': + doc += "<tr><th>Label</th><td>%s</td></tr>" % label + # Find subPropertyOf information rlist = '' first = True @@ -523,6 +527,10 @@ def rdfsClassInfo(term, m): global classdomains doc = "" + label = getLabel(m, term) + if label != '': + doc += "<tr><th>Label</th><td>%s</td></tr>" % label + # Find superclasses superclasses = set() for st in findStatements(m, term, rdfs.subClassOf, None): @@ -630,16 +638,21 @@ def rdfsInstanceInfo(term, m): """Generate rdfs-type information for instances""" doc = "" + label = getLabel(m, term) + if label != '': + doc += "<tr><th>Label</th><td>%s</td></tr>" % label + first = True + types = "" for match in sorted(findStatements(m, term, rdf.type, None)): - doc += getProperty(getTermLink(getObject(match), - term, - rdf.type), - first) + types += getProperty(getTermLink(getObject(match), + term, + rdf.type), + first) first = False - if doc != "": - doc = "<tr><th>Type</th>" + doc + if types != "": + doc += "<tr><th>Type</th>" + types doc += endProperties(first) |