# LV2 Variables Extension # Copyright (C) 2008 David Robillard # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. @prefix var: . @prefix lv2: . @prefix rdf: . @prefix rdfs: . @prefix xsd: . @prefix doap: . @prefix foaf: . @prefix owl: . a lv2:Specification ; doap:license ; doap:name "LV2 Instance Variables" ; doap:created "2008-08-18" ; doap:maintainer [ a foaf:Person ; foaf:name "David Robillard" ; foaf:homepage ; rdfs:seeAlso ] ; rdfs:comment """ An extension for setting named/typed variables on an instance of an LV2 Plugin (or anything else). A "variable" is really just a (reified) RDF statement with an implicit subject (e.g. the plugin instance). Variables serve as a portable, network transparent, and serialisable mechanism for clients (e.g. user interfaces, programs) to control any parameter of a running plugin instance. Because variables are 'keyed' by URI (the predicate), future extensions can define variables with specific meanings or restricted/extended types. The value (rdf:value) of a variable may be anything, but hosts or plugins aren't guaranteed to support anything other than simple typed literals. Serialisation and code access to complex variables is considered outside the scope of this extension. Hosts and plugins SHOULD use the following types for appropriate values:
RDF TypeData Type
xsd:stringstring
xsd:decimalfloating point number
xsd:integerinteger number
xsd:booleanboolean value
This extension does not currently define a code mechanism for access to variables. A future revision, or a different extension, may. An example of a plugin with several variables:
<http://example.org/plugin> a lv2:Plugin ;
	lv2var:variable [
		rdf:predicate <http://example.org/greetingology#Greeting> ;
		rdf:value "Hello, cruel world."
	] , [
		rdf:predicate <http://example.org/matheybits#Coeff> ;
		rdf:value 1.23456
	] , [
		rdf:predicate <http://example.org/databits#BigValue> ;
		rdf:value [
			a somext:Something ;
			someext:foo "Foo?" ;
			someext:bar "Bar." ;
			someext:baz 1234.0
		]
	] .
""" . var:Variable a rdfs:Class ; rdfs:label "LV2 Variable" ; rdfs:comment "A typed instance variable." ; rdfs:subClassOf [ a owl:Restriction ; rdfs:comment "Must have exactly one rdf:predicate which is a resource" ; owl:onProperty rdf:predicate ; owl:cardinality 1 ; owl:allValuesFrom rdfs:Resource ], [ a owl:Restriction ; rdfs:comment "Must have exactly one rdf:value (of any type)" ; owl:onProperty rdf:value ; owl:cardinality 1 ] . var:variable a owl:ObjectProperty ; rdfs:label "Has a Variable" ; rdfs:range var:Variable ; rdfs:comment """ Relates an LV2 Variable to some Resource, usually a plugin instance. The domain of this property is not restricted, it may be used for anything. The range is implicitly an lv2var:Variable, the 'a lv2var:Variable' triple is not mandatory. """ .