From 91cad8ad61b016890964cd4eca47a5d5b62a36f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Euzenat?= <Jerome.Euzenat@inria.fr> Date: Thu, 29 Apr 2004 11:05:58 +0000 Subject: [PATCH] - added an id attribute (reads as rdf:resource) --- .../exmo/align/parser/AlignmentParser.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/fr/inrialpes/exmo/align/parser/AlignmentParser.java b/src/fr/inrialpes/exmo/align/parser/AlignmentParser.java index adeaf0d4..2329a611 100644 --- a/src/fr/inrialpes/exmo/align/parser/AlignmentParser.java +++ b/src/fr/inrialpes/exmo/align/parser/AlignmentParser.java @@ -59,6 +59,7 @@ import org.semanticweb.owl.io.owl_rdf.OWLRDFParser; import org.semanticweb.owl.io.owl_rdf.OWLRDFErrorHandler; import org.semanticweb.owl.align.Alignment; +import org.semanticweb.owl.align.Cell; import org.semanticweb.owl.align.AlignmentException; import fr.inrialpes.exmo.align.impl.BasicAlignment; @@ -121,11 +122,21 @@ public class AlignmentParser extends DefaultHandler { */ protected OWLEntity cl2 = null; + /** + * the relation content as text... + */ + protected Cell cell = null; + /** * the relation content as text... */ protected String relation = null; + /** + * the cell id as text... + */ + protected String id = null; + /** * the measure content as text... */ @@ -191,7 +202,10 @@ public class AlignmentParser extends DefaultHandler { cl1 = (OWLEntity)getEntity( onto1, atts.getValue("rdf:resource") ); } else if (pName.equals("Cell")) { if ( alignment == null ) - { throw new SAXException("No alignment provided"); } + { throw new SAXException("No alignment provided"); }; + if ( atts.getValue("rdf:resource") != null ){ + id = atts.getValue("rdf:resource"); + } measure = null; relation = null; cl1 = null; @@ -289,9 +303,10 @@ public class AlignmentParser extends DefaultHandler { if ( cl1 == null || cl2 == null ) { throw new SAXException( "Missing entity "+cl1+" "+cl2 ); } if ( measure == null || relation == null ){ - alignment.addAlignCell( cl1, cl2); + cell = alignment.addAlignCell( cl1, cl2); } else { - alignment.addAlignCell( cl1, cl2, relation, Double.parseDouble(measure) );} + cell = alignment.addAlignCell( cl1, cl2, relation, Double.parseDouble(measure) );} + if ( id != null ) cell.setId( id ); } else if (pName.equals("map")) { } else if (pName.equals("uri1")) { try { alignment.setFile1( new URI( content ) ); -- GitLab