diff options
-rwxr-xr-x | lv2specgen/lv2specgen.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index d4d360a..fbecb23 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -460,7 +460,7 @@ def rdfsClassInfo(term, m): global classdomains doc = "" - # Find subClassOf information + # Find superclasses superclasses = set() for st in findStatements(m, term, rdfs.subClassOf, None): if not isBlank(getObject(st)): @@ -474,6 +474,20 @@ def rdfsClassInfo(term, m): doc += getProperty(getTermLink(superclass), first) first = False + # Find subclasses + subclasses = set() + for st in findStatements(m, None, rdfs.subClassOf, term): + if not isBlank(getObject(st)): + uri = getSubject(st) + subclasses |= set([uri]) + + if len(subclasses) > 0: + doc += "\n<tr><th>Superclass of</th>" + first = True + for superclass in sorted(subclasses): + doc += getProperty(getTermLink(superclass), first) + first = False + # Find out about properties which have rdfs:domain of t d = classdomains.get(str(term), "") if d: |