GraphStructure: Difference between revisions

(added: Properties)
(→‎Category: change default query to table)
 
(28 intermediate revisions by 2 users not shown)
Line 4: Line 4:


= Graph Structure =
= Graph Structure =
== Basic Item ==
 
A basic item describes a ''learning content''. It uses [[Property:P2|subclass of]] to link to a defined [[Item:Q169|Cateogory]], that is used to group topics. Items are linked between each other with [[Property:P1|depends on]] to define an item that defines some previous knowledge, or [[Property:P21|related to]] to link to a similar item. Additionally they link to resources with [[Property:P21|resource]].
[[File:Graph-structure.png|center|748x599px|Simple overview of the graph structure]]
 
== Topic ==
A topic describes a ''learning content''.  
(As most items in the graph are topics, their type/class is not explicitly defined.)
It uses [[Property:P2|subclass of]] to link to a defined [[Item:Q169|Category]], that is used to group topics.  
A [[Property:P1|depends on]] link from one topic to another indicates that the other topic is necessary prerequisite knowledge.
A [[Property:P21|related to]] link indicates a similar topic.  
Additionally for each topic, resources can be associated with [[Property:P21|resource]].


'''A short overview of possible links:'''
'''A short overview of possible links:'''
Line 11: Line 19:
{| class="wikitable" style="margin:auto; text-align:center;"
{| class="wikitable" style="margin:auto; text-align:center;"
|-
|-
| Item || — [[Property:P2|subclass of]] → || [[Item:Q169|Category]]
| Topic || — [[Property:P2|subclass of]] → || [[Item:Q169|Category]]
|-
|-
| Item || — [[Property:P1|depends on]] → || Prerequisite
| Topic || — [[Property:P1|depends on]] → || Prerequisite ''(another item)''
|-
|-
| Item || — [[Property:P4|related to]] → || Equivalent
| Topic || — [[Property:P4|related to]] → || Equivalent ''(another item)''
|-
|-
| Item || — [[Property:P21|resource]] →  || [[Item:Q446|Resource]]
| Topic || — [[Property:P21|resource]] →  || [[Item:Q446|Resource]]
|-
|-
| Item ||  — [[Property:P3|instanc of]] → || [[Item:Q353|Application]]
| Topic ||  — [[Property:P3|instance of]] → || [[Item:Q353|Application]]
|-
|-
|}
|}


Additionally an item can be closer defined by linking an importance-item using [[Property:P13|importance]]. This can be done as simple link or as an added value to a property.
Additionally an item can be defined further by linking an importance-item using [[Property:P13|importance]]. This can be done as simple link or as an added value to a property. See [[#Importance|Section: Importance]]
* [[Item:Q324|Mandatory]]
* [[Item:Q325|Essential]]
* [[Item:Q326|Recommended]]
* [[Item:Q327|Optional]]
 


== Resources ==
== Resources ==
A Resource is an item that is defined by the Properties [[Property:P20|url]] to '''link''' to an external site and [[Property:P3|instance of]] a '''structure-item''', as seen below.  
A Resource is an item that contains a link to some resource (property: [[Property:P20|url]]) hosted on the Wiki or on another platform.
It usually is an [[Property:P3|instance of]] a '''Resource Class''', as seen below.  
{{#widget:SPARQLquery|code=
{{#widget:SPARQLquery|code=
#defaultView:Graph
#defaultView:Graph
Line 41: Line 45:
   ?item wdt:P3 ?category.
   ?item wdt:P3 ?category.
   service wikibase:label { bd:serviceParam wikibase:language "en".}
   service wikibase:label { bd:serviceParam wikibase:language "en".}
}
} |caption=All classes that a resource can be an instance of
}}  
}}  


Line 49: Line 53:
| Resource || — [[Property:P20|url]] → || URL
| Resource || — [[Property:P20|url]] → || URL
|-
|-
| Resource ||  — [[Property:P3|instance of]] → || Structure-Item
| Resource ||  — [[Property:P3|instance of]] → || Resource Class
|-
|-
|}
|}
Line 58: Line 62:
A general category, such as "Mathematical Foundations"; used to group topics.  
A general category, such as "Mathematical Foundations"; used to group topics.  
{{#widget:SPARQLquery|code=
{{#widget:SPARQLquery|code=
#defaultView:Graph
#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 distinct ?item ?itemLabel ?category ?categoryLabel ?edgeLabel
select distinct ?item ?itemLabel ?category ?categoryLabel #?edgeLabel
where {
where {
   bind (wd:Q169 as ?category).
   bind (wd:Q169 as ?category).
Line 76: Line 80:
|}
|}


A Course can include  
== Course of Study ==
This item describes the course of a study path and bundles the set of courses that are included in that path. This is used for example to display the path through a major that a student is enrolled in and what lectures or courses are part of the program.
 
 
A specific Course of Study is declared by making it an [[Property:P3|instance of]] the [[Item:Q464|Course of Study]]-Item and then linking a course to it using the [[Property:P14|includes]]-property.
 
{| class="wikitable" style="margin:auto; text-align:center;"
|-
| Course of Study-Item || — [[Property:P3|instance of]] &rarr; || [[Item:Q464|Course of Study]]
|-
| Course of Study-Item || —  [[Property:P14|includes]] &rarr; || Course-Item
|}
 
 
[[File:Graph-structure-Course.png|right|400px|Connecting items to a course (of study)]]
 
''TODO: example''
 
=== Course ===
A course encompasses a collection of learning contents. To declare an item as a [[Item:Q170|Course]] use [[Property:P3|instance of]]. It is the equivalent of a course officially taught by the university that a student enrolls in.
 
 
Futhermore a course can [[Property:P1|include]] several other items, such as a [[Item:Q427|Session]]-Item, a [[Item:Q169|Category]]-Item or any learning content-Item directly. This structure can later be used to help classify which course an item can belong to.
 
 
The diagram on the left gives a simple illustration of how this graph structure works.


== Course ==
A course encompasses a collection of learning contents. To declare an item as a [[Item:Q170|Course]] use [[Property:P3|instance of]].


'''A short overview:'''
'''A short overview:'''
{| class="wikitable" style="margin:auto; text-align:center;"
{| class="wikitable" style="margin:auto; text-align:center;"
|-
|-
| Course-Item || — [[Property:P3|instance of]] &rarr; || [[Item:Q170|Course]]
| Course || — [[Property:P3|instance of]] &rarr; || [[Item:Q170|Course]]
|-
|-
| Course-Item || — [[Property:P24|taught by]] &rarr; || [[Item:Q168|Educator]]
| Course || — [[Property:P24|taught by]] &rarr; || Educator
|-
|-
| Course-Item || — [[Property:P14|includes]] &rarr; || [[Item:Q427|Session]]
| Course || — [[Property:P14|includes]] &rarr; || Session item
|-
| Course || — [[Property:P14|includes]] &rarr; || Learning Content
|-
| Course || — [[Property:P14|includes]] &rarr; || Category item
|}
|}
See: [[Item:Q170]] as an example.
See: [[Item:Q171]] as an example.
A course can include a [[Item:Q427|Session]], as seen below:
 
{{#widget:SPARQLquery|code=
#defaultView:Timeline
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>
select distinct ?item ?itemLabel ?edgeLabel ?date ?image #?session ?sessionLabel
where {
 
  ?session wdt:P14 ?item.
  MINUS {?item wdt:P20 ?url.}
  MINUS {?session wdt:P3 wd:Q162.}
  OPTIONAL {?item wdt:P11 ?image.}
  ?session wdt:P19 ?date.
 
  service wikibase:label { bd:serviceParam wikibase:language "en".}
}
}}
 
A course can include multiple [[Item:Q427|Session]]s, as seen below.
These may be used to structure the course contents.


=== Session ===
=== Session ===
A [[Item:Q427|Session]] acts as a possibility to group several items that will be discussed during an actual course session.
A [[Item:Q427|Session]] allows grouping multiple items that are discussed within an actual course session.
{{#widget:SPARQLquery|code=
{{#widget:SPARQLquery|code=
#defaultView:Graph
#defaultView:Graph
# via: https://phabricator.wikimedia.org/T168715
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 distinct ?item ?itemLabel ?session ?sessionLabel ?course ?courseLabel ?edgeLabel
select distinct ?item ?itemLabel?rgb ?session ?sessionLabel
where {
where {
    
    
Line 106: Line 155:
   MINUS {?item wdt:P20 ?url.}
   MINUS {?item wdt:P20 ?url.}
   MINUS {?session wdt:P3 wd:Q162.}
   MINUS {?session wdt:P3 wd:Q162.}
   ?property a wikibase:Property;
   MINUS {?session wdt:P3 wd:Q463.}
              wikibase:directClaim wdt:P14.
 
  Optional {
    ?session wdt:P3 ?var.
    bind (if(?var = wd:Q170, "e8fcff", # session (blue) 
          if(?var = wd:Q427 , "f0ffeb", # topics (green)
          "FFFFFF" )) as ?rgb). # course (white)
  }
  service wikibase:label { bd:serviceParam wikibase:language "en".}
} LIMIT 50
|caption=The Sessions and their topics for the CGBV-course
}}


  service wikibase:label { bd:serviceParam wikibase:language "en".
                          ?item rdfs:label ?itemLabel.
                          ?session rdfs:label ?sessionLabel.
                          ?property rdfs:label ?edgeLabel.}
}
}}
See: [[Item:Q248]] as an example.
See: [[Item:Q248]] as an example.


Line 126: Line 179:
| Course-Item || — [[Property:P19|on date]] &rarr; || Date
| Course-Item || — [[Property:P19|on date]] &rarr; || Date
|}
|}
=== Coursework ===
Defines work that is to be done for a course, such as mandatory exercises or exams.
An item is marked as coursework by making it an [[Property:P3|instance of]] [[Item:Q464|Coursework]].
It can be used to create a [[Template:Learning Path]] using syntax like: <pre>{{Learning Path|quiz=wd:Q451}}.</pre>
'''A short overview:'''
{| class="wikitable" style="margin:auto; text-align:center;"
|-
| Course Work-Item || — [[Property:P20|url]] &rarr; || URL
|-
| Course Work-Item || — [[Property:P3|instance of]] &rarr; || [[Item:Q464|Course Work]]
|-
| Course Work-Item || — [[Property:P13|importance]] &rarr; || [[#Importance|Importance]]-Item
|-
| Course Work-Item || — [[Property:P14|includes]] &rarr; || Item
|-
| Course Work-Item || — [[Property:P26|language]] &rarr; || Language-Item
|-
|}
See: [[Item:Q451]] as an example.


== People ==
== People ==
Line 143: Line 218:
|-
|-
|}
|}
See: [[Item:Q315]] as an example.
See: [[Item:Q157]] as an example.
{{#widget:SPARQLquery|code=
{{#widget:SPARQLquery|code=
#defaultView:Graph
#defaultView:Graph
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 distinct ?item ?itemLabel ?interest ?interestLabel ?complete ?completeLabel ?edgeLabel ?edgeLabel2
 
where {
SELECT ?item1 ?image ?item1Label ?item2 ?image2 ?item2Label ?edgeLabel ?rgb WHERE {
  VALUES ?item1 {wd:Q157}
    
    
   bind (wd:Q315 as ?item).
   ?item1 ?prop ?item2.
   ?item wdt:P3 ?category.
   ?edge ?dummy ?prop ; rdf:type wikibase:Property.
   ?item wdt:P23 ?interest.
 
  ?item wdt:P12 ?complete.
   # Color Coding:
    bind (if(?prop = wdt:P25, "e8fcff", # participates in (blue)  f3fdff
          if(?prop = wdt:P12, "e3ffd9", # has completed (green)
          if(?prop = wdt:P23, "ffeec2", # interested in (orange)
      "FFFFFF" ))) as ?rgb).
    
    
  ?property a wikibase:Property;
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
          wikibase:directClaim wdt:P23.
} ORDER BY ?prop
 
  service wikibase:label { bd:serviceParam wikibase:language "en".
                          ?item rdfs:label ?itemLabel.
                          ?interest rdfs:label ?interestLabel.
                          ?complete rdfs:label ?completeLabel.
                          ?property rdfs:label ?edgeLabel.
                        }
}  
}}
}}
NOTE: Query currently only shows one property label, the other would be "has completed".


=== Educator ===
=== Educator ===
The role of an educator is declared by linking from an item to [[Item:Q168|Educator]] using [[Property:P3|instance of]].
The role of an educator is declared by linking from an item to [[Item:Q168|Educator]] using [[Property:P3|instance of]].
See: [[Item:Q158]] as an example.
== Importance ==
An items that describes an importance to learn a learning content. It's linked to using [[Property:P13|importance]].
{| class="wikitable" style="margin:auto; text-align:center;"
|-
| Item || — [[Property:P13|importance]] &rarr; || [[Item:Q324|Mandatory]]
|-
| Item || — [[Property:P13|importance]] &rarr; || [[Item:Q325|Essential]]
|-
| Item || — [[Property:P13|importance]] &rarr; || [[Item:Q326|Recommended]]
|-
| Item ||— [[Property:P13|importance]] &rarr; || [[Item:Q327|Optional]]
|-
|}


-----
-----
Line 191: Line 278:
|-
|-
| [[Property:P14]] || includes || Making a list of items || Learning Contents, Sessions
| [[Property:P14]] || includes || Making a list of items || Learning Contents, Sessions
|-
| [[Property:P37]] || properties for this type || List of properties that apply || Property
|-
|-
|
|
Line 198: Line 287:
| [[Property:P20]] || url || save a URL || URL  
| [[Property:P20]] || url || save a URL || URL  
|-
|-
| [[Property:P11]] || image || declare images for items || Image  
| [[Property:P11]] || image || declare images for items || Image (from Wikimedia Commons)
|-
|-
|
|
Line 228: Line 317:
| [[Property:P26]] || language || Declare the language || Items
| [[Property:P26]] || language || Declare the language || Items
|-
|-
|}




|}
Items using '''[[Property:P37|property for this type]]''' and what properties they link to:
 
{{#widget:SPARQLquery|code=
#defaultView:Graph
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>
select distinct ?item ?itemLabel ?property ?propertyLabel ?rgb ?shape
where {
  ?item wdt:P37 ?property.
  BIND("box" as ?shape).
  BIND("E0EFFF" as ?rgb).
  service wikibase:label { bd:serviceParam wikibase:language "en".}
}
}}


= Useful Pages =
= Useful Pages =
* [[DebugQueries]]
* [[DebugQueries]]
* [https://query.graphit.ur.de/| Query Service]
* [https://query.graphit.ur.de/| Query Service]

Latest revision as of 09:02, 29 October 2024

A Documentation of the structure behind the Graph.

Graph Structure

Simple overview of the graph structure

Topic

A topic describes a learning content. (As most items in the graph are topics, their type/class is not explicitly defined.) It uses subclass of to link to a defined Category, that is used to group topics. A depends on link from one topic to another indicates that the other topic is necessary prerequisite knowledge. A related to link indicates a similar topic. Additionally for each topic, resources can be associated with resource.

A short overview of possible links:

Topic subclass of Category
Topic depends on Prerequisite (another item)
Topic related to Equivalent (another item)
Topic resource Resource
Topic instance of Application

Additionally an item can be defined further by linking an importance-item using importance. This can be done as simple link or as an added value to a property. See Section: Importance

Resources

A Resource is an item that contains a link to some resource (property: url) hosted on the Wiki or on another platform. It usually is an instance of a Resource Class, as seen below.

All classes that a resource can be an instance of

A short overview:

Resource url URL
Resource instance of Resource Class

See: Item:Q280 as an example and Resource to reference a dummy element

Category

A general category, such as "Mathematical Foundations"; used to group topics.

A short overview:

Category-Item instance of Category

Course of Study

This item describes the course of a study path and bundles the set of courses that are included in that path. This is used for example to display the path through a major that a student is enrolled in and what lectures or courses are part of the program.


A specific Course of Study is declared by making it an instance of the Course of Study-Item and then linking a course to it using the includes-property.

Course of Study-Item instance of Course of Study
Course of Study-Item includes Course-Item


Connecting items to a course (of study)

TODO: example

Course

A course encompasses a collection of learning contents. To declare an item as a Course use instance of. It is the equivalent of a course officially taught by the university that a student enrolls in.


Futhermore a course can include several other items, such as a Session-Item, a Category-Item or any learning content-Item directly. This structure can later be used to help classify which course an item can belong to.


The diagram on the left gives a simple illustration of how this graph structure works.


A short overview:

Course instance of Course
Course taught by Educator
Course includes Session item
Course includes Learning Content
Course includes Category item

See: Item:Q171 as an example.

A course can include multiple Sessions, as seen below. These may be used to structure the course contents.

Session

A Session allows grouping multiple items that are discussed within an actual course session.

The Sessions and their topics for the CGBV-course

See: Item:Q248 as an example.

A short overview:

Session-Item instance of Session
Session-Item includes Item
Course-Item on date Date

Coursework

Defines work that is to be done for a course, such as mandatory exercises or exams. An item is marked as coursework by making it an instance of Coursework.

It can be used to create a Template:Learning Path using syntax like:

{{Learning Path|quiz=wd:Q451}}.

A short overview:

Course Work-Item url URL
Course Work-Item instance of Course Work
Course Work-Item importance Importance-Item
Course Work-Item includes Item
Course Work-Item language Language-Item

See: Item:Q451 as an example.

People

Student

The role of a student is declared by linking from an item to Student using instance of. The student then can link their item to others using interested in and has completed to organize their interests and progress.

A short overview:

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

See: Item:Q157 as an example.

Educator

The role of an educator is declared by linking from an item to Educator using instance of.

See: Item:Q158 as an example.

Importance

An items that describes an importance to learn a learning content. It's linked to using importance.

Item importance Mandatory
Item importance Essential
Item importance Recommended
Item importance Optional

Properties

List of Properties

Important Properties:

Property Name Used for Links to →
Property:P1 depends on Prerequisites Learning contents
Property:P2 subclass of Grouping items into Topics Categories
Property:P3 instance of Abstract Classes Category
Property:P4 related to Equivalents Learning contents
Property:P14 includes Making a list of items Learning Contents, Sessions
Property:P37 properties for this type List of properties that apply Property
Property:P21 resource Link to a resource Resources
Property:P20 url save a URL URL
Property:P11 image declare images for items Image (from Wikimedia Commons)
Property:P12 has completed Completion Learning Contents, (Sessions, Courses)
Property:P23 interested in Declare interests Learning contents
Property:P25 participates in Participation Courses, Sessions
Property:P13 importance Declaring importance Learning contents
Property:P16 created by Author Person
Property:P17 modified by Author Person
Property:P22 certified by Author Educator
Property:P24 taught by Author Educator
Property:P19 on date Timeliness Date
Property:P15 comment Note something String
Property:P26 language Declare the language Items


Items using property for this type and what properties they link to:

Useful Pages