Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/main/java/be/ugent/rml/Executor.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,27 @@ private void generateQuad(ProvenancedTerm subject, ProvenancedTerm predicate, Pr


if (subject != null && predicate != null & object != null) {
if (object.getTerm() instanceof NamedNode) {
String iri = ((NamedNode) object.getTerm()).getValue();
if (Utils.isRelativeIRI(iri)) {
// Check the base IRI to see if we can use it to turn the IRI into an absolute one.
if (this.baseIRI == null) {
logger.error("The base IRI is null, so relative IRI of object cannot be turned in to absolute IRI. Skipped.");
return;
} else {
logger.debug("The IRI of object is made absolute via base IRI.");
iri = this.baseIRI + iri;

// Check if the new absolute IRI is valid.
if (Utils.isValidIRI(iri)) {
object = new ProvenancedTerm(new NamedNode(iri), object.getMetadata());
} else {
logger.error("The object \"" + iri + "\" is not a valid IRI. Skipped.");
return;
}
}
}
}
this.resultingQuads.addQuad(subject.getTerm(), predicate.getTerm(), object.getTerm(), g);
}
}
Expand Down Expand Up @@ -362,4 +383,4 @@ public static String getNewBlankNodeID() {
public List<Term> getTriplesMaps() {
return initializer.getTriplesMaps();
}
}
}