Class AbstractRDFParser<T extends AbstractRDFParser<T>>

java.lang.Object
org.apache.commons.rdf.simple.experimental.AbstractRDFParser<T>
All Implemented Interfaces:
Cloneable, RDFParser
Direct Known Subclasses:
JsonLdParser, RDF4JParser

public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>> extends Object implements RDFParser, Cloneable
Abstract RDFParser

This abstract class keeps the properties in protected fields like sourceFile using Optional. Some basic checking like checkIsAbsolute(IRI) is performed.

This class and its subclasses are Cloneable, immutable and (therefore) thread-safe - each call to option methods like contentType(String) or source(IRI) will return a cloned, mutated copy.

By default, parsing is done by the abstract method parseSynchronusly() - which is executed in a cloned snapshot - hence multiple parse() calls are thread-safe. The default parse() uses a thread pool in threadGroup - but implementations can override parse() (e.g. because it has its own threading model or use asynchronous remote execution).