### Question:
SmwSystem extends MediaWikiSystem { public static String fixAsk(String ask) { String fixedAsk = ask.replaceAll("^\\s*\\{\\{", ""); fixedAsk = fixedAsk.replaceAll("#ask:", ""); fixedAsk = fixedAsk.replaceAll("\\}\\}\\s*$", ""); String[] parts = fixedAsk.split("\n"); fixedAsk = ""; for (String part : parts) { part = part.trim(); part = part.replaceAll("\\s*\\|\\s*", "|"); part = part.replaceAll("\\s*=\\s*", "="); part = part.replaceAll("\\]\\s*\\[", "]["); part = part.replaceAll(" ", "_"); fixedAsk += part; } return fixedAsk; }  String getJson(); @Override SimpleSystem connect(String... connectionParams); @Override SimpleNode moveTo(String nodeQuery, String... keys); String getActionJson(String action, String param, String actionQuery); static String getPatternMatchGroup(String regex, String toMatch,
      int groupIndex); static String getConcept(String askQuery); SimpleNode conceptAlizePrintRequests(String concept,
      JsonSystem askJson); static Date getTime(String timeString); @SuppressWarnings("rawtypes") void putValue(Vertex node, String key,
      Map<String, Object> conceptMap); static String fixAsk(String ask);  }### Answer:
@Test public void testFixAsk() { String askQuery = "{{#ask:[[Concept:Semantic Web Events 2012]]\n" + "|?Has_location\n" + "|format=table\n" + "}}"; String fixedAsk = SmwSystem.fixAsk(askQuery); if (debug) System.out.println(fixedAsk); assertTrue("[[Concept:Semantic_Web_Events_2012]]|?Has_location|format=table" .equals(fixedAsk)); String concept = SmwSystem.getConcept(askQuery); assertEquals("Semantic Web Events 2012", concept); askQuery = "[[Concept:Participant]] [[-Has subobject::SMWEvent2018-02]]"; concept = SmwSystem.getConcept(askQuery); assertEquals("Participant", concept); }