own-pt / wql

WQL query language
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Not recognizing same variables while creating queries #2

Closed yfaria closed 3 years ago

yfaria commented 3 years ago

By way the SPARQL generation were thought, we would create a map between the WQL variables and the SPARQL variables for them to be referred correctly in more than 1 place. By now, the code is not doing that.

In a concrete example, if we loaded SparqlGenerator.hs and ran createSelectQuery . transformation . predx . fst . last $ readP_to_S WQL.wql "x:_run*[ARG1 y, ARG2 y]", we'd get

"PREFIX mrs: <http://www.delph-in.net/schema/mrs#> 
PREFIX erg: <http://www.delph-in.net/schema/erg#> 
PREFIX delph: <http://www.delph-in.net/schema/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
SELECT ?x0 WHERE { ?x0 rdf:type mrs:MRS . ?x0 mrs:hasEP ?x1 . ?x1 delph:hasPredicate ?x2 . ?x2 delph:predText <_run*> . ?x1 mrs:ARG1 ?x3 . ?x1 mrs:ARG2 ?x4 . }"

where we see the "y" variable in WQL becoming both "?x3" and "?x4"

yfaria commented 3 years ago

Solved on #7 .