Get all classes, individuals, and properties in repository

Skip to first unread message

Reid Yoder

May 10, 2020, 4:52:40 PM5/10/20
to semanticturkey-developer

Basically I am adding a portal button inside vocbench, that, when clicked, will open a new tab and take you to a different application (unrelated to vocbench or semantic turkey). When the button is clicked, I want to retrieve all of the classes, individuals, and properties from the opened repository in vocbench and send them along with the http GET request, as well as their labels (basically three maps formatted like: uri -> label). But I am not sure how to do this. I have looked through the,, and files in the st-core-services module, but I don't see any general "getAllClasses()", "getAllProperties()" etc. methods. I'm also not sure how I would invoke such methods in the javascript that gets triggered when the button is pressed.

I also want to note that I don't just want the data from the main user-created namespace; I want all of the classes, individuals, and properties from the imports as well. Basically everything you see in vocbench's "data" section.

Anything to point me in the right direction is appreciated.

- Reid

Manuel Fiorelli

May 13, 2020, 2:42:06 PM5/13/20
Hi Reid,

I think that there is no service returning all classes, properties, individuals, etc. Actually, we try to avoid such services for the fear of returning too much results if the repository is huge. For example, the trees are compute on-the-fly as each node is expanded by the user.

If you really need this information (assuming you know that it is manageable), a possible workaround is to invoke the service SPARQL.evaluateQuery ( specifying a custom SPARQL query. Please note that you should manage the retrieval of the "labels" yourself.

Concerning the UI,  I'm not definitely an expert. However, generally speaking, known services are exposed as a Angular services which they can be like a function call. For example, here the client invokes the getNarrowerConcepts service:

Here is the definition of the service:

The implementation of the service internally use an HttpManager, which composes the HTTP request based on the provided arguments, service name, etc.. while adding (on its own) contextual parameters (e.g. the context project) and the service base URI.


Hai ricevuto questo messaggio perché sei iscritto al gruppo "semanticturkey-developer" di Google Gruppi.
Per annullare l'iscrizione a questo gruppo e non ricevere più le sue email, invia un'email a
Per visualizzare questa discussione sul Web, visita

Manuel Fiorelli
Reply all
Reply to author
0 new messages