« GadgetData » : différence entre les versions
De Semantic MediaWiki - Sandbox
Balise : Éditeur de wikicode 2017 |
Balise : Éditeur de wikicode 2017 |
||
Ligne 2 : | Ligne 2 : | ||
== setting the value == | == setting the value == | ||
Setting [[Property:GadgetTestProperty]] to [[GadgetTestProperty:: | Setting [[Property:GadgetTestProperty]] to [[GadgetTestProperty::14]]<nowiki></nowiki> | ||
* SMW could encode more, but for now let's have one so my gadget doesn't have to error check. | * SMW could encode more, but for now let's have one so my gadget doesn't have to error check. | ||
Version du 29 mars 2019 à 22:30
I am setting up a Raspberry Pi (call it "the gadget") that will read Property:GadgetTestProperty encoded on this page. If the value is between 0 and 20 it will drive a servo in a specific way.
setting the value
Setting Property:GadgetTestProperty to 14« 14 » n’est pas dans la plage de « 1...10 » spécifiée par la contrainte de valeur autorisée pour la propriété « GadgetTestProperty ».
- SMW could encode more, but for now let's have one so my gadget doesn't have to error check.
API code to read it
The following will query what the value of Property:GadgetTestProperty for this page:
- https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[GadgetData]]|?GadgetTestProperty&format=json
The following will return all properties for this page:
- https://sandbox.semantic-mediawiki.org/w/api.php?action=browsebysubject&subject=GadgetData&format=json