@Override public boolean onAdvance() { Configuration config = app.getConfig(); if (config.isLocal) return true; else if (panel.kbSource.isValid() && panel.kbTarget.isValid()) { // Proceed KBInfo source = panel.kbSource.getKBInfo(); source.var = "?src"; KBInfo target = panel.kbTarget.getKBInfo(); target.var = "?dest"; config.setSource(source); config.setTarget(target); // panel.getWindow().showNotification(source + "\n\n" + target); return true; } return false; }
private KBInfo createKBInfo(HashMap<String, Object> param) { KBInfo info = new KBInfo(); info.endpoint = (String) param.get("endpoint"); info.graph = (String) param.get("graph"); info.var = (String) param.get("var"); System.out.println(info.endpoint); info.restrictions = new ArrayList<String>(); if (param.containsKey("class")) { String classRestrString = info.var + " rdf:type " + SPARQLHelper.wrapIfNecessary((String) param.get("class")); info.restrictions.add(classRestrString); } info.prefixes = (HashMap<String, String>) param.get("prefixes"); System.out.println("PREFIXES: " + info.prefixes); info.functions = (HashMap<String, String>) param.get("properties"); for (String prop : info.functions.keySet()) { info.properties.add(prop); } info.type = "SPARQL"; info.id = (String) param.get("id"); return info; }