|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hp.hpl.jena.rdf.arp.ARP
Another RDF Parser.
To load an RDF file:
For very large files, ARP does not use any additional
memory except when either the ExtendedHandler.discardNodesWithNodeID()
returns false or when the AResource.setUserData(java.lang.Object)
method has been
used. In these cases ARP needs to remember the rdf:nodeID
usage through the file life time.
Field Summary |
Constructor Summary | |
ARP()
Creates a new RDF Parser. |
Method Summary | |
org.xml.sax.Locator |
getLocator()
When parsing a file, this returns a Locator giving the position of the last XML event processed by ARP. |
static void |
initEncoding()
This method is a work-around for a Xerces bug. |
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. |
ExtendedHandler |
setExtendedHandler(ExtendedHandler sh)
Sets the ExtendedHandler that provides the callback mechanism for bnodes as they leave scope, and for the start and end of rdf:RDF elements. |
void |
setLaxErrorMode()
As many errors as possible are ignored. |
NamespaceHandler |
setNamespaceHandler(NamespaceHandler sh)
Sets the NamespaceHandler that provides the callback mechanism for XML namespace declarations. |
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 static void initEncoding()
public ExtendedHandler setExtendedHandler(ExtendedHandler sh)
See note about large files in class documentation.
sh
- The handler to use.
public NamespaceHandler setNamespaceHandler(NamespaceHandler sh)
sh
- The handler to use.
public org.xml.sax.Locator getLocator()
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; or false: match a typed node or rdf:Description against the whole document (the default).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 |