From a13a9617c0aac79cb90e069f1f774be54fcd96eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Euzenat?= <Jerome.Euzenat@inria.fr> Date: Sun, 8 Feb 2009 15:06:46 +0000 Subject: [PATCH] - Added output of extensions as comments or rdfs:comment --- .../impl/renderer/COWLMappingRendererVisitor.java | 10 +++++++++- .../exmo/align/impl/renderer/SWRLRendererVisitor.java | 9 ++++++++- .../exmo/align/impl/renderer/XSLTRendererVisitor.java | 10 +++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java index 33c53725..63481deb 100644 --- a/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java +++ b/src/fr/inrialpes/exmo/align/impl/renderer/COWLMappingRendererVisitor.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA Rhône-Alpes, 2003-2004, 2007-2008 + * Copyright (C) INRIA, 2003-2004, 2007-2009 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -33,6 +33,7 @@ import org.semanticweb.owl.align.Parameters; import org.semanticweb.owl.align.Cell; import org.semanticweb.owl.align.Relation; +import fr.inrialpes.exmo.align.impl.BasicParameters; import fr.inrialpes.exmo.align.impl.ObjectAlignment; import fr.inrialpes.exmo.align.impl.rel.*; import fr.inrialpes.exmo.align.onto.LoadedOntology; @@ -73,6 +74,13 @@ public class COWLMappingRendererVisitor implements AlignmentVisitor writer.print(" xml:base=\"http://www.itc.it/cowl#\" \n"); writer.print(" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\">\n\n"); writer.print(" <cowl:Mapping rdf:ID=\"\">\n"); + writer.print(" <rdfs:comment>Generated by fr.inrialpes.exmo.impl.renderer.COWLMappingRendererVisitor</rdfs:comment>\n"); + for ( Object ext : ((BasicParameters)align.getExtensions()).getValues() ){ + String name = ((String[])ext)[1]; + writer.print(" <rdfs:comment>"+name+": "+((String[])ext)[2]+"</rdfs:comment>\n"); + } + writer.print("\n"); + writer.print(" <cowl:sourceOntology>\n"); writer.print(" <owl:Ontology rdf:about=\""+onto1.getURI()+"\"/>\n"); writer.print(" </cowl:sourceOntology>\n"); diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java index 1b2d3df2..098c11b4 100644 --- a/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java +++ b/src/fr/inrialpes/exmo/align/impl/renderer/SWRLRendererVisitor.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA Rhône-Alpes, 2003-2004, 2007-2008 + * Copyright (C) INRIA, 2003-2004, 2007-2009 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -35,6 +35,7 @@ import org.semanticweb.owl.align.Cell; import org.semanticweb.owl.align.Relation; import fr.inrialpes.exmo.align.impl.ObjectAlignment; +import fr.inrialpes.exmo.align.impl.BasicParameters; import fr.inrialpes.exmo.align.impl.rel.*; import fr.inrialpes.exmo.align.onto.LoadedOntology; @@ -76,6 +77,12 @@ public class SWRLRendererVisitor implements AlignmentVisitor { writer.println(" xmlns:swrlx=\"http://www.w3.org/2003/11/swrlx#\""); writer.println(" xmlns:owlx=\"http://www.w3.org/2003/05/owl-xml\""); writer.println(" xmlns:ruleml=\"http://www.w3.org/2003/11/ruleml#\">"); + writer.print("\n <!-- Generated by fr.inrialpes.exmo.impl.renderer.SWRLRendererVisitor -->\n"); + for ( Object ext : ((BasicParameters)align.getExtensions()).getValues() ){ + String name = ((String[])ext)[1]; + writer.print(" <owlx:Annotation><owlx:Documentation>"+name+": "+((String[])ext)[2]+"</owlx:Documentation></owlx:Annotation>\n"); + } + writer.print("\n"); writer.println(" <owlx:Imports rdf:resource=\""+onto1.getURI()+"\"/>\n"); for( Enumeration e = align.getElements() ; e.hasMoreElements(); ){ Cell c = (Cell)e.nextElement(); diff --git a/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java b/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java index 2f9f4fac..b85323de 100644 --- a/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java +++ b/src/fr/inrialpes/exmo/align/impl/renderer/XSLTRendererVisitor.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA, 2003-2004, 2006-2008 + * Copyright (C) INRIA, 2003-2004, 2006-2009 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by @@ -35,6 +35,7 @@ import org.semanticweb.owl.align.Cell; import org.semanticweb.owl.align.Relation; import fr.inrialpes.exmo.align.impl.rel.*; +import fr.inrialpes.exmo.align.impl.BasicParameters; import fr.inrialpes.exmo.align.impl.ObjectAlignment; import fr.inrialpes.exmo.align.onto.LoadedOntology; @@ -89,6 +90,13 @@ public class XSLTRendererVisitor implements AlignmentVisitor { } writer.println(" >\n"); + writer.print(" <!-- Generated by fr.inrialpes.exmo.impl.renderer.XSLTRendererVisitor -->\n"); + for ( Object ext : ((BasicParameters)align.getExtensions()).getValues() ){ + String name = ((String[])ext)[1]; + writer.print(" <!-- "+name+": "+((String[])ext)[2]+" -->\n"); + } + writer.print("\n"); + for ( Enumeration e = align.getElements() ; e.hasMoreElements(); ){ Cell c = (Cell)e.nextElement(); c.accept( this ); -- GitLab