Template

Userpage: Difference between revisions

(fix query (optional) + add legend)
(update queries)
Line 6: Line 6:
{{#widget:SPARQLquery|code=
{{#widget:SPARQLquery|code=
#defaultView:Graph
#defaultView:Graph
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>
SELECT ?student ?studentLabel ?item ?itemLabel ?edgeLabel ?rgb1 ?shape1 WHERE {
  BIND (wd:{{{2|Q157}}} as ?student)
  ?student ?prop ?item.
  # ?edge ?dummy ?prop ; rdf:type wikibase:Property.
  MINUS {?student wdt:P3 ?item}. # remove self-reference
  # 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 ?rgb1).
    bind("ellipse" as ?shape1).
 
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} LIMIT 100
|caption=An Overview of (all) linked items for {{{1|Max Mustermann}}}
}}
{| class="wikitable"
! '''Interested Items''' !! '''Completed Items'''
|-
<!-- Linke Spalte -->
| style="width: 50%" | {{#widget:SPARQLquery|code=
#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  
SELECT DISTINCT  
?student ?studentLabel ?shape
?interest ?interestLabel  
?interest ?interestLabel ?rgb1
?complete ?completeLabel ?rgb2
WHERE {
WHERE {
   BIND (wd:{{{2|Q157}}} as ?student).
   BIND (wd:{{{2|Q157}}} as ?student).
    
   ?student wdt:P23 ?interest.
  OPTIONAL {?student wdt:P23 ?interest.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL {?student wdt:P12 ?complete.}
}
 
|height=30vh
  BIND ("box" as ?shape).
}}
  BIND ("ffeec2" as ?rgb1).
<!-- Rechte Spalte -->
  BIND ("e3ffd9" as ?rgb2).
| style="width: 50%" | {{#widget:SPARQLquery|code=
#defaultView:Table
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
PREFIX wd: <https://graphit.ur.de/entity/>


SELECT DISTINCT
?complete ?completeLabel
WHERE {
  BIND (wd:{{{2|Q157}}} as ?student).
  ?student wdt:P12 ?complete.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} |caption=An overview of all linked items for {{{1|Max Mustermann}}}
}
|height=30vh
}}
}}
This query shows:
|}
* The  <span style="background-color:#e3ffd9">items</span> that you have [[Property:P12|completed]].
 
* The <span style="background-color:#ffeec2">items</span> that you are [[Property:P23|interested in]].




<noinclude>
<noinclude>
Autmatically included in a somebodies Userpage via a sign-in script
* param 1 == Username
* param 1 == Username
* param 2 == QID
* param 2 == QID
</noinclude>
</noinclude>

Revision as of 12:56, 27 November 2024

This is the user page for {{{1}}}.

The user's node (Item) in the graph is [[Item:{{{2}}}]]


An Overview of (all) linked items for Max Mustermann


Interested Items Completed Items



Autmatically included in a somebodies Userpage via a sign-in script

  • param 1 == Username
  • param 2 == QID