public void addValue(Artifact annotable, Object value, String encoding) { addAnnotation(annotable,newValue(value,encoding)); }
public void addAnnotation(Annotable annotable, Label ann) { if (ann!=null) { super.addAnnotation(annotable,ann); try { ((RdfLabel)ann).toRdf(annotable); } catch (org.openrdf.repository.RepositoryException e) { e.printStackTrace(); } } }
public void addAnnotation(Annotable annotable, Type ann) { if (ann!=null) { super.addAnnotation(annotable,ann); try { ((RdfType)ann).toRdf(annotable); } catch (org.openrdf.repository.RepositoryException e) { e.printStackTrace(); } } }
public void addAnnotation(Annotable annotable, Value ann) { if (ann!=null) { super.addAnnotation(annotable,ann); HasFacade facade=(HasFacade) annotable; Object o=facade.findMyFacade(); org.openprovenance.rdf.Annotable annotable2=(org.openprovenance.rdf.Annotable) o; org.openprovenance.rdf.AValue ann2=(org.openprovenance.rdf.AValue) ((HasFacade)ann).findMyFacade(); ((org.openprovenance.rdf.Artifact) annotable2).getAvalues().add(ann2); } }
public WasGeneratedBy newWasGeneratedBy(String id, Artifact a, Role role, Process p, String type, Collection<Account> accounts) { WasGeneratedBy wgb=newWasGeneratedBy(id,a,role,p,accounts); addAnnotation(wgb,of.createType(newType(type))); return wgb; }
public Used newUsed(String id, Process p, Role role, Artifact a, String type, Collection<Account> accounts) { Used res=newUsed(id,p,role,a,accounts); addAnnotation(res,of.createType(newType(type))); return res; }
public WasControlledBy newWasControlledBy(String id, Process p, Role role, Agent ag, String type, Collection<Account> accounts) { WasControlledBy wcb=newWasControlledBy(id,p,role,ag,accounts); addAnnotation(wcb,of.createType(newType(type))); return wcb; }
public WasDerivedFrom newWasDerivedFrom(String id, Artifact a1, Artifact a2, String type, Collection<Account> accounts) { WasDerivedFrom wdf=newWasDerivedFrom(id,a1,a2,accounts); addAnnotation(wdf,of.createType(newType(type))); return wdf; }
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)); } }
public Process newProcess(String pr, Collection<Account> accounts, String label) { Process res=of.createProcess(); res.setId(pr); addAccounts(res,accounts,null); if (label!=null) addAnnotation(res,newLabel(label)); return res; }
public Agent newAgent(String ag, Collection<Account> accounts, String label) { Agent res=of.createAgent(); res.setId(ag); addAccounts(res,accounts,null); if (label!=null) addAnnotation(res,newLabel(label)); return res; }
public Artifact newArtifact(String id, Collection<Account> accounts, String label) { Artifact res=of.createArtifact(); res.setId(id); addAccounts(res,accounts,null); if (label!=null) addAnnotation(res,newLabel(label)); return res; }
public WasTriggeredBy newWasTriggeredBy(String id, Process p1, Process p2, String type, Collection<Account> accounts) { WasTriggeredBy wtb=newWasTriggeredBy(p1,p2,accounts); wtb.setId(id); addAnnotation(wtb,of.createType(newType(type))); return wtb; }
super.addAnnotation(res,newLabel(label)); super.addAnnotation(res,newPName(pname.toString())); super.addAnnotation(res,newProfile(profile)); super.addAnnotation(res,newType(type.toString())); Document doc=builder.newDocument(); Element el=(Element)doc.importNode(lit.getDocument().getDocumentElement(),true); super.addAnnotation(res,newValue(el, av.getEncoding().toString())); } else { super.addAnnotation(res,newValue(av.getContent(), av.getEncoding().toString()));
/** Add annotation to an annotable JAXB Bean and its corresponding RDF facade. */ public void addAnnotation(org.openprovenance.model.Annotable annotable, org.openprovenance.model.EmbeddedAnnotation ann) { if (ann instanceof Label) { addAnnotation(annotable,(Label) ann); } else if (ann instanceof Type) { addAnnotation(annotable,(Type) ann); } else if (ann instanceof Value) { addAnnotation(annotable,(Value) ann); } else { super.addAnnotation(annotable,ann); HasFacade facade=(HasFacade) annotable; Object o=facade.findMyFacade(); org.openprovenance.rdf.Annotable annotable2=(org.openprovenance.rdf.Annotable) o; org.openprovenance.rdf.Annotation ann2=(org.openprovenance.rdf.Annotation) ((HasFacade)ann).findMyFacade(); annotable2.getAnnotations().add(ann2); } }
super.addAnnotation(res,ann2);