Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0aedf355 authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- updated SPARQL construct tests (should have been with EDOAL rendering changes)

parent 50867cfb
No related branches found
No related tags found
No related merge requests found
......@@ -63,12 +63,14 @@ public class SPARQLConstructVisitorTest {
public void ConstructSimplePropertiesRelation() throws Exception {
// JE: This is absolutely non standard:
// no init and alignment used without ontology declaration
// This only works because the relation is built manually
EDOALAlignment alignment = new EDOALAlignment();
Relation opusRelation = new EquivRelation();
Expression opusExpression1 = new PropertyId(new URI("http://exmo.inrialpes.fr/connectors#opus"));
Expression opusExpression2 = new PropertyId(new URI("http://purl.org/ontology/mo/opus"));
EDOALCell opusCell = new EDOALCell("1", opusExpression1, opusExpression2, opusRelation, 1.0);
alignment.addAlignCell(opusCell);
alignment.addAlignCell( "1", opusExpression1, opusExpression2, opusRelation, 1.0 );
EDOALCell opusCell = (EDOALCell)alignment.getElements().nextElement();
StringWriter stringWriter = new StringWriter();
PrintWriter writer = new PrintWriter(stringWriter);
......@@ -100,13 +102,12 @@ public class SPARQLConstructVisitorTest {
+ "WHERE {\n"
+ "?s ns1:opus ?o .\n"
+ "}\n";
EDOALAlignment inval = new EDOALAlignment();
EDOALCell opusCell2 = opusCell.inverse();
inval.addAlignCell(opusCell2);
renderer = new SPARQLConstructRendererVisitor(writer);
EDOALAlignment inval = alignment.inverse();
EDOALCell opusCell2 = (EDOALCell)inval.getElements().nextElement();
renderer = new SPARQLConstructRendererVisitor(writer);
renderer.init(properties);
inval.render(renderer);
assertEquals( renderer.getQuery(opusCell2), expectedQuery2 );
assertEquals( renderer.getQuery( opusCell2 ), expectedQuery2 );
//With Named Graph
String namedGraph = "http://exmo.inrialpes.fr/connectors/one-graph";
......@@ -178,8 +179,6 @@ public class SPARQLConstructVisitorTest {
// + "}\n"
// + "}\n", remoteServiceURIName);
//
// JE2015-Tosee
// assertEquals( renderer.getQuery(opusCell), expectedQuery2 );
// assertEquals(renderer.getQueryFromOnto1ToOnto2(opusCell, remoteServiceURI), expectedQuery1);
// assertEquals(renderer.getQueryFromOnto2ToOnto1(opusCell, remoteServiceURI), expectedQuery2);
}
......@@ -192,11 +191,12 @@ public class SPARQLConstructVisitorTest {
@Test(groups = {"full", "impl", "raw"})
public void ConstructSimpleClassesRelation() throws Exception {
EDOALAlignment alignment = new EDOALAlignment();
Relation classesRelation = new EquivRelation();
Expression rootElementExpression = new ClassId(new URI("http://exmo.inrialpes.fr/connectors#RootElement"));
Expression musicalWorkExpression = new ClassId(new URI("http://purl.org/ontology/mo/MusicalWork"));
EDOALCell classCell = new EDOALCell("1", rootElementExpression, musicalWorkExpression, classesRelation, 1.0);
alignment.addAlignCell(classCell);
alignment.addAlignCell( "1", rootElementExpression, musicalWorkExpression, classesRelation, 1.0 );
EDOALCell classCell = (EDOALCell)alignment.getElements().nextElement();
StringWriter stringWriter = new StringWriter();
PrintWriter writer = new PrintWriter(stringWriter);
......@@ -228,9 +228,8 @@ public class SPARQLConstructVisitorTest {
+ "WHERE {\n"
+ "?s rdf:type ns1:RootElement .\n"
+ "}\n";
EDOALAlignment inval = new EDOALAlignment();
EDOALCell classCell2 = classCell.inverse();
inval.addAlignCell(classCell2);
EDOALAlignment inval = alignment.inverse();
EDOALCell classCell2 = (EDOALCell)inval.getElements().nextElement();
renderer = new SPARQLConstructRendererVisitor(writer);
renderer.init(properties);
inval.render(renderer);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment