Courses/CGBV SS24/Graph: Difference between revisions

(→‎Items: add orphan query)
Line 34: Line 34:


=== Orphans ===
=== Orphans ===
Returns all items included in the course, that don't depend on other items and aren't depended on by other items.
 
{{#widget:SPARQLquery|code=
<!-- Floated Table that contains both orphan queries(32.5em)-->
{| class="wikitable"
! '''Unlinked Items''' !! '''No dependencies'''
|-
<!-- Linke Spalte -->
| style="width: 50%" | {{#widget:SPARQLquery|code=
# All items that don't link to another item (no dependency)
# All items that don't link to another item (no dependency)
#defaultView:Table
#defaultView:Table
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>
PREFIX wd: <https://graphit.ur.de/entity/>
SELECT ?source ?sourceLabel ?dependency  
SELECT DISTINCT ?item ?itemLabel # ?dependency  
WHERE {
WHERE {


   wd:Q932 wdt:P14/wdt:P14 ?source.
   wd:Q932 wdt:P14/wdt:P14 ?item.
    
    
   MINUS {?dependency wdt:P1 ?source}. # Remove all items that have the ?source as a dependency
   MINUS {?dependency wdt:P1 ?item}. # Remove all items that have the ?source as a dependency
   MINUS {?source wdt:P1 ?dependency}. # Remove all ?source's that have a dependency
   MINUS {?item wdt:P1 ?dependency}. # Remove all ?source's that have a dependency
 
  service wikibase:label { bd:serviceParam wikibase:language "en" }
}
|caption=Items that don't depend on and aren't depended on
|height=25vh
}}
<!-- Rechte Spalte -->
| style="width: 50%" | {{#widget:SPARQLquery|code=
#defaultView:Table
# sources that don't -depend-on-> other item
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>
SELECT DISTINCT ?item ?itemLabel # ?dependency
WHERE {
 
  wd:Q932 wdt:P14/wdt:P14 ?item.
  MINUS {?item wdt:P1 ?dependency.}
    
    
   service wikibase:label { bd:serviceParam wikibase:language "en" }
   service wikibase:label { bd:serviceParam wikibase:language "en" }
}
}
|caption=Items that don't depend on other items
|height=25vh
}}
}}
|-
<!-- Linke Spalte -->
| [https://tinyurl.com/2aryewso Link to the query]
<!-- Rechte Spalte -->
| [https://tinyurl.com/2c2sm43y Link to the query]
|}


=== Resources ===
=== Resources ===

Revision as of 07:36, 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 existing CGBV SS24 sessions with included topics

All Categories

Returns a graph with all categories included in the course. See the query here

Items

Orphans

Unlinked Items No dependencies

Items that don't depend on and aren't depended on

Items that don't depend on other items

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)

Try it!


Items without Resources

Returns a table with all items in the CGBV 24SS course, that don't link to a resource.