public String getPropertyFromAny (Attribute o) { return o.getElementName().getUri(); }
public String getPropertyFromAny (Attribute o) { return o.getElementName().getUri(); }
public QualifiedName uniquify(QualifiedName q) { if (q==null) return null; String uri=q.getUri(); org.openprovenance.prov.model.QualifiedName found=table.get(uri); if (found!=null) { return found; } //Query qq=em.createQuery("SELECT e FROM QualifiedName e WHERE e.uri LIKE :uri"); Query qq=em.createNamedQuery("QualifiedName.Find"); qq.setParameter("uri", uri); @SuppressWarnings("unchecked") List<QualifiedName> ll=(List<QualifiedName>) qq.getResultList(); //System.out.println("found ll " + ll); QualifiedName newId=q; if ((ll!=null) && (!(ll.isEmpty()))) { newId=ll.get(0); //System.out.println("Uniquify found " + newId); } table.put(uri, newId); return newId; }
public ExpandAction(ProvFactory pf, ProvUtilities u, Expand expand, Hashtable<QualifiedName, QualifiedName> env, Hashtable<QualifiedName, List<TypedValue>> env2, List<Integer> index, Bindings bindings1, Groupings grp1, boolean addOrderp, boolean allUpdatedRequired) { this.pf = pf; this.expand = expand; this.env = env; this.u = u; this.index = index; this.bindings = bindings1; this.grp1 = grp1; this.env2 = env2; this.addOrderp = addOrderp; this.qualifiedNameURI = pf.getName().PROV_QUALIFIED_NAME.getUri(); this.allUpdatedRequired=allUpdatedRequired; }
public ExpandAction(ProvFactory pf, ProvUtilities u, Expand expand, Hashtable<QualifiedName, QualifiedName> env, Hashtable<QualifiedName, List<TypedValue>> env2, List<Integer> index, Bindings bindings1, Groupings grp1, boolean addOrderp, boolean allUpdatedRequired) { this.pf = pf; this.expand = expand; this.env = env; this.u = u; this.index = index; this.bindings = bindings1; this.grp1 = grp1; this.env2 = env2; this.addOrderp = addOrderp; this.qualifiedNameURI = pf.getName().PROV_QUALIFIED_NAME.getUri(); this.allUpdatedRequired=allUpdatedRequired; }
public static Object convertValueToBean(Object o, QualifiedName type, Hashtable<String, String> context) { if (o instanceof Integer) return o; if (o instanceof Float) return o; if (o instanceof QualifiedName) { QualifiedName qn=(QualifiedName)o; Hashtable<String,String> table=new Hashtable<String,String>(); table.put("@id",qn.getPrefix() + ":" + qn.getLocalPart()); context.put(qn.getPrefix(),qn.getNamespaceURI()); return table; } if (o instanceof LangString) { LangString qn=(LangString)o; Hashtable<String,String> table=new Hashtable<String,String>(); table.put("@language",qn.getLang()); table.put("@value",qn.getValue()); return table; } if (o instanceof String) { if ((type==null) || (type.getUri().equals(NamespacePrefixMapper.XSD_NS+"string"))) { return o; } else { Hashtable<String,String> table=new Hashtable<String,String>(); table.put("@type",type.toString()); table.put("@value",o.toString()); return table; } } throw new UnsupportedOperationException("type is " + o); }
public static Object convertValueToBean(Object o, QualifiedName type, Hashtable<String, String> context) { if (o instanceof Integer) return o; if (o instanceof Float) return o; if (o instanceof QualifiedName) { QualifiedName qn=(QualifiedName)o; Hashtable<String,String> table=new Hashtable<String,String>(); table.put("@id",qn.getPrefix() + ":" + qn.getLocalPart()); context.put(qn.getPrefix(),qn.getNamespaceURI()); return table; } if (o instanceof LangString) { LangString qn=(LangString)o; Hashtable<String,String> table=new Hashtable<String,String>(); table.put("@language",qn.getLang()); table.put("@value",qn.getValue()); return table; } if (o instanceof String) { if ((type==null) || (type.getUri().equals(NamespacePrefixMapper.XSD_NS+"string"))) { return o; } else { Hashtable<String,String> table=new Hashtable<String,String>(); table.put("@type",type.toString()); table.put("@value",o.toString()); return table; } } throw new UnsupportedOperationException("type is " + o); }
Hashtable<Integer, Hashtable<Integer,TypedValue>> map2=new Hashtable<Integer, Hashtable<Integer,TypedValue>>(); for (Other attr: entity.getOther()) { String uri = attr.getElementName().getUri(); if (uri.startsWith(APP_VALUE)) { Integer i=Integer.valueOf(uri.substring(APP_VALUE.length()));
HasOther stmt2=(HasOther)statement; for (Other other: stmt2.getOther()) { if (LINKED_URI.equals(other.getElementName().getUri())) { QualifiedName id=((Identifiable)statement).getId(); QualifiedName otherId=(QualifiedName) other.getValue();
if (type == null) type = name.XSD_STRING; if (FOR_XML_XSD_QNAME.equals(type.getUri())) { QualifiedName qn = stringToQualifiedName(child, el); Attribute x= pFactory.newAttribute(namespace, local, prefix, qn, name.PROV_QUALIFIED_NAME);
if (type == null) type = name.XSD_STRING; if (FOR_XML_XSD_QNAME.equals(type.getUri())) { QualifiedName qn = stringToQualifiedName(child, el); Attribute x= pFactory.newAttribute(namespace, local, prefix, qn, name.PROV_QUALIFIED_NAME);
if (qualifiedNameURI.equals(attribute.getType().getUri())) {
if (qualifiedNameURI.equals(attribute.getType().getUri())) {
public static String valueToNotationString(Object val, org.openprovenance.prov.model.QualifiedName xsdType) { if (val instanceof LangString) { LangString istring = (LangString) val; return "\"" + istring.getValue() + ((istring.getLang()==null) ? "\"" : "\"@" + istring.getLang()) + (((xsdType==null)||(xsdType.getUri().equals(internationalizedStringUri)))? "" : " %% " + Namespace.qualifiedNameToStringWithNamespace(xsdType)); } else if (val instanceof QualifiedName) { QualifiedName qn = (QualifiedName) val; return "'" + Namespace.qualifiedNameToStringWithNamespace(qn) + "'"; } else if (val instanceof String) { String s=(String)val; if (s.contains("\n")) { return "\"\"\"" + escape(s) + "\"\"\"" ; } else { //FIXME: It's here that we should detect an int and generate the compact form: e.g. 1 instand of 1 %% xsd:int // However dictionaries failed to be parsed then //if (xsdType.getLocalPart().equals("int")) { //FIXME:need to properly compare with xsd:int // return s; //} else { return "\"" + escape(s) + ((xsdType==null)? "\"" : "\" %% " + Namespace.qualifiedNameToStringWithNamespace(xsdType)); //} } } else { // We should never be here! return "\"" + val + "\" %% " + Namespace.qualifiedNameToStringWithNamespace(xsdType); } }
public static String valueToNotationString(Object val, org.openprovenance.prov.model.QualifiedName xsdType) { if (val instanceof LangString) { LangString istring = (LangString) val; return "\"" + istring.getValue() + ((istring.getLang()==null) ? "\"" : "\"@" + istring.getLang()) + (((xsdType==null)||(xsdType.getUri().equals(internationalizedStringUri)))? "" : " %% " + Namespace.qualifiedNameToStringWithNamespace(xsdType)); } else if (val instanceof QualifiedName) { QualifiedName qn = (QualifiedName) val; return "'" + Namespace.qualifiedNameToStringWithNamespace(qn) + "'"; } else if (val instanceof String) { String s=(String)val; if (s.contains("\n")) { return "\"\"\"" + escape(s) + "\"\"\"" ; } else { //FIXME: It's here that we should detect an int and generate the compact form: e.g. 1 instand of 1 %% xsd:int // However dictionaries failed to be parsed then //if (xsdType.getLocalPart().equals("int")) { //FIXME:need to properly compare with xsd:int // return s; //} else { return "\"" + escape(s) + ((xsdType==null)? "\"" : "\" %% " + Namespace.qualifiedNameToStringWithNamespace(xsdType)); //} } } else { // We should never be here! return "\"" + val + "\" %% " + Namespace.qualifiedNameToStringWithNamespace(xsdType); } }
String elementName = attribute.getElementName().getUri(); if (ExpandUtil.LABEL_URI.equals(elementName)) { Object value=val.getValue();
String elementName = attribute.getElementName().getUri(); if (ExpandUtil.LABEL_URI.equals(elementName)) { Object value=val.getValue();
EX2_PREFIX).getUri());