8 Documentation
8.1 library(space/space): Core spatial database
- [det]set_space(+Option)
- [det]set_space(+IndexName, +Option)
- This predicate can be used to change the options of a spatial index (or de default index for set_space/1). Some options, like rtree_storage(S) where S is disk or memory only have effect after clearing or bulkloading. Others, take effect immediately on a running index. More documentation will be provided in the near future.
- [det]space_assert(+URI,
+Shape, +IndexName)
- [det]space_assert(+URI, +Shape)
- Insert URI with associated Shape in the queue to be inserted into the index with name IndexName or the default index. Indexing happens lazily at the next call of a query or manually by calling space_index/1.
- [det]space_retract(+URI,
+Shape, +IndexName)
- [det]space_retract(+URI, +Shape)
- Insert URI with associated Shape in the queue to be removed into the index with name IndexName or the default index. Indexing happens lazily at the next call of a query or manually by calling space_index/1.
- [det]space_index(+IndexName)
- [det]space_index
- Processes all asserts or retracts in the space queue for index IndexName or the default index if no index is specified.
- [det]space_clear(+IndexName)
- [det]space_clear
- Clears index IndexName or the default index if no index is specified, removing all of its contents.
- [det]space_bulkload(:Closure,
+IndexName)
- [det]space_bulkload(:Closure)
- [det]space_bulkload
- [det]space_bulkload(:Closure)
- Fast loading of many Shapes into the index IndexName.
Closure is called with two additional arguments: URI and
Shape, that finds candidate URI-Shape pairs to index in the index IndexName.
space_bulkload/0 defaults to uri_shape/2 for :Closure.
- [nondet]space_contains(+Query,
?Cont, +IndexName)
- [nondet]space_contains(+Query, ?Cont)
- Containment query. Unifies Cont with shapes contained in Query Shape (or shape of Query URI) according to index IndexName or the default index.
- [nondet]space_intersects(+Query,
?Inter, +IndexName)
- [nondet]space_intersects(+Query, ?Inter)
- Intersection query. Unifies Inter with shapes intersecting with Query Shape (or Shape of Query URI) according to index IndexName or the default index. (intersection subsumes containment)
- [nondet]space_nearest(+Query,
-Near, +IndexName)
- [nondet]space_nearest(+Query, -Near)
- Incremental Nearest-Neighbor query. Unifies Near with shapes in order of increasing distance to Query Shape (or Shape of Query URI) according to index IndexName or the default index.
- [nondet]uri_shape(?URI, ?Shape)
- Finds pairs of URIs and their corresponding Shapes based on WGS84 RDF
properties (e.g. wgs84:lat), GeoRSS Simple properties (e.g.
georss:polygon), and GeoRSS GML properties (e.g. georss:where).
uri_shape/2 is a dynamic predicate, which means it can be extended. If you use uri_shape/2 in this way, the URI argument has to be a canonical URI, not a QName.
- [nondet]uri_shape(?URI, ?Shape, +Source)
- Finds pairs of URIs and their corresponding Shapes using uri_shape/2 from RDF that was loaded from a given Source.
- [det]space_index_all(+IndexName)
- [det]space_index_all
- Loads all URI-Shape pairs found with uri_shape/2 into index IndexName or the default index name.
- [det]shape(+Shape)
- Checks whether Shape is a valid supported shape.
- [det]space_distance(+Point1, +Point2, -Distance)
- Calculates the distance between Point1 and Point2 by default using pythagorean distance.
- [det]space_distance_greatcircle(+Point1,
+Point2, -Dist)
- [det]space_distance_greatcircle(+Point1, +Point2, -Dist, +Unit)
- Calculates great circle distance between Point1 and Point2 in the specified Unit, which can take as a value km (kilometers) or nm (nautical miles). By default, nautical miles are used.
8.2 library(space/georss)
- [nondet]georss_candidate(?URI, ?Shape)
- Finds URI-Shape pairs by searching for RDF triples that link URI to a Shape with GeoRSS RDF properties (e.g. georss:where, georss:line, georss:polygon). Both GeoRSS Simple and GML are supported.
- [nondet]georss_candidate(?URI, ?Shape, +Source)
- Finds URI-Shape pairs using georss_candidate/2 in RDF that was loaded from a certain Source.
- [nondet]georss_simple_candidate(?URI, ?Shape)
- Finds URI-Shape pairs by searching for GeoRSS Simple properties (e.g. georss:point, georss:line, georss:polygon) in the RDF database.
- [det]georss_uri_shape_triple(+URI,
+Shape, -Subject, -Predicate, -Object)
- [det]georss_uri_shape_triple(-URI, -Shape, +Subject, +Predicate, +Object)
- Converts between a URI-Shape pair and its GeoRSS simple RDF triple form.
- [nondet]georss_gml_candidate(?URI, ?Shape)
- Finds URI-Shape pairs by searching for GeoRSS GML properties (i.e. georss:where) in the RDF database. Uses gml_shape/2 to parse the XMLLiteral representing the GML shape.
8.3 library(space/wgs84)
- [nondet]wgs84_candidate(?URI, ?Point)
- Finds URI-Shape pairs of RDF resources that are place-tagged with W3C WGS84 properties (i.e. lat, long, alt). Point = point(?Lat,?Long) ; Point = point(?Lat,?Long,?Alt).
- [nondet]wgs84_candidate(?URI, ?Point, +Source)
- Finds URI-Shape pairs of RDF resources that are place-tagged with W3C WGS84 properties (i.e. lat, long, alt). From RDF that was loaded from a certain Source.
- [nondet]lat(?URI, ?Lat)
- Finds the WGS84 latitude of resource URI (and vice versa) using the rdf_db index. Lat is a number.
- [nondet]long(?URI, ?Long)
- Finds the WGS84 longitude of resource URI (and vice versa) using the rdf_db index. Long is a number.
- [nondet]alt(?URI, ?Alt)
- Finds the WGS84 altitude of resource URI (and vice versa) using the rdf_db index. Alt is a number.
- [nondet]coordinates(?URI,
?Lat, ?Long)
- [nondet]coordinates(?URI, ?Lat, ?Long, ?Alt)
- Finds the WGS84 latitude, longitude and possibly altitude of resource URI (and vice versa) using the rdf_db index. Lat, Long, and Alt are numbers.
8.4 library(space/freebase)
- [nondet]freebase_candidate(?URI, ?Point)
- Finds URI-Shape pairs of RDF resource that are place-tagged with Freebase's location.location.geoposition notation that capture WGS84 latitude/longitude positions.
- [nondet]freebase_candidate(?URI, ?Point, ?Source)
- Finds URI-Shape pairs of RDF resource that are place-tagged with Freebase's location.location.geoposition notation that capture WGS84 latitude/longitude positions. From RDF that was loaded from a certain Source.
8.5 library(space/dbpedia)
- [nondet]dbpedia_candidate(?URI, ?Point)
- Finds URI-Shape pairs of RDF resource that are place-tagged with DBpedia's coordinatenProperty notation that capture WGS84 latitude/longitude positions.
- [nondet]dbpedia_candidate(?URI, ?Point, ?Source)
- Finds URI-Shape pairs of RDF resource that are place-tagged with DBpedia's coordinatenProperty notation that capture WGS84 latitude/longitude positions. From RDF that was loaded from a certain Source.
8.6 library(space/wkt)
- [semidet]wkt_shape(?WKT, ?Shape)
- Converts between the WKT serialization of a Shape and its native Prolog term representation.
8.7 library(space/kml)
- [det]kml_file_to_georss(+KMLfile)
- [det]kml_file_to_georss(+KMLfile, +RDFfile)
- Converts the contents of an KML file into GeoRSS RDF in the RDF database of Prolog. The Geometries are converted to GeoRSS properties and values. Documents, Folders, etc. are ignored. MultiGeometry objects are expanded into separate simple Geometries. Geometries with an XML ID are assigned that ID as URI, other Geometries are assigned a RDF blank node. The kml:name and kml:description are translated to RDF properties.
- [det]georss_to_kml_file(+KMLfile)
- [det]georss_to_kml_file(+KMLfile, +Options)
- Converts the contents of the RDF database of Prolog into a KML file without style information and without Folders. kml:name and kml:description properties in the RDF database are converted to their KML counterparts. Options can be used to pass Document level options, for example, the name of the dataset. Options can also include a graph(Graph) option to specify which RDF named graph should be converted to KML.
- [semidet]kml_shape(?Stream,
?Shape)
- [semidet]kml_shape(?Stream, ?Shape, ?Attributes, ?Content)
- Converts between the KML serialization of a shape and its internal Prolog term representation. Attributes and Content can hold additional attributes and XML content elements of the KML, like ID, name, or styleUrl.
- [semidet]kml_uri_shape(?KML, ?URI, ?Shape)
- Converts between the KML serialization of a URI-shape
pair and its internal Prolog term representation. It is assumed the KML
Geometry element has a ID attribute specifying the URI of the
shape. e.g.
<PointID="http://example.org/point1"><coordinates>52.37,4.89</coordinates></Point>
- [semidet]kml_file_shape(+File,
?Shape)
- [semidet]kml_file_shape(+File, ?Shape, ?Attributes, ?Content)
- Reads shapes from a KML file using kml_shape/2.
kml_file_shape/4 also reads
extra attributes and elements of the KML Geometry. e.g. <Point
targetId="NCName"
><extrude>0</extrude>...</Point> will, besides parsing the Point, also instantiate Content with [extrude(0)] and Attributes with [targetId('NCName')]. - [semidet]kml_file_uri_shape(+File, ?URI, ?Shape)
- Reads URI-shape pairs from File using kml_uri_shape/2.
- [semidet]kml_save_header(+Stream, +Options)
- Outputs a KML header to Stream. This can be followed by calls
to kml_save_shape/3 and
kml_save_footer/1.
Options is an option list that can contain the option name(Name) specifying the Name of the document.
- [semidet]kml_save_shape(+Stream, +Shape, +Options)
- Outputs a KML serialization of Shape to Stream.
This can be preceded by a call to kml_save_header/2
and followed by more calls to kml_save_shape/3
and a call to
kml_save_footer/1.
Options is an option list that can contain the option attr(+List) or content(+List) that can be used to add additional attributes or xml element content to a shape. This can be used to specify things like the ID or name.
Layout elements, like Placemark and Folder, have their own separate extra attributes to supply additional attributes and content. These can contain the special terms geom_attributes and geom_content that pass their content to the shape contained by the Placemark. For example, rendering a Placemark with the ID "placemark12" of an extruded Point shape with its URI as name of the Placemark and as ID of the shape and an additional styleUrl works as follows:
kml_save_shape(Stream, placemark(point(53.0,3.9), [ id(placemark12), geom_attributes([ id(URI) ]) ], [ name(URI),styleUrl(URI), geom_content([ extrude(1) ]) ]), []). - [det]kml_save_footer(+Stream)
- Outputs a KML footer to stream Stream. This can be preceded by calls to kml_save_header/2 and kml_save_shape/3.
8.8 library(space/gml)
- [semidet]gml_shape(?GML, ?Shape)
- Converts between the GML serialization of a shape and its internal Prolog term representation.
8.9 library(space/space_web_loader)
- [det]space_load_url(+URL)
- Retrieve RDF over HTTP from a URL, load it in the rdf_db and index all URI-Shape pairs that can be found in it into the default index.
- [det]space_load_url(+URL, +Options)
- Load using space_load_url/1,
given extra options.
- index(+IndexName)
- Index the URI-Shape pairs into index named IndexName.
- graph(+Graph)
- Store the URI-Shape pairs in the named graph Graph. The pairs are recorded as uri_shape(URI,Shape,Graph).
- [det]space_unload_url(+URL)
- Unload the RDF that was fetched from URL and remove all URI-Shape pairs that are contained in it from the default index.
- [det]space_unload_url(+URL, +Options)
- Unload the RDF that was fetched from URL and remove all
URI-Shape pairs that are contained in it. Accepts extra options:
- index(+IndexName)
- Remove from the index named IndexName.
- graph(+Graph)
- Remove the URI-Shape pairs from the named graph Graph.
- [det]space_crawl_url(+URL)
- Retrieve RDF over HTTP from a URL, load it in the rdf_db and index all URI-Shape pairs that can be found in it into the default index. Also attempt to resolve all URIs that appear as object in a link_property statement downloaded from the URL. Retrieve these URIs and process them in the same way. Iterate this process until there are no new links that have not already been crawled.
- [det]space_crawl_url(+URL, +Options)
- Crawl using space_crawl_url/1,
with additional options.
- index(+IndexName)
- Index the URI-Shape pairs into index named IndexName.
- graph(+Graph)
- Store the URI-Shape pairs in the named graph Graph. The pairs are recorded as uri_shape(URI,Shape,Graph).
- [det]space_uncrawl_url(+URL)
- Unload the RDF that was fetched from URL and remove all URI-Shape pairs that are contained in it from the default index. Also unload all data that were crawled by iteratively resolving the URIs linked to with a link_property.
- [det]space_uncrawl_url(+URL, +IndexName)
- Unload using space_uncrawl_url/1,
but remove the URI-Shape pairs from the index named IndexName.
- index(+IndexName)
- Remove the URI-Shape pairs from index named IndexName.
- graph(+Graph)
- Remove the URI-Shape pairs from the named graph Graph.
Bibliography
- [1]
- Willem Robert van Hage, Jan Wielemaker and Guus Schreiber. The Space package: Tight Integration Between Space and Semantics. Proceedings of the 8th International Semantic Web Conference Workshop: TerraCognita 2009.
- [2]
- Marios Hadjieleftheriou, Erik Hoel, and Vassilis J. Tsotras. Sail: A spatial index library for efficient application integration. Geoinformatica, 9(4), 2005.
- [3]
- Gísli R. Hjaltason and Hanan Samet. Distance browsing in
spatial databases.
ACM Transactions on Database Systems (TODS), 24(2):265--318,
1999.
Index
- ?
- alt/2
- coordinates/3
- coordinates/4
- dbpedia_candidate/2
- dbpedia_candidate/3
- freebase_candidate/2
- freebase_candidate/3
- georss_candidate/2
- georss_candidate/3
- georss_gml_candidate/2
- georss_simple_candidate/2
- georss_to_kml_file/1
- georss_to_kml_file/2
- georss_uri_shape_triple/5
- gml_shape/2
- alt/2
- 5
- kml_file_shape/2
- kml_file_shape/4
- kml_file_to_georss/1
- kml_file_to_georss/2
- kml_file_uri_shape/3
- kml_save_footer/1
- kml_save_header/2
- kml_save_shape/3
- kml_shape/2
- kml_file_shape/4
- 5
- kml_shape/4
- kml_uri_shape/3
- lat/2
- long/2
- set_space/1
- set_space/2
- shape/1
- space_assert/2
- space_assert/3
- kml_uri_shape/3
- 3
- space_bulkload/0
- space_bulkload/1
- space_bulkload/2
- space_bulkload/3
- space_bulkload/1
- 3 7
- space_clear/0
- space_clear/1
- space_contains/2
- space_contains/3
- space_clear/1
- 4
- space_crawl_url/1
- space_crawl_url/2
- space_distance/3
- space_distance_greatcircle/3
- space_distance_greatcircle/4
- space_index/0
- space_index/1
- space_index_all/0
- space_crawl_url/2
- 3
- space_index_all/1
- space_intersects/2
- space_intersects/3
- space_intersects/2
- 4
- space_load_url/1
- space_load_url/2
- space_nearest/2
- space_nearest/3
- space_load_url/2
- 4 4
- space_nearest_bounded/4
- 4
- space_retract/2
- space_retract/3
- 3
- space_uncrawl_url/1
- space_uncrawl_url/2
- space_unload_url/1
- space_unload_url/2
- uri_shape/2
- space_uncrawl_url/2
- 2 2 3 7
- uri_shape/3
- wgs84_candidate/2
- wgs84_candidate/3
- wkt_shape/2
- wgs84_candidate/2
- 5