public Bindings(Hashtable<QualifiedName, List<QualifiedName>> variables, Hashtable<QualifiedName, List<List<TypedValue>>> attributes, ProvFactory pf) { this.variables=variables; this.attributes=attributes; this.pf=pf; this.name=pf.getName(); }
public RdfConstructor(GraphBuilder<RESOURCE, LITERAL, STATEMENT> gb, ProvFactory pFactory) { this.onto = new Ontology(pFactory); this.gb = gb; this.pFactory=pFactory; this.name=pFactory.getName(); }
public ProvDocumentDeserializer(ProvFactory pf) { this.pf=pf; this.name=pf.getName(); this.vconv = new ValueConverter(pf); }
/** * Factory method to create an instance of of the PROV-DM prov:value attribute (see {@link Value}). * @param value a String * @return a new {@link Value} with type xsd:string (see {@link Name#XSD_STRING}) */ public Value newValue(String value) { return newValue(value,getName().XSD_STRING); }
public void add1DValues_v2(List<Statement> ll, Hashtable<QualifiedName, List<QualifiedName>> variables) { for (Entry<QualifiedName, List<QualifiedName>> entry: variables.entrySet()) { int count=0; List<Attribute> attrs=new LinkedList<Attribute>(); for (QualifiedName qn: entry.getValue()) { attrs.add(pf.newAttribute(TMPL_NS, VALUE_v2+count, TMPL_PREFIX, qn, pf.getName().PROV_QUALIFIED_NAME)); count++; } Entity e=pf.newEntity(entry.getKey(),attrs); ll.add(e); } }
public List<Type> getType(HasOther e) { if (e instanceof HasType) return ((HasType) e).getType(); List<Type> res = new LinkedList<Type>(); res.add(newType("pFact: type TODO",getName().XSD_STRING)); return res; }
public List<Type> getType(HasOther e) { if (e instanceof HasType) return ((HasType) e).getType(); List<Type> res = new LinkedList<Type>(); res.add(newType("pFact: type TODO",getName().XSD_STRING)); return res; }
public void addVariableBindingsAsAttributeBindings() { Hashtable<QualifiedName, List<QualifiedName>> vb=getVariables(); for(Entry<QualifiedName,List<QualifiedName>> entry: vb.entrySet()) { int count=0; for (QualifiedName qn: entry.getValue()) { List<TypedValue> ll=new LinkedList<TypedValue>(); ll.add(pf.newAttribute(TMPL_NS, VALUE2+count+"_"+0, TMPL_PREFIX, qn, pf.getName().PROV_QUALIFIED_NAME)); count++; addAttribute(entry.getKey(),ll); } } }
public void addVariableBindingsAsAttributeBindings() { Hashtable<QualifiedName, List<QualifiedName>> vb=getVariables(); for(Entry<QualifiedName,List<QualifiedName>> entry: vb.entrySet()) { int count=0; for (QualifiedName qn: entry.getValue()) { List<TypedValue> ll=new LinkedList<TypedValue>(); ll.add(pf.newAttribute(TMPL_NS, VALUE2+count+"_"+0, TMPL_PREFIX, qn, pf.getName().PROV_QUALIFIED_NAME)); count++; addAttribute(entry.getKey(),ll); } } }
public void addOrderAttribute(HasOther res) { if (addOrderp) { res.getOther().add(pf.newOther(TMPL_NS, "order", TMPL_PREFIX, index, pf.getName().XSD_STRING)); } }
public List<Attribute> convertLabelAttributes(HasLabel e, List<Attribute> acc) { List<LangString> labels = e.getLabel(); for (LangString label : labels) { acc.add(pFactory.newAttribute(Attribute.AttributeKind.PROV_LABEL,label, pFactory.getName().XSD_STRING)); } return acc; }
public void addOrderAttribute(HasOther res) { if (addOrderp) { res.getOther().add(pf.newOther(TMPL_NS, "order", TMPL_PREFIX, index, pf.getName().XSD_STRING)); } }
public KeyAdapter(org.openprovenance.prov.model.ProvFactory pFactory) { this.pFactory=pFactory; domProcessor=new DOMProcessing(pFactory); qualifiedName_PROV_KEY = pFactory.getName().PROV_KEY; vconv=new ValueConverter(pFactory); }
public TreeTraversal(ModelConstructor c, ProvFactory pFactory) { this.c=c; this.pFactory=pFactory; this.name=pFactory.getName(); this.namespace=pFactory.newNamespace(); this.namespace.addKnownNamespaces(); this.vconv=new ValueConverter(pFactory); }
@Override public JsonElement serialize(final Document doc, Type typeOfSrc, JsonSerializationContext context) { JSONConstructor jsonConstructor = new JSONConstructor(pFactory.getName()); BeanTraversal bt = new BeanTraversal(jsonConstructor, pFactory); bt.doAction(doc); Object jsonStructure = jsonConstructor.getJSONStructure(); return context.serialize(jsonStructure); } }
public WasGeneratedBy newWasGeneratedBy(QualifiedName id, Entity a, String role, Activity p) { WasGeneratedBy res=newWasGeneratedBy(id, a.getId(), p.getId()); if (role!=null) addRole(res, newRole(role,getName().XSD_STRING)); return res; }
public Used newUsed(QualifiedName id, QualifiedName aid, String role, QualifiedName eid) { Used res = newUsed(id); res.setActivity(aid); if (role!=null) addRole(res, newRole(role,getName().XSD_STRING)); res.setEntity(eid); return res; }
public WasGeneratedBy newWasGeneratedBy(QualifiedName id, Entity a, String role, Activity p) { WasGeneratedBy res=newWasGeneratedBy(id, a.getId(), p.getId()); if (role!=null) addRole(res, newRole(role,getName().XSD_STRING)); return res; }
@Override public JsonElement serialize(final Document doc, Type typeOfSrc, JsonSerializationContext context) { JSONConstructor jsonConstructor = new JSONConstructor(pFactory.getName()); BeanTraversal bt = new BeanTraversal(jsonConstructor, pFactory); bt.doAction(doc); Object jsonStructure = jsonConstructor.getJSONStructure(); return context.serialize(jsonStructure); } }
public WasGeneratedBy newWasGeneratedBy(QualifiedName id, QualifiedName aid, String role, QualifiedName pid) { WasGeneratedBy res = of.createWasGeneratedBy(); res.setId(id); res.setActivity(pid); res.setEntity(aid); if (role!=null) addRole(res, newRole(role,getName().XSD_STRING)); return res; }