public void addProperty(EmbeddedAnnotation ann, Property p) { ann.getProperty().add(p); }
public void addProperty(EmbeddedAnnotation ann, List<Property> p) { ann.getProperty().addAll(p); }
public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getProperty()); hashCodeBuilder.append(this.getAccount()); hashCodeBuilder.append(this.getAnnotation()); hashCodeBuilder.append(this.getId()); }
public void toString(ToStringBuilder toStringBuilder) { { List<Property> theProperty; theProperty = this.getProperty(); toStringBuilder.append("property", theProperty); } { List<AccountRef> theAccount; theAccount = this.getAccount(); toStringBuilder.append("account", theAccount); } { List<JAXBElement<? extends EmbeddedAnnotation>> theAnnotation; theAnnotation = this.getAnnotation(); toStringBuilder.append("annotation", theAnnotation); } { String theId; theId = this.getId(); toStringBuilder.append("id", theId); } }
public String getLabel(EmbeddedAnnotation annotation) { if (annotation instanceof Label) { Label label=(Label) annotation; return label.getValue(); } else { for (Property prop: annotation.getProperty()) { if (prop.getKey().equals(LABEL_PROPERTY)) { return (String) prop.getValue(); } } return null; } }
public Object getValue(EmbeddedAnnotation annotation) { if (annotation instanceof Value) { Value value=(Value) annotation; return value.getContent(); } else { for (Property prop: annotation.getProperty()) { if (prop.getKey().equals(VALUE_PROPERTY)) { return prop.getValue(); } } return null; } }
public String getEncoding(EmbeddedAnnotation annotation) { if (annotation instanceof Value) { Value value=(Value) annotation; return value.getEncoding(); } else { for (Property prop: annotation.getProperty()) { if (prop.getKey().equals(ENCODING_PROPERTY)) { return (String) prop.getValue(); } } return null; } }
public void expandAnnotation(EmbeddedAnnotation ann) { if (ann instanceof Label) { Label label=(Label) ann; String labelValue=label.getValue(); ann.getProperty().add(newProperty(LABEL_PROPERTY,labelValue)); } if (ann instanceof Type) { Type type=(Type) ann; String typeValue=type.getValue(); ann.getProperty().add(newProperty(TYPE_PROPERTY,typeValue)); } if (ann instanceof Value) { Value val=(Value) ann; Object valValue=val.getContent(); ann.getProperty().add(newProperty(VALUE_PROPERTY,valValue)); } if (ann instanceof PName) { PName pname=(PName) ann; String pnameValue=pname.getValue(); ann.getProperty().add(newProperty(PNAME_PROPERTY,pnameValue)); } }
public String getPname(EmbeddedAnnotation annotation) { if (annotation instanceof PName) { PName pname=(PName) annotation; return pname.getValue(); } else { for (Property prop: annotation.getProperty()) { if (prop.getKey().equals(PNAME_PROPERTY)) { return (String) prop.getValue(); } } return null; } }
public String getType(EmbeddedAnnotation annotation) { if (annotation instanceof Type) { Type type=(Type) annotation; return type.getValue(); } else { for (Property prop: annotation.getProperty()) { if (prop.getKey().equals(TYPE_PROPERTY)) { return (String) prop.getValue(); } } return null; } }
public String getProfile(EmbeddedAnnotation annotation) { if (annotation instanceof Profile) { Profile profile=(Profile) annotation; return profile.getValue(); } else { for (Property prop: annotation.getProperty()) { if (prop.getKey().equals(PROFILE_PROPERTY)) { return (String) prop.getValue(); } } return null; } }
public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof EmbeddedAnnotation)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final EmbeddedAnnotation that = ((EmbeddedAnnotation) object); equalsBuilder.append(this.getProperty(), that.getProperty()); equalsBuilder.append(this.getAccount(), that.getAccount()); equalsBuilder.append(this.getAnnotation(), that.getAnnotation()); equalsBuilder.append(this.getId(), that.getId()); }
public HashMap<String,String> addAnnotationLabel(EmbeddedAnnotation ann, HashMap<String,String> properties) { String label=""; label=label+"<<TABLE cellpadding=\"0\" border=\"0\">\n"; for (Property prop: ann.getProperty()) { label=label+" <TR>\n"; label=label+" <TD align=\"left\">" + convertProperty(prop.getKey()) + ":</TD>\n"; label=label+" <TD align=\"left\">" + convertValue(prop.getValue()) + "</TD>\n"; label=label+" </TR>\n"; } label=label+" </TABLE>>\n"; properties.put("label",label); return properties; }
public void sortAnnotations(List<JAXBElement<? extends EmbeddedAnnotation>> ll) { Collections.sort(ll, new Comparator() { public int compare(Object o1, Object o2) { JAXBElement j1=(JAXBElement) o1; JAXBElement j2=(JAXBElement) o2; EmbeddedAnnotation a1=(EmbeddedAnnotation) j1.getValue(); EmbeddedAnnotation a2=(EmbeddedAnnotation) j2.getValue(); if (a1.getId()==null) { if (a2.getId()==null) { return a1.getClass().getName().compareTo(a2.getClass().getName()); } else { return -1; } } else { if (a2.getId()==null) { return +1; } else { return a1.getId().compareTo(a2.getId()); } } }}); for (JAXBElement je: ll) { EmbeddedAnnotation a=(EmbeddedAnnotation) je.getValue(); sortProperties(a.getProperty()); sortByRef(a.getAccount()); } }
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 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); } } }
for (Property prop: ann.getProperty()) { Resource predicate=Resource.uriRef(prop.getUri()); Resource value=makeLiteral(prop.getValue());
return of.createPname(pname); List<Property> properties=ann.getProperty(); if (properties.size()==1) { Property prop=properties.get(0);
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(); String label=getLabel(ea); if (label!=null) addAnnotation(res,newLabel(label)); String type=getType(ea); if (type!=null) addAnnotation(res,newType(type)); String profile=getProfile(ea); if (profile!=null) addAnnotation(res,newProfile(profile)); String pname=getPname(ea); if (pname!=null) addAnnotation(res,newPName(pname)); Object value=getValue(ea); if (value!=null) addAnnotation(res,newValue(value,getEncoding(ea))); if (ea.getId()!=null) addAnnotation(res,newEmbeddedAnnotation(ea.getId(), ea.getProperty(), newAccounts(ea.getAccount()), null)); } }