Modifier and Type | Field and Description |
---|---|
private static Configuration |
currentConfig |
private long |
dt |
org.apache.jena.rdf.model.Model |
model
The disk-based model that will contain all RDF triples generated during transformation.
|
private Assistant |
myAssistant |
private TripleGenerator |
myGenerator |
private FeatureRegister |
myRegister |
private int |
numRec |
(package private) java.lang.String |
pathTDB |
private java.io.BufferedWriter |
registryWriter |
private int |
rejectedRec |
private long |
t_start |
Constructor and Description |
---|
GraphConverter(Configuration config,
Assistant assist,
java.lang.String outputFile)
Constructs a GraphConverter object that will conduct transformation at GRAPH mode.
|
Modifier and Type | Method and Description |
---|---|
private void |
collectTriples()
Collects RDF triples generated from a given feature (its thematic attributes and its geometry) and stores them into the disk-based RDF graph.
|
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 from transformation.
|
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 creates the resulting triples on a disk-based model (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 creates the resulting triples on a disk-based model (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 creates the resulting triples on a disk-based model (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 creates the resulting triples on a disk-based model (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)
Stores 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
public org.apache.jena.rdf.model.Model model
java.lang.String pathTDB
private java.io.BufferedWriter registryWriter
private TripleGenerator myGenerator
private Assistant myAssistant
private FeatureRegister myRegister
private int numRec
private int rejectedRec
private long t_start
private long dt
public GraphConverter(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 void parse(org.geotools.feature.FeatureIterator<?> iterator, Classification classific, org.opengis.referencing.operation.MathTransform reproject, int targetSRID, java.lang.String outputFile)
parse
in interface Converter
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 Converter
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 Converter
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 Converter
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 Converter
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.)private void collectTriples()
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 Converter
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.public void store(java.lang.String outputFile)
public void store(java.lang.String outputFile, int partition_index)
public void setHeader(java.lang.String[] header)
public org.apache.jena.rdf.model.Model getModel()
public java.lang.String getTDBDir()
public java.util.List<org.apache.jena.graph.Triple> getTriples()
getTriples
in interface Converter
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 Converter
dataset
- 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.IOException
public 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 Converter
dataset
- 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.IOException
public void parseWithRML(java.util.HashMap<java.lang.String,java.lang.String> row, be.ugent.mmlab.rml.model.dataset.RMLDataset dataset)
parseWithRML
in interface Converter
row
- Record with attribute names and their respective values.dataset
- RMLDataset to collect the resulting triples.public java.lang.String getURItemplate4Classification()
getURItemplate4Classification
in interface Converter