Get all classes, individuals, and properties in repository

8 views
Skip to first unread message

Reid Yoder

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

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 Classes.java, Individuals.java, and Properties.java 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

unread,
May 13, 2020, 2:42:06 PM5/13/20
to semanticturk...@googlegroups.com
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 (https://bitbucket.org/art-uniroma2/semantic-turkey/src/b07905616fb232bdd8f06f8eac8f213496061b58/core-services/src/main/java/it/uniroma2/art/semanticturkey/services/core/SPARQL.java#lines-129) 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.

Regards
Manuel

--
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 semanticturkey-dev...@googlegroups.com.
Per visualizzare questa discussione sul Web, visita https://groups.google.com/d/msgid/semanticturkey-developer/2a4132a3-1bbb-493d-9b80-1a31b9b80033%40googlegroups.com.


--
Manuel Fiorelli
Reply all
Reply to author
Forward
0 new messages