public Annotation newAnnotation(Annotation ann) { Annotation res=newAnnotation(ann.getId(), ann.getLocalSubject(), ann.getProperty(), ann.getAccount()); return res; }
public RdfAnnotation(ElmoManager manager, QName qname) { this.manager=manager; this.qname=qname; this.prefix=qname.getNamespaceURI(); super.setId(qname.getLocalPart()); }
/** * Create an instance of {@link Annotation } * */ public Annotation createAnnotation() { return new Annotation(); }
public void hashCode(HashCodeBuilder hashCodeBuilder) { super.hashCode(hashCodeBuilder); hashCodeBuilder.append(this.getExternalSubject()); hashCodeBuilder.append(this.getLocalSubject()); }
public Annotation newAnnotation(String id, Object o, List<Property> properties, Collection<AccountRef> accs) { Annotation res=of.createAnnotation(); res.setId(id); res.setLocalSubject(o); for (Property property: properties) { addProperty(res,property); } addAccounts(res,accs); return res; }
public List<Triple> triplifyAnnotation(Annotation annotation) { String id=(((Identifiable)annotation.getLocalSubject()).getId()); Resource subject=idTable.get(id); List<Triple> triples=new LinkedList(); if (subject!=null) { addTriplesForAnnotation(subject,annotation,triples); } else { logger.warn("$$$$$$$$$$$$$$$ " + id + ": no rdf subject!"); } return triples; }
public void addProperty(Annotation ann, Property p) { ann.getProperty().add(p); }
public void setLocalSubject(Object value) { super.setLocalSubject(value); Annotable ann=(Annotable) ((HasFacade)value).findMyFacade(); ann.getAnnotations().add(findMyFacade()); }
public boolean equals(Object object) { if (!(object instanceof Annotation)) { return false; } if (this == object) { return true; } final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder(); equals(object, equalsBuilder); return equalsBuilder.isEquals(); }
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof Annotation)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } super.equals(object, equalsBuilder); final Annotation that = ((Annotation) object); equalsBuilder.append(this.getExternalSubject(), that.getExternalSubject()); equalsBuilder.append(this.getLocalSubject(), that.getLocalSubject()); }
public Annotation newAnnotation(String id, Ref ref, String property, Object value, Collection<AccountRef> accs) { Annotation res=of.createAnnotation(); res.setId(id); res.setLocalSubject(ref.getRef()); addProperty(res,newProperty(property,value)); addAccounts(res,accs); return res; }
public void addProperty(Annotation ann, List<Property> p) { ann.getProperty().addAll(p); }
public Annotation newAnnotation(Annotation ann) { Annotation res=newAnnotation(ann.getId(), getFromRegisters(((Identifiable)ann.getLocalSubject()).getId()), newProperties(ann.getProperty()), newAccounts(ann.getAccount())); return res; }
public void toString(ToStringBuilder toStringBuilder) { super.toString(toStringBuilder); { String theExternalSubject; theExternalSubject = this.getExternalSubject(); toStringBuilder.append("externalSubject", theExternalSubject); } { Object theLocalSubject; theLocalSubject = this.getLocalSubject(); toStringBuilder.append("localSubject", theLocalSubject); } }
public void setId(String value) { super.setId(value); qname = new QName(prefix, value); manager.designate(qname, org.openprovenance.rdf.Annotation.class); }
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); } }