Class SPARQLResultsTSVMappingStrategy
- java.lang.Object
-
- org.eclipse.rdf4j.query.resultio.text.SPARQLResultsXSVMappingStrategy
-
- org.eclipse.rdf4j.query.resultio.text.tsv.SPARQLResultsTSVMappingStrategy
-
- All Implemented Interfaces:
com.opencsv.bean.MappingStrategy<BindingSet>
- Direct Known Subclasses:
SPARQLStarResultsTSVMappingStrategy
public class SPARQLResultsTSVMappingStrategy extends SPARQLResultsXSVMappingStrategy
Implements aMappingStrategyto allow opencsv to work in parallel. This is where the input is converted intoBindingSets.
-
-
Field Summary
-
Fields inherited from class org.eclipse.rdf4j.query.resultio.text.SPARQLResultsXSVMappingStrategy
bindingNames, numberPattern, valueFactory
-
-
Constructor Summary
Constructors Constructor Description SPARQLResultsTSVMappingStrategy(ValueFactory valueFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcaptureHeader(com.opencsv.CSVReader reader)protected static java.lang.StringdecodeString(java.lang.String s)Decodes an encoded Turtle string.private intfindEndOfLabel(java.lang.String literal)Finds the end of the label in a literal string.protected LiteralparseLiteral(java.lang.String literal)Parses a literal, creates an object for it and returns this object.protected ValueparseValue(java.lang.String valueString)BindingSetpopulateNewBean(java.lang.String[] line)-
Methods inherited from class org.eclipse.rdf4j.query.resultio.text.SPARQLResultsXSVMappingStrategy
generateHeader, getBindingNames, isAnnotationDriven, parseNumberPatternMatch, setErrorLocale, setType, transmuteBean
-
-
-
-
Constructor Detail
-
SPARQLResultsTSVMappingStrategy
public SPARQLResultsTSVMappingStrategy(ValueFactory valueFactory)
-
-
Method Detail
-
captureHeader
public void captureHeader(com.opencsv.CSVReader reader) throws java.io.IOException- Throws:
java.io.IOException
-
populateNewBean
public BindingSet populateNewBean(java.lang.String[] line)
-
parseValue
protected Value parseValue(java.lang.String valueString)
-
parseLiteral
protected Literal parseLiteral(java.lang.String literal) throws java.lang.IllegalArgumentException
Parses a literal, creates an object for it and returns this object.- Parameters:
literal- The literal to parse.- Returns:
- An object representing the parsed literal.
- Throws:
java.lang.IllegalArgumentException- If the supplied literal could not be parsed correctly.
-
findEndOfLabel
private int findEndOfLabel(java.lang.String literal)
Finds the end of the label in a literal string.- Returns:
- The index of the double quote ending the label.
-
decodeString
protected static java.lang.String decodeString(java.lang.String s)
Decodes an encoded Turtle string. Any \-escape sequences are substituted with their decoded value.- Parameters:
s- An encoded Turtle string.- Returns:
- The unencoded string.
- Throws:
java.lang.IllegalArgumentException- If the supplied string is not a correctly encoded Turtle string.
-
-