diff --git a/html/edoal.html b/html/edoal.html index a073007c16dbe261841d2da127c27d8746b1c559..1816c99143fc7e56302d9937ecb160ee886d2279 100644 --- a/html/edoal.html +++ b/html/edoal.html @@ -221,7 +221,7 @@ exemplified in the code below. <align:Ontology rdf:about="http://www.example.org/ontology1"> <align:location>file:examples/rdf/onto1.owl</align:location> <align:formalism> - <align:Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/> + <align:Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#" /> </align:formalism> </align:Ontology> </align:onto1> @@ -229,7 +229,7 @@ exemplified in the code below. <align:Ontology rdf:about="http://www.example.org/ontology2"> <align:location>file:examples/rdf/onto2.owl</location> <align:formalism> - <align:Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#"/> + <align:Formalism align:name="OWL1.0" align:uri="http://www.w3.org/2002/07/owl#" /> </align:formalism> </align:Ontology> </align:onto2> @@ -399,7 +399,7 @@ the <a href="http://www.w3.org/TR/xquery-operators/">XQuery 1.0 and Hence, a class expression may be an identified class: <div class="rdfxml">RDF/XML Syntax</div> <div class="rdfxml"> - <Class rdf:about="&wine;WineFlavor"/> + <Class rdf:about="&wine;WineFlavor" /> </div></div> <div class="rdfxmlDiv"> a disjunction or class expressions: @@ -407,9 +407,9 @@ a disjunction or class expressions: <div class="rdfxml"> <Class> <or rdf:parseType="Collection"> - <Class rdf:about="&vin;Acidite"/> - <Class rdf:about="&vin;Astreingence"/> - <Class rdf:about="&vin;Amertume"/> + <Class rdf:about="&vin;Acidite" /> + <Class rdf:about="&vin;Astreingence" /> + <Class rdf:about="&vin;Amertume" /> </Collection></or> </Class> </div></div> @@ -419,17 +419,17 @@ Thanks to paths and restrictions, it is possible to restrict a correspondence to <div class="rdfxml"> <Class> <and rdf:parseType="Collection"> - <Class rdf:about="&vin;Wine"/> + <Class rdf:about="&vin;Wine" /> <AttributeValueRestriction> <onAttribute> <Property> <compose rdf:parseType="Collection"> - <Relation rdf:about="&vin;hasTerroir"/> - <Property rdf:about="&proton;name"/> + <Relation rdf:about="&vin;hasTerroir" /> + <Property rdf:about="&proton;name" /> </compose> </Property> </onAttribute> - <comparator rdf:resource="&edoal;equals"/> + <comparator rdf:resource="&edoal;equals" /> <value edoal:type="&xsd;string">Acquitaine</value> </AttributeValueRestriction> </and> @@ -453,12 +453,12 @@ We can with this restriction build the correspondence between <onAttribute> <Relation> <compose rdf:parseType="Collection"> - <Relation rdf:about="&vin;hasTerroir"/> - <Relation rdf:about="&proton;LocatedIn"/> + <Relation rdf:about="&vin;hasTerroir" /> + <Relation rdf:about="&proton;LocatedIn" /> </compose> </Relation> </onAttribute> - <comparator rdf:resource="&edoal;equals"/> + <comparator rdf:resource="&edoal;equals" /> <value edoal:type="&xsd;string">Acquitaine</value> </Restriction> </attributeValueCondition> @@ -515,7 +515,7 @@ a restriction. There are three classes of property restrictions: As previously properties can be identified by its URI: <div class="rdfxml">RDF/XML Syntax</div> <div class="rdfxml"> - <Property rdf:about="&wine;hasVintageYear"/> + <Property rdf:about="&wine;hasVintageYear" /> </div></div> <div class="rdfxmlDiv"> As previously properties can be assembled by boolean connectors: @@ -523,8 +523,8 @@ As previously properties can be assembled by boolean connectors: <div class="rdfxml"> <Property> <and rdf:parseType="Collection"> - <Property rdf:about="&vin;propriétaire"/> - <Property rdf:about="&vin;négociant"/> + <Property rdf:about="&vin;propriétaire" /> + <Property rdf:about="&vin;négociant" /> </and> </Property> </div></div> @@ -535,8 +535,8 @@ ending by a property: <div class="rdfxml"> <Property> <compose rdf:parseType="Collection"> - <Relation rdf:about="&vin;hasTerroir"/> - <Property rdf:about="&proton;name"/> + <Relation rdf:about="&vin;hasTerroir" /> + <Property rdf:about="&proton;name" /> </compose> </Property> </div></div> @@ -631,12 +631,12 @@ An example of occurrence restriction would be the wines produced in a region wit <onAttribute> <Relation> <compose rdf:parseType="Collection"> - <Relation rdf:about="&vin;hasTerroir"/> - <Relation rdf:about="&wine;adjacentRegion"/> + <Relation rdf:about="&vin;hasTerroir" /> + <Relation rdf:about="&wine;adjacentRegion" /> </compose> </Relation> </onAttribute> - <comparator rdf:resource="&edoal;greater-than"/> + <comparator rdf:resource="&edoal;greater-than" /> <value edoal:type="&xsd;integer">0</value> </Restriction> </attributeOccurrenceCondition> @@ -658,7 +658,7 @@ uses a path to state that a locally grown wine is a wine whose owner (propri&eac <div class="rdfxml"> <align:Cell> <align:entity1> - <Class rdf:about="&wine;LocallyGrownWine"/> + <Class rdf:about="&wine;LocallyGrownWine" /> </align:entity1> <align:entity2> <Class> @@ -666,10 +666,10 @@ uses a path to state that a locally grown wine is a wine whose owner (propri&eac <Class rdf:about="&vin;Vin"> <AttributeValueRestriction> <onAttribute> - <Relation rdf:about="&vin;propriétaire"/></first> + <Relation rdf:about="&vin;propriétaire" /></first> </onAttribute> - <comparator rdf:resource="&edoal;equals"/> - <value><Relation rdf:about="&vin;négotiant"/></value> + <comparator rdf:resource="&edoal;equals" /> + <value><Relation rdf:about="&vin;négotiant" /></value> </AttributeValueRestriction> </and> </Class> @@ -709,8 +709,7 @@ They obey the following grammar: <u>val</u> ::= <value> <u>value</u> </value> <u>value</u> ::= <Literal {edoal:type=" <u>URI</u> "} edoal:string=" <u>STRING</u> " /> - | <Literal {edoal:type=" <u>URI</u> "}> <u>STRING</u> </Literal> - | <u>instexpr</u> +<!-- | <Literal {edoal:type=" <u>URI</u> "}> <u>STRING</u> </Literal> --> | <u>instexpr</u> | <u>attrexpr</u> | <Apply edoal:operator=" <u>URI</u> "> <arguments rdf:parseType="Collection"><u>value</u>*</arguments> </Apply> <!-- JE: this is unfortunately ugly, otherwise, this is perfect REST--><!-- @@ -729,7 +728,7 @@ Literal values: <div class="rdfxml">RDF/XML Syntax</div> <div class="rdfxml"> <Literal edoal:type="&xsd;integer" edoal:string="123" /> - <Literal edoal:type="&xsd;integer">123</Literal> +<!-- <Literal edoal:type="&xsd;integer">123</Literal>--> </div></div> <p> @@ -739,6 +738,7 @@ Instances are always single entities refering to an individual <div class="rdfxml">RDF/XML Syntax</div> <div class="rdfxml"> <Instance rdf:about="&vin;hasTerroir" /> + </div></div> </p> <p> @@ -749,7 +749,7 @@ the following way: <div class="rdfxml"> <Apply edoal:operator="http://example.com/Whatever"> <arguments rdf:parseType="Collection"> - <Literal rdf:about="&xsd;integer">123</Literal> + <Literal rdf:about="&xsd;integer" edoal:string="123" /> <Property> <compose rdf:parseType="Collection"> <Relation rdf:about="&vin;hasTerroir" /> @@ -808,12 +808,12 @@ The following correspondence shows an example of the use of data transformation: <entity2> <Apply edoal:operator="concat"> <arguments rdf:parseType="Collection"> - <Property rdf:about="vcard:firstname"/> - <Literal edoal:type="&xsd;string" edoal:string=" "/> + <Property rdf:about="vcard:firstname" /> + <Literal edoal:type="&xsd;string" edoal:string=" " /> <!-- or even compute middle initial from middlename --> - <Property rdf:about="vcard:middleinitial"/> - <Literal edoal:string=". "/> - <Property rdf:about="vcard:lastname"/> + <Property rdf:about="vcard:middleinitial" /> + <Literal edoal:string=". " /> + <Property rdf:about="vcard:lastname" /> </arguments> </Apply> </entity2> @@ -845,7 +845,7 @@ The following correspondence shows an example of the use of data transformation: <Relation rdf:about="&O1;hasColor" /> </onAttribute> <comparator rdf:resource="&edoal;equals" /> - <value><Instance rdf:about="&O1;Blue"/></value> + <value><Instance rdf:about="&O1;Blue" /></value> </AttributeValueRestriction> </and> </Class> @@ -864,7 +864,7 @@ The following correspondence shows an example of the use of data transformation: <Relation rdf:about="&O1;hasColor" /> </onAttribute> <comparator rdf:resource="&edoal;equals" /> - <value><Instance rdf:about="&O1;Red"/></value> + <value><Instance rdf:about="&O1;Red" /></value> </AttributeValueRestriction> </and> </Class> @@ -883,7 +883,7 @@ The following correspondence shows an example of the use of data transformation: <Relation rdf:about="&O1;hasColor" /> </onAttribute> <comparator rdf:resource="&edoal;equals" /> - <value><Instance rdf:about="&O1;Green"/></value> + <value><Instance rdf:about="&O1;Green" /></value> </AttributeValueRestriction> </and> </Class> @@ -1037,8 +1037,8 @@ O2:weight a edoal:Property. <Apply edoal:operator="http://www.google.com/finance/converter"> <arguments rdf:parseType="Collection"> <Property><compose rdf:parseType="Collection"/></Property> - <Literal edoal:value="EUR" /> - <Literal edoal:value="CNY" /> + <Literal edoal:string="EUR" /> + <Literal edoal:string="CNY" /> </arguments> </Apply> </entity2> @@ -1158,7 +1158,7 @@ for a more complete description of the EDOAL Pattern language. <div class="grammar"> variable ::= <Variable> <var_id>string</var_id> - <var_binding rdf:resource="uri"/> + <var_binding rdf:resource="uri" /> </Variable> </div--> diff --git a/src/fr/inrialpes/exmo/align/impl/edoal/Comparator.java b/src/fr/inrialpes/exmo/align/impl/edoal/Comparator.java index 9ecf3b87af3aaee39a19c3990bc347fc024a5c1c..d6c2c2fdda8990b45ce600cf86ea8a4d2ece5b87 100644 --- a/src/fr/inrialpes/exmo/align/impl/edoal/Comparator.java +++ b/src/fr/inrialpes/exmo/align/impl/edoal/Comparator.java @@ -31,9 +31,9 @@ public class Comparator { // This replaces the Comparator class // SHOULD CERTAINLY BE AN ENUM - public static Comparator EQUAL = initComparator( Namespace.XSD.prefix+"equals", 0 ); - public static Comparator LOWER = initComparator( Namespace.XSD.prefix+"lower-than", -1 ); - public static Comparator GREATER = initComparator( Namespace.XSD.prefix+"greater-than", 1 ); + public static Comparator EQUAL = initComparator( Namespace.EDOAL.prefix+"equals", 0 ); + public static Comparator LOWER = initComparator( Namespace.EDOAL.prefix+"lower-than", -1 ); + public static Comparator GREATER = initComparator( Namespace.EDOAL.prefix+"greater-than", 1 ); public static Comparator getComparator( URI u ) { if ( u.equals( EQUAL.getURI() ) ) { diff --git a/test/src/EDOALExportTest.java b/test/src/EDOALExportTest.java index 1716701a2ef86e73a35e130f84d5cc422bc4cd95..c6104f8d5f5ca3781ee296599736b0a9c0fd36f2 100644 --- a/test/src/EDOALExportTest.java +++ b/test/src/EDOALExportTest.java @@ -213,19 +213,19 @@ public class EDOALExportTest { toExport = new ClassValueRestriction(new PropertyId(new URI("http://my.sister#age")),Comparator.GREATER,new Value("18")); assertEquals( render( toExport ), "<edoal:AttributeValueRestriction>" + "<edoal:onAttribute><edoal:Property rdf:about=\"http://my.sister#age\"/></edoal:onAttribute>" - + "<edoal:comparator rdf:resource=\"http://www.w3.org/2001/XMLSchema#greater-than\"/>" + + "<edoal:comparator rdf:resource=\"http://ns.inria.org/edoal/1.0/#greater-than\"/>" + "<edoal:value><edoal:Literal edoal:string=\"18\"/></edoal:value>" + "</edoal:AttributeValueRestriction>" ); toExport = new ClassTypeRestriction( new PropertyId(new URI("http://my.sister#age")), new Datatype("integer-under-100")); assertEquals( render( toExport ), "<edoal:AttributeTypeRestriction>" + "<edoal:onAttribute><edoal:Property rdf:about=\"http://my.sister#age\"/></edoal:onAttribute>" - //+ "<edoal:comparator rdf:resource=\"http://www.w3.org/2001/XMLSchema#equals\"/>" + //+ "<edoal:comparator rdf:resource=\"http://ns.inria.org/edoal/1.0/#equals\"/>" + "<edoal:datatype><edoal:Datatype rdf:about=\"integer-under-100\"/></edoal:datatype>" + "</edoal:AttributeTypeRestriction>" ); toExport = new ClassOccurenceRestriction( new PropertyId(new URI("http://my.sister#age")), Comparator.GREATER, 18); assertEquals( render( toExport ), "<edoal:AttributeOccurenceRestriction>" + "<edoal:onAttribute><edoal:Property rdf:about=\"http://my.sister#age\"/></edoal:onAttribute>" - + "<edoal:comparator rdf:resource=\"http://www.w3.org/2001/XMLSchema#greater-than\"/>" + + "<edoal:comparator rdf:resource=\"http://ns.inria.org/edoal/1.0/#greater-than\"/>" + "<edoal:value>18</edoal:value>" + "</edoal:AttributeOccurenceRestriction>" ); } @@ -286,7 +286,7 @@ public class EDOALExportTest { + "<edoal:onAttribute>" + "<edoal:Property rdf:about=\"http://vinum#age\"/>" + "</edoal:onAttribute>" - + "<edoal:comparator rdf:resource=\"http://www.w3.org/2001/XMLSchema#greater-than\"/>" + + "<edoal:comparator rdf:resource=\"http://ns.inria.org/edoal/1.0/#greater-than\"/>" + "<edoal:value><edoal:Literal edoal:string=\"20\"/></edoal:value>" + "</edoal:AttributeValueRestriction>" + "</edoal:or>"+ "</edoal:Class>" ); @@ -300,7 +300,7 @@ public class EDOALExportTest { + "</edoal:class></edoal:PropertyDomainRestriction>" ); assertEquals( render( new PropertyValueRestriction( Comparator.EQUAL, new Value("18"))), "<edoal:PropertyValueRestriction>" - + "<edoal:comparator rdf:resource=\"http://www.w3.org/2001/XMLSchema#equals\"/>" + + "<edoal:comparator rdf:resource=\"http://ns.inria.org/edoal/1.0/#equals\"/>" + "<edoal:value><edoal:Literal edoal:string=\"18\"/></edoal:value>" + "</edoal:PropertyValueRestriction>" ); assertEquals( render( new PropertyTypeRestriction(new Datatype("int"))), @@ -331,7 +331,7 @@ public class EDOALExportTest { + "<edoal:Property rdf:about=\"http://mein/super/property1\"/>" + "</edoal:or></edoal:Property>" + "<edoal:PropertyValueRestriction>" - + "<edoal:comparator rdf:resource=\"http://www.w3.org/2001/XMLSchema#equals\"/>" + + "<edoal:comparator rdf:resource=\"http://ns.inria.org/edoal/1.0/#equals\"/>" + "<edoal:value><edoal:Literal edoal:string=\"5\"/></edoal:value></edoal:PropertyValueRestriction>" + "</edoal:and></edoal:Property>"); toExport = new PropertyConstruction( Constructor.NOT, Collections.singleton((PathExpression)new PropertyId(new URI("http://mein/super/property")))); diff --git a/test/src/EDOALTest.java b/test/src/EDOALTest.java index fc5f2b4e36ea625ffa71c9f9d09fbcde23d253c9..bf9e55b85e84e585dda494bec85a16ace48fd2de 100644 --- a/test/src/EDOALTest.java +++ b/test/src/EDOALTest.java @@ -119,7 +119,7 @@ java -cp ../../lib/procalign.jar fr.inrialpes.exmo.align.cli.ParserPrinter wine2 // This tests the round triping assertEquals( wine2.length(), stream.toString().length() ); // This provides an absolute value - assertEquals( wine2.length(), 4671 ); + assertEquals( wine2.length(), 4669 ); // This does not work because (at least) the order of correspondences is never the same... //assertEquals( wine2, stream.toString() ); }