Mentions légales du service

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

- implemented and tested OWLAxiomRendererVisitor for EDOAL

parent 9b7bbbb8
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE rdf:RDF [
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY wine "http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine#">
<!ENTITY vin "http://ontology.deri.org/vin#">
<!ENTITY proton "http://proton.semanticweb.org/">
]>
<!-- JE2010: With the "#" in the end, this is parsed (by the RDF parser...)
without it, this is not! -->
<rdf:RDF xmlns="http://knowledgeweb.semanticweb.org/heterogeneity/alignment#"
xml:base="http://oms.omwg.org/wine-vin/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:align="http://knowledgeweb.semanticweb.org/heterogeneity/alignment#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:ex="http://example.org"
xmlns:wine="http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine#"
xmlns:vin="http://ontology.deri.org/vin#"
xmlns:proton="http://proton.semanticweb.org/"
xmlns:edoal="http://ns.inria.org/edoal/1.0/#">
<Alignment rdf:about="http://oms.omwg.org/wine-vin/">
<xml>yes</xml>
<dc:creator>http://www.scharffe.fr/foaf.rdf</dc:creator>
<dc:date>2010/10/10</dc:date>
<method>manual</method>
<purpose>example</purpose>
<rdf:comment>This is a transformation of total.xml which can be transformed in OWL</rdf:comment>
<level>2EDOAL</level>
<type>**</type>
<onto1>
<Ontology rdf:about="&wine;">
<formalism>
<Formalism>
<uri>http://www.w3.org/TR/owl-guide/</uri>
<name>owl</name>
</Formalism>
</formalism>
</Ontology>
</onto1>
<onto2>
<Ontology rdf:about="&vin;">
<location>http://www.scharffe.fr/ontologies/OntologieDuVin.wsml</location>
<formalism>
<Formalism align:uri="http://www.wsmo.org/wsml/wsml-syntax/wsml-dl"
align:name="wsml" />
</formalism>
</Ontology>
</onto2>
<!-- Class basis -->
<map>
<Cell rdf:about="MappingRule_class_basis">
<entity1><edoal:Class rdf:about="&wine;VintageYear"/></entity1>
<entity2><edoal:Class rdf:about="&vin;Millesime"/></entity2>
<measure rdf:datatype="&xsd;float">1.0</measure>
<relation>Equivalence</relation>
</Cell>
</map>
<!-- class const: and or not -->
<map>
<Cell rdf:about="MappingRule_class_const">
<entity1>
<edoal:Class>
<edoal:not>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class>
<edoal:or rdf:parseType="Collection">
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class rdf:about="&wine;Bordeaux1"/>
<edoal:Class rdf:about="&wine;Bordeaux2"/>
</edoal:and>
</edoal:Class>
<edoal:Class>
<edoal:not>
<edoal:Class rdf:about="&wine;Bordeaux3"/>
</edoal:not>
</edoal:Class>
</edoal:or>
</edoal:Class>
<edoal:Class>
<edoal:not>
<edoal:Class rdf:about="&wine;Bordeaux4"/>
</edoal:not>
</edoal:Class>
</edoal:and>
</edoal:Class>
</edoal:not>
</edoal:Class>
</entity1>
<entity2>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class rdf:about="&vin;Vin"/>
<edoal:Class>
<edoal:or rdf:parseType="Collection">
<edoal:Class>
<edoal:not>
<edoal:Class rdf:about="&vin;Bordeaux5"/>
</edoal:not>
</edoal:Class>
<edoal:Class rdf:about="&vin;Bordeaux6"/>
</edoal:or>
</edoal:Class>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class>
<edoal:not>
<edoal:Class rdf:about="&vin;Bordeaux7"/>
</edoal:not>
</edoal:Class>
<edoal:Class rdf:about="&vin;Bordeaux7"/>
</edoal:and>
</edoal:Class>
</edoal:and>
</edoal:Class>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- class rest: att-type... -->
<map>
<Cell rdf:about="MappingRule_class_rest">
<entity1>
<edoal:Class>
<edoal:or rdf:parseType="Collection">
<edoal:Class rdf:about="&wine;Vin"/>
<edoal:AttributeDomainRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&proton;locatedIn"/>
</edoal:onAttribute>
<edoal:class><edoal:Class rdf:about="&wine;FrenchRegion"/></edoal:class>
</edoal:AttributeDomainRestriction>
<edoal:AttributeTypeRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&wine;hasTerroir"/>
</edoal:onAttribute>
<edoal:datatype>An-integer-as-datatype</edoal:datatype>
</edoal:AttributeTypeRestriction>
<edoal:AttributeOccurenceRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&wine;hasTerroir"/>
</edoal:onAttribute>
<edoal:comparator rdf:resource="&xsd;lower-than"/>
<edoal:value>12</edoal:value>
</edoal:AttributeOccurenceRestriction>
<edoal:Class rdf:about="&wine;Bordeaux7"/>
</edoal:or>
</edoal:Class>
</entity1>
<entity2>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class rdf:about="&vin;Vin"/>
<edoal:AttributeValueRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&vin;hasTerroir"/>
</edoal:onAttribute>
<edoal:comparator rdf:resource="&xsd;equals"/>
<edoal:value><edoal:Instance rdf:about="&vin;Aquitaine"/></edoal:value>
</edoal:AttributeValueRestriction>
<edoal:AttributeOccurenceRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&proton;locatedIn"/>
</edoal:onAttribute>
<edoal:comparator rdf:resource="&xsd;greater-than"/>
<edoal:value>4</edoal:value>
</edoal:AttributeOccurenceRestriction>
</edoal:and>
</edoal:Class>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- test the quantifiers -->
<map>
<Cell rdf:about="MappingRule_class_quant">
<entity1>
<edoal:Class>
<edoal:or rdf:parseType="Collection">
<edoal:Class rdf:about="&wine;Vin"/>
<edoal:AttributeDomainRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&wine;hasTerroir"/>
</edoal:onAttribute>
<edoal:all><edoal:Class rdf:about="&wine;FrenchRegion"/></edoal:all>
</edoal:AttributeDomainRestriction>
</edoal:or>
</edoal:Class>
</entity1>
<entity2>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class rdf:about="&vin;Vin"/>
<edoal:AttributeDomainRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&vin;hasTerroir"/>
</edoal:onAttribute>
<edoal:exists><edoal:Class rdf:about="&wine;FrenchRegion"/></edoal:exists>
</edoal:AttributeDomainRestriction>
</edoal:and>
</edoal:Class>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- a bit more test on values -->
<map>
<Cell rdf:about="MappingRule_class_values">
<entity1>
<edoal:Class>
<edoal:or rdf:parseType="Collection">
<edoal:Class rdf:about="&wine;Vin"/>
<edoal:AttributeValueRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&wine;hasTerroir"/>
</edoal:onAttribute>
<edoal:comparator rdf:resource="&xsd;equals"/>
<edoal:value><edoal:Instance rdf:about="&wine;Bordelais"/></edoal:value>
</edoal:AttributeValueRestriction>
<edoal:Class rdf:about="&wine;Bordeaux7"/>
</edoal:or>
</edoal:Class>
</entity1>
<entity2>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class rdf:about="&vin;Vin"/>
<edoal:AttributeValueRestriction>
<edoal:onAttribute>
<edoal:Relation rdf:about="&wine;hasTerroir"/>
</edoal:onAttribute>
<edoal:comparator rdf:resource="&xsd;equals"/>
<edoal:value><edoal:Literal edoal:string="33"/></edoal:value>
</edoal:AttributeValueRestriction>
</edoal:and>
</edoal:Class>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- class const and rest -->
<!-- rel basis -->
<map>
<Cell rdf:about="MappingRule_rel_basis">
<entity1><edoal:Relation rdf:about="&wine;locatedIn"/></entity1>
<entity2><edoal:Relation rdf:about="&vin;hasTerroir"/></entity2>
<measure rdf:datatype="&xsd;float">1.0</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- rel const: and or not compose inverse trans refl sym -->
<map>
<Cell rdf:about="MappingRule_rel_const">
<entity1>
<edoal:Relation>
<edoal:inverse>
<edoal:Relation rdf:about="&wine;loc4"/>
</edoal:inverse>
</edoal:Relation>
</entity1>
<entity2>
<edoal:Relation rdf:about="&vin;place3"/>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- rel rest: att-type... -->
<map>
<Cell rdf:about="MappingRule_rel_rest">
<entity1>
<edoal:RelationDomainRestriction>
<edoal:class><edoal:Class rdf:about="&wine;Bordeaux1"/></edoal:class>
</edoal:RelationDomainRestriction>
</entity1>
<entity2>
<edoal:RelationDomainRestriction>
<edoal:class>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class rdf:about="&vin;Bordeaux5"/>
<edoal:Class rdf:about="&vin;Bordeaux6"/>
</edoal:and>
</edoal:Class>
</edoal:class>
</edoal:RelationDomainRestriction>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- rel const and rest -->
<!-- prop basis -->
<map>
<Cell rdf:about="MappingRule_prop_basis">
<entity1><edoal:Property rdf:about="&wine;yearValue"/></entity1>
<entity2><edoal:Property rdf:about="&vin;anneeMillesime"/></entity2>
<measure rdf:datatype="&xsd;float">1.0</measure>
<relation>Equivalence</relation>
</Cell>
</map>
<!-- prop const: and or not compose -->
<map>
<Cell rdf:about="MappingRule_prop_const">
<entity1>
<edoal:Property rdf:about="&wine;number1"/>
</entity1>
<entity2>
<edoal:Property rdf:about="&vin;dpt3"/>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- prop rest: att-type... -->
<map>
<Cell rdf:about="MappingRule_prop_rest">
<entity1>
<edoal:PropertyValueRestriction>
<edoal:comparator rdf:resource="http://www.w3.org/2001/XMLSchema#equals"/>
<edoal:value><edoal:Literal edoal:string="Bordeaux"/></edoal:value>
</edoal:PropertyValueRestriction>
</entity1>
<entity2>
<edoal:PropertyDomainRestriction>
<edoal:class>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class rdf:about="&vin;Bordeaux5"/>
<edoal:Class rdf:about="&vin;Bordeaux6"/>
</edoal:and>
</edoal:Class>
</edoal:class>
</edoal:PropertyDomainRestriction>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- prop const and rest -->
<!-- instance -->
<map>
<Cell rdf:about="MappingRule_inst_basis">
<entity1><edoal:Instance rdf:about="&wine;ChateauMargaux1995"/></entity1>
<entity2><edoal:Instance rdf:about="&vin;MoutonRotschild1889"/></entity2>
<measure rdf:datatype="&xsd;float">1.0</measure>
<relation>Equivalence</relation>
</Cell>
</map>
<!-- Miscelaneous -->
<map>
<Cell rdf:about="MappingRule_3">
<entity1>
<edoal:Class>
<edoal:and rdf:parseType="Collection">
<edoal:Class rdf:about="&wine;Bordeaux17"/>
<edoal:Class>
<edoal:or rdf:parseType="Collection">
<edoal:Class rdf:about="&wine;Bordeaux18"/>
<edoal:Class rdf:about="&wine;Bordeaux18"/>
</edoal:or>
</edoal:Class>
</edoal:and>
</edoal:Class>
</entity1>
<entity2>
<edoal:Class rdf:about="&vin;Vin"/>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<map>
<Cell rdf:about="MappingRule_4">
<entity1>
<edoal:Class>
<edoal:or rdf:parseType="Collection">
<edoal:Class rdf:about="&vin;Acidite"/>
<edoal:Class rdf:about="&vin;Astreingence"/>
<edoal:Class rdf:about="&vin;Amertume"/>
</edoal:or>
</edoal:Class>
</entity1>
<entity2>
<edoal:Class>
<edoal:not>
<edoal:Class rdf:about="&vin;WineFlavor"/>
</edoal:not>
</edoal:Class>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
</Cell>
</map>
<!-- The transformation will be ignored by OWL -->
<map>
<Cell rdf:about="TransformationTest">
<entity1>
<edoal:Property rdf:about="foaf:name"/>
</entity1>
<entity2>
<edoal:Relation rdf:about="vcard:name"/>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
<edoal:transformation>
<edoal:Transformation edoal:type="o-">
<edoal:entity1>
<edoal:Property><edoal:compose rdf:parseType="Collection"/></edoal:Property>
</edoal:entity1>
<edoal:entity2>
<edoal:Apply edoal:operator="concat">
<edoal:arguments rdf:parseType="Collection">
<edoal:Property rdf:about="vcard:firstname"/>
<edoal:Literal edoal:string=" "/>
<!-- or even compute middle initial from middlename -->
<edoal:Property rdf:about="vcard:middleinitial"/>
<edoal:Literal edoal:string=". "/>
<edoal:Property rdf:about="vcard:lastname"/>
</edoal:arguments>
</edoal:Apply>
</edoal:entity2>
</edoal:Transformation>
</edoal:transformation>
</Cell>
</map>
<!-- TOCHECK DOES NOT WORK BECAUSE OF OUT TOP/BOTTOM -->
<map>
<Cell rdf:about="ExtremeTransformationTest">
<entity1>
<edoal:Class>
<edoal:or />
</edoal:Class>
</entity1>
<entity2>
<edoal:Class>
<edoal:and />
</edoal:Class>
</entity2>
<measure rdf:datatype='&xsd;float'>1.</measure>
<relation>SubsumedBy</relation>
<edoal:transformation>
<edoal:Transformation edoal:type="o-">
<edoal:entity1>
<edoal:Relation><edoal:compose /></edoal:Relation>
</edoal:entity1>
<edoal:entity2>
<edoal:Relation><edoal:compose /></edoal:Relation>
</edoal:entity2>
</edoal:Transformation>
</edoal:transformation>
</Cell>
</map>
</Alignment>
</rdf:RDF>
......@@ -158,7 +158,7 @@
</edoal:or>
</edoal:Relation>
</edoal:onAttribute>
<edoal:comparator rdf:resource="&xsd;less-than"/>
<edoal:comparator rdf:resource="&xsd;lower-than"/>
<edoal:value>12</edoal:value>
</edoal:AttributeOccurenceRestriction>
<edoal:Class rdf:about="&wine;Bordeaux7"/>
......@@ -234,7 +234,6 @@
</edoal:compose>
</edoal:Relation>
</edoal:onAttribute>
<edoal:comparator rdf:resource="&xsd;equals"/>
<edoal:exists><edoal:Class rdf:about="&wine;FrenchRegion"/></edoal:exists>
</edoal:AttributeDomainRestriction>
</edoal:and>
......@@ -627,12 +626,14 @@
</map>
<!-- prop const and rest -->
<!-- instance -->
<!-- This equivalence does not means anything.
It was a subsumption which was not better -->
<map>
<Cell rdf:about="MappingRule_inst_basis">
<entity1><edoal:Instance rdf:about="&wine;ChateauMargaux1995"/></entity1>
<entity2><edoal:Instance rdf:about="&vin;MoutonRotschild1889"/></entity2>
<measure rdf:datatype="&xsd;float">1.0</measure>
<relation>SubsumedBy</relation>
<relation>Equivalence</relation>
</Cell>
</map>
<!-- Miscelaneous -->
......
......@@ -35,6 +35,16 @@ public class Comparator {
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 getComparator( URI u ) {
if ( u.equals( EQUAL.getURI() ) ) {
return EQUAL;
} else if ( u.equals( LOWER.getURI() ) ) {
return LOWER;
} else if ( u.equals( GREATER.getURI() ) ) {
return GREATER;
} else return new Comparator( u );
}
protected Comparator() {
super();
}
......
......@@ -22,6 +22,10 @@
package fr.inrialpes.exmo.align.impl.edoal;
import org.semanticweb.owl.align.AlignmentException;
import org.semanticweb.owl.align.AlignmentVisitor;
import org.semanticweb.owl.align.Visitable;
/**
* <p>
* Id to represent a datatype
......@@ -31,11 +35,15 @@ package fr.inrialpes.exmo.align.impl.edoal;
* </p>
*/
public class Datatype { //implements Cloneable, Visitable {
public class Datatype implements Visitable { //implements Cloneable
/** Holds the type */
private String type;
public void accept( AlignmentVisitor visitor) throws AlignmentException {
visitor.visit( this );
}
/**
* Constructs an object with the given type.
*
......@@ -53,10 +61,6 @@ public class Datatype { //implements Cloneable, Visitable {
this.type = type;
}
// public void accept(AlignmentVisitor visitor) throws AlignmentException {
// visitor.visit(this);
// }
public String plainText() {
return type;
}
......
......@@ -553,7 +553,7 @@ public class RDFParser {
stmt = node.getProperty( (Property)SyntaxElement.COMPARATOR.resource );
if ( stmt == null ) throw new AlignmentException( "Required edoal:comparator property" );
URI id = getNodeId( stmt.getResource() );
if ( id != null ) comp = new Comparator( id );
if ( id != null ) comp = Comparator.getComparator( id );
else throw new AlignmentException("edoal:comparator requires an URI");
if ( rdfType.equals( SyntaxElement.OCCURENCE_COND.resource ) ) {
stmt = node.getProperty( (Property)SyntaxElement.VALUE.resource );
......@@ -681,7 +681,7 @@ public class RDFParser {
if ( stmt == null ) throw new AlignmentException( "Required edoal:comparator property" );
URI id = getNodeId( stmt.getResource() );
if ( id == null ) throw new AlignmentException("edoal:comparator requires and URI");
Comparator comp = new Comparator( id );
Comparator comp = Comparator.getComparator( id );
stmt = node.getProperty( (Property)SyntaxElement.VALUE.resource );
if ( stmt == null ) throw new AlignmentException( "Required edoal:value property" );
ValueExpression v = parseValue( stmt.getObject() );
......
......@@ -35,9 +35,11 @@ import org.semanticweb.owl.align.Alignment;
import org.semanticweb.owl.align.Visitable;
import fr.inrialpes.exmo.align.impl.renderer.RDFRendererVisitor;
import fr.inrialpes.exmo.align.impl.renderer.OWLAxiomsRendererVisitor;
import fr.inrialpes.exmo.align.impl.Annotations;
import fr.inrialpes.exmo.align.impl.Namespace;
import fr.inrialpes.exmo.align.impl.edoal.EDOALAlignment;
import fr.inrialpes.exmo.align.parser.AlignmentParser;
import fr.inrialpes.exmo.ontowrap.Ontology;
import fr.inrialpes.exmo.ontowrap.BasicOntology;
......@@ -93,7 +95,6 @@ import fr.inrialpes.exmo.align.impl.edoal.Value;
import fr.inrialpes.exmo.align.impl.edoal.Datatype;
import fr.inrialpes.exmo.align.impl.edoal.Comparator;
/**
* These tests corresponds to the tests presented in the examples/omwg directory
*/
......@@ -127,6 +128,50 @@ public class EDOALExportTest {
return stream.toString();
}
// Load the full test ==> break because not all can be rendered
@Test(expectedExceptions = AlignmentException.class, groups = { "full", "omwg", "raw" }, dependsOnMethods = {"setUp"})
public void testOWLRendering0() throws Exception {
AlignmentParser aparser = new AlignmentParser( 0 );
aparser.initAlignment( null );
Alignment alignment = aparser.parse( "file:examples/omwg/total.xml" );
assertNotNull( alignment );
// Print it in a string
ByteArrayOutputStream stream = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter (
new BufferedWriter(
new OutputStreamWriter( stream, "UTF-8" )), true);
AlignmentVisitor renderer = new OWLAxiomsRendererVisitor( writer );
alignment.render( renderer );
}
// Load the stripped down test ==> it loads
// This cannot be passed to an OWL parser because no typechecking has been done
// This is only a syntactic test
@Test(groups = { "full", "omwg", "raw" }, dependsOnMethods = {"testOWLRendering0"})
public void testOWLRendering1() throws Exception {
AlignmentParser aparser = new AlignmentParser( 0 );
aparser.initAlignment( null );
Alignment alignment = aparser.parse( "file:examples/omwg/total-owlable.xml" );
assertNotNull( alignment );
// Print it in a string
ByteArrayOutputStream stream = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter (
new BufferedWriter(
new OutputStreamWriter( stream, "UTF-8" )), true);
/*
OutputStream stream = new FileOutputStream( "/tmp/total.owl" );
PrintWriter writer = new PrintWriter (
new BufferedWriter(
new OutputStreamWriter( stream, "UTF-8" )), true);
*/
AlignmentVisitor renderer = new OWLAxiomsRendererVisitor( writer );
alignment.render( renderer );
writer.flush();
writer.close();
String str1 = stream.toString();
assertEquals( str1.length(), 12099 );
}
@Test(groups = { "full", "omwg", "raw" }, dependsOnMethods = {"setUp"})
public void testExportPath() throws Exception {
/*
......
......@@ -84,14 +84,15 @@ public class EDOALParserTest {
aparser1 = new AlignmentParser( 0 );
aparser1.initAlignment( null );
//System.err.println( str1 );
alignment = aparser1.parseString( str1 );
Alignment al = aparser1.parseString( str1 );
assertEquals( alignment.nbCells(), al.nbCells() );
// Print it in another string
stream = new ByteArrayOutputStream();
writer = new PrintWriter (
new BufferedWriter(
new OutputStreamWriter( stream, "UTF-8" )), true);
renderer = new RDFRendererVisitor( writer );
alignment.render( renderer );
al.render( renderer );
writer.flush();
writer.close();
String str2 = stream.toString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment