Courses/CGBV SS24/Graph: Difference between revisions
(→Resources: add query) |
(→Resources: update with second query) |
||
Line 33: | Line 33: | ||
== Items == | == Items == | ||
=== Resources === | === Resources === | ||
==== All Resources ==== | |||
Returns a table with all resources that are linked to from inside the course. | Returns a table with all resources that are linked to from inside the course. | ||
{{ | |||
{{SPARQL2|query= | |||
#defaultView:Table | #defaultView:Table | ||
PREFIX wdt: <https://graphit.ur.de/prop/direct/> | PREFIX wdt: <https://graphit.ur.de/prop/direct/> | ||
Line 50: | Line 52: | ||
service wikibase:label { bd:serviceParam wikibase:language "en" } | service wikibase:label { bd:serviceParam wikibase:language "en" } | ||
} ORDER BY ASC(?resourceLabel) | } 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. | |||
{{#widget:SPARQLquery|code= | |||
#All CGBV-SS24 Items with no linked resources | |||
#defaultView:Table | |||
PREFIX wdt: <https://graphit.ur.de/prop/direct/> | |||
PREFIX wd: <https://graphit.ur.de/entity/> | |||
SELECT DISTINCT ?item ?itemLabel ?resource ?resourceLabel | |||
WHERE { | |||
wd:Q932 wdt:P14/wdt:P14 ?item. # select al course items | |||
MINUS {?item wdt:P21 ?resource.} # remove all with resources | |||
service wikibase:label { bd:serviceParam wikibase:language "en". } | |||
} | |||
}} | }} |
Revision as of 07:15, 3 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 included in the course. See the query here
Items
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.