Class AbstractNIFParser
- All Implemented Interfaces:
NIFParser
- Direct Known Subclasses:
TurtleNIFParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate static final org.slf4j.Loggerprivate DocumentListParserprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theDocumentListParserused by this parser.This method should return the HTTP content type string for the data that can be handled by this reader.protected voidinfereTypes(org.apache.jena.rdf.model.Model nifModel) parseNIF(InputStream is) Parses the NIF data read from the given InputStream and returns the list of documents that could be found.parseNIF(InputStream is, org.apache.jena.rdf.model.Model nifModel) LikeNIFParser.parseNIF(InputStream), this method parses the NIF data inside the given String and returns the list of documents that could be found.Parses the NIF data read from the given Reader and returns the list of documents that could be found.LikeNIFParser.parseNIF(Reader), this method parses the NIF data inside the given String and returns the list of documents that could be found.Parses the NIF data inside the given String and returns the list of documents that could be found.LikeNIFParser.parseNIF(String), this method parses the NIF data inside the given String and returns the list of documents that could be found.protected abstract org.apache.jena.rdf.model.ModelparseNIFModel(InputStream is, org.apache.jena.rdf.model.Model nifModel) protected abstract org.apache.jena.rdf.model.ModelparseNIFModel(Reader reader, org.apache.jena.rdf.model.Model nifModel) voidsetDocumentListParser(DocumentListParser listParser) Sets theDocumentListParserused by this parser.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
TYPE_INFERENCE_RULES
- See Also:
-
httpContentType
-
parser
-
-
Constructor Details
-
AbstractNIFParser
-
-
Method Details
-
parseNIF
Description copied from interface:NIFParserParses the NIF data inside the given String and returns the list of documents that could be found. -
parseNIF
Description copied from interface:NIFParserLikeNIFParser.parseNIF(String), this method parses the NIF data inside the given String and returns the list of documents that could be found. But it uses the given model to store this information.Note that the parser will use and change the data that is already inside the given model.
The aim of this method is to take a reference to a model (that might be empty) and store all additional information that has been read but could not be added to the created
Documentinstances. -
parseNIF
Description copied from interface:NIFParserParses the NIF data read from the given Reader and returns the list of documents that could be found.Note that following the recommendations of the Jena framework we highly recommend to use
NIFParser.parseNIF(InputStream)instead of using aReadersince theInputStreamis not relying on a specific encoding. -
parseNIF
Description copied from interface:NIFParserLikeNIFParser.parseNIF(Reader), this method parses the NIF data inside the given String and returns the list of documents that could be found. But it uses the given model to store this information.Note that following the recommendations of the Jena framework we highly recommend to use
NIFParser.parseNIF(InputStream, Model)instead of using aReadersince theInputStreamis not relying on a specific encoding.Note that the parser will use and change the data that is already inside the given model.
The aim of this method is to take a reference to a model (that might be empty) and store all additional information that has been read but could not be added to the created
Documentinstances. -
parseNIFModel
protected abstract org.apache.jena.rdf.model.Model parseNIFModel(Reader reader, org.apache.jena.rdf.model.Model nifModel) -
parseNIF
Description copied from interface:NIFParserParses the NIF data read from the given InputStream and returns the list of documents that could be found.- Specified by:
parseNIFin interfaceNIFParser- Parameters:
is- anInputStreamfrom which the NIF data is read- Returns:
- a list of
Documentinstances found in the given NIF
-
parseNIF
Description copied from interface:NIFParserLikeNIFParser.parseNIF(InputStream), this method parses the NIF data inside the given String and returns the list of documents that could be found. But it uses the given model to store this information.Note that the parser will use and change the data that is already inside the given model.
The aim of this method is to take a reference to a model (that might be empty) and store all additional information that has been read but could not be added to the created
Documentinstances.- Specified by:
parseNIFin interfaceNIFParser- Parameters:
is- anInputStreamfrom which the NIF data is readnifModel- a model which is used to store the NIF data- Returns:
- a list of
Documentinstances found in the given NIF
-
parseNIFModel
protected abstract org.apache.jena.rdf.model.Model parseNIFModel(InputStream is, org.apache.jena.rdf.model.Model nifModel) -
getHttpContentType
Description copied from interface:NIFParserThis method should return the HTTP content type string for the data that can be handled by this reader.- Specified by:
getHttpContentTypein interfaceNIFParser- Returns:
- the HTTP content type string
-
getDocumentListParser
Description copied from interface:NIFParserReturns theDocumentListParserused by this parser.- Specified by:
getDocumentListParserin interfaceNIFParser- Returns:
- the
DocumentListParserused by this parser
-
setDocumentListParser
Description copied from interface:NIFParserSets theDocumentListParserused by this parser.- Specified by:
setDocumentListParserin interfaceNIFParser- Parameters:
listParser- theDocumentListParserused by this parser
-
infereTypes
protected void infereTypes(org.apache.jena.rdf.model.Model nifModel)
-