From bdf14db0af9cf3ebc52225f8b33abd6def61587d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 10 Jan 2013 05:51:00 +0000 Subject: Make patch:Set a compact message for setting one property. Add patch:readable and patch:writable for describing available properties. --- lv2/lv2plug.in/ns/ext/patch/lv2-patch.doap.ttl | 11 ++++ lv2/lv2plug.in/ns/ext/patch/manifest.ttl | 2 +- lv2/lv2plug.in/ns/ext/patch/patch.h | 4 ++ lv2/lv2plug.in/ns/ext/patch/patch.ttl | 88 +++++++++++++++++++------- 4 files changed, 82 insertions(+), 23 deletions(-) diff --git a/lv2/lv2plug.in/ns/ext/patch/lv2-patch.doap.ttl b/lv2/lv2plug.in/ns/ext/patch/lv2-patch.doap.ttl index a996b6c..ba976f5 100644 --- a/lv2/lv2plug.in/ns/ext/patch/lv2-patch.doap.ttl +++ b/lv2/lv2plug.in/ns/ext/patch/lv2-patch.doap.ttl @@ -12,6 +12,17 @@ doap:name "LV2 Patch" ; doap:shortdesc "Messages for accessing and manipulating properties." ; doap:release [ + doap:revision "1.1" ; + doap:created "2012-01-10" ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Make patch:Set a compact message for setting one property." + ] , [ + rdfs:label "Add patch:readable and patch:writable for describing available properties." + ] + ] + ] , [ doap:revision "1.0" ; doap:created "2012-04-17" ; doap:file-release ; diff --git a/lv2/lv2plug.in/ns/ext/patch/manifest.ttl b/lv2/lv2plug.in/ns/ext/patch/manifest.ttl index 38b93ae..1037a9c 100644 --- a/lv2/lv2plug.in/ns/ext/patch/manifest.ttl +++ b/lv2/lv2plug.in/ns/ext/patch/manifest.ttl @@ -4,5 +4,5 @@ a lv2:Specification ; lv2:minorVersion 1 ; - lv2:microVersion 0 ; + lv2:microVersion 1 ; rdfs:seeAlso . diff --git a/lv2/lv2plug.in/ns/ext/patch/patch.h b/lv2/lv2plug.in/ns/ext/patch/patch.h index d03cdae..1a7a893 100644 --- a/lv2/lv2plug.in/ns/ext/patch/patch.h +++ b/lv2/lv2plug.in/ns/ext/patch/patch.h @@ -43,9 +43,13 @@ #define LV2_PATCH__add LV2_PATCH_PREFIX "add" #define LV2_PATCH__body LV2_PATCH_PREFIX "body" #define LV2_PATCH__destination LV2_PATCH_PREFIX "destination" +#define LV2_PATCH__property LV2_PATCH_PREFIX "property" +#define LV2_PATCH__readable LV2_PATCH_PREFIX "readable" #define LV2_PATCH__remove LV2_PATCH_PREFIX "remove" #define LV2_PATCH__request LV2_PATCH_PREFIX "request" #define LV2_PATCH__subject LV2_PATCH_PREFIX "subject" +#define LV2_PATCH__value LV2_PATCH_PREFIX "value" #define LV2_PATCH__wildcard LV2_PATCH_PREFIX "wildcard" +#define LV2_PATCH__writable LV2_PATCH_PREFIX "writable" #endif /* LV2_PATCH_H */ diff --git a/lv2/lv2plug.in/ns/ext/patch/patch.ttl b/lv2/lv2plug.in/ns/ext/patch/patch.ttl index 6267c71..ae1a0e3 100644 --- a/lv2/lv2plug.in/ns/ext/patch/patch.ttl +++ b/lv2/lv2plug.in/ns/ext/patch/patch.ttl @@ -231,42 +231,37 @@ patch:Set [ a owl:Restriction ; owl:cardinality 1 ; - owl:onProperty patch:body + owl:onProperty patch:property + ] , [ + a owl:Restriction ; + owl:cardinality 1 ; + owl:onProperty patch:value ] ; lv2:documentation """ -

A method for setting properties of an object to unique values.

+

A compact message for setting one property to a specific value.

-

This is a simplified version of patch:Patch which only makes sense for -properties which have at most one value. This method always has at least one -patch:subject, and exactly one patch:add property. All the properties of the -value of patch:add are set on the subject, with all old values for those -properties removed. For example:

+

This is equivalent to a patch:Patch which removes all pre-existing +values for the property before setting the new value. For example:

 []
     a patch:Set ;
     patch:subject <something> ;
-    patch:body [
-        eg:name "New name" ;
-        eg:age 42 ;
-    ] .
+    patch:property eg:name ;
+    patch:value "New name" .
 
-

This method is equivalent to a patch:Patch where the patch:remove value has -every property of patch:add but with wildcard values. For example, the above -patch is equivalent to:

+

Which is equivalent to:

 []
     a patch:Patch ;
     patch:subject <something> ;
     patch:add [
         eg:name "New name" ;
-        eg:age 42 ;
     ] ;
     patch:remove [
         eg:name patch:wildcard ;
-        eg:age patch:wildcard ;
-    ] ;
+    ] .
 
""" . @@ -294,6 +289,29 @@ patch:destination owl:FunctionalProperty ; rdfs:domain patch:Message . +patch:property + a rdf:Property ; + rdfs:label "property" ; + rdfs:range rdf:Property ; + lv2:documentation """ +

The property this message applies to.

+""" . + +patch:readable + a rdf:Property ; + rdfs:label "readable" ; + rdfs:range rdf:Property ; + lv2:documentation """ +

Indicates that the subject may have a property that can be read via a +patch:Get message. See the similar property patch:writable for details.

+""" . + +patch:remove + a rdf:Property , + owl:ObjectProperty , + owl:FunctionalProperty ; + rdfs:domain patch:Message . + patch:request a rdf:Property , owl:ObjectProperty , @@ -310,14 +328,40 @@ patch:subject owl:FunctionalProperty ; rdfs:domain patch:Message . -patch:remove - a rdf:Property , - owl:ObjectProperty , - owl:FunctionalProperty ; - rdfs:domain patch:Message . +patch:value + a rdf:Property ; + rdfs:label "value" ; + rdfs:range rdf:Property ; + lv2:documentation """ +

The value of a property in a patch:Set message.

+""" . patch:wildcard a rdfs:Resource ; rdfs:comment """ A wildcard which matches any resource. This makes it possible to describe the removal of all values for a given property. """ . + +patch:writable + a rdf:Property ; + rdfs:label "writable" ; + rdfs:range rdf:Property ; + lv2:documentation """ +

Indicates that subject may have a property that can be written via a patch +message. This is used to list supported properties, e.g. so user interfaces +can present appropriate controls. For example:

+ +
+@prefix eg:   <http://example.org/> .
+@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+eg:title
+    a rdf:Property ;
+    rdfs:label "title" ;
+    rdfs:range xsd:string .
+
+eg:plugin
+    patch:writable eg:title .
+
+""" . -- cgit v1.2.1