Jump to content

Template:Userpage: Difference between revisions

Leonie (talk | contribs)
add user graph (test)
Leonie (talk | contribs)
fix query
Line 9: Line 9:
PREFIX wd: <https://graphit.ur.de/entity/>
PREFIX wd: <https://graphit.ur.de/entity/>


SELECT ?item1 ?image ?item1Label ?item2 ?image2 ?item2Label ?edgeLabel ?rgb1 ?shape1 WHERE {
SELECT DISTINCT
   ?item1 rdfs:label wd:{{{2|Q157}}}.
?student ?studentLabel ?shape
?interest ?interestLabel ?rgb1
?complete ?completeLabel ?rgb2
WHERE {
   BIND (wd:{{{2|Q157}}} as ?student).
    
    
   ?item1 ?prop ?item2.
   ?student wdt:P23 ?interest.
   #?edge ?dummy ?prop ; rdf:type wikibase:Property.
   ?student wdt:P12 ?complete.
    
    
   MINUS {?item wdt:P3 ?item2}.
   BIND ("box" as ?shape).
  BIND ("ffeec2" as ?rgb1).
  BIND ("e3ffd9" as ?rgb2).


  # 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". }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} |caption=An overview of all linked items for {{{1|Max Mustermann}}}
} |caption=An overview of all linked items for {{{1|Max Mustermann}}}

Revision as of 12:41, 27 November 2024

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

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


{{#widget:SPARQLquery|code=

  1. defaultView:Graph

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

SELECT DISTINCT ?student ?studentLabel ?shape ?interest ?interestLabel ?rgb1 ?complete ?completeLabel ?rgb2 WHERE {

 BIND (wd:Q157 as ?student).
 
 ?student wdt:P23 ?interest.
 ?student wdt:P12 ?complete.
 
 BIND ("box" as ?shape).
 BIND ("ffeec2" as ?rgb1).
 BIND ("e3ffd9" as ?rgb2).

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } |caption=An overview of all linked items for Max Mustermann }}


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