From caafa740aee40e5078eed87c076e02580dd5acb1 Mon Sep 17 00:00:00 2001 From: Axel Lehmann Date: Mon, 29 Apr 2024 18:10:47 +0200 Subject: [PATCH] Remove osm2rdfgeom namespace --- include/osm2rdf/ttl/Constants.h | 1 - src/osm/FactHandler.cpp | 25 ++++---- src/ttl/Writer.cpp | 8 +-- tests/Baseline.cpp | 2 + tests/E2E.cpp | 50 +++++++-------- tests/issues/Issue15.cpp | 8 +-- tests/issues/Issue24.cpp | 50 +++++++-------- tests/osm/FactHandler.cpp | 108 ++++++++++++++++---------------- tests/ttl/Writer.cpp | 8 +-- tests/util/DirectedGraph.cpp | 2 + 10 files changed, 130 insertions(+), 132 deletions(-) diff --git a/include/osm2rdf/ttl/Constants.h b/include/osm2rdf/ttl/Constants.h index efa09a4c..033a08d4 100644 --- a/include/osm2rdf/ttl/Constants.h +++ b/include/osm2rdf/ttl/Constants.h @@ -37,7 +37,6 @@ const static inline std::string NAMESPACE__OSM_WAY = "osmway"; const static inline std::string NAMESPACE__OSM_META = "osmmeta"; const static inline std::string NAMESPACE__OSM = "osm"; const static inline std::string NAMESPACE__OSM2RDF = "osm2rdf"; -const static inline std::string NAMESPACE__OSM2RDF_GEOM = "osm2rdfgeom"; const static inline std::string NAMESPACE__OSM2RDF_MEMBER = "osm2rdfmember"; const static inline std::string NAMESPACE__OSM2RDF_META = "osm2rdfmeta"; const static inline std::string NAMESPACE__OSM2RDF_TAG = "osm2rdfkey"; diff --git a/src/osm/FactHandler.cpp b/src/osm/FactHandler.cpp index 922c107b..948f19ce 100644 --- a/src/osm/FactHandler.cpp +++ b/src/osm/FactHandler.cpp @@ -66,7 +66,6 @@ using osm2rdf::ttl::constants::IRI__XSD_YEAR_MONTH; using osm2rdf::ttl::constants::LITERAL__NO; using osm2rdf::ttl::constants::LITERAL__YES; using osm2rdf::ttl::constants::NAMESPACE__OSM2RDF; -using osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_GEOM; using osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_META; using osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_TAG; using osm2rdf::ttl::constants::NAMESPACE__OSM_NODE; @@ -93,9 +92,9 @@ void osm2rdf::osm::FactHandler::area(const osm2rdf::osm::Area& area) { area.objId()); const std::string& geomObj = _writer->generateIRI( - NAMESPACE__OSM2RDF_GEOM, DATASET_ID[_config.sourceDataset] + "_" + - (area.fromWay() ? "way" : "rel") + "area_" + - std::to_string(area.objId())); + NAMESPACE__OSM2RDF, DATASET_ID[_config.sourceDataset] + + (area.fromWay() ? "way" : "rel") + "area_" + + std::to_string(area.objId())); _writer->writeTriple(subj, IRI__GEOSPARQL__HAS_GEOMETRY, geomObj); writeBoostGeometry(geomObj, IRI__GEOSPARQL__AS_WKT, area.geom()); @@ -125,8 +124,8 @@ void osm2rdf::osm::FactHandler::node(const osm2rdf::osm::Node& node) { writeTagList(subj, node.tags()); const std::string& geomObj = _writer->generateIRI( - NAMESPACE__OSM2RDF_GEOM, - DATASET_ID[_config.sourceDataset] + "_node_" + std::to_string(node.id())); + NAMESPACE__OSM2RDF, + DATASET_ID[_config.sourceDataset] + "node_" + std::to_string(node.id())); _writer->writeTriple(subj, IRI__GEOSPARQL__HAS_GEOMETRY, geomObj); writeBoostGeometry(geomObj, IRI__GEOSPARQL__AS_WKT, node.geom()); @@ -183,10 +182,9 @@ void osm2rdf::osm::FactHandler::relation( #if BOOST_VERSION >= 107800 if (relation.hasGeometry() && !relation.isArea()) { - const std::string& geomObj = - _writer->generateIRI(NAMESPACE__OSM2RDF_GEOM, - DATASET_ID[_config.sourceDataset] + "_relation_" + - std::to_string(relation.id())); + const std::string& geomObj = _writer->generateIRI( + NAMESPACE__OSM2RDF, DATASET_ID[_config.sourceDataset] + "rel_" + + std::to_string(relation.id())); _writer->writeTriple(subj, IRI__GEOSPARQL__HAS_GEOMETRY, geomObj); writeBoostGeometry(geomObj, IRI__GEOSPARQL__AS_WKT, relation.geom()); @@ -242,8 +240,8 @@ void osm2rdf::osm::FactHandler::way(const osm2rdf::osm::Way& way) { _writer->writeTriple(subj, IRI__RDF_TYPE, IRI__OSM_NODE); const std::string& geomObj = _writer->generateIRI( - NAMESPACE__OSM2RDF_GEOM, DATASET_ID[_config.sourceDataset] + - "_node_" + std::to_string(node.id())); + NAMESPACE__OSM2RDF, DATASET_ID[_config.sourceDataset] + "node_" + + std::to_string(node.id())); _writer->writeTriple(subj, IRI__GEOSPARQL__HAS_GEOMETRY, geomObj); writeBoostGeometry(geomObj, IRI__GEOSPARQL__AS_WKT, node.geom()); @@ -282,7 +280,8 @@ void osm2rdf::osm::FactHandler::way(const osm2rdf::osm::Way& way) { if (_config.addAreaWayLinestrings || !way.isArea()) { const std::string& geomObj = _writer->generateIRI( - NAMESPACE__OSM2RDF, "way_" + std::to_string(way.id())); + NAMESPACE__OSM2RDF, + DATASET_ID[_config.sourceDataset] + "way_" + std::to_string(way.id())); _writer->writeTriple(subj, IRI__GEOSPARQL__HAS_GEOMETRY, geomObj); writeBoostGeometry(geomObj, IRI__GEOSPARQL__AS_WKT, locations); diff --git a/src/ttl/Writer.cpp b/src/ttl/Writer.cpp index 7ff14b85..94854054 100644 --- a/src/ttl/Writer.cpp +++ b/src/ttl/Writer.cpp @@ -54,8 +54,6 @@ osm2rdf::ttl::Writer::Writer(const osm2rdf::config::Config& config, // own prefix {osm2rdf::ttl::constants::NAMESPACE__OSM2RDF, "https://osm2rdf.cs.uni-freiburg.de/rdf#"}, - {osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_GEOM, - "https://osm2rdf.cs.uni-freiburg.de/rdf/geom#"}, {osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_TAG, "https://osm2rdf.cs.uni-freiburg.de/rdf/key#"}, {osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_MEMBER, @@ -109,11 +107,11 @@ osm2rdf::ttl::Writer::Writer(const osm2rdf::config::Config& config, osm2rdf::ttl::constants::IRI__OSM2RDF_INTERSECTS_NON_AREA = generateIRI( osm2rdf::ttl::constants::NAMESPACE__OSM2RDF, "intersects_nonarea"); osm2rdf::ttl::constants::IRI__OSM2RDF_GEOM__CONVEX_HULL = generateIRI( - osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_GEOM, "convex_hull"); + osm2rdf::ttl::constants::NAMESPACE__OSM2RDF, "convex_hull"); osm2rdf::ttl::constants::IRI__OSM2RDF_GEOM__ENVELOPE = - generateIRI(osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_GEOM, "envelope"); + generateIRI(osm2rdf::ttl::constants::NAMESPACE__OSM2RDF, "envelope"); osm2rdf::ttl::constants::IRI__OSM2RDF_GEOM__OBB = - generateIRI(osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_GEOM, "obb"); + generateIRI(osm2rdf::ttl::constants::NAMESPACE__OSM2RDF, "obb"); osm2rdf::ttl::constants::IRI__OSM2RDF_MEMBER__ID = generateIRI(osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_MEMBER, "id"); osm2rdf::ttl::constants::IRI__OSM2RDF_MEMBER__ROLE = diff --git a/tests/Baseline.cpp b/tests/Baseline.cpp index d97dc3ae..484cdc8d 100644 --- a/tests/Baseline.cpp +++ b/tests/Baseline.cpp @@ -16,6 +16,8 @@ // You should have received a copy of the GNU General Public License // along with osm2rdf. If not, see . +#include + #include "gtest/gtest.h" namespace osm2rdf { diff --git a/tests/E2E.cpp b/tests/E2E.cpp index b8231197..05d15586 100644 --- a/tests/E2E.cpp +++ b/tests/E2E.cpp @@ -172,7 +172,7 @@ TEST(E2E, singleNodeWithTags) { ::testing::HasSubstr("osmnode:925950614 rdf:type osm:node .\n")); ASSERT_THAT(printedData, ::testing::HasSubstr( - "osm2rdfgeom:osm_node_240092010 geo:asWKT \"POINT(7.8494005 " + "osm2rdf:osmnode_240092010 geo:asWKT \"POINT(7.8494005 " "47.9960901)\"^^geo:wktLiteral .\n")); ASSERT_THAT(printedData, ::testing::HasSubstr( @@ -317,7 +317,7 @@ TEST(E2E, singleWayWithTagsAndNodes) { "\"maps4bw (LGL, www.lgl-bw.de)\" .\n")); // No nodes -> no real geometry ASSERT_THAT(printedData, - ::testing::HasSubstr("osm2rdf:way_98284318 geo:asWKT " + ::testing::HasSubstr("osm2rdf:osmway_98284318 geo:asWKT " "\"LINESTRING()\"^^geo:wktLiteral .\n")); // Reset std::cerr and std::cout @@ -407,8 +407,9 @@ TEST(E2E, osmWikiExample) { ASSERT_THAT(printedData, ::testing::HasSubstr( "osmway:26659127 osmkey:name \"Pastower Straße\" .\n")); - ASSERT_THAT(printedData, ::testing::HasSubstr( - "osm2rdf:way_26659127 geo:asWKT \"LINESTRING(")); + ASSERT_THAT( + printedData, + ::testing::HasSubstr("osm2rdf:osmway_26659127 geo:asWKT \"LINESTRING(")); ASSERT_THAT(printedData, ::testing::HasSubstr("osmrel:56688 rdf:type osm:relation .\n")); ASSERT_THAT(printedData, @@ -538,7 +539,7 @@ TEST(E2E, building51NT) { ASSERT_THAT( printedData, ::testing::HasSubstr( - " " + " " " \"LINESTRING(7")); ASSERT_THAT( printedData, @@ -547,7 +548,7 @@ TEST(E2E, building51NT) { ASSERT_THAT( printedData, ::testing::HasSubstr( - " " + " " " \"MULTIPOLYGON(((7")); ASSERT_THAT( printedData, @@ -691,12 +692,11 @@ TEST(E2E, building51TTL) { "\"maps4bw (LGL, www.lgl-bw.de)\" .\n")); ASSERT_THAT( printedData, - ::testing::HasSubstr("osm2rdf:way_98284318 geo:asWKT \"LINESTRING(7")); + ::testing::HasSubstr("osm2rdf:osmway_98284318 geo:asWKT \"LINESTRING(7")); ASSERT_THAT(printedData, ::testing::HasSubstr("7)\"^^geo:wktLiteral .\n")); - ASSERT_THAT( - printedData, - ::testing::HasSubstr( - "osm2rdfgeom:osm_wayarea_98284318 geo:asWKT \"MULTIPOLYGON(((7")); + ASSERT_THAT(printedData, + ::testing::HasSubstr( + "osm2rdf:osmwayarea_98284318 geo:asWKT \"MULTIPOLYGON(((7")); ASSERT_THAT(printedData, ::testing::HasSubstr("0)))\"^^geo:wktLiteral .\n")); ASSERT_THAT(printedData, ::testing::HasSubstr( @@ -824,12 +824,11 @@ TEST(E2E, building51QLEVER) { "\"maps4bw (LGL, www.lgl-bw.de)\" .\n")); ASSERT_THAT( printedData, - ::testing::HasSubstr("osm2rdf:way_98284318 geo:asWKT \"LINESTRING(7")); + ::testing::HasSubstr("osm2rdf:osmway_98284318 geo:asWKT \"LINESTRING(7")); ASSERT_THAT(printedData, ::testing::HasSubstr("7)\"^^geo:wktLiteral .\n")); - ASSERT_THAT( - printedData, - ::testing::HasSubstr( - "osm2rdfgeom:osm_wayarea_98284318 geo:asWKT \"MULTIPOLYGON(((7")); + ASSERT_THAT(printedData, + ::testing::HasSubstr( + "osm2rdf:osmwayarea_98284318 geo:asWKT \"MULTIPOLYGON(((7")); ASSERT_THAT(printedData, ::testing::HasSubstr("0)))\"^^geo:wktLiteral .\n")); ASSERT_THAT(printedData, ::testing::HasSubstr( @@ -938,12 +937,12 @@ TEST(E2E, tf) { "\"Albert-Ludwigs-Universität Freiburg\" .\n")); ASSERT_THAT(printedData, ::testing::HasSubstr( "osmway:4498466 osmkey:wheelchair \"yes\" .\n")); - ASSERT_THAT(printedData, ::testing::HasSubstr( - "osm2rdf:way_4498466 geo:asWKT \"LINESTRING(7")); ASSERT_THAT( printedData, - ::testing::HasSubstr( - "osm2rdfgeom:osm_wayarea_4498466 geo:asWKT \"MULTIPOLYGON(((7")); + ::testing::HasSubstr("osm2rdf:osmway_4498466 geo:asWKT \"LINESTRING(7")); + ASSERT_THAT(printedData, + ::testing::HasSubstr( + "osm2rdf:osmwayarea_4498466 geo:asWKT \"MULTIPOLYGON(((7")); // Reset std::cerr and std::cout std::cerr.rdbuf(cerrBufferOrig); @@ -1059,11 +1058,10 @@ TEST(E2E, building51inTF) { "\"maps4bw (LGL, www.lgl-bw.de)\" .\n")); ASSERT_THAT( printedData, - ::testing::HasSubstr("osm2rdf:way_98284318 geo:asWKT \"LINESTRING(7")); - ASSERT_THAT( - printedData, - ::testing::HasSubstr( - "osm2rdfgeom:osm_wayarea_98284318 geo:asWKT \"MULTIPOLYGON(((7")); + ::testing::HasSubstr("osm2rdf:osmway_98284318 geo:asWKT \"LINESTRING(7")); + ASSERT_THAT(printedData, + ::testing::HasSubstr( + "osm2rdf:osmwayarea_98284318 geo:asWKT \"MULTIPOLYGON(((7")); ASSERT_THAT(printedData, ::testing::HasSubstr("osmway:4498466 rdf:type osm:way .\n")); ASSERT_THAT(printedData, @@ -1080,7 +1078,7 @@ TEST(E2E, building51inTF) { "osmway:4498466 osmkey:wheelchair \"yes\" .\n")); ASSERT_THAT(printedData, ::testing::HasSubstr( - "osm2rdfgeom:osm_wayarea_4498466 geo:asWKT \"MULTIPOLYGON(((7")); + "osm2rdf:osmwayarea_4498466 geo:asWKT \"MULTIPOLYGON(((7")); ASSERT_THAT(printedData, ::testing::HasSubstr( "osmway:4498466 ogc:sfContains osmway:98284318 .\n")); diff --git a/tests/issues/Issue15.cpp b/tests/issues/Issue15.cpp index 427251ab..66c32ce9 100644 --- a/tests/issues/Issue15.cpp +++ b/tests/issues/Issue15.cpp @@ -71,7 +71,7 @@ TEST(Issue15, Relation_8291361_expected) { ASSERT_THAT( printedData, ::testing::HasSubstr( - "osm2rdfgeom:osm_relarea_8291361 geo:asWKT \"MULTIPOLYGON(((14")); + "osm2rdf:osmrelarea_8291361 geo:asWKT \"MULTIPOLYGON(((14")); // Reset std::cerr and std::cout std::cerr.rdbuf(cerrBufferOrig); @@ -119,7 +119,7 @@ TEST(Issue15, Relation_8291361_failed) { ASSERT_THAT( printedData, ::testing::HasSubstr( - "osm2rdfgeom:osm_relarea_8291361 geo:asWKT \"MULTIPOLYGON(((14")); + "osm2rdf:osmrelarea_8291361 geo:asWKT \"MULTIPOLYGON(((14")); // Reset std::cerr and std::cout std::cerr.rdbuf(cerrBufferOrig); @@ -171,7 +171,7 @@ TEST(Issue15, Way_201387026_expected) { ASSERT_THAT( printedData, ::testing::HasSubstr( - "osm2rdfgeom:osm_wayarea_201387026 geo:asWKT \"MULTIPOLYGON(((1")); + "osm2rdf:osmwayarea_201387026 geo:asWKT \"MULTIPOLYGON(((1")); // Reset std::cerr and std::cout std::cerr.rdbuf(cerrBufferOrig); @@ -219,7 +219,7 @@ TEST(Issue15, Way_201387026_failed) { ASSERT_THAT( printedData, ::testing::HasSubstr( - "osm2rdfgeom:osm_wayarea_201387026 geo:asWKT \"MULTIPOLYGON(((1")); + "osm2rdf:osmwayarea_201387026 geo:asWKT \"MULTIPOLYGON(((1")); // Reset std::cerr and std::cout std::cerr.rdbuf(cerrBufferOrig); diff --git a/tests/issues/Issue24.cpp b/tests/issues/Issue24.cpp index 6f2019a0..998fe32f 100644 --- a/tests/issues/Issue24.cpp +++ b/tests/issues/Issue24.cpp @@ -63,13 +63,13 @@ TEST(Issue24, areaFromWayHasGeometryAsGeoSPARQL) { output.close(); ASSERT_EQ( - "osmway:21 geo:hasGeometry osm2rdfgeom:osm_wayarea_21 .\n" - "osm2rdfgeom:osm_wayarea_21 geo:asWKT \"MULTIPOLYGON(((48.0 7.5,48.0 " + "osmway:21 geo:hasGeometry osm2rdf:osmwayarea_21 .\n" + "osm2rdf:osmwayarea_21 geo:asWKT \"MULTIPOLYGON(((48.0 7.5,48.0 " "7.6,48.1 7.6,48.1 7.5,48.0 7.5)))\"^^geo:wktLiteral .\n" - "osmway:21 osm2rdfgeom:convex_hull \"POLYGON(())\"^^geo:wktLiteral .\n" - "osmway:21 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:21 osm2rdf:convex_hull \"POLYGON()\"^^geo:wktLiteral .\n" + "osmway:21 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:21 osm2rdfgeom:obb \"POLYGON(())\"^^geo:wktLiteral .\n" + "osmway:21 osm2rdf:obb \"POLYGON()\"^^geo:wktLiteral .\n" "osmway:21 osm2rdf:area \"0.000000000000\"^^xsd:double .\n", buffer.str()); @@ -117,14 +117,14 @@ TEST(Issue24, areaFromRelationHasGeometryAsGeoSPARQL) { output.close(); ASSERT_EQ( - "osmrel:10 geo:hasGeometry osm2rdfgeom:osm_relarea_10 .\n" - "osm2rdfgeom:osm_relarea_10 geo:asWKT \"MULTIPOLYGON(((48.0 7.5,48.0 " + "osmrel:10 geo:hasGeometry osm2rdf:osmrelarea_10 .\n" + "osm2rdf:osmrelarea_10 geo:asWKT \"MULTIPOLYGON(((48.0 7.5,48.0 " "7.6,48.1 7.6,48.1 7.5,48.0 7.5)))\"^^geo:wktLiteral .\n" - "osmrel:10 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmrel:10 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmrel:10 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmrel:10 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmrel:10 osm2rdfgeom:obb \"POLYGON((48.0 7.6,48.1 7.6,48.1 7.5,48.0 " + "osmrel:10 osm2rdf:obb \"POLYGON((48.0 7.6,48.1 7.6,48.1 7.5,48.0 " "7.5,48.0 7.6))\"^^geo:wktLiteral .\n" "osmrel:10 osm2rdf:area \"0.010000000000\"^^xsd:double .\n", buffer.str()); @@ -170,14 +170,14 @@ TEST(Issue24, nodeHasGeometryAsGeoSPARQL) { "osmnode:42 rdf:type osm:node .\n" "osmnode:42 osmmeta:timestamp \"1970-01-01T00:00:00\"^^xsd:dateTime .\n" "osmnode:42 osm2rdf:facts \"0\"^^xsd:integer .\n" - "osmnode:42 geo:hasGeometry osm2rdfgeom:osm_node_42 .\n" - "osm2rdfgeom:osm_node_42 geo:asWKT \"POINT(7.5 48.0)\"^^geo:wktLiteral " + "osmnode:42 geo:hasGeometry osm2rdf:osmnode_42 .\n" + "osm2rdf:osmnode_42 geo:asWKT \"POINT(7.5 48.0)\"^^geo:wktLiteral " ".\n" - "osmnode:42 osm2rdfgeom:convex_hull \"POLYGON((7.5 48.0,7.5 48.0,7.5 " + "osmnode:42 osm2rdf:convex_hull \"POLYGON((7.5 48.0,7.5 48.0,7.5 " "48.0,7.5 48.0,7.5 48.0))\"^^geo:wktLiteral .\n" - "osmnode:42 osm2rdfgeom:envelope \"POLYGON((7.5 48.0,7.5 48.0,7.5 " + "osmnode:42 osm2rdf:envelope \"POLYGON((7.5 48.0,7.5 48.0,7.5 " "48.0,7.5 48.0,7.5 48.0))\"^^geo:wktLiteral .\n" - "osmnode:42 osm2rdfgeom:obb \"POLYGON((7.5 48.0,7.5 48.0,7.5 48.0,7.5 " + "osmnode:42 osm2rdf:obb \"POLYGON((7.5 48.0,7.5 48.0,7.5 48.0,7.5 " "48.0,7.5 48.0))\"^^geo:wktLiteral .\n", buffer.str()); @@ -267,14 +267,14 @@ TEST(Issue24, relationWithGeometryHasGeometryAsGeoSPARQL) { "_:0_1 osm2rdfmember:id osmway:55 .\n" "_:0_1 osm2rdfmember:role \"outer\" .\n" "_:0_1 osm2rdfmember:pos \"1\"^^xsd:integer .\n" - "osmrel:42 geo:hasGeometry osm2rdfgeom:osm_relation_42 .\n" - "osm2rdfgeom:osm_relation_42 geo:asWKT \"GEOMETRYCOLLECTION(POINT(7.5 " + "osmrel:42 geo:hasGeometry osm2rdf:osmrel_42 .\n" + "osm2rdf:osmrel_42 geo:asWKT \"GEOMETRYCOLLECTION(POINT(7.5 " "48.0),LINESTRING(7.5 48.0,7.6 48.0))\"^^geo:wktLiteral .\n" - "osmrel:42 osm2rdfgeom:convex_hull \"POLYGON((7.5 48.0,7.6 48.0,7.5 " + "osmrel:42 osm2rdf:convex_hull \"POLYGON((7.5 48.0,7.6 48.0,7.5 " "48.0,7.5 48.0))\"^^geo:wktLiteral .\n" - "osmrel:42 osm2rdfgeom:envelope \"POLYGON((7.5 48.0,7.5 48.0,7.6 " + "osmrel:42 osm2rdf:envelope \"POLYGON((7.5 48.0,7.5 48.0,7.6 " "48.0,7.6 48.0,7.5 48.0))\"^^geo:wktLiteral .\n" - "osmrel:42 osm2rdfgeom:obb \"POLYGON((7.6 48.0,7.6 48.0,7.5 48.0,7.5 " + "osmrel:42 osm2rdf:obb \"POLYGON((7.6 48.0,7.6 48.0,7.5 48.0,7.5 " "48.0,7.6 48.0))\"^^geo:wktLiteral .\n" "osmrel:42 osm2rdf:completeGeometry \"yes\" .\n", buffer.str()); @@ -323,14 +323,14 @@ TEST(Issue24, wayHasGeometryAsGeoSPARQL) { "osmway:42 rdf:type osm:way .\n" "osmway:42 osmmeta:timestamp \"1970-01-01T00:00:00\"^^xsd:dateTime .\n" "osmway:42 osm2rdf:facts \"0\"^^xsd:integer .\n" - "osmway:42 geo:hasGeometry osm2rdf:way_42 .\n" - "osm2rdf:way_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " + "osmway:42 geo:hasGeometry osm2rdf:osmway_42 .\n" + "osm2rdf:osmway_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " "7.6)\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " + "osmway:42 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " "7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:42 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " + "osmway:42 osm2rdf:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " "7.5,48.1 7.6))\"^^geo:wktLiteral .\n" "osmway:42 osm2rdf:length \"0.141421\"^^xsd:double .\n", buffer.str()); diff --git a/tests/osm/FactHandler.cpp b/tests/osm/FactHandler.cpp index da0812a7..07ca54fc 100644 --- a/tests/osm/FactHandler.cpp +++ b/tests/osm/FactHandler.cpp @@ -86,15 +86,15 @@ TEST(OSM_FactHandler, areaFromWay) { output.close(); ASSERT_EQ( - "osmway:21 geo:hasGeometry osm2rdfgeom:osm_wayarea_21 .\n" - "osm2rdfgeom:osm_wayarea_21 geo:asWKT \"MULTIPOLYGON(((48.0 7.5,48.0 " + "osmway:21 geo:hasGeometry osm2rdf:osmwayarea_21 .\n" + "osm2rdf:osmwayarea_21 geo:asWKT \"MULTIPOLYGON(((48.0 7.5,48.0 " "7.6,48.1 " "7.6,48.1 7.5,48.0 7.5)))\"^^geo:wktLiteral .\n" - "osmway:21 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:21 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:21 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:21 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:21 osm2rdfgeom:obb \"POLYGON((48.0 7.6,48.1 7.6,48.1 7.5,48.0 " + "osmway:21 osm2rdf:obb \"POLYGON((48.0 7.6,48.1 7.6,48.1 7.5,48.0 " "7.5,48.0 7.6))\"^^geo:wktLiteral .\n" "osmway:21 osm2rdf:area \"0.010000000000\"^^xsd:double .\n", buffer.str()); @@ -144,15 +144,15 @@ TEST(OSM_FactHandler, areaFromRelation) { output.close(); ASSERT_EQ( - "osmrel:10 geo:hasGeometry osm2rdfgeom:osm_relarea_10 .\n" - "osm2rdfgeom:osm_relarea_10 geo:asWKT \"MULTIPOLYGON(((48.0 7.5,48.0 " + "osmrel:10 geo:hasGeometry osm2rdf:osmrelarea_10 .\n" + "osm2rdf:osmrelarea_10 geo:asWKT \"MULTIPOLYGON(((48.0 7.5,48.0 " "7.6,48.1 " "7.6,48.1 7.5,48.0 7.5)))\"^^geo:wktLiteral .\n" - "osmrel:10 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmrel:10 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmrel:10 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmrel:10 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmrel:10 osm2rdfgeom:obb \"POLYGON((48.0 7.6,48.1 7.6,48.1 7.5,48.0 " + "osmrel:10 osm2rdf:obb \"POLYGON((48.0 7.6,48.1 7.6,48.1 7.5,48.0 " "7.5,48.0 7.6))\"^^geo:wktLiteral .\n" "osmrel:10 osm2rdf:area \"0.010000000000\"^^xsd:double .\n", buffer.str()); @@ -200,14 +200,14 @@ TEST(OSM_FactHandler, node) { "osmnode:42 osmmeta:timestamp \"1970-01-01T00:00:00\"^^xsd:dateTime .\n" "osmnode:42 osmkey:city \"Freiburg\" .\n" "osmnode:42 osm2rdf:facts \"1\"^^xsd:integer .\n" - "osmnode:42 geo:hasGeometry osm2rdfgeom:osm_node_42 .\n" - "osm2rdfgeom:osm_node_42 geo:asWKT \"POINT(7.5 48.0)\"^^geo:wktLiteral " + "osmnode:42 geo:hasGeometry osm2rdf:osmnode_42 .\n" + "osm2rdf:osmnode_42 geo:asWKT \"POINT(7.5 48.0)\"^^geo:wktLiteral " ".\n" - "osmnode:42 osm2rdfgeom:convex_hull \"POLYGON((7.5 48.0,7.5 48.0,7.5 " + "osmnode:42 osm2rdf:convex_hull \"POLYGON((7.5 48.0,7.5 48.0,7.5 " "48.0,7.5 48.0,7.5 48.0))\"^^geo:wktLiteral .\n" - "osmnode:42 osm2rdfgeom:envelope \"POLYGON((7.5 48.0,7.5 48.0,7.5 " + "osmnode:42 osm2rdf:envelope \"POLYGON((7.5 48.0,7.5 48.0,7.5 " "48.0,7.5 48.0,7.5 48.0))\"^^geo:wktLiteral .\n" - "osmnode:42 osm2rdfgeom:obb \"POLYGON((7.5 48.0,7.5 48.0,7.5 48.0,7.5 " + "osmnode:42 osm2rdf:obb \"POLYGON((7.5 48.0,7.5 48.0,7.5 48.0,7.5 " "48.0,7.5 48.0))\"^^geo:wktLiteral .\n", buffer.str()); @@ -360,14 +360,14 @@ TEST(OSM_FactHandler, relationWithGeometry) { "_:0_1 osm2rdfmember:id osmway:55 .\n" "_:0_1 osm2rdfmember:role \"outer\" .\n" "_:0_1 osm2rdfmember:pos \"1\"^^xsd:integer .\n" - "osmrel:42 geo:hasGeometry osm2rdfgeom:osm_relation_42 .\n" - "osm2rdfgeom:osm_relation_42 geo:asWKT \"GEOMETRYCOLLECTION(POINT(7.5 " + "osmrel:42 geo:hasGeometry osm2rdf:osmrel_42 .\n" + "osm2rdf:osmrel_42 geo:asWKT \"GEOMETRYCOLLECTION(POINT(7.5 " "48.0),LINESTRING(7.5 48.0,7.6 48.0))\"^^geo:wktLiteral .\n" - "osmrel:42 osm2rdfgeom:convex_hull \"POLYGON((7.5 48.0,7.6 48.0,7.5 " + "osmrel:42 osm2rdf:convex_hull \"POLYGON((7.5 48.0,7.6 48.0,7.5 " "48.0,7.5 48.0))\"^^geo:wktLiteral .\n" - "osmrel:42 osm2rdfgeom:envelope \"POLYGON((7.5 48.0,7.5 48.0,7.6 " + "osmrel:42 osm2rdf:envelope \"POLYGON((7.5 48.0,7.5 48.0,7.6 " "48.0,7.6 48.0,7.5 48.0))\"^^geo:wktLiteral .\n" - "osmrel:42 osm2rdfgeom:obb \"POLYGON((7.6 48.0,7.6 48.0,7.5 48.0,7.5 " + "osmrel:42 osm2rdf:obb \"POLYGON((7.6 48.0,7.6 48.0,7.5 48.0,7.5 " "48.0,7.6 48.0))\"^^geo:wktLiteral .\n" "osmrel:42 osm2rdf:completeGeometry \"yes\" .\n", buffer.str()); @@ -418,14 +418,14 @@ TEST(OSM_FactHandler, way) { "osmway:42 osmmeta:timestamp \"1970-01-01T00:00:00\"^^xsd:dateTime .\n" "osmway:42 osmkey:city \"Freiburg\" .\n" "osmway:42 osm2rdf:facts \"1\"^^xsd:integer .\n" - "osmway:42 geo:hasGeometry osm2rdf:way_42 .\n" - "osm2rdf:way_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " + "osmway:42 geo:hasGeometry osm2rdf:osmway_42 .\n" + "osm2rdf:osmway_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " "7.6)\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " + "osmway:42 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " "7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:42 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " + "osmway:42 osm2rdf:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " "7.5,48.1 7.6))\"^^geo:wktLiteral .\n" "osmway:42 osm2rdf:length \"0.141421\"^^xsd:double .\n", buffer.str()); @@ -481,22 +481,22 @@ TEST(OSM_FactHandler, wayAddWayNodeGeoemtry) { "_:0_0 osmway:node osmnode:1 .\n" "_:0_0 osm2rdfmember:pos \"0\"^^xsd:integer .\n" "osmnode:1 rdf:type osm:node .\n" - "osmnode:1 geo:hasGeometry osm2rdfgeom:osm_node_1 .\n" - "osm2rdfgeom:osm_node_1 geo:asWKT \"POINT(48.0 7.5)\"^^geo:wktLiteral .\n" + "osmnode:1 geo:hasGeometry osm2rdf:osmnode_1 .\n" + "osm2rdf:osmnode_1 geo:asWKT \"POINT(48.0 7.5)\"^^geo:wktLiteral .\n" "osmway:42 osmway:node _:0_1 .\n" "_:0_1 osmway:node osmnode:2 .\n" "_:0_1 osm2rdfmember:pos \"1\"^^xsd:integer .\n" "osmnode:2 rdf:type osm:node .\n" - "osmnode:2 geo:hasGeometry osm2rdfgeom:osm_node_2 .\n" - "osm2rdfgeom:osm_node_2 geo:asWKT \"POINT(48.1 7.6)\"^^geo:wktLiteral .\n" - "osmway:42 geo:hasGeometry osm2rdf:way_42 .\n" - "osm2rdf:way_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " + "osmnode:2 geo:hasGeometry osm2rdf:osmnode_2 .\n" + "osm2rdf:osmnode_2 geo:asWKT \"POINT(48.1 7.6)\"^^geo:wktLiteral .\n" + "osmway:42 geo:hasGeometry osm2rdf:osmway_42 .\n" + "osm2rdf:osmway_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " "7.6)\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " + "osmway:42 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " "7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:42 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " + "osmway:42 osm2rdf:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " "7.5,48.1 7.6))\"^^geo:wktLiteral .\n" "osmway:42 osm2rdf:length \"0.141421\"^^xsd:double .\n", buffer.str()); @@ -553,14 +553,14 @@ TEST(OSM_FactHandler, wayAddWayNodeOrder) { "osmway:42 osmway:node _:0_1 .\n" "_:0_1 osmway:node osmnode:2 .\n" "_:0_1 osm2rdfmember:pos \"1\"^^xsd:integer .\n" - "osmway:42 geo:hasGeometry osm2rdf:way_42 .\n" - "osm2rdf:way_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " + "osmway:42 geo:hasGeometry osm2rdf:osmway_42 .\n" + "osm2rdf:osmway_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " "7.6)\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " + "osmway:42 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " "7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:42 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " + "osmway:42 osm2rdf:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " "7.5,48.1 7.6))\"^^geo:wktLiteral .\n" "osmway:42 osm2rdf:length \"0.141421\"^^xsd:double .\n", buffer.str()); @@ -620,14 +620,14 @@ TEST(OSM_FactHandler, wayAddWayNodeSpatialMetadataShortWay) { "_:0_1 osm2rdfmember:pos \"1\"^^xsd:integer .\n" "_:0_0 osmway:next_node osmnode:2 .\n" "_:0_0 osmway:next_node_distance \"15657.137001\"^^xsd:decimal .\n" - "osmway:42 geo:hasGeometry osm2rdf:way_42 .\n" - "osm2rdf:way_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " + "osmway:42 geo:hasGeometry osm2rdf:osmway_42 .\n" + "osm2rdf:osmway_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " "7.6)\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " + "osmway:42 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " "7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:42 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " + "osmway:42 osm2rdf:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " "7.5,48.1 7.6))\"^^geo:wktLiteral .\n" "osmway:42 osm2rdf:length \"0.141421\"^^xsd:double .\n", buffer.str()); @@ -700,14 +700,14 @@ TEST(OSM_FactHandler, wayAddWayNodeSpatialMetadataLongerWay) { "_:0_3 osm2rdfmember:pos \"3\"^^xsd:integer .\n" "_:0_2 osmway:next_node osmnode:3 .\n" "_:0_2 osmway:next_node_distance \"11024.108103\"^^xsd:decimal .\n" - "osmway:42 geo:hasGeometry osm2rdf:way_42 .\n" - "osm2rdf:way_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 7.6,48.1 7.5,48.0 " + "osmway:42 geo:hasGeometry osm2rdf:osmway_42 .\n" + "osm2rdf:osmway_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 7.6,48.1 7.5,48.0 " "7.5)\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.1 " + "osmway:42 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.1 " "7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:42 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " + "osmway:42 osm2rdf:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " "7.5,48.1 7.6))\"^^geo:wktLiteral .\n" "osmway:42 osm2rdf:length \"0.341421\"^^xsd:double .\n", buffer.str()); @@ -758,14 +758,14 @@ TEST(OSM_FactHandler, wayAddWayMetaData) { "osmway:42 osmmeta:timestamp \"1970-01-01T00:00:00\"^^xsd:dateTime .\n" "osmway:42 osmkey:city \"Freiburg\" .\n" "osmway:42 osm2rdf:facts \"1\"^^xsd:integer .\n" - "osmway:42 geo:hasGeometry osm2rdf:way_42 .\n" - "osm2rdf:way_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " + "osmway:42 geo:hasGeometry osm2rdf:osmway_42 .\n" + "osm2rdf:osmway_42 geo:asWKT \"LINESTRING(48.0 7.5,48.1 " "7.6)\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " + "osmway:42 osm2rdf:convex_hull \"POLYGON((48.0 7.5,48.1 7.6,48.0 " "7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " + "osmway:42 osm2rdf:envelope \"POLYGON((48.0 7.5,48.0 7.6,48.1 " "7.6,48.1 7.5,48.0 7.5))\"^^geo:wktLiteral .\n" - "osmway:42 osm2rdfgeom:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " + "osmway:42 osm2rdf:obb \"POLYGON((48.1 7.6,48.1 7.6,48.0 7.5,48.0 " "7.5,48.1 7.6))\"^^geo:wktLiteral .\n" "osmway:42 osmway:is_closed \"no\" .\n" "osmway:42 osmway:nodeCount \"2\"^^xsd:integer .\n" diff --git a/tests/ttl/Writer.cpp b/tests/ttl/Writer.cpp index bfedba57..ee00367e 100644 --- a/tests/ttl/Writer.cpp +++ b/tests/ttl/Writer.cpp @@ -702,8 +702,8 @@ TEST(TTL_WriterTTL, writeStatisticJson) { statsBuffer << statsIFStream.rdbuf(); ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"blankNodes\": 3")); - ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"header\": 20")); - ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"lines\": 25")); + ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"header\": 19")); + ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"lines\": 24")); ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"triples\": 5")); // Cleanup @@ -764,8 +764,8 @@ TEST(TTL_WriterQLEVER, writeStatisticJson) { statsBuffer << statsIFStream.rdbuf(); ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"blankNodes\": 3")); - ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"header\": 20")); - ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"lines\": 25")); + ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"header\": 19")); + ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"lines\": 24")); ASSERT_THAT(statsBuffer.str(), ::testing::HasSubstr("\"triples\": 5")); // Cleanup diff --git a/tests/util/DirectedGraph.cpp b/tests/util/DirectedGraph.cpp index 259889db..147171d0 100644 --- a/tests/util/DirectedGraph.cpp +++ b/tests/util/DirectedGraph.cpp @@ -18,6 +18,8 @@ #include "osm2rdf/util/DirectedGraph.h" +#include + #include "gtest/gtest.h" namespace osm2rdf::util {