Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit 81d3a50

Browse files
Alexander PatrikalakisAlexander Patrikalakis
authored andcommitted
Update OpenCsv version and convert hotels file to csv
1 parent 254b398 commit 81d3a50

File tree

4 files changed

+71
-71
lines changed

4 files changed

+71
-71
lines changed

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<exec.maven.plugin.version>1.2</exec.maven.plugin.version>
3131
<download.maven.plugin.version>1.2.1</download.maven.plugin.version>
3232
<slf4j.version>1.7.21</slf4j.version>
33-
<opencsv.version>2.4</opencsv.version>
33+
<opencsv.version>3.8</opencsv.version>
3434
<metrics3.version>3.0.1</metrics3.version>
3535
<commons.logging.version>1.1.1</commons.logging.version>
3636
<hadoop.version>2.2.0</hadoop.version>
@@ -111,15 +111,15 @@
111111
<version>${metrics3.version}</version>
112112
</dependency>
113113
<dependency>
114-
<groupId>au.com.bytecode</groupId>
114+
<groupId>com.opencsv</groupId>
115115
<artifactId>opencsv</artifactId>
116116
<version>${opencsv.version}</version>
117117
</dependency>
118118
<dependency>
119119
<groupId>org.slf4j</groupId>
120120
<artifactId>slf4j-log4j12</artifactId>
121121
<version>${slf4j.version}</version>
122-
<scope>runtime</scope>
122+
<scope>test</scope>
123123
</dependency>
124124
<!-- Gremlin -->
125125
<dependency>
@@ -154,7 +154,7 @@
154154
<groupId>log4j</groupId>
155155
<artifactId>log4j</artifactId>
156156
<version>1.2.17</version>
157-
<scope>runtime</scope>
157+
<scope>test</scope>
158158
</dependency>
159159
<dependency>
160160
<groupId>commons-configuration</groupId>

src/main/java/com/amazon/janusgraph/example/MarvelGraphFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242

4343
import com.codahale.metrics.ConsoleReporter;
4444
import com.codahale.metrics.MetricRegistry;
45+
import com.opencsv.CSVReader;
4546

46-
import au.com.bytecode.opencsv.CSVReader;
4747
import lombok.Getter;
4848
import lombok.RequiredArgsConstructor;
4949
import lombok.extern.slf4j.Slf4j;

src/test/java/com/amazon/janusgraph/ScenarioTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.inV;
1818
import static org.junit.Assert.fail;
1919

20-
import java.io.BufferedReader;
2120
import java.io.IOException;
2221
import java.io.InputStreamReader;
2322
import java.net.URL;
@@ -61,6 +60,7 @@
6160
import com.amazon.janusgraph.testcategory.IsolateRemainingTestsCategory;
6261
import com.google.common.base.Preconditions;
6362
import com.google.common.base.Stopwatch;
63+
import com.opencsv.CSVReader;
6464

6565
import lombok.Getter;
6666
import lombok.ToString;
@@ -167,12 +167,12 @@ private void tripleIngestBase(BiConsumer<StandardJanusGraph, List<Triple>> write
167167
watch.reset();
168168
watch.start();
169169
final URL url = ScenarioTests.class.getClassLoader().getResource("META-INF/HotelTriples.txt");
170+
Preconditions.checkNotNull(url);
170171
final List<Triple> lines;
171-
try (final BufferedReader bf = new BufferedReader(new InputStreamReader(url.openStream()))) {
172-
lines = bf.lines()
173-
.map(line -> line.split("\t"))
174-
.map(Triple::new)
175-
.collect(Collectors.toList());
172+
try (CSVReader reader = new CSVReader(new InputStreamReader(url.openStream()))) {
173+
lines = reader.readAll().stream()
174+
.map(Triple::new)
175+
.collect(Collectors.toList());
176176
} catch (IOException e) {
177177
throw new IllegalStateException("Error processing triple file", e);
178178
}
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
name:JW Marriott instanceOf name:Marriott International, Inc.
2-
name:The Ritz-Carlton instanceOf name:Marriott International, Inc.
3-
name:St. Regis instanceOf name:Marriott International, Inc.
4-
name:Bulgari Hotels & Resorts instanceOf name:Marriott International, Inc.
5-
name:Edition Hotels instanceOf name:Marriott International, Inc.
6-
name:The Luxury Collection instanceOf name:Marriott International, Inc.
7-
name:W Hotels instanceOf name:Marriott International, Inc.
8-
name:Delta Hotels instanceOf name:Marriott International, Inc.
9-
name:Marriott instanceOf name:Marriott International, Inc.
10-
name:Marriott Vacation Club instanceOf name:Marriott International, Inc.
11-
name:Sheraton instanceOf name:Marriott International, Inc.
12-
name:Autograph Collection instanceOf name:Marriott International, Inc.
13-
name:Design Hotels instanceOf name:Marriott International, Inc.
14-
name:Gaylord Hotels instanceOf name:Marriott International, Inc.
15-
name:Le Méridien instanceOf name:Marriott International, Inc.
16-
name:Renaissance Hotels instanceOf name:Marriott International, Inc.
17-
name:Tribute Portfolio instanceOf name:Marriott International, Inc.
18-
name:Westin instanceOf name:Marriott International, Inc.
19-
name:Courtyard by Marriott instanceOf name:Marriott International, Inc.
20-
name:Fairfield Inn by Marriott instanceOf name:Marriott International, Inc.
21-
name:Four Points by Sheraton instanceOf name:Marriott International, Inc.
22-
name:Protea Hotels by Marriott instanceOf name:Marriott International, Inc.
23-
name:SpringHill Suites by Marriott instanceOf name:Marriott International, Inc.
24-
name:AC Hotels instanceOf name:Marriott International, Inc.
25-
name:Aloft Hotels instanceOf name:Marriott International, Inc.
26-
name:Moxy Hotels instanceOf name:Marriott International, Inc.
27-
name:Marriott Executive Apartments instanceOf name:Marriott International, Inc.
28-
name:Residence Inn by Marriott instanceOf name:Marriott International, Inc.
29-
name:TownePlace Suites by Marriott instanceOf name:Marriott International, Inc.
30-
name:Element by Westin instanceOf name:Marriott International, Inc.
31-
name:JW Marriott hotelBrandType brandtype:Classic Luxury
32-
name:The Ritz-Carlton hotelBrandType brandtype:Classic Luxury
33-
name:St. Regis hotelBrandType brandtype:Classic Luxury
34-
name:Bulgari Hotels & Resorts hotelBrandType brandtype:Distinctive Luxury
35-
name:Edition Hotels hotelBrandType brandtype:Distinctive Luxury
36-
name:The Luxury Collection hotelBrandType brandtype:Distinctive Luxury
37-
name:W Hotels hotelBrandType brandtype:Distinctive Luxury
38-
name:Delta Hotels hotelBrandType brandtype:Classic Premium
39-
name:Marriott hotelBrandType brandtype:Classic Premium
40-
name:Marriott Vacation Club hotelBrandType brandtype:Classic Premium
41-
name:Sheraton hotelBrandType brandtype:Classic Premium
42-
name:Autograph Collection hotelBrandType brandtype:Distinctive Premium
43-
name:Design Hotels hotelBrandType brandtype:Distinctive Premium
44-
name:Gaylord Hotels hotelBrandType brandtype:Distinctive Premium
45-
name:Le Méridien hotelBrandType brandtype:Distinctive Premium
46-
name:Renaissance Hotels hotelBrandType brandtype:Distinctive Premium
47-
name:Tribute Portfolio hotelBrandType brandtype:Distinctive Premium
48-
name:Westin hotelBrandType brandtype:Distinctive Premium
49-
name:Courtyard by Marriott hotelBrandType brandtype:Classic Select
50-
name:Fairfield Inn by Marriott hotelBrandType brandtype:Classic Select
51-
name:Four Points by Sheraton hotelBrandType brandtype:Classic Select
52-
name:Protea Hotels by Marriott hotelBrandType brandtype:Classic Select
53-
name:SpringHill Suites by Marriott hotelBrandType brandtype:Classic Select
54-
name:AC Hotels hotelBrandType brandtype:Distinctive Select
55-
name:Aloft Hotels hotelBrandType brandtype:Distinctive Select
56-
name:Moxy Hotels hotelBrandType brandtype:Distinctive Select
57-
name:Marriott Executive Apartments hotelBrandType brandtype:Classic Longer Stays
58-
name:Residence Inn by Marriott hotelBrandType brandtype:Classic Longer Stays
59-
name:TownePlace Suites by Marriott hotelBrandType brandtype:Classic Longer Stays
60-
name:Element by Westin hotelBrandType brandtype:Distinctive Longer Stays
1+
name:JW Marriott,instanceOf,name:Marriott International Inc.
2+
name:The Ritz-Carlton,instanceOf,name:Marriott International Inc.
3+
name:St. Regis,instanceOf,name:Marriott International Inc.
4+
name:Bulgari Hotels & Resorts,instanceOf,name:Marriott International Inc.
5+
name:Edition Hotels,instanceOf,name:Marriott International Inc.
6+
name:The Luxury Collection,instanceOf,name:Marriott International Inc.
7+
name:W Hotels,instanceOf,name:Marriott International Inc.
8+
name:Delta Hotels,instanceOf,name:Marriott International Inc.
9+
name:Marriott,instanceOf,name:Marriott International Inc.
10+
name:Marriott Vacation Club,instanceOf,name:Marriott International Inc.
11+
name:Sheraton,instanceOf,name:Marriott International Inc.
12+
name:Autograph Collection,instanceOf,name:Marriott International Inc.
13+
name:Design Hotels,instanceOf,name:Marriott International Inc.
14+
name:Gaylord Hotels,instanceOf,name:Marriott International Inc.
15+
name:Le Méridien,instanceOf,name:Marriott International Inc.
16+
name:Renaissance Hotels,instanceOf,name:Marriott International Inc.
17+
name:Tribute Portfolio,instanceOf,name:Marriott International Inc.
18+
name:Westin,instanceOf,name:Marriott International Inc.
19+
name:Courtyard by Marriott,instanceOf,name:Marriott International Inc.
20+
name:Fairfield Inn by Marriott,instanceOf,name:Marriott International Inc.
21+
name:Four Points by Sheraton,instanceOf,name:Marriott International Inc.
22+
name:Protea Hotels by Marriott,instanceOf,name:Marriott International Inc.
23+
name:SpringHill Suites by Marriott,instanceOf,name:Marriott International Inc.
24+
name:AC Hotels,instanceOf,name:Marriott International Inc.
25+
name:Aloft Hotels,instanceOf,name:Marriott International Inc.
26+
name:Moxy Hotels,instanceOf,name:Marriott International Inc.
27+
name:Marriott Executive Apartments,instanceOf,name:Marriott International Inc.
28+
name:Residence Inn by Marriott,instanceOf,name:Marriott International Inc.
29+
name:TownePlace Suites by Marriott,instanceOf,name:Marriott International Inc.
30+
name:Element by Westin,instanceOf,name:Marriott International Inc.
31+
name:JW Marriott,hotelBrandType,brandtype:Classic Luxury
32+
name:The Ritz-Carlton,hotelBrandType,brandtype:Classic Luxury
33+
name:St. Regis,hotelBrandType,brandtype:Classic Luxury
34+
name:Bulgari Hotels & Resorts,hotelBrandType,brandtype:Distinctive Luxury
35+
name:Edition Hotels,hotelBrandType,brandtype:Distinctive Luxury
36+
name:The Luxury Collection,hotelBrandType,brandtype:Distinctive Luxury
37+
name:W Hotels,hotelBrandType,brandtype:Distinctive Luxury
38+
name:Delta Hotels,hotelBrandType,brandtype:Classic Premium
39+
name:Marriott,hotelBrandType,brandtype:Classic Premium
40+
name:Marriott Vacation Club,hotelBrandType,brandtype:Classic Premium
41+
name:Sheraton,hotelBrandType,brandtype:Classic Premium
42+
name:Autograph Collection,hotelBrandType,brandtype:Distinctive Premium
43+
name:Design Hotels,hotelBrandType,brandtype:Distinctive Premium
44+
name:Gaylord Hotels,hotelBrandType,brandtype:Distinctive Premium
45+
name:Le Méridien,hotelBrandType,brandtype:Distinctive Premium
46+
name:Renaissance Hotels,hotelBrandType,brandtype:Distinctive Premium
47+
name:Tribute Portfolio,hotelBrandType,brandtype:Distinctive Premium
48+
name:Westin,hotelBrandType,brandtype:Distinctive Premium
49+
name:Courtyard by Marriott,hotelBrandType,brandtype:Classic Select
50+
name:Fairfield Inn by Marriott,hotelBrandType,brandtype:Classic Select
51+
name:Four Points by Sheraton,hotelBrandType,brandtype:Classic Select
52+
name:Protea Hotels by Marriott,hotelBrandType,brandtype:Classic Select
53+
name:SpringHill Suites by Marriott,hotelBrandType,brandtype:Classic Select
54+
name:AC Hotels,hotelBrandType,brandtype:Distinctive Select
55+
name:Aloft Hotels,hotelBrandType,brandtype:Distinctive Select
56+
name:Moxy Hotels,hotelBrandType,brandtype:Distinctive Select
57+
name:Marriott Executive Apartments,hotelBrandType,brandtype:Classic Longer Stays
58+
name:Residence Inn by Marriott,hotelBrandType,brandtype:Classic Longer Stays
59+
name:TownePlace Suites by Marriott,hotelBrandType,brandtype:Classic Longer Stays
60+
name:Element by Westin,hotelBrandType,brandtype:Distinctive Longer Stays

0 commit comments

Comments
 (0)