Graph Statistics: Difference between revisions
m (→OutDegree of Item: added specification, that the query uses P1) |
(→Simple Metrics: added InDegree of Item) |
||
Line 36: | Line 36: | ||
}} | }} | ||
''Make inline'' | ''Make inline'' | ||
== InDegree of Item == | |||
Gives back the indegree (=all dependencies (P1) going '''in''' to a node) of a specific item. | |||
{{SPARQL2|query= | |||
#defaultView:Table | |||
PREFIX wd: <https://graphit.ur.de/entity/> | |||
PREFIX wdt: <https://graphit.ur.de/prop/direct/> | |||
Select ?item ?itemLabel (count(DISTINCT ?inItem) as ?inDegree) | |||
WHERE { | |||
BIND (wd:Q93 as ?item). | |||
OPTIONAL {?inItem wdt:P1 ?item.} | |||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | |||
} | |||
group by ?item ?itemLabel LIMIT 10 | |||
}} | |||
''Change harcoded item to parameter'' | |||
== OutDegree of Item == | == OutDegree of Item == |
Revision as of 13:07, 27 November 2023
A page to help show the structure of the graph using metrics and statistics. For similar pages reference:
Simple Metrics
ItemCount
Gives a count of all items in the Wikibase-instance. Items used: Student (Q167)
Properties used: instance of (P3)
#defaultView:Table
PREFIX wd: <https://graphit.ur.de/entity>
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
SELECT (COUNT(*) as ?items)
WHERE {
# items that have 0+ statements
?item wikibase:statements ?s.
MINUS{ ?item a wikibase:Property } # Filter out properties
MINUS{ ?item wdt:P3 wd:Q167 } # Filter out students
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} LIMIT 25
Make inline
PropertyCount
Gives a count of all properties in the Wikibase-instance
#defaultView:Table
PREFIX wd: <https://graphit.ur.de/entity>
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
SELECT (COUNT(*) as ?property)
WHERE {
?property a wikibase:Property.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} LIMIT 28
Make inline
InDegree of Item
Gives back the indegree (=all dependencies (P1) going in to a node) of a specific item.
Items used: Matrix Multiplication (Q93)
Properties used: depends on (P1)
#defaultView:Table
PREFIX wd: <https://graphit.ur.de/entity/>
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
Select ?item ?itemLabel (count(DISTINCT ?inItem) as ?inDegree)
WHERE {
BIND (wd:Q93 as ?item).
OPTIONAL {?inItem wdt:P1 ?item.}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
group by ?item ?itemLabel LIMIT 10
Change harcoded item to parameter
OutDegree of Item
Gives back the outdegree (= all dependencies (P1) going out of a node) of a specific item.
Items used: Radiosity (Q113)
Properties used: depends on (P1)
#defaultView:Table
PREFIX wd: <https://graphit.ur.de/entity/>
PREFIX wdt: <https://graphit.ur.de/prop/direct/>
Select ?item ?itemLabel (count(DISTINCT ?outItem) as ?outDegree)
WHERE {
BIND (wd:Q113 as ?item).
OPTIONAL {?item wdt:P1 ?outItem.} # replace wdt:P1 with ?p to get ALL "outItems"
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
group by ?item ?itemLabel LIMIT 10
Change harcoded item to parameter