From e171a9564dc6477f21710fad61469119904e5193 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 22 Mar 2020 19:30:23 +0100 Subject: lv2specgen: Show label in metadata table for all resources --- lv2specgen/lv2specgen.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'lv2specgen/lv2specgen.py') 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 += "Label%s" % 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 += "Label%s" % 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 += "Label%s" % 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 = "Type" + doc + if types != "": + doc += "Type" + types doc += endProperties(first) -- cgit v1.2.1