public class RDFParser extends DefaultHandler implements IRIProvider
| Constructor and Description |
|---|
RDFParser() |
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endDocument() |
void |
endElement(String uri,
String localName,
String qName) |
void |
error(SAXParseException e) |
void |
fatalError(SAXParseException e) |
IRI |
getIRI(String s) |
void |
parse(InputSource source,
RDFConsumer inputConsumer)
Parses RDF from given input source.
|
void |
popState()
Pops a state from the stack.
|
void |
processingInstruction(String target,
String data) |
void |
pushState(State s)
Pushes a new state on the state stack.
|
String |
resolveIRI(String uri)
Resolves an IRI with the current base.
|
void |
setDocumentLocator(Locator locator) |
void |
setErrorHandler(ErrorHandler errorHandler)
Sets the error handler.
|
void |
startDocument() |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes) |
void |
statementWithLiteralValue(String subject,
String predicate,
String object,
String dataType,
String reificationID)
Called when a statement with literal value is added to the model.
|
void |
statementWithResourceValue(String subject,
String predicate,
String object,
String reificationID)
Called when a statement with resource value is added to the model.
|
void |
verify(boolean b,
String message)
If conditon b is true, throw an exception with provided message.
|
void |
warning(SAXParseException e) |
endPrefixMapping, ignorableWhitespace, notationDecl, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDeclpublic void setDocumentLocator(@Nullable Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandlerpublic void parse(InputSource source, RDFConsumer inputConsumer) throws SAXException, IOException
source - specifies where RDF comes frominputConsumer - receives notifications about RDF parsing eventsSAXException - SAXExceptionIOException - IOExceptionpublic void setErrorHandler(ErrorHandler errorHandler)
errorHandler - the error handlerpublic void warning(@Nullable SAXParseException e) throws SAXException
warning in interface ErrorHandlerwarning in class DefaultHandlerSAXExceptionpublic void error(@Nullable SAXParseException e) throws SAXException
error in interface ErrorHandlererror in class DefaultHandlerSAXExceptionpublic void fatalError(@Nullable SAXParseException e) throws SAXException
fatalError in interface ErrorHandlerfatalError in class DefaultHandlerSAXExceptionpublic void startDocument()
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerpublic void endDocument()
endDocument in interface ContentHandlerendDocument in class DefaultHandlerpublic void startElement(@Nullable String uri, @Nullable String localName, @Nullable String qName, @Nullable Attributes attributes) throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXExceptionpublic void endElement(@Nullable String uri, @Nullable String localName, @Nullable String qName) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionpublic void characters(@Nullable char[] ch, int start, int length) throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXExceptionpublic void processingInstruction(@Nullable String target, @Nullable String data)
processingInstruction in interface ContentHandlerprocessingInstruction in class DefaultHandlerpublic void pushState(State s)
s - new statepublic void popState()
public String resolveIRI(String uri)
uri - the IRI being resolvedpublic void statementWithResourceValue(String subject, String predicate, String object, @Nullable String reificationID)
subject - IRI of the subject resourcepredicate - IRI of the predicate resourceobject - IRI of the object resourcereificationID - if not null, contains IRI of the resource that will wold the
reified statementpublic void statementWithLiteralValue(String subject, String predicate, String object, @Nullable String dataType, @Nullable String reificationID)
subject - IRI of the subject resourcepredicate - IRI of the predicate resourceobject - literal object valuedataType - the IRI of the literal's datatype (may be null)reificationID - if not null, contains IRI of the resource that will wold the
reified statementpublic IRI getIRI(String s)
getIRI in interface IRIProviders - input Stringpublic void verify(boolean b,
String message)
b - condition to verifymessage - message for the exceptionRDFParserException - exception thrownCopyright © 2019 The University of Manchester. All rights reserved.