public EmbeddedAnnotation newEmbeddedAnnotation(String id, String property, Object value, Collection<Account> accs) { LinkedList<AccountRef> ll=new LinkedList(); if (accs!=null) { for (Account acc: accs) { ll.add(newAccountRef(acc)); } } return newEmbeddedAnnotation(id,property,value,ll,null); }
public void addNewAnnotations(Annotable res, List<JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation>> anns) { for (JAXBElement<? extends org.openprovenance.model.EmbeddedAnnotation> ann: anns) { EmbeddedAnnotation ea=ann.getValue(); if (ea.getId()!=null) addAnnotation(res,newEmbeddedAnnotation(ea.getId(), ea.getProperty(), ea.getAccount(), null)); } }
EmbeddedAnnotation e=pFactory.newEmbeddedAnnotation(id, properties, accRefs, null); pFactory.addAnnotations(e,subAnnotations); embedded.add(e);
public void emitAnnotations(Annotable node, PrintStream out) { if (collapseAnnotations) { EmbeddedAnnotation newAnn=null; for (JAXBElement<? extends EmbeddedAnnotation> ann: node.getAnnotation()) { EmbeddedAnnotation emb=ann.getValue(); of.expandAnnotation(emb); if (filterAnnotation(emb)) { List<Property> properties=emb.getProperty(); if (newAnn==null) { newAnn=of.newEmbeddedAnnotation("eid"+(embeddedAnnotationCounter++), new LinkedList<Property>(), null, null); } newAnn.getProperty().addAll(properties); } } if (newAnn!=null) { emitAnnotation(node.getId(),newAnn,out); } } else { for (JAXBElement<? extends EmbeddedAnnotation> ann: node.getAnnotation()) { EmbeddedAnnotation emb=ann.getValue(); of.expandAnnotation(emb); if (filterAnnotation(emb)) emitAnnotation(node.getId(), emb,out); } } }
public void embedExternalAnnotations(OPMGraph graph) { IndexedOPMGraph igraph=new IndexedOPMGraph(oFactory,graph); // embed external annotations if (graph.getAnnotations()!=null) { List<Annotation> anns=graph.getAnnotations().getAnnotation(); for (Annotation ann: anns) { String id=(((Identifiable)ann.getLocalSubject()).getId()); EmbeddedAnnotation embedded=oFactory.newEmbeddedAnnotation(ann.getId(), ann.getProperty(), ann.getAccount(), null); Process p=igraph.getProcess(id); if (p!=null) { p.getAnnotation().add(oFactory.compactAnnotation(embedded)); } else { Artifact a=igraph.getArtifact(id); if (a!=null) { a.getAnnotation().add(oFactory.compactAnnotation(embedded)); } else { Agent ag=igraph.getAgent(id); if (ag!=null) { ag.getAnnotation().add(oFactory.compactAnnotation(embedded)); } } } } graph.setAnnotations(null); } }