Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 131: Line 131:
</sparql>
</sparql>


=== Identifiers ===
==== COEXISTENCE Thesaurus ====
This query returns all instances of items with at least one mapping to an identifier in the COEXISTENCE Thesaurus. It uses the service wikibase:label to return the labels in your default language or in English.
<sparql tryit="1">PREFIX wd: <https://lgbtdb.wikibase.cloud/entity/>
PREFIX wdt: <https://lgbtdb.wikibase.cloud/prop/direct/>
SELECT DISTINCT ?item ?itemLabel ?coexist
WHERE
{
  ?item wdt:P652 ?coexist . # Returns COEXISTENCE identifiers.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en (English) language
}
</sparql>
==== GSSO ====
This query returns all instances of items with at least one mapping to an identifier in the GSSO (version 2). It uses the service wikibase:label to return the labels in your default language or in English.
<sparql tryit="1">PREFIX wd: <https://lgbtdb.wikibase.cloud/entity/>
PREFIX wdt: <https://lgbtdb.wikibase.cloud/prop/direct/>
SELECT DISTINCT ?item ?itemLabel ?gsso
WHERE
{
  ?item wdt:P25 ?gsso . # Returns GSSO identifiers.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en (English) language
}
</sparql>


=== Mappings ===
=== Mappings ===

Navigation menu