Commit 8696554f authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Only add digital object if a locator is present

Without a ebucore:locator the digital object has no purpose!
parent 4ef0d363
Pipeline #8775 failed with stages
in 2 minutes and 41 seconds
......@@ -22,6 +22,7 @@ import org.apache.jena.riot.RDFDataMgr
import org.apache.jena.riot.RDFFormat
import org.memobase.mapping.exceptions.InvalidMappingException
import org.memobase.mapping.mappers.IFieldMapper
import org.memobase.rdf.EBUCORE
import java.io.StringWriter
class ResourceBuilder(
......@@ -65,11 +66,14 @@ class ResourceBuilder(
digitalObjectFieldMappers.forEach {
it.apply(source, digitalObject)
}
digitalObject.addRecord(record)
record.addInstantiation(digitalObject)
resources.add(digitalObject)
}
// Records in which no external link is available no digital object is generated at all.
if (record.resource.hasProperty(EBUCORE.locator)) {
digitalObject.addRecord(record)
record.addInstantiation(digitalObject)
resources.add(digitalObject)
}
}
}
fun write(): List<Pair<String, String>> {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment