Utilisateur:Tenbergen/gadgetdata
De Semantic MediaWiki - Sandbox
Révision datée du 26 mars 2019 à 23:56 par Tenbergen (discussion | contributions) (→API code to read it : removed old call that only worked on a different installation)
I am setting up a Raspberry Pi that will read a semantic value from this page and use that value to drive a motor - in this context I'll just call it "the gadget".
setting the value
This page encodes as Property:GadgetTestProperty the following:
- 4
- 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:TestProperty for this page:
- https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Utilisateur:Tenbergen/gadgetdata]]|?GadgetTestProperty&format=json
The following will return all properties for this page:
- https://sandbox.semantic-mediawiki.org/w/api.php?action=browsebysubject&subject=Utilisateur:Tenbergen/gadgetdata&format=json