SPARQL examples: Difference between revisions

(added example for "advanced topics")
(add central topics)
Line 22: Line 22:


=== Central topics (topics with a high number of dependencies) ===
=== Central topics (topics with a high number of dependencies) ===
{{#widget:SPARQLquery|code=
#defaultView:Graph
PREFIX wd: <https://graphit.ur.de/entity/>
PREFIX wds: <https://graphit.ur.de/entity/statement/>
PREFIX wdv: <https://graphit.ur.de/value/>
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX p: <https://graphit.ur.de/prop/>
PREFIX ps: <https://graphit.ur.de/prop/statement/>
PREFIX pq: <https://graphit.ur.de/prop/qualifier/>


SELECT ?prerequisite ?prerequisiteLabel ?prerequisites ?dependency ?dependencyLabel WHERE {
  {
  SELECT ?dependency ?dependencyLabel (COUNT(DISTINCT ?prerequisite) as ?prerequisites) WHERE {
      ?prerequisite wdt:P1 ?dependency.     
  } GROUP BY ?dependency ?dependencyLabel
  }
  ?prerequisite wdt:P1 ?dependency.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}}
=== Advanced topics (topics with a high number of prerequisites) ===
=== Advanced topics (topics with a high number of prerequisites) ===
{{#widget:SPARQLquery|code=
{{#widget:SPARQLquery|code=
Line 36: Line 55:
SELECT ?prerequisite ?prerequisiteLabel ?dependencies ?dependency ?dependencyLabel WHERE {
SELECT ?prerequisite ?prerequisiteLabel ?dependencies ?dependency ?dependencyLabel WHERE {
   {
   {
   SELECT ?prerequisite ?prerequisiteLabel (COUNT(?dependency) as ?dependencies) WHERE {
   SELECT ?prerequisite ?prerequisiteLabel (COUNT(DISTINCT ?dependency) as ?dependencies) WHERE {
       ?prerequisite wdt:P1 ?dependency.       
       ?prerequisite wdt:P1 ?dependency.       
   } GROUP BY ?prerequisite ?prerequisiteLabel
   } GROUP BY ?prerequisite ?prerequisiteLabel

Revision as of 22:09, 5 May 2023

This page is automatically parsed by the query page to provide examples.

Simple Queries

Complete Dependency Graph

All topics in the CGBV course

Educational resources for learning Python

Stuff you need to learn if you want to write a tool that counts objects in an image

Central topics (topics with a high number of dependencies)

Advanced topics (topics with a high number of prerequisites)

Topics that Max Mustermann wants to complete

Topics that Max Mustermann has completed