How to get number of items made by count function ?

5 views
Skip to first unread message

Jacek Grzebyta

unread,
Jun 22, 2017, 7:59:57 AM6/22/17
to linked-data-api-discuss
Hi,

In elda I need to display number of classes instances. I added to api:ListEndpoint following selector:


resource:countAll a api:Selector ;
  api:where """select ?item ?itemNumber where {
           ?item rdfs:label ?label .
           {
              select ?item (count(*) as ?itemNumber) where {
              [] a ?item
              } group by ?item }
           }""" .


Now is it possible to restore value of ?itemNumber and display it? Adding itemNumber into a viewer does not work.
I defined itemNumber so elda knows about existance of it:

resource:itemNumber api:name "itemNumber"
   ; a rdf:Property
   ; api:label "itemNumber"
   ; rdfs:range xsd:int .


Thanks a lot,
Jacek
Reply all
Reply to author
Forward
0 new messages