Skip to main content

Additional services

When uploading and indexing the data QAnswer also generated some additonal services. We describe them here briefly

SparqlToUser

One service that is set up is SparqlToUser, a service that converts a SPARQL query to a representation that is understandable by an end-user.

Concretely the service converts the SPARQL query:

SELECT DISTINCT ?s1 where { 
?s1 ?p1 <http://vocabulary.semantic-web.at/cocktail-ontology/Ingredients> .
?s1 ?p2 <http://vocabulary.semantic-web.at/cocktails/2d85fb1b-96cb-4c48-8df5-707032f34e71> .
}
limit 1000

to the more user friendly representation:

type / Ingredients
/ is part of, is used by / Margarita

This service can be called using the following code snippets:

curl -X GET \
'https://app.qanswer.ai/api/sparqltouser/cocktails?sparql=SELECT%20DISTINCT%20?s1%20where%20{%20%0A%20%20%20%20?s1%20?p1%20%3Chttp://vocabulary.semantic-web.at/cocktail-ontology/Ingredients%3E%20.%0A%20%20%20%20?s1%20?p2%20%3Chttp://vocabulary.semantic-web.at/cocktails/2d85fb1b-96cb-4c48-8df5-707032f34e71%3E%20.%20%0A}%0Alimit%201000&lang=en' \
-H 'Accept: */*' \
-H 'Authorization: Bearer eyJhbGciOiJIUzUxMi....' \

the result is:

{
"sparql": "SELECT DISTINCT ?s1 where { \n ?s1 ?p1 <http://vocabulary.semantic-web.at/cocktail-ontology/Ingredients> .\n ?s1 ?p2 <http://vocabulary.semantic-web.at/cocktails/2d85fb1b-96cb-4c48-8df5-707032f34e71> . \n}\nlimit 1000",
"lang": "en",
"kb": "cocktails",
"interpretation": "type / Ingredients\n / is part of, is used by / Margarita"
}