aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-03-19 16:38:55 +0100
committerDavid Robillard <d@drobilla.net>2020-03-28 17:10:05 +0100
commitb86c039bb32a28525df9afe26154d0e90698cb31 (patch)
tree780e2ad265735a52d28d7633bdc84df6ae075fdb
parent329637e5b3d74ddf2f3f37414158aa83d6f0e873 (diff)
downloadlv2-b86c039bb32a28525df9afe26154d0e90698cb31.tar.xz
Add missing labels and a test to prevent this in the future
-rw-r--r--lv2/core/lv2core.ttl1
-rw-r--r--lv2/parameters/parameters.ttl1
-rw-r--r--lv2/patch/patch.ttl13
-rw-r--r--lv2/port-groups/port-groups.ttl2
-rw-r--r--lv2/ui/ui.ttl1
-rw-r--r--wscript30
6 files changed, 45 insertions, 3 deletions
diff --git a/lv2/core/lv2core.ttl b/lv2/core/lv2core.ttl
index 2f5ebc3..1f62018 100644
--- a/lv2/core/lv2core.ttl
+++ b/lv2/core/lv2core.ttl
@@ -9,6 +9,7 @@ lv2:Specification
a rdfs:Class ,
owl:Class ;
rdfs:subClassOf doap:Project ;
+ rdfs:label "Specification" ;
lv2:documentation """
<p>An LV2 specification (i.e. this specification, or an LV2 extension).</p>
diff --git a/lv2/parameters/parameters.ttl b/lv2/parameters/parameters.ttl
index 67f7ce9..5d8d947 100644
--- a/lv2/parameters/parameters.ttl
+++ b/lv2/parameters/parameters.ttl
@@ -19,6 +19,7 @@ to the user more efficiently.</p> """ .
param:ControlGroup
a rdfs:Class ;
rdfs:subClassOf pg:Group ;
+ rdfs:label "Control Group" ;
rdfs:comment "A group representing a set of associated controls." .
param:amplitude
diff --git a/lv2/patch/patch.ttl b/lv2/patch/patch.ttl
index 9f2ef69..3ccd840 100644
--- a/lv2/patch/patch.ttl
+++ b/lv2/patch/patch.ttl
@@ -284,13 +284,16 @@ patch:add
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
- rdfs:domain patch:Message .
+ rdfs:domain patch:Message ;
+ rdfs:label "add" ;
+ rdfs:comment "The properties to add to the subject." .
patch:body
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain patch:Message ;
+ rdfs:label "body" ;
rdfs:comment """The body of a message.
The details of this property's value depend on the type of message it is a
@@ -300,6 +303,7 @@ patch:context
a rdf:Property ,
owl:ObjectProperty ;
rdfs:domain patch:Message ;
+ rdfs:label "context" ;
rdfs:comment """The context of properties in this message.
For example, a plugin may have a special context for ephemeral properties which
@@ -317,7 +321,8 @@ patch:destination
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
- rdfs:domain patch:Message .
+ rdfs:domain patch:Message ;
+ rdfs:label "destination" .
patch:property
a rdf:Property ;
@@ -338,7 +343,8 @@ patch:remove
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:label "remove" ;
- rdfs:domain patch:Message .
+ rdfs:domain patch:Message ;
+ rdfs:comment "The properties to remove from the subject." .
patch:request
a rdf:Property ,
@@ -365,6 +371,7 @@ patch:subject
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain patch:Message ;
+ rdfs:label "subject" ;
rdfs:comment "The subject this message applies to." .
patch:value
diff --git a/lv2/port-groups/port-groups.ttl b/lv2/port-groups/port-groups.ttl
index 944b5c7..7149db2 100644
--- a/lv2/port-groups/port-groups.ttl
+++ b/lv2/port-groups/port-groups.ttl
@@ -110,6 +110,7 @@ pg:group
pg:DiscreteGroup
a rdfs:Class ;
rdfs:subClassOf pg:Group ;
+ rdfs:label "Discrete Group" ;
rdfs:comment "Discrete channel configurations. These groups are divided into channels where each represents a particular speaker location. The position of sound in one of these groups depends on a particular speaker configuration." .
pg:left
@@ -486,6 +487,7 @@ pg:ACN15
pg:AmbisonicGroup
a rdfs:Class ;
rdfs:subClassOf pg:Group ;
+ rdfs:label "Ambisonic Group" ;
rdfs:comment "Ambisonic channel configurations. These groups are divided into channels which together represent a position in an abstract n-dimensional space. The position of sound in one of these groups does not depend on a particular speaker configuration; a decoder can be used to convert an ambisonic stream for any speaker configuration." .
pg:AmbisonicBH1P0Group
diff --git a/lv2/ui/ui.ttl b/lv2/ui/ui.ttl
index fcd2f67..261c473 100644
--- a/lv2/ui/ui.ttl
+++ b/lv2/ui/ui.ttl
@@ -250,6 +250,7 @@ ui:PortNotification
owl:cardinality 1 ;
rdfs:comment "A PortNotification MUST have exactly one ui:plugin."
] ;
+ rdfs:label "Port Notification" ;
lv2:documentation """
<p>A port notification. This describes which ports the host must send
notifications to the UI about. The port can be specific by index, using the
diff --git a/wscript b/wscript
index b30239a..10c1682 100644
--- a/wscript
+++ b/wscript
@@ -443,6 +443,31 @@ def lint(ctx):
"build-test.c")
subprocess.call(cmd, cwd='build', shell=True)
+
+def test_vocabularies(check, files):
+ import rdflib
+
+ lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#')
+ owl = rdflib.Namespace('http://www.w3.org/2002/07/owl#')
+ rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#')
+ rdfs = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#')
+
+ model = rdflib.ConjunctiveGraph()
+ for f in files:
+ model.parse(f, format='n3')
+
+ # Check that all classes and properties have labels
+ for t in [rdf.Property, rdfs.Class]:
+ for r in sorted(model.triples([None, rdf.type, t])):
+ subject = r[0]
+
+ def has_property(subject, prop):
+ return model.value(subject, prop, None) is not None
+
+ check(lambda: has_property(subject, rdfs.label),
+ name = '%s has rdfs:label' % subject)
+
+
def test(tst):
import tempfile
@@ -464,6 +489,11 @@ def test(tst):
all_files = schemas + spec_files + plugin_files + bld_files
check(tst.env.SORD_VALIDATE + all_files)
+ try:
+ test_vocabularies(check, spec_files)
+ except ImportError as e:
+ Logs.warn('Not running vocabulary tests (%s)' % e)
+
with tst.group('Unit') as check:
pattern = tst.env.cprogram_PATTERN % '**/*-test'
for test in tst.path.get_bld().ant_glob(pattern):