Skip to content

Commit a9b2995

Browse files
authored
Fix remaining issues regarding --iri-prefix-for-untagged-nodes (#124)
Fixes two issues with #120 (which introduced the option to have separate prefixes for tagged and untagged nodes), which went unnoticed during the review phase: 1. The computation phase of the geometric relations ignored the separate prefixes and always used the standard prefix 2. The separate prefixes for tagged and untagged nodes always used `osm`, even when `--source-dataset` was set to `OHM` The fix for 1 is trivial. The fix for 2 is as follows: If `--source-dataset` is `OSM`, use `https://www.openstreetmap.org/node` as the default prefix for nodes, if it is `OHM`, use `https://www.openhistoricalmap/node`. If `--iri-prefix-for-untagged-nodes` is not set or empty, use that default prefix for both tagged and untagged nodes, otherwise use it for the tagged nodes.
1 parent 4ce84df commit a9b2995

9 files changed

Lines changed: 117 additions & 60 deletions

File tree

include/osm2rdf/config/Constants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 - 2022, University of Freiburg
1+
// Copyright 2020 - 2025, University of Freiburg
22
// Authors: Axel Lehmann <[email protected]>
33
// Patrick Brosi <[email protected]>
44
// Hannah Bast <[email protected]>
@@ -215,7 +215,7 @@ const static inline std::string IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_SHORT = "";
215215
const static inline std::string IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_LONG =
216216
"iri-prefix-for-untagged-nodes";
217217
const static inline std::string IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_HELP =
218-
"IRI prefix for untagged nodes";
218+
"IRI prefix for untagged nodes; when empty, use same as for tagged nodes";
219219

220220
const static inline std::string NO_UNTAGGED_WAYS_INFO =
221221
"Do not output untagged ways";

include/osm2rdf/osm/GeometryHandler.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@ class GeometryHandler {
5757
// Calculate data
5858
void calculateRelations();
5959

60+
// Set the location handler
61+
void setLocationHandler(osm2rdf::osm::LocationHandler* locationHandler);
62+
6063
// Global config
6164
osm2rdf::config::Config _config;
6265
osm2rdf::ttl::Writer<W>* _writer;
66+
osm2rdf::osm::LocationHandler* _locationHandler;
6367

6468
private:
6569
sj::Sweeper _sweeper;

include/osm2rdf/ttl/Constants.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ namespace osm2rdf::ttl::constants {
2626
// Real constants
2727
const static inline std::string NAMESPACE__GEOSPARQL = "geo";
2828
const static inline std::string NAMESPACE__OHM_NODE = "ohmnode";
29+
const static inline std::string NAMESPACE__OHM_NODE_TAGGED = "ohmnode_tagged";
30+
const static inline std::string NAMESPACE__OHM_NODE_UNTAGGED = "ohmnode_untagged";
2931
const static inline std::string NAMESPACE__OHM_RELATION = "ohmrel";
3032
const static inline std::string NAMESPACE__OHM_WAY = "ohmway";
3133
const static inline std::string NAMESPACE__OHM_CHANGESET = "ohmchangeset";
@@ -51,6 +53,8 @@ const static inline std::string NAMESPACE__XML_SCHEMA = "xsd";
5153
// IRI Prefixes
5254
const static inline std::string IRI_PREFIX__OSM_NODE_TAGGED = "https://www.openstreetmap.org/node/";
5355
const static inline std::string IRI_PREFIX__OSM_NODE_UNTAGGED = "https://www.openstreetmap.org/node/";
56+
const static inline std::string IRI_PREFIX__OHM_NODE_TAGGED = "https://www.openhistoricalmap.org/node/";
57+
const static inline std::string IRI_PREFIX__OHM_NODE_UNTAGGED = "https://www.openhistoricalmap.org/node/";
5458

5559
// Generated constants (depending on output format)
5660
inline std::string IRI__GEOSPARQL__AS_WKT;
@@ -120,8 +124,14 @@ inline std::string LITERAL__TRUE;
120124

121125
// Arrays holding values depending on the used dataset
122126
const static inline std::vector<std::string> DATASET_ID = {"osm", "ohm"};
127+
const static inline std::vector<std::string> IRI_PREFIX_NODE_TAGGED = {
128+
IRI_PREFIX__OSM_NODE_TAGGED, IRI_PREFIX__OHM_NODE_TAGGED};
123129
const static inline std::vector<std::string> NODE_NAMESPACE = {
124130
NAMESPACE__OSM_NODE, NAMESPACE__OHM_NODE};
131+
const static inline std::vector<std::string> NODE_NAMESPACE_TAGGED = {
132+
NAMESPACE__OSM_NODE_TAGGED, NAMESPACE__OHM_NODE_TAGGED};
133+
const static inline std::vector<std::string> NODE_NAMESPACE_UNTAGGED = {
134+
NAMESPACE__OSM_NODE_UNTAGGED, NAMESPACE__OHM_NODE_UNTAGGED};
125135
const static inline std::vector<std::string> RELATION_NAMESPACE = {
126136
NAMESPACE__OSM_RELATION, NAMESPACE__OHM_RELATION};
127137
const static inline std::vector<std::string> WAY_NAMESPACE = {

src/config/Config.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ std::string osm2rdf::config::Config::getInfo(std::string_view prefix) const {
9393
<< prefix << osm2rdf::config::constants::NO_UNTAGGED_NODES_INFO;
9494
} else {
9595
oss << "\n"
96-
<< prefix << osm2rdf::config::constants::IRI_PREFIX_FOR_UNTAGGED_NODES_INFO
96+
<< prefix
97+
<< osm2rdf::config::constants::IRI_PREFIX_FOR_UNTAGGED_NODES_INFO
9798
<< iriPrefixForUntaggedNodes;
9899
}
99100
if (!addUntaggedWays) {
@@ -322,12 +323,12 @@ void osm2rdf::config::Config::fromArgs(int argc, char** argv) {
322323
osm2rdf::config::constants::NO_UNTAGGED_NODES_OPTION_LONG,
323324
osm2rdf::config::constants::NO_UNTAGGED_NODES_OPTION_HELP);
324325

325-
auto iriPrefixForUntaggedNodesOp =
326-
parser.add<popl::Value<std::string>, popl::Attribute::expert>(
327-
osm2rdf::config::constants::IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_SHORT,
328-
osm2rdf::config::constants::IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_LONG,
329-
osm2rdf::config::constants::IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_HELP,
330-
osm2rdf::ttl::constants::IRI_PREFIX__OSM_NODE_UNTAGGED);
326+
auto iriPrefixForUntaggedNodesOp = parser.add<popl::Value<std::string>,
327+
popl::Attribute::expert>(
328+
osm2rdf::config::constants::IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_SHORT,
329+
osm2rdf::config::constants::IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_LONG,
330+
osm2rdf::config::constants::IRI_PREFIX_FOR_UNTAGGED_NODES_OPTION_HELP,
331+
"");
331332

332333
auto noUntaggedWaysOp = parser.add<popl::Switch, popl::Attribute::expert>(
333334
osm2rdf::config::constants::NO_UNTAGGED_WAYS_OPTION_SHORT,
@@ -535,8 +536,12 @@ void osm2rdf::config::Config::fromArgs(int argc, char** argv) {
535536
addSpatialRelsForUntaggedNodes = untaggedNodesSpatialRelsOp->is_set();
536537

537538
addUntaggedNodes = !noUntaggedNodesOp->is_set();
538-
if (iriPrefixForUntaggedNodesOp->is_set()) {
539+
if (iriPrefixForUntaggedNodesOp->is_set() &&
540+
iriPrefixForUntaggedNodesOp->value().size() > 0) {
539541
iriPrefixForUntaggedNodes = iriPrefixForUntaggedNodesOp->value();
542+
} else {
543+
iriPrefixForUntaggedNodes =
544+
osm2rdf::ttl::constants::IRI_PREFIX_NODE_TAGGED[sourceDataset];
540545
}
541546
addUntaggedWays = !noUntaggedWaysOp->is_set();
542547
addUntaggedRelations = !noUntaggedRelationsOp->is_set();

src/osm/FactHandler.cpp

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,20 @@ using osm2rdf::ttl::constants::IRI__XSD__DOUBLE;
7575
using osm2rdf::ttl::constants::IRI__XSD__INTEGER;
7676
using osm2rdf::ttl::constants::IRI__XSD__YEAR;
7777
using osm2rdf::ttl::constants::IRI__XSD__YEAR_MONTH;
78-
using osm2rdf::ttl::constants::IRI_PREFIX__OSM_NODE_TAGGED;
78+
using osm2rdf::ttl::constants::IRI_PREFIX_NODE_TAGGED;
7979
using osm2rdf::ttl::constants::LITERAL__FALSE;
8080
using osm2rdf::ttl::constants::LITERAL__TRUE;
8181
using osm2rdf::ttl::constants::NAMESPACE__OSM2RDF;
8282
using osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_GEOM;
8383
using osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_META;
8484
using osm2rdf::ttl::constants::NAMESPACE__OSM2RDF_TAG;
85-
using osm2rdf::ttl::constants::NAMESPACE__OSM_NODE;
86-
using osm2rdf::ttl::constants::NAMESPACE__OSM_NODE_TAGGED;
87-
using osm2rdf::ttl::constants::NAMESPACE__OSM_NODE_UNTAGGED;
8885
using osm2rdf::ttl::constants::NAMESPACE__OSM_RELATION;
8986
using osm2rdf::ttl::constants::NAMESPACE__OSM_TAG;
9087
using osm2rdf::ttl::constants::NAMESPACE__OSM_WAY;
9188
using osm2rdf::ttl::constants::NAMESPACE__WIKIDATA_ENTITY;
9289
using osm2rdf::ttl::constants::NODE_NAMESPACE;
90+
using osm2rdf::ttl::constants::NODE_NAMESPACE_TAGGED;
91+
using osm2rdf::ttl::constants::NODE_NAMESPACE_UNTAGGED;
9392
using osm2rdf::ttl::constants::RELATION_NAMESPACE;
9493
using osm2rdf::ttl::constants::WAY_NAMESPACE;
9594

@@ -115,9 +114,9 @@ void osm2rdf::osm::FactHandler<W>::area(const osm2rdf::osm::Area& area) {
115114
area.objId());
116115

117116
const std::string& geomObj = _writer->generateIRIUnsafe(
118-
NAMESPACE__OSM2RDF_GEOM,
119-
DATASET_ID[_config.sourceDataset] + (area.fromWay() ? "way_" : "rel_")
120-
+ std::to_string(area.objId()));
117+
NAMESPACE__OSM2RDF_GEOM, DATASET_ID[_config.sourceDataset] +
118+
(area.fromWay() ? "way_" : "rel_") +
119+
std::to_string(area.objId()));
121120

122121
_writer->writeTriple(subj, IRI__GEOSPARQL__HAS_GEOMETRY, geomObj);
123122

@@ -129,9 +128,9 @@ void osm2rdf::osm::FactHandler<W>::area(const osm2rdf::osm::Area& area) {
129128

130129
if (_config.addCentroid) {
131130
const std::string& centroidObj = _writer->generateIRIUnsafe(
132-
NAMESPACE__OSM2RDF_GEOM,
133-
DATASET_ID[_config.sourceDataset] + (area.fromWay() ? "way_" : "rel_")
134-
+ "centroid_" + std::to_string(area.id()));
131+
NAMESPACE__OSM2RDF_GEOM, DATASET_ID[_config.sourceDataset] +
132+
(area.fromWay() ? "way_" : "rel_") +
133+
"centroid_" + std::to_string(area.id()));
135134
_writer->writeTriple(subj, IRI__GEOSPARQL__HAS_CENTROID, centroidObj);
136135
writeGeometry(centroidObj, IRI__GEOSPARQL__AS_WKT, area.centroid());
137136
}
@@ -160,14 +159,18 @@ void osm2rdf::osm::FactHandler<W>::area(const osm2rdf::osm::Area& area) {
160159
template <typename W>
161160
void osm2rdf::osm::FactHandler<W>::node(const osm2rdf::osm::Node& node) {
162161
bool untagged = node.tags().empty();
163-
bool separatePrefixes =
164-
(_config.iriPrefixForUntaggedNodes != IRI_PREFIX__OSM_NODE_TAGGED);
162+
bool separatePrefixes = (_config.iriPrefixForUntaggedNodes !=
163+
IRI_PREFIX_NODE_TAGGED[_config.sourceDataset]);
165164
const std::string& subj =
166165
!separatePrefixes
167-
? _writer->generateIRI(NAMESPACE__OSM_NODE, node.id())
168-
: (untagged
169-
? _writer->generateIRI(NAMESPACE__OSM_NODE_UNTAGGED, node.id())
170-
: _writer->generateIRI(NAMESPACE__OSM_NODE_TAGGED, node.id()));
166+
? _writer->generateIRI(NODE_NAMESPACE[_config.sourceDataset],
167+
node.id())
168+
: (untagged ? _writer->generateIRI(
169+
NODE_NAMESPACE_UNTAGGED[_config.sourceDataset],
170+
node.id())
171+
: _writer->generateIRI(
172+
NODE_NAMESPACE_TAGGED[_config.sourceDataset],
173+
node.id()));
171174

172175
_writer->writeTriple(subj, IRI__RDF__TYPE, IRI__OSM__NODE);
173176
// Meta
@@ -188,9 +191,8 @@ void osm2rdf::osm::FactHandler<W>::node(const osm2rdf::osm::Node& node) {
188191

189192
if (_config.addCentroid) {
190193
const std::string& centroidObj = _writer->generateIRIUnsafe(
191-
NAMESPACE__OSM2RDF_GEOM,
192-
DATASET_ID[_config.sourceDataset] + "node_"
193-
+ "centroid_" + std::to_string(node.id()));
194+
NAMESPACE__OSM2RDF_GEOM, DATASET_ID[_config.sourceDataset] + "node_" +
195+
"centroid_" + std::to_string(node.id()));
194196
_writer->writeTriple(subj, IRI__GEOSPARQL__HAS_CENTROID, centroidObj);
195197
writeGeometry(centroidObj, IRI__GEOSPARQL__AS_WKT, node.geom());
196198
}
@@ -235,12 +237,12 @@ void osm2rdf::osm::FactHandler<W>::relation(
235237
switch (member.type()) {
236238
case osm2rdf::osm::RelationMemberType::NODE:
237239
if (_config.iriPrefixForUntaggedNodes ==
238-
IRI_PREFIX__OSM_NODE_TAGGED) {
239-
type = NAMESPACE__OSM_NODE;
240+
IRI_PREFIX_NODE_TAGGED[_config.sourceDataset]) {
241+
type = NODE_NAMESPACE[_config.sourceDataset];
240242
} else if (_locationHandler->get_node_is_tagged(member.id())) {
241-
type = NAMESPACE__OSM_NODE_TAGGED;
243+
type = NODE_NAMESPACE_TAGGED[_config.sourceDataset];
242244
} else {
243-
type = NAMESPACE__OSM_NODE_UNTAGGED;
245+
type = NODE_NAMESPACE_UNTAGGED[_config.sourceDataset];
244246
}
245247
break;
246248
case osm2rdf::osm::RelationMemberType::RELATION:
@@ -271,18 +273,17 @@ void osm2rdf::osm::FactHandler<W>::relation(
271273

272274
if (relation.hasGeometry()) {
273275
const std::string& geomObj = _writer->generateIRIUnsafe(
274-
NAMESPACE__OSM2RDF_GEOM,
275-
DATASET_ID[_config.sourceDataset] + "rel_"
276-
+ std::to_string(relation.id()));
276+
NAMESPACE__OSM2RDF_GEOM, DATASET_ID[_config.sourceDataset] + "rel_" +
277+
std::to_string(relation.id()));
277278

278279
_writer->writeTriple(subj, IRI__GEOSPARQL__HAS_GEOMETRY, geomObj);
279280
writeGeometry(geomObj, IRI__GEOSPARQL__AS_WKT, relation.geom());
280281

281282
if (_config.addCentroid) {
282283
const std::string& centroidObj = _writer->generateIRIUnsafe(
283-
NAMESPACE__OSM2RDF_GEOM,
284-
DATASET_ID[_config.sourceDataset] + "rel_"
285-
+ "centroid_" + std::to_string(relation.id()));
284+
NAMESPACE__OSM2RDF_GEOM, DATASET_ID[_config.sourceDataset] + "rel_" +
285+
"centroid_" +
286+
std::to_string(relation.id()));
286287
_writer->writeTriple(subj, IRI__GEOSPARQL__HAS_CENTROID, centroidObj);
287288
writeGeometry(centroidObj, IRI__GEOSPARQL__AS_WKT, relation.centroid());
288289
}
@@ -332,12 +333,13 @@ void osm2rdf::osm::FactHandler<W>::way(const osm2rdf::osm::Way& way) {
332333
_writer->writeTriple(subj, IRI__OSMWAY__NODE, blankNode);
333334

334335
std::string nodeNamespace;
335-
if (_config.iriPrefixForUntaggedNodes == IRI_PREFIX__OSM_NODE_TAGGED) {
336-
nodeNamespace = NAMESPACE__OSM_NODE;
336+
if (_config.iriPrefixForUntaggedNodes ==
337+
IRI_PREFIX_NODE_TAGGED[_config.sourceDataset]) {
338+
nodeNamespace = NODE_NAMESPACE[_config.sourceDataset];
337339
} else if (_locationHandler->get_node_is_tagged(node.id())) {
338-
nodeNamespace = NAMESPACE__OSM_NODE_TAGGED;
340+
nodeNamespace = NODE_NAMESPACE_TAGGED[_config.sourceDataset];
339341
} else {
340-
nodeNamespace = NAMESPACE__OSM_NODE_UNTAGGED;
342+
nodeNamespace = NODE_NAMESPACE_UNTAGGED[_config.sourceDataset];
341343
}
342344

343345
_writer->writeTriple(blankNode,
@@ -380,8 +382,7 @@ void osm2rdf::osm::FactHandler<W>::way(const osm2rdf::osm::Way& way) {
380382
if (_config.addAreaWayLinestrings || !way.isArea()) {
381383
const std::string& geomObj = _writer->generateIRIUnsafe(
382384
NAMESPACE__OSM2RDF_GEOM,
383-
DATASET_ID[_config.sourceDataset] + "way_"
384-
+ std::to_string(way.id()));
385+
DATASET_ID[_config.sourceDataset] + "way_" + std::to_string(way.id()));
385386

386387
_writer->writeTriple(subj, IRI__GEOSPARQL__HAS_GEOMETRY, geomObj);
387388
writeGeometry(geomObj, IRI__GEOSPARQL__AS_WKT, way.geom());
@@ -392,9 +393,8 @@ void osm2rdf::osm::FactHandler<W>::way(const osm2rdf::osm::Way& way) {
392393
// are already written in the area handler
393394
if (_config.addCentroid) {
394395
const std::string& centroidObj = _writer->generateIRIUnsafe(
395-
NAMESPACE__OSM2RDF_GEOM,
396-
DATASET_ID[_config.sourceDataset] + "way_"
397-
+ "centroid_" + std::to_string(way.id()));
396+
NAMESPACE__OSM2RDF_GEOM, DATASET_ID[_config.sourceDataset] + "way_" +
397+
"centroid_" + std::to_string(way.id()));
398398
_writer->writeTriple(subj, IRI__GEOSPARQL__HAS_CENTROID, centroidObj);
399399
writeGeometry(centroidObj, IRI__GEOSPARQL__AS_WKT, way.centroid());
400400
}

src/osm/GeometryHandler.cpp

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ using osm2rdf::osm::GeometryHandler;
5151
using osm2rdf::osm::Node;
5252
using osm2rdf::osm::Relation;
5353
using osm2rdf::osm::Way;
54+
using osm2rdf::ttl::constants::IRI_PREFIX_NODE_TAGGED;
55+
using osm2rdf::ttl::constants::NODE_NAMESPACE;
56+
using osm2rdf::ttl::constants::NODE_NAMESPACE_TAGGED;
57+
using osm2rdf::ttl::constants::NODE_NAMESPACE_UNTAGGED;
5458

5559
const static size_t BATCH_SIZE = 10000;
5660

@@ -96,6 +100,13 @@ GeometryHandler<W>::GeometryHandler(const osm2rdf::config::Config& config,
96100
template <typename W>
97101
GeometryHandler<W>::~GeometryHandler() = default;
98102

103+
// ____________________________________________________________________________
104+
template <typename W>
105+
void GeometryHandler<W>::setLocationHandler(
106+
osm2rdf::osm::LocationHandler* locationHandler) {
107+
_locationHandler = locationHandler;
108+
}
109+
99110
// ____________________________________________________________________________
100111
template <typename W>
101112
void GeometryHandler<W>::relation(const Relation& rel) {
@@ -113,9 +124,16 @@ void GeometryHandler<W>::relation(const Relation& rel) {
113124

114125
for (const auto& m : rel.members()) {
115126
if (m.type() == osm2rdf::osm::RelationMemberType::NODE) {
116-
std::string pid = _writer->generateIRI(
117-
osm2rdf::ttl::constants::NODE_NAMESPACE[_config.sourceDataset],
118-
m.id());
127+
std::string type;
128+
if (_config.iriPrefixForUntaggedNodes ==
129+
IRI_PREFIX_NODE_TAGGED[_config.sourceDataset]) {
130+
type = NODE_NAMESPACE[_config.sourceDataset];
131+
} else if (_locationHandler->get_node_is_tagged(m.id())) {
132+
type = NODE_NAMESPACE_TAGGED[_config.sourceDataset];
133+
} else {
134+
type = NODE_NAMESPACE_UNTAGGED[_config.sourceDataset];
135+
}
136+
std::string pid = _writer->generateIRI(type, m.id());
119137
_sweeper.add(pid, transform(rel.envelope()), id, subId, false,
120138
_parseBatches[omp_get_thread_num()]);
121139
}
@@ -228,9 +246,20 @@ ::util::geo::I32Point GeometryHandler<W>::transform(
228246
// ____________________________________________________________________________
229247
template <typename W>
230248
void GeometryHandler<W>::node(const Node& node) {
231-
std::string id = _writer->generateIRI(
232-
osm2rdf::ttl::constants::NODE_NAMESPACE[_config.sourceDataset],
233-
node.id());
249+
bool untagged = node.tags().empty();
250+
bool separatePrefixes = (_config.iriPrefixForUntaggedNodes !=
251+
IRI_PREFIX_NODE_TAGGED[_config.sourceDataset]);
252+
253+
const std::string& id =
254+
!separatePrefixes
255+
? _writer->generateIRI(NODE_NAMESPACE[_config.sourceDataset],
256+
node.id())
257+
: (untagged ? _writer->generateIRI(
258+
NODE_NAMESPACE_UNTAGGED[_config.sourceDataset],
259+
node.id())
260+
: _writer->generateIRI(
261+
NODE_NAMESPACE_TAGGED[_config.sourceDataset],
262+
node.id()));
234263

235264
_sweeper.add(transform(node.geom()), id, false,
236265
_parseBatches[omp_get_thread_num()]);

src/osm/OsmiumHandler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ void osm2rdf::osm::OsmiumHandler<W>::handle() {
9797
_config, countHandler.minNodeId(), countHandler.maxNodeId());
9898
_relationHandler.setLocationHandler(locationHandler);
9999
_factHandler->setLocationHandler(locationHandler);
100+
_geometryHandler->setLocationHandler(locationHandler);
100101

101102
size_t numTasks = 0;
102103
if (!_config.noFacts && !_config.noNodeFacts) {

src/ttl/Writer.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ osm2rdf::ttl::Writer<T>::Writer(const osm2rdf::config::Config& config,
7575
{osm2rdf::ttl::constants::NAMESPACE__OSM_NODE_TAGGED,
7676
osm2rdf::ttl::constants::IRI_PREFIX__OSM_NODE_TAGGED},
7777
{osm2rdf::ttl::constants::NAMESPACE__OSM_NODE_UNTAGGED,
78-
config.iriPrefixForUntaggedNodes},
78+
config.sourceDataset == osm2rdf::config::OSM
79+
? config.iriPrefixForUntaggedNodes
80+
: osm2rdf::ttl::constants::IRI_PREFIX__OSM_NODE_UNTAGGED},
7981
{osm2rdf::ttl::constants::NAMESPACE__OSM_RELATION,
8082
"https://www.openstreetmap.org/relation/"},
8183
{osm2rdf::ttl::constants::NAMESPACE__OSM_WAY,
@@ -86,7 +88,13 @@ osm2rdf::ttl::Writer<T>::Writer(const osm2rdf::config::Config& config,
8688
{osm2rdf::ttl::constants::NAMESPACE__OHM,
8789
"https://www.openhistoricalmap.org/"},
8890
{osm2rdf::ttl::constants::NAMESPACE__OHM_NODE,
89-
"https://www.openhistoricalmap.org/node/"},
91+
osm2rdf::ttl::constants::IRI_PREFIX__OHM_NODE_TAGGED},
92+
{osm2rdf::ttl::constants::NAMESPACE__OHM_NODE_TAGGED,
93+
osm2rdf::ttl::constants::IRI_PREFIX__OHM_NODE_TAGGED},
94+
{osm2rdf::ttl::constants::NAMESPACE__OHM_NODE_UNTAGGED,
95+
config.sourceDataset == osm2rdf::config::OHM
96+
? config.iriPrefixForUntaggedNodes
97+
: osm2rdf::ttl::constants::IRI_PREFIX__OHM_NODE_UNTAGGED},
9098
{osm2rdf::ttl::constants::NAMESPACE__OHM_RELATION,
9199
"https://www.openhistoricalmap.org/relation/"},
92100
{osm2rdf::ttl::constants::NAMESPACE__OHM_WAY,

0 commit comments

Comments
 (0)