Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 113: Line 113:
}
}
</sparql>
</sparql>
=== Maps ===
==== Map of instances of gay bars ====
This query returns all instances of gay bars (or instances of subclasses of gay bars) in the form of a map. 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/>
#defaultView:Map
SELECT ?gayBar ?gayBarLabel ?coor
WHERE
{
  ?gayBar wdt:P1/wdt:P2* wd:Q1106 . # Returns instances of gay bars or instances of subclasses of gay bars (such as lesbian bars)
  ?gayBar wdt:P638 ?coor . # Returns instances of gay bars with geographic coordinates available.
  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