Jump to content

ExampleStudent: Difference between revisions

Leonie (talk | contribs)
m →A Student: update
Leonie (talk | contribs)
added: Completed Items
Line 13: Line 13:




The item itself needs '''further specifications''', such as a declaration that it is an [[Property:P3|instance of]] the [[Item:Q167|Student]]-Item, which course a student [[Property:P25|participates in]], and what items a student is [[Property:P23|interested in]] or [[Property:P12|has completed]]. As seen below:
The item itself needs '''further specifications''', such as a declaration that it is an [[Property:P3|instance of]] the [[Item:Q167|Student]]-Item, which course a student [[Property:P25|participates in]], and what items a student is [[Property:P23|interested in]] or [[Property:P12|has completed]].


{| class="wikitable" style="margin:auto; text-align:center;"
{| class="wikitable" style="margin:auto; text-align:center;"
| <Name> || — [[Property:P3|instance of]] &rarr; || [[Item:Q167|Student]]
| Student-Item || — [[Property:P3|instance of]] &rarr; || [[Item:Q167|Student]]
|-
|-
| Student-Item || — [[Property:P23|interested in]] &rarr; || Item
| Student-Item || — [[Property:P23|interested in]] &rarr; || Item
Line 67: Line 67:
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?prop
} ORDER BY ?prop
}}
== Completed Items ==
Returns all items, that have been completed. And shows those who have been completed on a specified date in a timeline. (The rest is visible via the table-option of the graph widget.)
{{#widget:SPARQLquery|code=
#defaultView:Timeline
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 ?topic ?topicLabel ?image ?date WHERE {
  BIND(wd:Q157 as ?user).
  ?user p:P12 ?statement.
  ?statement ps:P12 ?topic.
  OPTIONAL {?statement pq:P19 ?date.}
  OPTIONAL {?topic wdt:P11 ?image.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}}
}}


Line 107: Line 128:
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?prop
} ORDER BY ?prop
}}
== Completed Items ==
{{SPARQL2|query=
#defaultView:Timeline
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 ?topic ?topicLabel ?image ?date WHERE {
  BIND(wd:Q157 as ?user).
  ?user p:P12 ?statement.
  ?statement ps:P12 ?topic.
  OPTIONAL {?statement pq:P19 ?date.}
  OPTIONAL {?topic wdt:P11 ?image.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}}
}}

Revision as of 15:19, 19 September 2023

This is an examplatory page for student Max Mustermann's course of study. Max Mustermann is a prototype of a student-item and can be used to view a possible approach to use GraphIT.

A Student

A Student in the graph is defined as an item, that uses a students name or prefered alias/nickname as a label, as seen below.

Language Label Description
English <Name> Student at University of Regensburg (<Name>)


The item itself needs further specifications, such as a declaration that it is an instance of the Student-Item, which course a student participates in, and what items a student is interested in or has completed.

Student-Item — instance of → Student
Student-Item — interested in → Item
Student-Item — has completed → Item
Student-Item — participates in → Course, Session

Using the Graph

Here are visual examples of how Max uses the graph. All used queries are made accessible in the next section.

A complete overview

Returns an entire overview of all items connected to Max. {{#widget:SPARQLquery|code=

  1. defaultView:Graph

PREFIX wdt: <https://graphit.ur.de/prop/direct/> PREFIX wd: <https://graphit.ur.de/entity/>

SELECT ?item1 ?image ?item1Label ?item2 ?image2 ?item2Label ?edgeLabel WHERE {

 VALUES ?item1 {wd:Q157}
 
 ?item1 ?prop ?item2.
 ?edge ?dummy ?prop ; rdf:type wikibase:Property 
 

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?prop }}.

Learnpath to interests

Returns the immediate dependencies for all items that Max is interested in. {{#widget:SPARQLquery|code=

  1. defaultView:Graph

PREFIX wdt: <https://graphit.ur.de/prop/direct/> PREFIX wd: <https://graphit.ur.de/entity/>

SELECT DISTINCT #?item1 ?item1Label ?edgeLabel ?item2 ?item2Label ?dependency ?dependencyLabel ?item2 ?item2Label ?dependency ?dependencyLabel ?item1 ?item1Label ?edgeLabel WHERE {

 VALUES ?item1 {wd:Q157}
 VALUES ?prop {wdt:P23}
 ?item1 ?prop ?item2.
 # Select all dependencies for every item2
 OPTIONAL {?item2 wdt:P1 ?dependency.}
 ?edge ?dummy ?prop ; rdf:type wikibase:Property. # edge labels
 

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?prop }}

Completed Items

Returns all items, that have been completed. And shows those who have been completed on a specified date in a timeline. (The rest is visible via the table-option of the graph widget.) {{#widget:SPARQLquery|code=

  1. defaultView:Timeline

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 ?topic ?topicLabel ?image ?date WHERE {

 BIND(wd:Q157 as ?user).
 ?user p:P12 ?statement.
 ?statement ps:P12 ?topic.
 OPTIONAL {?statement pq:P19 ?date.}
 OPTIONAL {?topic wdt:P11 ?image.}
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

} }}

Using the Graph yourself

If you want to visualize your own usage of the graph, try the queries down below. After clicking Try it all you need to do is swap out the Item: Q157 with your own item's number Q... and query the graph (or press CTRL+ENTER).


A complete overview

{{#if: Max Mustermann (Q157) | Items used: Max Mustermann (Q157) | }}

{{#if: | Properties used: | }}

{{#if:|
{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX p: <https://graphit.ur.de/prop/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX p: <https://graphit.ur.de/prop/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX q: <https://graphit.ur.de/prop/qualifier/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX q: <https://graphit.ur.de/prop/qualifier/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX v: <https://graphit.ur.de/prop/statement/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX v: <https://graphit.ur.de/prop/statement/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
|}}}}
}}#defaultView:Graph
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>

SELECT ?item1 ?image ?item1Label ?item2 ?image2 ?item2Label ?edgeLabel WHERE {
  VALUES ?item1 {wd:Q157}
  
  ?item1 ?prop ?item2.
  ?edge ?dummy ?prop ; rdf:type wikibase:Property 
  
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?prop

Try it!

.


Learnpath to interests

{{#if: Max Mustermann (Q157) | Items used: Max Mustermann (Q157) | }}

{{#if: interested in (P23), depends on (P1) | Properties used: interested in (P23), depends on (P1) | }}

{{#if:|
{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX p: <https://graphit.ur.de/prop/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX p: <https://graphit.ur.de/prop/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX q: <https://graphit.ur.de/prop/qualifier/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX q: <https://graphit.ur.de/prop/qualifier/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX v: <https://graphit.ur.de/prop/statement/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX v: <https://graphit.ur.de/prop/statement/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
|}}}}
}}#defaultView:Graph
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>

SELECT DISTINCT ?item2 ?item2Label ?dependency ?dependencyLabel ?item1 ?item1Label ?edgeLabel
WHERE {
  VALUES ?item1 {wd:Q157}
  VALUES ?prop {wdt:P23}
  ?item1 ?prop ?item2.
  OPTIONAL {?item2 wdt:P1 ?dependency.} # Select first dependencies
  ?edge ?dummy ?prop ; rdf:type wikibase:Property. # edge labels
  
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?prop

Try it!


Completed Items

{{#if: Max Mustermann (Q157) | Items used: Max Mustermann (Q157) | }}

{{#if: image (P11), has completed (P12), on date (P19) | Properties used: image (P11), has completed (P12), on date (P19) | }}

{{#if:|
{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX p: <https://graphit.ur.de/prop/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX p: <https://graphit.ur.de/prop/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX q: <https://graphit.ur.de/prop/qualifier/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX q: <https://graphit.ur.de/prop/qualifier/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
PREFIX v: <https://graphit.ur.de/prop/statement/>|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
PREFIX v: <https://graphit.ur.de/prop/statement/>|}}}}{{ safesubst:p{{ safesubst:#ifeq:|eq|1|2}}|{{ safesubst:p{{ safesubst:#ifeq:|
|1|2}}||}}|{{ safesubst:p{{ safesubst:#if:|1|2}}|
|}}}}
}}#defaultView:Timeline
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 ?topic ?topicLabel ?image ?date WHERE {
  BIND(wd:Q157 as ?user).
  ?user p:P12 ?statement.
  ?statement ps:P12 ?topic.
  OPTIONAL {?statement pq:P19 ?date.}
  OPTIONAL {?topic wdt:P11 ?image.}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Try it!