Skip to content
Axel Ngonga edited this page Feb 19, 2014 · 8 revisions

This module implements a prototype OpenQA's answer generation module. The module expects the following two JSON input (as GET or POST request) as follows:

  • Query description: This description encompasses the description of the queries that come from a query generation module. An example of such an object is as follows:
[
    {
        "query": "SELECT ?x WHERE {?x dbo:numberOfStudents dbr:VU_Amsterdam}",
        "score": 1
    },
    {
        "query": "SELECT count(?x) WHERE {?x dbo:almaMater dbr:VU_Amsterdam}",
        "score": 0.5
    }
]
  • Endpoints: List of endpoints on which the queries are to be carried out. Note that this is not meant to be a federation. For query federation, please use SPARQL's service clause. An example of the input is as follows:
[
"http://dbpedia.org/sparql", "http://mycopy.org/sparql"
]

The output of the module is an object which contains variable names, variable bindings and the endpoint from which the bindings were computed. An example of an output is thus as follows:

[
    [
        {
            "var": "p",
            "binding": "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
            "endpoint": "http://dbpedia.org/sparql"
        },
        {
            "var": "s",
            "binding": "http://www.openlinksw.com/virtrdf-data-formats#default-iid",
            "endpoint": "http://dbpedia.org/sparql"
        },
        {
            "var": "o",
            "binding": "http://www.openlinksw.com/schemas/virtrdf#QuadMapFormat",
            "endpoint": "http://dbpedia.org/sparql"
        }
    ]
]

This result is return for the input

[
    {
        "query": "SELECT * where {?s ?p ?o} limit 1",
        "score": 0.8
    }
]
Clone this wiki locally