Mentions légales du service

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

- improved (legacy) parsing of uriX and ontoX (with default recopy)

parent 92a0b565
No related branches found
No related tags found
No related merge requests found
...@@ -325,8 +325,6 @@ public class XMLParser extends DefaultHandler { ...@@ -325,8 +325,6 @@ public class XMLParser extends DefaultHandler {
String about = atts.getValue( SyntaxElement.RDF_ABOUT.print() ); String about = atts.getValue( SyntaxElement.RDF_ABOUT.print() );
if ( about != null && !about.equals("") ) { if ( about != null && !about.equals("") ) {
try { try {
// JE: Onto
//curronto.setOntology( new URI( atts.getValue("rdf:about") ) );
curronto.setURI( new URI( about ) ); curronto.setURI( new URI( about ) );
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
throw new SAXException("onto2: malformed URI"); throw new SAXException("onto2: malformed URI");
...@@ -451,41 +449,38 @@ public class XMLParser extends DefaultHandler { ...@@ -451,41 +449,38 @@ public class XMLParser extends DefaultHandler {
if ( extensions != null ) ((BasicCell)cell).setExtensions( extensions ); if ( extensions != null ) ((BasicCell)cell).setExtensions( extensions );
} else if (pName.equals( SyntaxElement.MAP.name )) { } else if (pName.equals( SyntaxElement.MAP.name )) {
} else if (pName.equals("uri1")) { // Legacy } else if (pName.equals("uri1")) { // Legacy
if ( onto1.getURI() == null ){//JE: Onto try {
try { URI u = new URI( content );
URI u = new URI( content ); onto1.setURI( u );
// JE: Onto if ( onto1.getFile() == null ) onto1.setFile( u );
//onto1.setOntology( u ); } catch (URISyntaxException e) {
onto1.setURI( u ); throw new SAXException("uri1: malformed URI : "+content);
} catch (URISyntaxException e) {
throw new SAXException("uri1: malformed URI");
}
} }
} else if (pName.equals("uri2")) { // Legacy } else if (pName.equals("uri2")) { // Legacy
if ( onto2.getURI() == null ){//JE: Onto try {
try { URI u = new URI( content );
URI u = new URI( content ); onto2.setURI( u );
// JE: Onto if ( onto2.getFile() == null ) onto2.setFile( u );
//onto2.setOntology( u ); } catch (URISyntaxException e) {
onto2.setURI( u ); throw new SAXException("uri1: malformed URI : "+content);
} catch (URISyntaxException e) {
throw new SAXException("uri2: malformed URI");
}
} }
} else if (pName.equals( SyntaxElement.ONTOLOGY.name )) { } else if (pName.equals( SyntaxElement.ONTOLOGY.name )) {
} else if (pName.equals( SyntaxElement.LOCATION.name )) { } else if (pName.equals( SyntaxElement.LOCATION.name )) {
try { curronto.setFile( new URI( content ) ); try { curronto.setFile( new URI( content ) );
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
throw new SAXException("onto2: malformed URI"); throw new SAXException("Malformed URI : "+content );
} }
} else if (pName.equals( SyntaxElement.FORMALISM.name )) { } else if (pName.equals( SyntaxElement.FORMALISM.name )) {
} else if (pName.equals( SyntaxElement.FORMATT.name )) { } else if (pName.equals( SyntaxElement.FORMATT.name )) {
} else if (pName.equals( SyntaxElement.MAPPING_SOURCE.name ) || pName.equals( SyntaxElement.MAPPING_TARGET.name )) { } else if (pName.equals( SyntaxElement.MAPPING_SOURCE.name ) || pName.equals( SyntaxElement.MAPPING_TARGET.name )) {
if ( curronto.getFile() == null && if ( curronto.getFile() == null &&
content != null && !content.equals("") ) { content != null && !content.equals("") ) {
try { curronto.setFile( new URI( content ) ); try {
URI u = new URI( content );
curronto.setFile( u );
if ( curronto.getURI() == null ) curronto.setURI( u );
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
throw new SAXException(pName+": malformed URI"); throw new SAXException(pName+": malformed URI : "+content );
} }
}; };
curronto = null; curronto = null;
......
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