| Modifier and Type | Field and Description |
|---|---|
private static Configuration |
currentConfig |
private long |
dt |
private Assistant |
myAssistant |
private TripleGenerator |
myGenerator |
private FeatureRegister |
myRegister |
private int |
numRec |
private int |
numTriples |
private java.io.OutputStream |
outFile |
private java.io.BufferedWriter |
registryWriter |
private int |
rejectedRec |
private java.util.List<org.apache.jena.graph.Triple> |
results |
private org.apache.jena.riot.system.StreamRDF |
stream |
private long |
t_start |
| Constructor and Description |
|---|
StreamConverter(Configuration config,
Assistant assist,
java.lang.String outputFile)
Constructs a StreamConverter object that will conduct transformation at STREAM mode.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
collectTriples()
Collects RDF triples generated from a batch of features (their thematic attributes and their geometries) and streamlines them to output file.
|
org.apache.jena.rdf.model.Model |
getModel()
Provides access to the disk-based model consisting of transformed triples.
|
java.lang.String |
getTDBDir()
Returns the local directory that holds the disk-based RDF graph for this transformation thread.
|
java.util.List<org.apache.jena.graph.Triple> |
getTriples()
Provides triples resulted after applying transformation against a single input feature or a small batch of features.
|
java.lang.String |
getURItemplate4Classification()
Provides the URI template used for all subjects in RDF triples concerning the classification hierarchy.
|
void |
parse(org.geotools.feature.FeatureIterator<?> iterator,
Classification classific,
org.opengis.referencing.operation.MathTransform reproject,
int targetSRID,
java.lang.String outputFile)
Parses each record from a FeatureIterator and streamlines the resulting triples (including geometric and non-spatial attributes).
|
void |
parse(java.util.Iterator<org.apache.commons.csv.CSVRecord> records,
Classification classific,
org.opengis.referencing.operation.MathTransform reproject,
int targetSRID,
java.lang.String outputFile)
Parses each record from a collection of CSV records and streamlines the resulting triples (including geometric and non-spatial attributes).
|
void |
parse(OSMRecord rs,
Classification classific,
org.opengis.referencing.operation.MathTransform reproject,
int targetSRID)
Parses a single OSM record and streamlines the resulting triples (including geometric and non-spatial attributes).
|
void |
parse(java.sql.ResultSet rs,
Classification classific,
org.opengis.referencing.operation.MathTransform reproject,
int targetSRID,
java.lang.String outputFile)
Parses each record from a ResultSet and streamlines the resulting triples (including geometric and non-spatial attributes).
|
void |
parse(java.lang.String wkt,
java.util.Map<java.lang.String,java.lang.String> attrValues,
Classification classific,
int targetSRID,
org.opengis.referencing.operation.MathTransform reproject,
java.lang.String geomType,
int partition_index,
java.lang.String outputFile)
Parses a Map structure of (key, value) pairs and streamlines the resulting triples (including geometric and non-spatial attributes).
|
void |
parse(java.lang.String wkt,
java.util.Map<java.lang.String,java.lang.String> attrValues,
Classification classific,
int targetSRID,
java.lang.String geomType)
Parses a single GPX waypoint/track or a single JSON node and streamlines the resulting triples (including geometric and non-spatial attributes).
|
void |
parseWithRML(java.util.HashMap<java.lang.String,java.lang.String> row,
be.ugent.mmlab.rml.model.dataset.RMLDataset dataset)
Converts a row into triples according to the specified RML mappings.
|
void |
setHeader(java.lang.String[] header)
Retains the header (column names) of an input CSV file.
|
void |
store(java.lang.String outputFile)
Finalizes storage of resulting tuples into a file.
|
void |
store(java.lang.String outputFile,
int partition_index)
Finalizes storage of resulting tuples into a file.
|
int |
writeTriples(be.ugent.mmlab.rml.model.dataset.RMLDataset dataset,
java.io.BufferedWriter writer,
org.openrdf.rio.RDFFormat rdfFormat,
java.lang.String encoding)
Serializes the given RML dataset as triples written into a file.
|
int |
writeTriples(be.ugent.mmlab.rml.model.dataset.RMLDataset dataset,
java.io.OutputStream writer,
org.openrdf.rio.RDFFormat rdfFormat)
Serializes the given RML dataset as triples written into a file.
|
private static Configuration currentConfig
private java.util.List<org.apache.jena.graph.Triple> results
private TripleGenerator myGenerator
private Assistant myAssistant
private FeatureRegister myRegister
private long t_start
private long dt
private int numRec
private int rejectedRec
private int numTriples
private java.io.BufferedWriter registryWriter
private java.io.OutputStream outFile
private org.apache.jena.riot.system.StreamRDF stream
public StreamConverter(Configuration config, Assistant assist, java.lang.String outputFile)
config - User-specified configuration for the transformation process.assist - Assistant to perform auxiliary operations.outputFile - Output file that will collect resulting triples.public java.util.List<org.apache.jena.graph.Triple> getTriples()
getTriples in interface Converterpublic void parse(org.geotools.feature.FeatureIterator<?> iterator,
Classification classific,
org.opengis.referencing.operation.MathTransform reproject,
int targetSRID,
java.lang.String outputFile)
parse in interface ConvertermyAssistant - Instantiation of Assistant class to perform auxiliary operations (geometry transformations, auto-generation of UUIDs, etc.)iterator - FeatureIterator over spatial features collected from an ESRI shapefile of a GeoJSON file.classific - Instantiation of the classification scheme that assigns categories to input features.reproject - CRS transformation parameters to be used in reprojecting a geometry to a target SRID (EPSG code).targetSRID - Spatial reference system (EPSG code) of geometries in the output RDF triples.outputFile - Path to the output file that collects RDF triples.public void parse(java.sql.ResultSet rs,
Classification classific,
org.opengis.referencing.operation.MathTransform reproject,
int targetSRID,
java.lang.String outputFile)
parse in interface ConvertermyAssistant - Instantiation of Assistant class to perform auxiliary operations (geometry transformations, auto-generation of UUIDs, etc.)rs - ResultSet containing spatial features retrieved from a DBMS.classific - Instantiation of the classification scheme that assigns categories to input features.reproject - CRS transformation parameters to be used in reprojecting a geometry to a target SRID (EPSG code).targetSRID - Spatial reference system (EPSG code) of geometries in the output RDF triples.outputFile - Path to the output file that collects RDF triples.public void parse(java.util.Iterator<org.apache.commons.csv.CSVRecord> records,
Classification classific,
org.opengis.referencing.operation.MathTransform reproject,
int targetSRID,
java.lang.String outputFile)
parse in interface ConvertermyAssistant - Instantiation of Assistant class to perform auxiliary operations (geometry transformations, auto-generation of UUIDs, etc.)records - Iterator over CSV records collected from a CSV file.classific - Instantiation of the classification scheme that assigns categories to input features.reproject - CRS transformation parameters to be used in reprojecting a geometry to a target SRID (EPSG code).targetSRID - Spatial reference system (EPSG code) of geometries in the output RDF triples.outputFile - Path to the output file that collects RDF triples.public void parse(OSMRecord rs, Classification classific, org.opengis.referencing.operation.MathTransform reproject, int targetSRID)
parse in interface ConvertermyAssistant - Instantiation of Assistant class to perform auxiliary operations (geometry transformations, auto-generation of UUIDs, etc.)rs - Representation of an OSM record with attributes extracted from an OSM element (node, way, or relation).classific - Instantiation of the classification scheme that assigns categories to input features.reproject - CRS transformation parameters to be used in reprojecting a geometry to a target SRID (EPSG code).targetSRID - Spatial reference system (EPSG code) of geometries in the output RDF triples.public void parse(java.lang.String wkt,
java.util.Map<java.lang.String,java.lang.String> attrValues,
Classification classific,
int targetSRID,
java.lang.String geomType)
parse in interface ConvertermyAssistant - Instantiation of Assistant class to perform auxiliary operations (geometry transformations, auto-generation of UUIDs, etc.)wkt - Well-Known Text representation of the geometryattrValues - Attribute values for each thematic (non-spatial) attributeclassific - Instantiation of the classification scheme that assigns categories to input features.targetSRID - Spatial reference system (EPSG code) of geometries in the output RDF triples.geomType - The type of the geometry (e.g., POINT, POLYGON, etc.)public void parse(java.lang.String wkt,
java.util.Map<java.lang.String,java.lang.String> attrValues,
Classification classific,
int targetSRID,
org.opengis.referencing.operation.MathTransform reproject,
java.lang.String geomType,
int partition_index,
java.lang.String outputFile)
parse in interface ConvertermyAssistant - Instantiation of Assistant class to perform auxiliary operations (geometry transformations, auto-generation of UUIDs, etc.)wkt - Well-Known Text representation of the geometryattrValues - Attribute values for each thematic (non-spatial) attributeclassific - Instantiation of the classification scheme that assigns categories to input features.targetSRID - Spatial reference system (EPSG code) of geometries in the output RDF triples.reproject - CRS transformation parameters to be used in reprojecting a geometry to a target SRID (EPSG code).geomType - The type of the geometry (e.g., POINT, POLYGON, etc.)partition_index - The index of the partition.outputFile - Path to the output file that collects RDF triples.private void collectTriples()
public void store(java.lang.String outputFile)
public void store(java.lang.String outputFile,
int partition_index)
store in interface ConvertermyAssistant - Instantiation of Assistant class to perform auxiliary operations (geometry transformations, auto-generation of UUIDs, etc.)outputFile - Path to the output file that collects RDF triples.partition_index - The index of the partition.public void setHeader(java.lang.String[] header)
public org.apache.jena.rdf.model.Model getModel()
public java.lang.String getTDBDir()
public int writeTriples(be.ugent.mmlab.rml.model.dataset.RMLDataset dataset,
java.io.BufferedWriter writer,
org.openrdf.rio.RDFFormat rdfFormat,
java.lang.String encoding)
throws java.io.IOException
writeTriples in interface Converterdataset - RMLDataset that has collected the resulting triples.writer - BufferedWriter to write triples in the output stream.rdfFormat - Serialization format of triples to be written to the file.encoding - Encoding for string literals.java.io.IOExceptionpublic int writeTriples(be.ugent.mmlab.rml.model.dataset.RMLDataset dataset,
java.io.OutputStream writer,
org.openrdf.rio.RDFFormat rdfFormat)
throws java.io.IOException
writeTriples in interface Converterdataset - RMLDataset that has collected the resulting triples.writer - BufferedWriter to write triples in the output stream.rdfFormat - Serialization format of triples to be written to the file.java.io.IOExceptionpublic void parseWithRML(java.util.HashMap<java.lang.String,java.lang.String> row,
be.ugent.mmlab.rml.model.dataset.RMLDataset dataset)
parseWithRML in interface Converterrow - Record with attribute names and their respective values.dataset - RMLDataset to collect the resulting triples.public java.lang.String getURItemplate4Classification()
getURItemplate4Classification in interface Converter