|
Alignment API and Server 3.5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
fr.inrialpes.exmo.align.parser.AlignmentParser
public class AlignmentParser
This class allows the creation of a parser for an Alignment file. The class is called by: AlignmentParser parser = new AlignmentParser( debugLevel ); Alignment alignment = parser.parse( input ); input can be a URI as a String, an InputStream This new version (January 2004) parses the alignment description in RDF/XML/OWL format
Field Summary | |
---|---|
protected int |
alignLevel
The level at which we found the Alignment tag. |
protected Alignment |
alignment
the alignment that is parsed We always create a URIAlignment (we could also use a BasicAlignment). |
protected Cell |
cell
the relation content as text... |
protected Object |
cl1
the first entity of a cell |
protected Object |
cl2
the second entity of a cell |
protected String |
content
the content found as text... |
(package private) Ontology |
curronto
|
protected int |
debugMode
level of debug/warning information |
protected boolean |
embedded
The parsing level, if equal to 3 we are in the Alignment if equal to 5 we are in a cell and can find metadata |
protected Parameters |
extensions
Cell extensions (default null) |
protected String |
id
the cell id as text... |
protected String |
measure
the measure content as text... |
(package private) Ontology |
onto1
the first Ontology |
(package private) Ontology |
onto2
the second Ontology |
protected int |
parseLevel
The parsing level, if equal to 3 we are in the Alignment if equal to 5 we are in a cell and can find metadata |
protected SAXParser |
parser
XML Parser 1 |
protected String |
relation
the relation content as text... |
protected String |
sem
the semantics of the cell (default first-order)... |
protected String |
uri
a URI to a process |
Constructor Summary | |
---|---|
AlignmentParser(int debugMode)
Creates an XML Parser. |
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
Put the content in a variable |
void |
endElement(String namespaceURI,
String pName,
String qName)
Called by the XML parser at the end of an element. |
private Object |
getEntity(Object ontology,
String name)
|
void |
initAlignment(URIAlignment al)
Allows to have the parser filling an existing alignment instead of creating a new one |
Alignment |
parse(InputStream s)
Parses a string instead of a URI |
Alignment |
parse(String uri)
Parses the document corresponding to the URI given in parameter If the current process has links (import or include) to others documents then they are parsed. |
Alignment |
parse(String uri,
Hashtable loaded)
Deprecated. use parse( URI ) instead |
Alignment |
parseString(String s)
Parses a string instead of a URI |
void |
setEmbedded(boolean b)
|
void |
startElement(String namespaceURI,
String pName,
String qname,
Attributes atts)
Called by the XML parser at the begining of an element. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int debugMode
protected String uri
Ontology onto1
Ontology curronto
Ontology onto2
protected Alignment alignment
protected String content
protected Object cl1
protected Object cl2
protected Cell cell
protected String relation
protected String id
protected String sem
protected Parameters extensions
protected String measure
protected SAXParser parser
protected int parseLevel
protected boolean embedded
protected int alignLevel
Constructor Detail |
---|
public AlignmentParser(int debugMode) throws ParserConfigurationException, SAXException
debugMode
- The value of the debug mode
ParserConfigurationException
SAXException
Method Detail |
---|
public void setEmbedded(boolean b)
@Deprecated public Alignment parse(String uri, Hashtable loaded) throws SAXException, IOException, org.omwg.mediation.parser.rdf.RDFParserException
uri
- URI of the document to parseloaded
- (cached ontologies)
SAXException
IOException
org.omwg.mediation.parser.rdf.RDFParserException
public Alignment parse(String uri) throws SAXException, IOException, org.omwg.mediation.parser.rdf.RDFParserException
uri
- URI of the document to parse
SAXException
IOException
org.omwg.mediation.parser.rdf.RDFParserException
public Alignment parseString(String s) throws SAXException, IOException
s
- String the string to parse
SAXException
IOException
public Alignment parse(InputStream s) throws SAXException, IOException
s
- String the string to parse
SAXException
IOException
public void initAlignment(URIAlignment al)
al
- URIAlignment the alignment to be returned by the parser
Note that this function is also useful for reseting the parser
and using it once again by parser.initAlignment( null )
Otherwise, this may lead to errors.public void startElement(String namespaceURI, String pName, String qname, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
namespaceURI
- The namespace of the current elementpName
- The local name of the current elementqname
- The name of the current elementatts
- The attributes name of the current element
SAXException
private Object getEntity(Object ontology, String name) throws SAXException
SAXException
public void characters(char[] ch, int start, int length)
characters
in interface ContentHandler
characters
in class DefaultHandler
public void endElement(String namespaceURI, String pName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
namespaceURI
- The namespace of the current elementpName
- The local name of the current elementqName
- The name of the current element
SAXException
|
Alignment API and Server 3.5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |