MaRDI4NFDI / portal-compose

docker-composer repo for mardi
https://portal.mardi4nfdi.de
GNU General Public License v3.0
3 stars 1 forks source link

Counter mit Link unterlegen #529

Closed physikerwelt closed 1 month ago

physikerwelt commented 1 month ago

Describe the issue

The counters just present values. To understand what was counted the things should be clickable.

physikerwelt commented 1 month ago

This is somehow done. However one needs to manually remove the select count. I think this can be a good entry point for people to learn SPARQL but maybe the we should improve the UI to help people editing queries

physikerwelt commented 1 month ago

cc @Daniel-Mietchen @timconrad

timconrad commented 1 month ago

Ich hatte da verstanden, dass die tatsaechlichen Eintraege angezeigt werden sollen - nicht die "Zahl". Aber das kann man ja leicht in der SPARQL Abfrage aendern, oder? )(Dann muss da natuerlich ein LIMIT rein)

physikerwelt commented 1 month ago

@Daniel-Mietchen do you know a more efficient way to compute the labels

PREFIX wdt: <https://portal.mardi4nfdi.de/prop/direct/>
PREFIX wd: <https://portal.mardi4nfdi.de/entity/>
SELECT ?itemLabel ?value ?item # Replace with (COUNT(*) as ?cnt) to get the count
WHERE {   ?item ?p ?value  .
         SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
   } }
LIMIT 50 # Remove this line to get the counts

times out whereas

PREFIX wdt: <https://portal.mardi4nfdi.de/prop/direct/>
PREFIX wd: <https://portal.mardi4nfdi.de/entity/>
SELECT ?itemLabel ?value ?item # Replace with (COUNT(*) as ?cnt) to get the count
WHERE {   ?item ?p ?value  }
LIMIT 50 # Remove this line to get the counts

computes in 0.1s

physikerwelt commented 1 month ago

Besides the label, I think this is done. See https://portal.mardi4nfdi.de/w/index.php?title=Template%3AStatisticsRow&diff=34162067&oldid=9909283 for the implementation

Daniel-Mietchen commented 1 month ago

@Daniel-Mietchen do you know a more efficient way to compute the labels

PREFIX wdt: <https://portal.mardi4nfdi.de/prop/direct/>
PREFIX wd: <https://portal.mardi4nfdi.de/entity/>
SELECT ?itemLabel ?value ?item # Replace with (COUNT(*) as ?cnt) to get the count
WHERE {   ?item ?p ?value  .
         SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
   } }
LIMIT 50 # Remove this line to get the counts

times out whereas

PREFIX wdt: <https://portal.mardi4nfdi.de/prop/direct/>
PREFIX wd: <https://portal.mardi4nfdi.de/entity/>
SELECT ?itemLabel ?value ?item # Replace with (COUNT(*) as ?cnt) to get the count
WHERE {   ?item ?p ?value  }
LIMIT 50 # Remove this line to get the counts

computes in 0.1s

@physikerwelt Perhaps https://portal.mardi4nfdi.de/w/index.php?title=Template%3AStatisticsRow&diff=34172316&oldid=34162067 is what you're after?

physikerwelt commented 1 month ago

Thank you. Works perfect.