Différences entre les versions de « Utilisateur:Tenbergen/gadgetdata »

De Semantic MediaWiki - Sandbox
m (→‎API code to read it : removed old call that only worked on a different installation)
Balise : Éditeur de wikicode 2017
m
Balise : Éditeur de wikicode 2017
Ligne 7 : Ligne 7 :
  
 
== API code to read it ==
 
== API code to read it ==
The following will query what the value of [[Property:TestProperty]] for this page:
+
The following will query what the value of [[Property:GadgetTestProperty]] for this page:
 
* '''<nowiki> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Utilisateur:Tenbergen/gadgetdata]]|?GadgetTestProperty&format=json </nowiki>'''
 
* '''<nowiki> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Utilisateur:Tenbergen/gadgetdata]]|?GadgetTestProperty&format=json </nowiki>'''
  
 
The following will return all properties for this page:  
 
The following will return all properties for this page:  
 
* <nowiki> https://sandbox.semantic-mediawiki.org/w/api.php?action=browsebysubject&subject=Utilisateur:Tenbergen/gadgetdata&format=json  </nowiki>
 
* <nowiki> https://sandbox.semantic-mediawiki.org/w/api.php?action=browsebysubject&subject=Utilisateur:Tenbergen/gadgetdata&format=json  </nowiki>

Version du 27 mars 2019 à 00:03

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:GadgetTestProperty 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
Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.