diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyConstruction.java b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyConstruction.java index 0999db643dfb204f4828ee3d14f3b18242957ec6..6d71879cc0ddd192bb9cce253e461418f1e11cab 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/PropertyConstruction.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/PropertyConstruction.java @@ -65,12 +65,15 @@ public class PropertyConstruction extends PropertyExpression { } if ( op == SyntaxElement.COMPOSE.getOperator() ) { // In case of COMPOSE, the list should have only relations and end in a property - for ( PathExpression pe : components.subList( 0, components.size()-1 ) ) { - if ( ! ( pe instanceof RelationExpression ) ) - throw new IllegalArgumentException( "Property composition must be based on relation expressions" ); + // Or, it can be empty! If it is a path starting from a property! (see total.xml) + if ( !expressions.isEmpty() ) { + for ( PathExpression pe : components.subList( 0, components.size()-1 ) ) { + if ( ! ( pe instanceof RelationExpression ) ) + throw new IllegalArgumentException( "Property composition must be based on relation expressions" ); + } + if ( ! ( components.get( components.size()-1 ) instanceof PropertyExpression ) ) + throw new IllegalArgumentException( "Property composition must end by a property expression" ); } - if ( ! ( components.get( components.size()-1 ) instanceof PropertyExpression ) ) - throw new IllegalArgumentException( "Property composition must end by a property expressions" ); } else if ( op == SyntaxElement.AND.getOperator() || op == SyntaxElement.OR.getOperator() || op == SyntaxElement.NOT.getOperator() ) { diff --git a/src/fr/inrialpes/exmo/align/parser/RDFParser.java b/src/fr/inrialpes/exmo/align/parser/RDFParser.java index be0e8b90b8afdce4f6d9e7d20d07a752b42449e1..942891ce24aac7b168c3019e6eab98b5e580e2c6 100644 --- a/src/fr/inrialpes/exmo/align/parser/RDFParser.java +++ b/src/fr/inrialpes/exmo/align/parser/RDFParser.java @@ -774,9 +774,10 @@ public class RDFParser { } clexpr.add(parseProperty(coll)); } else if (op == SyntaxElement.COMPOSE.getOperator()) { - if (coll == null) { - throw new AlignmentException("COMPOSE constructor for properties cannot be empty : " + node); - } + // It can: see total.xml/TransformationTest + //if ( coll == null || RDF.nil.getURI().equals( coll.getURI() ) ) { + // throw new AlignmentException("COMPOSE constructor cannot be empty : " + node); + //} while (!RDF.nil.getURI().equals(coll.getURI())) { // In this present case, it is a series of Relations followed by a Property Resource newcoll = coll.getProperty(RDF.rest).getResource(); // MUSTCHECK diff --git a/test/src/EDOALExportTest.java b/test/src/EDOALExportTest.java index ca5aed04365e89190f41d1ffccb9284abf0d1cec..60e4b237c787f5af327696790926e76444c46c9f 100644 --- a/test/src/EDOALExportTest.java +++ b/test/src/EDOALExportTest.java @@ -213,6 +213,7 @@ public class EDOALExportTest { writer.flush(); writer.close(); String str1 = stream.toString(); + //System.err.println(str1); assertEquals(str1.length(), 37286); }