Español (spanish formal Internacional)English (United Kingdom)

geometry2rdf

geometry2rdf is a library for generating RDF files for geometrical information (which could be available in GML or WKT). The GML and WKT is manipulated with GeoTools. The current version of the library works with Oracle geospatial databases and relies on Jena.

geometry2rdf

geometry2rdf has been developed by the GeoLinked Data (.es) team.

For downloading the library, use the following link.

Quick start

You need:

  • Java 1.5 or newer on the path (check with java -version if you're not sure)

What to do:

  1. Download and extract the archive to a suitable location.
  2. The current distribution comes with a dummy properties file. This dummy file can be used as the base file for your work.
  3. Run geometry2rdf from the command line.
  4. Wait till it finishes, and check the rdf file created.

Working with the configuration files

The library needs a properties file for its execution. The default name for that file is options.properties. A dummy file with that name is provided in the distribution and can be used. If you want to use a different file, change the path of the properties file in the bat file.

Properties file example

Here is an example configuration file:

##############################
# Input and output parameters
##############################
inputDir = temp
outputFile = temp/output.rdf

##############################
# DDBB parameters
##############################
# 0-MSAccess 1-MYSQL 2-Oracle
dbType=2
dbName=alias
dbUserName=user
dbPassword=pass
dbHost=localhost
dbPort=1122
resourceName=River
tableName=EXAMPLE_TABLE
condition=upper(label) like upper('River %') or upper(label) like upper('Rivers %')
labelColumnName=label
geometryColumnName=geometryColumn

##############################
#Namespaces paramters
##############################
# Optional parameters. Change these parameters if you want to use different values for the namespaces and prefixes
nsPrefix=georesource
nsURI=http://geo.linkeddata.es/resource/
ontologyNSPrefix=geontology
ontologyNS=http://geo.linkeddata.es/ontology/

##############################
# Reference systems parameters
##############################
# Optional parameters. Used when a reference system change wants to be made.
gmlSourceRS=SDO:8223
gmlTargetRS=EPSG:4230

# Optional parameters. These fields should be filled in if a transformation between EPSG reference system is needed
sourceRS=EPSG:4230
targetRS=EPSG:4326

##############################
# Types parameters
##############################
# Optional parameters. URI for types point, linstring and plygon. Notice that the URI must be encoded in UTF-8. By defaults, their values will be those listed below.
pointType=http://www.w3.org/2003/01/geo/wgs84_pos#Point
linestringType=http://geo.linkeddata.es/ontology/Curva
polygonType=http://geo.linkeddata.es/ontology/Pol%C3%ADgono
# Optional parameter. This parameter is used to describe the relation between a geometry and the points of that geometry. By default, the value will be "formadoPor"
formBy=formadoPor

##############################
# Other parameters
##############################
# Optional parameters. Default lang for the labels created in the output RDF. By default, the value will be Spanish-es
defaultLang=es

Structure of the properties file:

1. Input and output parameters

Working dir and the name of output file.

2. DDBB parameters

All the parameters necessaries for the Data Base connection are set in this section. Also the name of the type of resources that will be created is set in this section.

3. Namespaces parameters

The namespaces and prefixes for the resources generated and for the ontology used are set in this section.

4. Reference systems parameters

Geometry2rdf works for EPSG reference systems. If your gml data is not in EPGS, a transformation between your reference system and a EPSG system is necessary. For doing that, use fields gmlSourceRS and gmlTargetRS. If another transformation is required or wanted for the final data in the RDF, use sourceRS and targetRS.

5. Types parameters

In this section, the URIs for Point, Linestring and Polygon resources are defined. Also URI of the relationship "formBy" is defined. A Linestring and a Polygon are "formBy" Points.

6. Other parameters

In this section, the default language of the label of each resource is defined.

Examples of output RDF files.

Here are an examples of output RDF files generated by geomtry2rdf:

  • Example of a resource of type "Municipio" (municipality) with a geometry form by a single point. Link.
  • Example of a resource of type "Balsa" (pond) with a geometry of type Linestring. Link.
  • Example of a resource of type "Pozo" (well) with a geometry of type Polygon. Link.

 

 News

Created under Creative Commons License - 2015 OEG.