IO Specification

bdares edited this page Jun 12, 2014 · 9 revisions
Clone this wiki locally

Input for module is json produced by Template Generation module:

{
    "question" : "How many students does the Free University of Berlin have?",
    "pseudoquery" : "select ?y where { ?x ?p1 ?y }",
    "score" : 0.6,
    "language" : "en",
    "slots" : [
      {"s" : "?x", "p" : "is", "o" : "rdf:Resource"},
      {"s" : "?x", "p" : "verbalization", "o" : "Free University of Berlin"},
      {"s" : "?p1", "p" : "is", "o" : "rdf:Property"},
      {"s" : "?p1", "p" : "verbalization", "o" : "students"},
      {"s" : "?y", "p" : "is", "o" : "number"}
    ]
}

Pseudoquery variables can be rdf:Resource, rdf:Property, number, date, string.

In current implementation, pseudoquery structure can have only simple triples (no turtle form, nested queries).

The "language" parameter is optional (defaults to "en").

Output for module is json of the following form (to be consumed by Query Generation module):

{
    "question":"How many students does the Free University of Berlin have?",
    "ned":[{
        "score":0.3,
        "entities": [
            {
                "var" : "x", 
                "value" : "http://dbpedia.org/resource/Free_University_of_Berlin",
                "type" : "DBpedia:University",
                "score" : 0.3
            }
        ],
        "properties": [
            {
                "var" : "p1",
                "value" : "http://dbpedia.org/property/students",
                "score" : 0.7
            }
        ]
     }]
}