Courses/CGBV SS24/Graph: Difference between revisions
m (→"Interests" and "Knowledge": fix typo) |
(→"Interests" and "Knowledge": add alternative query + legend) |
||
Line 187: | Line 187: | ||
} | } | ||
}} | }} | ||
'''Alternative Visualization''' | |||
{{#widget:SPARQLquery|code= | |||
#defaultView:Graph | |||
PREFIX wd: <https://graphit.ur.de/entity/> | |||
PREFIX wdt: <https://graphit.ur.de/prop/direct/> | |||
SELECT DISTINCT ?sum ?item ?itemLabel ?rgb ?known ?interests | |||
WHERE { | |||
wd:Q932 wdt:P14/wdt:P14 ?item. | |||
OPTIONAL { | |||
SELECT ?item ?itemLabel (COUNT(DISTINCT ?student) as ?known) WHERE { | |||
?student wdt:P12 ?item. | |||
} GROUP BY ?item ?itemLabel | |||
} | |||
OPTIONAL { | |||
SELECT ?item ?itemLabel (COUNT(DISTINCT ?student) as ?interests) WHERE { | |||
?student wdt:P23 ?item. | |||
} GROUP BY ?item ?itemLabel | |||
}. | |||
BIND (IF(!BOUND(?interests), 0, ?interest) as ?interests). | |||
BIND (IF(!BOUND(?known), 0, ?known) as ?known). | |||
BIND ( ?interests + ?known as ?sum) | |||
# STYLING # | |||
BIND (if(?interests = 0 && ?known = 0, "FFFFFF", # white | |||
if(?interests = ?known, "DFDFDF", # grey | |||
if(?interests = 1 && ?known = 0, "e3ffd9", # light green | |||
if(?interests = 0 && ?known = 1, "F9DCDF", # light red | |||
if(?interests+1 = ?known, "BECF96", # red+green -> both | |||
if(?interests < ?known, "9FE586", # green, bc. knowledge is "good" :D | |||
if(?interests > ?known, "F0A8AF", # red | |||
"FFFFFF" ))))))) as ?rgb). | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |||
} ORDER BY DESC(?sum) | |||
}} | |||
<span style="background-color:#F0A8AF">'''Interests'''</span> and <span style="background-color:#9FE586">'''knowledge'''</span> are mapped to color and to size. | |||
The '''size''' equals to the sum of interest and knowledge. | |||
A <span style="background-color:#F0A8AF">red</span> node means that '''more''' students are <span style="background-color:#F0A8AF">interested</span> in a topic. | |||
A <span style="background-color:#9FE586">green</span> node means that '''more''' students <span style="background-color:#9FE586">know</span> a topic. | |||
A <span style="background-color:#BECF96">olive</span> node means that '''one more''' student knows a topic than are interested in. | |||
A <span style="background-color:#DFDFDF">gray</span> node meant that the '''same''' amount of students know/are interested in a topic |
Revision as of 13:45, 7 May 2024
Contains queries about the graph of the "CGBV SS24" course to help debug and structure it.
All Sessions
Returns a graph containing all sessions included in the course, as well as all included topics.
All Categories
Returns a graph with all categories included in the course. See the query here
Indegrees
Returns a graph that uses the indegrees to size items. I.e. the size of a node depends on how many prerequisites it has.
Nodes that aren't cicles are items, that are linked to course-items, but are themselves not included in the course.Items
Orphans
Unlinked Items | No dependencies |
---|---|
Link to the query | Link to the query |
Resources
All Resources
Returns a table with all resources that are linked to from inside the course.
Items used: CGBV 24SS (Q932)
Properties used: includes (P14), resource (P21), url (P20), instance of (P3)
#defaultView:Table
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>
SELECT DISTINCT ?item ?itemLabel ?resource ?resourceLabel ?alias ?url ?type ?typeLabel # ?resLabelLength
WHERE {
wd:Q932 wdt:P14/wdt:P14 ?item.
?item wdt:P21 ?resource.
OPTIONAL {?resource wdt:P20 ?link.
BIND("true" as ?url) }
OPTIONAL {?resource wdt:P3 ?type.}
OPTIONAL {?resource skos:altLabel ?alias.}
service wikibase:label { bd:serviceParam wikibase:language "en" }
} ORDER BY ASC(?resourceLabel)
Items without Resources
Returns a table with all items in the CGBV 24SS course, that don't link to a resource.
"Interests" and "Knowledge"
✒️ Note: The plot doesn't really show overlapping points
Alternative Visualization
Interests and knowledge are mapped to color and to size. The size equals to the sum of interest and knowledge.A red node means that more students are interested in a topic. A green node means that more students know a topic.
A olive node means that one more student knows a topic than are interested in.
A gray node meant that the same amount of students know/are interested in a topic