@@ -96,12 +96,8 @@ void BasicHDT::createComponents() {
9696
9797 // DICTIONARY
9898
99- std::string dictType = " " ;
100- try {
101- dictType = spec.get (" dictionary.type" );
102- }
103- catch (std::exception& e){
104- }
99+ std::string dictType = spec.getOrEmpty (" dictionary.type" );
100+
105101
106102 if (dictType==HDTVocabulary::DICTIONARY_TYPE_FOUR) {
107103 dictionary = new FourSectionDictionary (spec);
@@ -118,11 +114,8 @@ void BasicHDT::createComponents() {
118114 }
119115
120116 // TRIPLES
121- std::string triplesType = " " ;
122- try {
123- triplesType = spec.get (" triples.type" );
124- }catch (std::exception& e) {
125- }
117+ std::string triplesType = spec.getOrEmpty (" triples.type" );
118+
126119 if (triplesType==HDTVocabulary::TRIPLES_TYPE_BITMAP) {
127120 triples = new BitmapTriples (spec);
128121 } else if (triplesType==HDTVocabulary::TRIPLES_TYPE_PLAIN) {
@@ -299,11 +292,8 @@ void BasicHDT::loadTriples(const char* fileName, const char* baseUri, RDFNotatio
299292 triplesList->stopProcessing (&iListener);
300293
301294 // SORT & Duplicates
302- string ord = " " ;
303- try {
304- ord = spec.get (" triplesOrder" );
305- }catch (std::exception& e){
306- }
295+ string ord = spec.getOrEmpty (" triplesOrder" );
296+
307297 TripleComponentOrder order = parseOrder (
308298 ord.c_str ());
309299 if (order == Unknown) {
@@ -581,12 +571,8 @@ void BasicHDT::loadTriplesFromHDTs(const char** fileNames, size_t numFiles, cons
581571 triplesList->stopProcessing (&iListener);
582572
583573 // SORT & Duplicates
584- string ord = " " ;
585- try {
586- ord = spec.get (" triplesOrder" );
587- }
588- catch (std::exception& e){
589- }
574+ string ord = spec.getOrEmpty (" triplesOrder" );
575+
590576 TripleComponentOrder order = parseOrder (ord.c_str ());
591577 if (order == Unknown) {
592578 order = SPO;
0 commit comments