Mentions légales du service

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

- introduced atributes method and semantics

parent 376c4533
No related branches found
No related tags found
No related merge requests found
/*
* $Id$
*
* Copyright (C) INRIA Rhne-Alpes, 2003-2004
* Copyright (C) INRIA Rhne-Alpes, 2003-2005
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
......@@ -55,6 +55,7 @@ public class BasicCell implements Cell, Comparable {
}
String id = null;
String semantics = null;
OWLEntity object1 = null;
OWLEntity object2 = null;
Relation relation = null;
......@@ -106,6 +107,11 @@ public class BasicCell implements Cell, Comparable {
public String getId(){ return id; };
public void setId( String id ){ this.id = id; };
public String getSemantics(){
if ( semantics != null ) { return semantics; }
else { return "first-order"; }
};
public void setSemantics( String sem ){ semantics = sem; };
public Object getObject1(){ return object1; };
public Object getObject2(){ return object2; };
public void setObject1( Object ob ) throws AlignmentException {
......
......@@ -113,7 +113,10 @@ public class RDFRendererVisitor implements AlignmentVisitor
writer.print( ((OWLEntity)cell.getObject2()).getURI().toString() );
writer.print("'/>\n <measure rdf:datatype='http://www.w3.org/2001/XMLSchema#float'>");
writer.print( cell.getStrength() );
writer.print("</measure>\n <relation>");
writer.print("</measure>\n");
if ( !cell.getSemantics().equals("first-order") )
writer.print(" <semantics>"+cell.getSemantics()+"</semantics>\n");
writer.print(" <relation>");
cell.getRelation().accept( this );
writer.print("</relation>\n </Cell>\n </map>\n");
} catch ( OWLException e) { throw new AlignmentException( "getURI problem", e ); }
......
......@@ -137,6 +137,11 @@ public class AlignmentParser extends DefaultHandler {
*/
protected String id = null;
/**
* the semantics of the cell (default first-order)...
*/
protected String sem = null;
/**
* the measure content as text...
*/
......@@ -191,6 +196,7 @@ public class AlignmentParser extends DefaultHandler {
if(namespaceURI.equals("http://knowledgeweb.semanticweb.org/heterogeneity/alignment")) {
try {
if (pName.equals("relation")) {
} else if (pName.equals("semantics")) {
} else if (pName.equals("measure")) {
} else if (pName.equals("entity2")) {
if(debugMode > 2)
......@@ -206,6 +212,7 @@ public class AlignmentParser extends DefaultHandler {
if ( atts.getValue("rdf:resource") != null ){
id = atts.getValue("rdf:resource");
}
sem = null;
measure = null;
relation = null;
cl1 = null;
......@@ -293,6 +300,8 @@ public class AlignmentParser extends DefaultHandler {
relation = content;
} else if (pName.equals("measure")) {
measure = content;
} else if (pName.equals("semantics")) {
sem = content;
} else if (pName.equals("entity2")) {
} else if (pName.equals("entity1")) {
} else if (pName.equals("Cell")) {
......@@ -309,6 +318,7 @@ public class AlignmentParser extends DefaultHandler {
} else {
cell = alignment.addAlignCell( cl1, cl2, relation, Double.parseDouble(measure) );}
if ( id != null ) cell.setId( id );
if ( sem != null ) cell.setSemantics( sem );
} else if (pName.equals("map")) {
} else if (pName.equals("uri1")) {
onto1 = (OWLOntology)ontologies.get( content );
......
/*
* $Id$
*
* Copyright (C) INRIA Rhône-Alpes, 2003-2004
* Copyright (C) INRIA Rhône-Alpes, 2003-2005
*
* 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
......@@ -48,6 +48,8 @@ public interface Cell
public String getId();
public void setId( String id );
public String getSemantics();
public void setSemantics( String s );
public Object getObject1();
public Object getObject2();
public void setObject1( Object ob ) throws AlignmentException;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment