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

De Semantic MediaWiki - Sandbox
(Page créée avec « 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". == se... »)
 
Balise : Éditeur de wikicode 2017
Ligne 8 : Ligne 8 :
 
== 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:TestProperty]] for this page:
* '''<nowiki> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[Utilisateur:Tenbergen/gadgetdata]]|?TestProperty&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 query for the page that contains this value:  
 
The following will query for the page that contains this value:  
* <nowiki> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[TestProperty::My%20tummy%20feels%20funny.]]&format=json    </nowiki>
+
* <nowiki> https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[GadgetTestProperty::My%20tummy%20feels%20funny.]]&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 26 mars 2019 à 23:53

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 query for the page that contains this value:

  • https://sandbox.semantic-mediawiki.org/w/api.php?action=ask&query=[[GadgetTestProperty::My%20tummy%20feels%20funny.]]&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.