|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.hp.hpl.jena.rdf.arp.ARP
Another RDF Parser.
To load an RDF file:
| Field Summary |
| Constructor Summary | |
ARP()
Creates a new RDF Parser. |
|
| Method Summary | |
void |
load(java.io.InputStream in)
Load RDF/XML from an InputStream, using base URL http://unknown.org/. |
void |
load(java.io.InputStream in,
java.lang.String xmlBase)
Load RDF/XML from an InputStream. |
void |
load(java.io.Reader in)
Load RDF/XML from a Reader, using base URL http://unknown.org/. |
void |
load(java.io.Reader in,
java.lang.String xmlBase)
Load RDF/XML from a Reader. |
void |
setDefaultErrorMode()
Resets error mode to the default values: most errors are reported as warnings, but triples are produced. |
void |
setEmbedding(boolean embed)
Sets whether the XML document is only RDF, or contains RDF embedded in other XML. |
void |
setErrorHandler(org.xml.sax.ErrorHandler eh)
Sets the error handler, for both XML and RDF parse errors. |
int |
setErrorMode(int errno,
int mode)
Sets or gets the error handling mode for a specific error condition. |
void |
setLaxErrorMode()
As many errors as possible are ignored. |
StatementHandler |
setStatementHandler(StatementHandler sh)
Sets the StatementHandler that provides the callback mechanism for each triple in the file. |
void |
setStrictErrorMode()
This method tries to emulate the latest Working Group recommendations. |
void |
setStrictErrorMode(int nonErrorMode)
This method detects and prohibits errors according to the latest Working Group recommendations. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ARP()
| Method Detail |
public StatementHandler setStatementHandler(StatementHandler sh)
sh - The statement handler to use.
public void setErrorHandler(org.xml.sax.ErrorHandler eh)
void error( SAXParseException e ) throws SAXException {
if ( e instanceof com.hp.hpl.jena.rdf.arp.ParseException ) {
...
} else {
...
}
}
See the ARP documentation for ErrorHandler for details of the ErrorHandler semantics (in particular how to upgrade a warning to an error, and an error to a fatalError).
The Xerces/SAX documentation for ErrorHandler is available on the web.
eh - The error handler to use.
public int setErrorMode(int errno,
int mode)
errno - The specific error condition to change.mode - The new mode one of:
public void setDefaultErrorMode()
public void setLaxErrorMode()
public void setStrictErrorMode()
public void setStrictErrorMode(int nonErrorMode)
ARPErrorNumbers.WARN_PROCESSING_INSTRUCTION_IN_RDF and
ARPErrorNumbers.WARN_LEGAL_REUSE_OF_ID, nonErrorMode is used.
nonErrorMode - The way of treating non-error conditions.public void setEmbedding(boolean embed)
embed - true: Look for embedded RDF (the default); or false: match a typed node or rdf:Description against the whole document.
public void load(java.io.Reader in,
java.lang.String xmlBase)
throws org.xml.sax.SAXException,
java.io.IOException
in - The input XML document.xmlBase - The base URI for the document.
org.xml.sax.SAXException - More serious error during XML or RDF processing; or thrown from the fatalError method of the ErrorHandler.
java.io.IOException - Occurring during XML processing.
public void load(java.io.InputStream in,
java.lang.String xmlBase)
throws org.xml.sax.SAXException,
java.io.IOException
in - The input XML document.xmlBase - The base URI for the document.
org.xml.sax.SAXException - More serious error during XML or RDF processing; or thrown from the fatalError method of the ErrorHandler.
java.io.IOException - Occurring during XML processing.
public void load(java.io.InputStream in)
throws org.xml.sax.SAXException,
java.io.IOException
in - The input XML document.
org.xml.sax.SAXException - More serious error during XML or RDF processing; or thrown from the fatalError method of the ErrorHandler.
java.io.IOException - Occurring during XML processing.
public void load(java.io.Reader in)
throws org.xml.sax.SAXException,
java.io.IOException
in - The input XML document.
org.xml.sax.SAXException - More serious error during XML or RDF processing; or thrown from the fatalError method of the ErrorHandler.
java.io.IOException - Occurring during XML processing.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||