use of org.apache.clerezza.rdf.core.sparql.query.ConstructQuery in project stanbol by apache.
the class JenaAdpterTest method wrongAdaptabeClassTest.
@SuppressWarnings("unchecked")
@Test
public void wrongAdaptabeClassTest() {
try {
List<ConstructQuery> constructQueries = (List<ConstructQuery>) ruleAdapter.adaptTo(recipeGood, ConstructQuery.class);
for (ConstructQuery constructQuery : constructQueries) {
log.debug(constructQuery.toString());
Assert.fail("The adapter for Jena should not accept " + ConstructQuery.class.getCanonicalName() + " objects.");
}
} catch (UnavailableRuleObjectException e) {
Assert.fail(e.getMessage());
} catch (UnsupportedTypeForExportException e) {
log.debug(e.getMessage());
} catch (RuleAtomCallExeption e) {
Assert.fail(e.getMessage());
}
}
use of org.apache.clerezza.rdf.core.sparql.query.ConstructQuery in project stanbol by apache.
the class ClerezzaAdpterTest method test.
@SuppressWarnings("unchecked")
@Test
public void test() {
try {
List<ConstructQuery> constructQueries = (List<ConstructQuery>) ruleAdapter.adaptTo(recipeGood, ConstructQuery.class);
for (ConstructQuery constructQuery : constructQueries) {
ConstructQuery cq = (ConstructQuery) QueryParser.getInstance().parse(constructQuery.toString());
System.out.println(cq.toString());
}
Assert.assertTrue(true);
} catch (UnavailableRuleObjectException e) {
Assert.fail(e.getMessage());
} catch (UnsupportedTypeForExportException e) {
Assert.fail(e.getMessage());
} catch (RuleAtomCallExeption e) {
Assert.fail(e.getMessage());
} catch (ParseException e) {
Assert.fail(e.getMessage());
}
}
Aggregations