public class IgnoreAccidentalRDFa extends Object implements TripleHandler
TripleHandler
that suppresses output of the RDFa
parser if the document only contains "accidental" RDFa,
like stylesheet links and other non-RDFa uses of HTML'sConstructor and Description |
---|
IgnoreAccidentalRDFa(TripleHandler wrapped) |
IgnoreAccidentalRDFa(TripleHandler wrapped,
boolean alwaysSuppressCSSTriples)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Will be called last and exactly once.
|
void |
closeContext(ExtractionContext context)
Informs the handler that no more triples will come from a
previously opened context.
|
void |
endDocument(org.eclipse.rdf4j.model.IRI documentIRI)
Informs the handler that the end of the document
has been reached.
|
void |
openContext(ExtractionContext context)
Informs the handler that a new context has been established.
|
void |
receiveNamespace(String prefix,
String uri,
ExtractionContext context)
Invoked with a currently open context, notifies the detection of a
namespace.
|
void |
receiveTriple(org.eclipse.rdf4j.model.Resource s,
org.eclipse.rdf4j.model.IRI p,
org.eclipse.rdf4j.model.Value o,
org.eclipse.rdf4j.model.IRI g,
ExtractionContext context)
Invoked with a currently open context,
notifies the detection of a triple.
|
void |
setContentLength(long contentLength)
Sets the length of the content to be processed.
|
void |
startDocument(org.eclipse.rdf4j.model.IRI documentIRI) |
public IgnoreAccidentalRDFa(TripleHandler wrapped, boolean alwaysSuppressCSSTriples)
wrapped
- the decorated triple handler.alwaysSuppressCSSTriples
- if true
the CSS triples will be
always suppressed even if the document is not empty.
If false
then the CSS triples will be suppressed only if
document is empty.public IgnoreAccidentalRDFa(TripleHandler wrapped)
public void startDocument(org.eclipse.rdf4j.model.IRI documentIRI) throws TripleHandlerException
startDocument
in interface TripleHandler
TripleHandlerException
public void openContext(ExtractionContext context) throws TripleHandlerException
TripleHandler
openContext
in interface TripleHandler
context
- an instantiated ExtractionContext
TripleHandlerException
- if there is an errr opening the
ExtractionContext
public void receiveTriple(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, org.eclipse.rdf4j.model.IRI g, ExtractionContext context) throws TripleHandlerException
TripleHandler
receiveTriple
in interface TripleHandler
s
- triple subject, cannot be null
.p
- triple predicate, cannot be null
.o
- triple object, cannot be null
.g
- triple graph, can be null
.context
- extraction context.TripleHandlerException
- if there is an error receiving the triple.public void receiveNamespace(String prefix, String uri, ExtractionContext context) throws TripleHandlerException
TripleHandler
receiveNamespace
in interface TripleHandler
prefix
- namespace prefix.uri
- namespace IRI.context
- namespace context.TripleHandlerException
- if there is an error receiving the namespace.public void closeContext(ExtractionContext context)
TripleHandler
closeContext
in interface TripleHandler
context
- the context to be closed.public void close() throws TripleHandlerException
TripleHandler
close
in interface AutoCloseable
close
in interface TripleHandler
TripleHandlerException
- if there is an error closing the
TripleHandler
implementation.public void endDocument(org.eclipse.rdf4j.model.IRI documentIRI) throws TripleHandlerException
TripleHandler
endDocument
in interface TripleHandler
documentIRI
- document IRI.TripleHandlerException
- if there is an error ending the document.public void setContentLength(long contentLength)
TripleHandler
setContentLength
in interface TripleHandler
contentLength
- length of the content being processed.Copyright © 2010–2018 The Apache Software Foundation. All rights reserved.