Jassa icon indicating copy to clipboard operation
Jassa copied to clipboard

There are no means to update Sponate mapping

Open patrickwestphal opened this issue 11 years ago • 1 comments

When having set a Sponate mapping, e.g. via

store.addMap({
    name: 'castles',
    template: [{
      id: '?s',
      name: '?l',
      depiction: '?d',
    }],
   from: '{ Select * { ?s a dbpedia-owl:Castle ; rdfs:label ?l ; foaf:depiction ?d ; dbpedia-owl:owner ?o . ?o rdfs:label ?on . Filter(langMatches(lang(?l), "en")) . Filter(langMatches(lang(?on), "en")) } Limit 10 }'
});

there is no way to update it. Calling the addMap method again will result in an error:

[ERROR] An attribute / store with name concept0 already exists

In some cases it would be very usefull to update or re-set a mapping for a given name, e.g. via delMap or by just calling addMap again.

patrickwestphal avatar Nov 22 '13 00:11 patrickwestphal

Here is my API suggestion:

  • store.addMap should allow adding multiple mappings which become overlays based on the name attribute - so a query will run on the union of all the maps (not there yet)
  • the JSON for the mapping gets extended with an optional id attribute that enables referring to a specific map
  • store.delete("mapName") deletes all maps by name, such that store.mapName becomes undefined.
  • store.mapName.clear() clears all maps so that store.mapName is still defined, yet queries can only yield empty results.

Aklakan avatar Nov 22 '13 01:11 Aklakan