Skip to content

Commit

Permalink
Fixed some things
Browse files Browse the repository at this point in the history
  • Loading branch information
dschiese committed Jan 24, 2024
1 parent b7dd25e commit 847b610
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/example/inputdatastorage/QueriesPojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ protected void setUpProperties(String item) throws IOException {
BufferedReader reader = new BufferedReader(new StringReader(item));
String line = reader.readLine();
while(line != null) {
getGraphIdFromItem(line);
getAnnotationTypeFromItem(line);
getGraphIdFromItem(line);
line = reader.readLine();
}
if(this.graphId == null && this.annotationType == null)
if(this.graphId == null || this.annotationType == null)
throw new RuntimeException("Error while creating object from pass query with graphID = " + graphId + " and annotationType = " + annotationType);
else
logger.info("Found graphId: {} and annotationType: {}", this.graphId, this.annotationType);
}

protected void getGraphIdFromItem(String line) {
if(line.startsWith("FROM <")) {
this.graphId = line.replace("FROM <", "").replace("> {", "");
this.graphId = line.substring(line.indexOf("<")+1,line.indexOf(">"));
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/example/inputdatastorage/Service.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,16 @@ public List<Statement> createStatementsFromQueryPojo(QueriesPojo queriesPojo, St
Resource componentResource = ResourceFactory.createResource("urn:qanary:" + component);
Literal query = ResourceFactory.createStringLiteral(queriesPojo.getQuery());
Resource annType = ResourceFactory.createResource("qa:" + queriesPojo.getAnnotationType());
statements.add(ResourceFactory.createStatement(
componentResource,
this.hasInputQuery,
query
));
statements.add(ResourceFactory.createStatement(
componentResource,
this.hasAnnotationType,
annType
));
statements.add(ResourceFactory.createStatement(
annType,
this.hasInputQuery,
query
));
logger.debug("Statements: {}", statements);
return statements;
}
Expand Down

0 comments on commit 847b610

Please sign in to comment.