adding CA creators as RO authors previously, the importer just treated a single (first) CA creator as the RO creator. this patch imports all CA creators as RO authors and if there is only one creator it is also added as an RO creator.
fixes https://issues.apache.org/jira/browse/TAVERNA-845 Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/commit/3cf8cf7d Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/tree/3cf8cf7d Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/diff/3cf8cf7d Branch: refs/heads/master Commit: 3cf8cf7d4c7e8bcca05eab280207870361bb3be2 Parents: 075ef0b Author: Martin Scharm <[email protected]> Authored: Mon Jul 13 15:27:25 2015 +0100 Committer: Martin Scharm <[email protected]> Committed: Mon Jul 13 15:27:25 2015 +0100 ---------------------------------------------------------------------- .../manifest/combine/CombineManifest.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-taverna-language/blob/3cf8cf7d/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java ---------------------------------------------------------------------- diff --git a/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java b/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java index ddad7af..16188b4 100644 --- a/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java +++ b/taverna-robundle/src/main/java/org/apache/taverna/robundle/manifest/combine/CombineManifest.java @@ -377,14 +377,18 @@ public class CombineManifest { } } + // add the COMBINE "creators" as RO "authors" + List<Agent> authors = pathMetadata.getAuthoredBy (); + for (RDFNode s : creatingAgentsFor(resource)) { - if (pathMetadata.getCreatedBy() != null) { - logger.warning("Ignoring additional createdBy agents for " - + resource); - break; + if (authors == null) + { + authors = new ArrayList<Agent> (); + pathMetadata.setAuthoredBy (authors); } + if (s.isLiteral()) { - pathMetadata.setCreatedBy(new Agent(s.asLiteral() + authors.add (new Agent(s.asLiteral() .getLexicalForm())); continue; } @@ -402,8 +406,12 @@ public class CombineManifest { agent.setUri(URI.create(mbox.getURI())); } agent.setName(nameForAgent(agentResource)); - pathMetadata.setCreatedBy(agent); + authors.add (agent); } + // if there is a single COMBINE "creator" it is also the RO "creator" + if (authors != null && authors.size () == 1) + pathMetadata.setCreatedBy (authors.get (0)); + if (pathMetadata.getFile().equals(bundle.getRoot()) || pathMetadata.getFile().equals(metadataRdf)) { // Statements where about the RO itself
