Skip to content

Commit

Permalink
Fixed attempted correlation of .csv headers and .ttl classes not find…
Browse files Browse the repository at this point in the history
…ing equal strings - failed due to \uFEFF being prepended to .csv headers.
  • Loading branch information
CodeGat committed Feb 9, 2019
1 parent 5d80707 commit 90ba5ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/model/dataintegration/DataIntegrator.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,13 @@ public void attemptCorrelationOfHeaders(){

for (Entry<String, Integer> header : headers.entrySet()){
for (Vertex klass : classes){
boolean isExactMatch = header.getKey().equals(klass.getName());
String headerComparable =
header.getKey().charAt(0) == '\uFEFF' ? header.getKey().substring(1) : header.getKey();

boolean isExactMatch = headerComparable.equals(klass.getName());
boolean isCloseMatch = !klass.isIri()
&& klass.getElementType() == CLASS
&& header.getKey().equalsIgnoreCase(klass.getName().split(":", 2)[1]);
&& headerComparable.equalsIgnoreCase(klass.getName().split(":", 2)[1]);

if (isExactMatch || isCloseMatch){
csvTtlCorrelations.add(new Correlation(header.getValue(), header.getKey(), klass));
Expand Down

0 comments on commit 90ba5ae

Please sign in to comment.