Overview of this Wikibase: Difference between revisions

From MtM
No edit summary
No edit summary
Line 1: Line 1:
== List of all properties ==
== Which and how many persons are registered on this Wikibase?List of all properties ==
<syntaxhighlight lang="sparql">
<syntaxhighlight lang="sparql" line="1">
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
Line 13: Line 13:
}
}
ORDER BY ASC(xsd:integer(STRAFTER(STR(?property), 'P')))
ORDER BY ASC(xsd:integer(STRAFTER(STR(?property), 'P')))
</syntaxhighlight>Click here: [http://mtm.uni-trier.de/query/#PREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fprop%2Fdirect%2F%3E%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fentity%2F%3E%0A%0ASELECT%20%3Fproperty%20%3FpropertyLabel%0AWHERE%20%7B%0A%20%20%3Fproperty%20a%20wikibase%3AProperty%20.%0A%20%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23Ensures%20readable%20labels%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%0A%20%20%20%20%7D%0A%7D%0AORDER%20BY%20ASC%28xsd%3Ainteger%28STRAFTER%28STR%28%3Fproperty%29%2C%20%27P%27%29%29%29 test SPARQL-query]
</syntaxhighlight>Click here: [http://mtm.uni-trier.de/query/#PREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fprop%2Fdirect%2F%3E%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fentity%2F%3E%0A%0ASELECT%20%3Fproperty%20%3FpropertyLabel%0AWHERE%20%7B%0A%20%20%3Fproperty%20a%20wikibase%3AProperty%20.%0A%20%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23Ensures%20readable%20labels%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%0A%20%20%20%20%7D%0A%7D%0AORDER%20BY%20ASC%28xsd%3Ainteger%28STRAFTER%28STR%28%3Fproperty%29%2C%20%27P%27%29%29%29 Test SPARQL query]
 
== Which productions are listed on this Wikibase? ==
<syntaxhighlight lang="sparql" line="1">
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
 
SELECT ?staging ?stagingLabel WHERE {
  ?staging wdt:P3 wd:Q309.    #Staging is instance of (P3) staging (Q309)
  SERVICE wikibase:label {        #Ensures readable labels
  bd:serviceParam wikibase:language "en".
  }
}
</syntaxhighlight>Click here: [http://mtm.uni-trier.de/query/#PREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fprop%2Fdirect%2F%3E%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fentity%2F%3E%0A%0ASELECT%20%3Fstaging%20%3FstagingLabel%20WHERE%20%7B%0A%20%20%3Fstaging%20wdt%3AP3%20wd%3AQ309.%20%20%20%20%23Staging%20is%20instance%20of%20%28P3%29%20staging%20%28Q309%29%0A%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20%20%20%20%20%20%20%20%23Ensures%20readable%20labels%0A%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%0A%20%20%7D%0A%7D Test SPARQL query]
 
== Map of all performance venues ==
<syntaxhighlight lang="sparql" line="1">
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
 
PREFIX mmd: <https://mtm.uni-trier.de/entity/>
PREFIX mmdt: <https://mtm.uni-trier.de/prop/direct/>
 
#defaultView:Map
SELECT ?production ?productionLabel ?venueLabel ?WikiDataEntity ?coordinates WHERE {
 
  ?production mmdt:P3 mmd:Q309.  # Production is an instance of Production (Q309). 
  ?production mmdt:P8 ?venue.
  ?venue mmdt:P2 ?WikiDataEntity.  # P2 = exact match to Wikidata item
 
  SERVICE <https://query.wikidata.org/sparql> {
      ?WikiDataEntity wdt:P625 ?coordinates.  # P625 = coordinates in Wikidata
  }
 
  SERVICE wikibase:label {   
      bd:serviceParam wikibase:language "en". 
  }
}
 
</syntaxhighlight>Click here: [http://mtm.uni-trier.de/query/#PREFIX%20wd%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttp%3A%2F%2Fwww.wikidata.org%2Fprop%2Fdirect%2F%3E%0A%0APREFIX%20mmd%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fentity%2F%3E%20%0APREFIX%20mmdt%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fprop%2Fdirect%2F%3E%0A%0A%23defaultView%3AMap%0ASELECT%20%3Fproduction%20%3FproductionLabel%20%3FvenueLabel%20%3FWikiDataEntity%20%3Fcoordinates%20WHERE%20%7B%0A%0A%20%20%3Fproduction%20mmdt%3AP3%20mmd%3AQ309.%20%20%20%23%20Production%20is%20an%20instance%20of%20Production%20%28Q309%29.%20%20%0A%20%20%3Fproduction%20mmdt%3AP8%20%3Fvenue.%0A%20%20%3Fvenue%20mmdt%3AP2%20%3FWikiDataEntity.%20%20%23%20P2%20%3D%20exact%20match%20to%20Wikidata%20item%0A%20%20%0A%20%20SERVICE%20%3Chttps%3A%2F%2Fquery.wikidata.org%2Fsparql%3E%20%7B%0A%20%20%20%20%20%20%3FWikiDataEntity%20wdt%3AP625%20%3Fcoordinates.%20%20%23%20P625%20%3D%20coordinates%20in%20Wikidata%0A%20%20%7D%0A%20%20%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20%20%20%20%20%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%20%20%0A%20%20%7D%0A%7D%0A Test SPARQL query]
 
== Which and how many persons are listed on this Wikibase Instance? ==
<syntaxhighlight lang="sparql" line="1">
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
 
SELECT ?person ?personLabel WHERE {
  ?person wdt:P3 wd:Q241.  # Person is an instance of human being (Q241)
 
  SERVICE wikibase:label {   
      bd:serviceParam wikibase:language "en". 
  }
}
 
</syntaxhighlight>The number of results corresponds to the number of real persons created in Wikibase.
 
Click here: [http://mtm.uni-trier.de/query/#PREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fprop%2Fdirect%2F%3E%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fentity%2F%3E%0A%0ASELECT%20%3Fperson%20%3FpersonLabel%20WHERE%20%7B%0A%20%20%3Fperson%20wdt%3AP3%20wd%3AQ241.%20%20%23%20Person%20is%20an%20instance%20of%20human%20being%20%28Q241%29%0A%20%20%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20%20%20%20%20%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%20%20%0A%20%20%7D%0A%7D%0A Test SPARQL query]
 
However, if this number is to be output as a result, the following query can be used:<syntaxhighlight lang="sparql" line="1">
PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>
 
SELECT (COUNT(*) AS ?count) WHERE {
  ?person wdt:P3 wd:Q241.  # Person is an instance of human being (Q241)
 
  SERVICE wikibase:label {   
      bd:serviceParam wikibase:language "en". 
  }
}
 
</syntaxhighlight>Click here: [http://mtm.uni-trier.de/query/#PREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fprop%2Fdirect%2F%3E%0APREFIX%20wd%3A%20%3Chttps%3A%2F%2Fmtm.uni-trier.de%2Fentity%2F%3E%0A%0ASELECT%20%28COUNT%28%2a%29%20AS%20%3Fcount%29%20WHERE%20%7B%0A%20%20%3Fperson%20wdt%3AP3%20wd%3AQ241.%20%20%23%20Person%20is%20an%20instance%20of%20human%20being%20%28Q241%29%0A%20%20%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20%20%20%20%20%0A%20%20%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%20%20%0A%20%20%7D%0A%7D%0A Test SPARQL query]

Revision as of 16:43, 28 November 2025

Which and how many persons are registered on this Wikibase?List of all properties

PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>

SELECT ?property ?propertyLabel
WHERE {
  ?property a wikibase:Property .
 
    SERVICE wikibase:label {                         #Ensures readable labels
    bd:serviceParam wikibase:language "en".
    }
}
ORDER BY ASC(xsd:integer(STRAFTER(STR(?property), 'P')))

Click here: Test SPARQL query

Which productions are listed on this Wikibase?

PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>

SELECT ?staging ?stagingLabel WHERE {
  ?staging wdt:P3 wd:Q309.    #Staging is instance of (P3) staging (Q309)
   SERVICE wikibase:label {        #Ensures readable labels
   bd:serviceParam wikibase:language "en".
  }
}

Click here: Test SPARQL query

Map of all performance venues

PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

PREFIX mmd: <https://mtm.uni-trier.de/entity/> 
PREFIX mmdt: <https://mtm.uni-trier.de/prop/direct/>

#defaultView:Map
SELECT ?production ?productionLabel ?venueLabel ?WikiDataEntity ?coordinates WHERE {

  ?production mmdt:P3 mmd:Q309.   # Production is an instance of Production (Q309).  
  ?production mmdt:P8 ?venue.
  ?venue mmdt:P2 ?WikiDataEntity.  # P2 = exact match to Wikidata item
  
  SERVICE <https://query.wikidata.org/sparql> {
      ?WikiDataEntity wdt:P625 ?coordinates.  # P625 = coordinates in Wikidata
  }
  
  SERVICE wikibase:label {     
      bd:serviceParam wikibase:language "en".   
  }
}

Click here: Test SPARQL query

Which and how many persons are listed on this Wikibase Instance?

PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>

SELECT ?person ?personLabel WHERE {
  ?person wdt:P3 wd:Q241.  # Person is an instance of human being (Q241)
  
  SERVICE wikibase:label {     
      bd:serviceParam wikibase:language "en".   
  }
}

The number of results corresponds to the number of real persons created in Wikibase.

Click here: Test SPARQL query

However, if this number is to be output as a result, the following query can be used:

PREFIX wdt: <https://mtm.uni-trier.de/prop/direct/>
PREFIX wd: <https://mtm.uni-trier.de/entity/>

SELECT (COUNT(*) AS ?count) WHERE {
  ?person wdt:P3 wd:Q241.  # Person is an instance of human being (Q241)
  
  SERVICE wikibase:label {     
      bd:serviceParam wikibase:language "en".   
  }
}

Click here: Test SPARQL query