Package org.apache.jena.rdfxml.xmlinput
Class ARP
- java.lang.Object
-
- org.apache.jena.rdfxml.xmlinput.ARP
-
- All Implemented Interfaces:
ARPConfig
public class ARP extends java.lang.Object implements ARPConfig
Another RDF Parser. To load an RDF file:- Create an ARP.
- Set its handlers, by calling the
getHandlers()
method, and then. - Setting the statement handler.
- Optionally setting the other handlers.
- Call a load method.
Xerces is used for parsing the XML. The SAXEvents generated by Xerces are then analysed as RDF by ARP. Errors may occur in either the XML or the RDF part, see
ARPHandlers.setErrorHandler(org.xml.sax.ErrorHandler)
for details of how to distinguish between them.For very large files, ARP does not use any additional memory except when either the
ExtendedHandler.discardNodesWithNodeID()
returns false or when theAResource.setUserData(java.lang.Object)
method has been used. In these cases ARP needs to remember therdf:nodeID
usage through the file life time.See ARP documentation for more information.
Includes contributions from Simon Raboczi and Andrew Newman
-
-
Constructor Summary
Constructors Constructor Description ARP()
Creates a new RDF Parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ARPHandlers
getHandlers()
The handlers used during parsing.org.xml.sax.Locator
getLocator()
When parsing a file, this returns a Locator giving the position of the last XML event processed by ARP.ARPOptions
getOptions()
The options used during parsing.void
load(java.io.InputStream in)
Load RDF/XML from an InputStream, leaving relative URIs as relative.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, leaving relative URIs as relative.void
load(java.io.Reader in, java.lang.String xmlBase)
Load RDF/XML from a Reader.void
setHandlersWith(ARPHandlers handlers)
Copies the handlers from the argument to be used by this instance.void
setOptionsWith(ARPOptions opts)
Copies the options from the argument to be used by this instance.
-
-
-
Method Detail
-
getLocator
public org.xml.sax.Locator getLocator()
When parsing a file, this returns a Locator giving the position of the last XML event processed by ARP. This may return null or misleading results before any tokens have been processed.- Returns:
- Locator
-
load
public void load(java.io.Reader in, java.lang.String xmlBase) throws org.xml.sax.SAXException, java.io.IOException
Load RDF/XML from a Reader.- Parameters:
in
- The input XML document.xmlBase
- The base URI for the document.- Throws:
org.xml.sax.SAXException
- More serious error during XML or RDF processing; or thrown from the ErrorHandler.java.io.IOException
- Occurring during XML processing.
-
load
public void load(java.io.InputStream in, java.lang.String xmlBase) throws org.xml.sax.SAXException, java.io.IOException
Load RDF/XML from an InputStream.- Parameters:
in
- The input XML document.xmlBase
- The base URI for the document.- Throws:
org.xml.sax.SAXException
- More serious error during XML or RDF processing; or thrown from the ErrorHandler.java.io.IOException
- Occurring during XML processing.
-
load
public void load(java.io.InputStream in) throws org.xml.sax.SAXException, java.io.IOException
Load RDF/XML from an InputStream, leaving relative URIs as relative.- Parameters:
in
- The input XML document.- Throws:
org.xml.sax.SAXException
- More serious error during XML or RDF processing; or thrown from the ErrorHandler.java.io.IOException
- Occurring during XML processing.
-
load
public void load(java.io.Reader in) throws org.xml.sax.SAXException, java.io.IOException
Load RDF/XML from a Reader, leaving relative URIs as relative.- Parameters:
in
- The input XML document.- Throws:
org.xml.sax.SAXException
- More serious error during XML or RDF processing; or thrown from the ErrorHandler.java.io.IOException
- Occurring during XML processing.
-
getHandlers
public ARPHandlers getHandlers()
The handlers used during parsing. The handlers can be changed by calling this method and then using theset..Handler
methods inARPHandlers
. The handlers can be copied onto another ARP instance using thesetHandlersWith(org.apache.jena.rdfxml.xmlinput.ARPHandlers)
method.- Specified by:
getHandlers
in interfaceARPConfig
- Returns:
- The handlers used during parsing.
- See Also:
ARPHandlers.setStatementHandler(StatementHandler)
,ARPHandlers.setErrorHandler(ErrorHandler)
,ARPHandlers.setExtendedHandler(ExtendedHandler)
,ARPHandlers.setNamespaceHandler(NamespaceHandler)
,setHandlersWith(org.apache.jena.rdfxml.xmlinput.ARPHandlers)
-
setHandlersWith
public void setHandlersWith(ARPHandlers handlers)
Copies the handlers from the argument to be used by this instance. To make further modifications it is necessary to callgetHandlers()
to retrieve this instance's copy of the handler information.- Specified by:
setHandlersWith
in interfaceARPConfig
- Parameters:
handlers
- The new values to use.
-
getOptions
public ARPOptions getOptions()
The options used during parsing. The options can be changed by calling this method and then using theset..
methods inARPOptions
. The options can be copied onto another ARP instance using thesetOptionsWith(org.apache.jena.rdfxml.xmlinput.ARPOptions)
method.- Specified by:
getOptions
in interfaceARPConfig
- Returns:
- The handlers used during parsing.
- See Also:
ARPOptions.setDefaultErrorMode()
,ARPOptions.setLaxErrorMode()
,ARPOptions.setStrictErrorMode()
,ARPOptions.setStrictErrorMode(int)
,ARPOptions.setEmbedding(boolean)
,ARPOptions.setErrorMode(int, int)
,setOptionsWith(org.apache.jena.rdfxml.xmlinput.ARPOptions)
-
setOptionsWith
public void setOptionsWith(ARPOptions opts)
Copies the options from the argument to be used by this instance. To make further modifications it is necessary to callgetOptions()
to retrieve this instance's copy of the options.- Specified by:
setOptionsWith
in interfaceARPConfig
- Parameters:
opts
- The new values to use.
-
-