Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 219: Line 219:


== Visualization Queries ==
== Visualization Queries ==
=== Line Charts ===
==== MAP Overall Policy Tallies Over Time ===
This query returns a line chart showcasing how the MAP (Movement Advancement Project) Overall Tally (P863) has changed in the U.S. state of Alabama over the past decade. 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/>
PREFIX p: <https://lgbtdb.wikibase.cloud/prop/>
PREFIX pq: <https://lgbtdb.wikibase.cloud/prop/qualifier/>
PREFIX ps: <https://lgbtdb.wikibase.cloud/prop/statement/>
SELECT DISTINCT ?PointInTime ?OverallTally
WHERE
{
  wd:Q31554 p:P863 ?OverallTallyProp .
  ?OverallTallyProp pq:P19 ?PointInTime ;
                    ps:P863 ?OverallTally .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Helps get the label in your language, if not, then en (English) language
}
</sparql>
=== Graphs ===
=== Graphs ===
==== Subclass tree for a class entity ====
==== Subclass tree for a class entity ====

Navigation menu