com.hp.hpl.mesa.rdf.jena.common
Class RDFXMLReader

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.common.RDFXMLReader
All Implemented Interfaces:
com.megginson.sax.rdf.RDFHandler, RDFReader

public class RDFXMLReader
extends java.lang.Object
implements com.megginson.sax.rdf.RDFHandler, RDFReader

Uses David Megginson's RDF Filter to load an XML serialization into a model.

Uses the Sax2 parser specified by the org.xml.sax.driver system property. If this is not set, uses the Apache Xerces parser by default.

Version:
Release='$Name: $' Revision='$Revision: 1.3 $' Date='$Date: 2001/07/04 18:40:33 $'
Author:
bwm

Fields inherited from interface com.megginson.sax.rdf.RDFHandler
featureName, propertyName, SUBJECT_DISTRIBUTED, SUBJECT_GENERATED, SUBJECT_URI, SUBJECT_URI_PATTERN
 
Method Summary
 void endXMLStatement()
           
 void literalStatement(int subjectType, java.lang.String subject, java.lang.String predicate, java.lang.String object, java.lang.String language)
           
 void literalStatement(int subjectType, java.lang.String subject, java.lang.String predicate, java.lang.String object, java.lang.String language, boolean wellFormed)
           
 void read(Model model, java.io.Reader reader, java.lang.String base)
          Read serialized RDF from a Reader and add the statements to a Model
 void read(Model model, java.lang.String url)
          Read serialized RDF from a url and add the statements to a model.
 void resourceStatement(int subjectType, java.lang.String subject, java.lang.String predicate, java.lang.String object)
           
 RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
          Set an error handler for the reader
 java.lang.Object setProperty(java.lang.String propName, java.lang.Object propValue)
          Set a property to control the reader's behaviour.
 void startXMLStatement(int subjectType, java.lang.String subject, java.lang.String predicate, java.lang.String language)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public void read(Model model,
                 java.io.Reader reader,
                 java.lang.String base)
          throws RDFException
Description copied from interface: RDFReader
Read serialized RDF from a Reader and add the statements to a Model
Specified by:
read in interface RDFReader
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFReader
Parameters:
model - The model to which statements are added.
r - the reader from which to read

read

public void read(Model model,
                 java.lang.String url)
          throws RDFException
Description copied from interface: RDFReader
Read serialized RDF from a url and add the statements to a model.
Specified by:
read in interface RDFReader
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFReader
Parameters:
model - the model to which statements should be added
url - the url, as a string, from which the serialized RDF should be read.

setProperty

public java.lang.Object setProperty(java.lang.String propName,
                                    java.lang.Object propValue)
                             throws RDFException
Set a property to control the reader's behaviour.

This reader currently recognises no properties. Invoking this method always causes an UNKNOWNPROPERTY RDFException to be raised.

?
Specified by:
setProperty in interface RDFReader
Parameters:
propName - The name of the property to be set
propValue - The new value of the property
Returns:
the previous value of the property
Throws:
RDFException - Throws UNKNOWNPROPERTY RDFException if the property name is not recognised

setErrorHandler

public RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
Description copied from interface: RDFReader
Set an error handler for the reader
Specified by:
setErrorHandler in interface RDFReader
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFReader
Parameters:
errHandler - the new error handler
Returns:
the previous error handler

literalStatement

public void literalStatement(int subjectType,
                             java.lang.String subject,
                             java.lang.String predicate,
                             java.lang.String object,
                             java.lang.String language)
Specified by:
literalStatement in interface com.megginson.sax.rdf.RDFHandler

literalStatement

public void literalStatement(int subjectType,
                             java.lang.String subject,
                             java.lang.String predicate,
                             java.lang.String object,
                             java.lang.String language,
                             boolean wellFormed)

resourceStatement

public void resourceStatement(int subjectType,
                              java.lang.String subject,
                              java.lang.String predicate,
                              java.lang.String object)
Specified by:
resourceStatement in interface com.megginson.sax.rdf.RDFHandler

startXMLStatement

public void startXMLStatement(int subjectType,
                              java.lang.String subject,
                              java.lang.String predicate,
                              java.lang.String language)
Specified by:
startXMLStatement in interface com.megginson.sax.rdf.RDFHandler

endXMLStatement

public void endXMLStatement()
Specified by:
endXMLStatement in interface com.megginson.sax.rdf.RDFHandler


Copyright © 2001 Hewlett-Packard. All Rights Reserved.