Main Page/UsingTheQueryService: Difference between revisions

From LD4 WBStack Test
Jump to navigation Jump to search
(Added two basic example queries)
 
(Added text to second example)
 
Line 1: Line 1:
* This query selects all Institutions in this Wikibase instance and retrieves their local Q-Number and label
* This query selects all Institutions in this Wikibase instance and retrieves their local Q-Number and label
<nowiki>SELECT ?institution ?institutionLabel  
<nowiki>SELECT ?institution ?institutionLabel  
   WHERE
   WHERE
Line 7: Line 8:
       }</nowiki>
       }</nowiki>


* This query selects all "preferred local labels," the authorized access point of the headings they replace, and the institution(s) that use them
* This query selects all "preferred local labels," the authorized access point of the headings they replace, and the institution(s) that use them.  Note that the SERVICE command invokes the Wikibase label service, which functions the same in a local Wikibase instance as it does in Wikidata.
 
<nowiki>SELECT ?preferredLocalLabel ?replacesLabel ?institutionLabel
<nowiki>SELECT ?preferredLocalLabel ?replacesLabel ?institutionLabel
WHERE
WHERE

Latest revision as of 10:41, 23 May 2022

  • This query selects all Institutions in this Wikibase instance and retrieves their local Q-Number and label

SELECT ?institution ?institutionLabel WHERE { ?institution <http://ld4-wbs-test.wiki.opencura.com/prop/direct/P1> <http://ld4-wbs-test.wiki.opencura.com/entity/Q25> ; <http://www.w3.org/2000/01/rdf-schema#label> ?institutionLabel . }

  • This query selects all "preferred local labels," the authorized access point of the headings they replace, and the institution(s) that use them. Note that the SERVICE command invokes the Wikibase label service, which functions the same in a local Wikibase instance as it does in Wikidata.

SELECT ?preferredLocalLabel ?replacesLabel ?institutionLabel WHERE { ?preferredLocal <http://ld4-wbs-test.wiki.opencura.com/prop/direct/P1> <http://ld4-wbs-test.wiki.opencura.com/entity/Q12> ; <http://ld4-wbs-test.wiki.opencura.com/prop/direct/P4> ?replaces ; <http://ld4-wbs-test.wiki.opencura.com/prop/direct/P3> ?institution . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }