Browse Source

Add missing labels and a test to prevent this in the future

zrythm_meson
David Robillard 2 years ago
parent
commit
b86c039bb3
  1. 1
      lv2/core/lv2core.ttl
  2. 1
      lv2/parameters/parameters.ttl
  3. 13
      lv2/patch/patch.ttl
  4. 2
      lv2/port-groups/port-groups.ttl
  5. 1
      lv2/ui/ui.ttl
  6. 30
      wscript

1
lv2/core/lv2core.ttl

@ -9,6 +9,7 @@ lv2:Specification @@ -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>

1
lv2/parameters/parameters.ttl

@ -19,6 +19,7 @@ to the user more efficiently.</p> """ . @@ -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

13
lv2/patch/patch.ttl

@ -284,13 +284,16 @@ patch:add @@ -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 @@ -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 @@ -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 @@ -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 @@ -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

2
lv2/port-groups/port-groups.ttl

@ -110,6 +110,7 @@ pg:group @@ -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 @@ -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

1
lv2/ui/ui.ttl

@ -250,6 +250,7 @@ ui:PortNotification @@ -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

30
wscript

@ -443,6 +443,31 @@ def lint(ctx): @@ -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): @@ -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):

Loading…
Cancel
Save