org.openprovenance.prov.model.QualifiedName.getUri()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(83)

本文整理了Java中org.openprovenance.prov.model.QualifiedName.getUri方法的一些代码示例,展示了QualifiedName.getUri的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QualifiedName.getUri方法的具体详情如下:
包路径:org.openprovenance.prov.model.QualifiedName
类名称:QualifiedName
方法名:getUri

QualifiedName.getUri介绍

暂无

代码示例

代码示例来源:origin: org.openprovenance.prov/prov-template

@Override
public int compare(QualifiedName arg0, QualifiedName arg1) {
  return arg0.getUri().compareTo(arg1.getUri());
}

代码示例来源:origin: lucmoreau/ProvToolbox

@Override
public int compare(QualifiedName arg0, QualifiedName arg1) {
  return arg0.getUri().compareTo(arg1.getUri());
}

代码示例来源:origin: org.openprovenance.prov/prov-dot

public String getPropertyFromAny (Attribute o) {
  return o.getElementName().getUri();
}

代码示例来源:origin: lucmoreau/ProvToolbox

public String getPropertyFromAny (Attribute o) {
  return o.getElementName().getUri();
}

代码示例来源:origin: lucmoreau/ProvToolbox

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;
}

代码示例来源:origin: org.openprovenance.prov/prov-template

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;
}

代码示例来源:origin: lucmoreau/ProvToolbox

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;
}

代码示例来源:origin: org.openprovenance.prov/prov-template

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);
}

代码示例来源:origin: lucmoreau/ProvToolbox

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);
}

代码示例来源:origin: org.openprovenance.prov/prov-template

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()));

代码示例来源:origin: lucmoreau/ProvToolbox

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();

代码示例来源:origin: lucmoreau/ProvToolbox

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);

代码示例来源:origin: org.openprovenance.prov/prov-model

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);

代码示例来源:origin: org.openprovenance.prov/prov-template

if (qualifiedNameURI.equals(attribute.getType().getUri())) {

代码示例来源:origin: lucmoreau/ProvToolbox

if (qualifiedNameURI.equals(attribute.getType().getUri())) {

代码示例来源:origin: org.openprovenance.prov/prov-model

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);
  }
}

代码示例来源:origin: lucmoreau/ProvToolbox

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);
  }
}

代码示例来源:origin: org.openprovenance.prov/prov-template

String elementName = attribute.getElementName().getUri();
if (ExpandUtil.LABEL_URI.equals(elementName)) {
  Object value=val.getValue();

代码示例来源:origin: lucmoreau/ProvToolbox

String elementName = attribute.getElementName().getUri();
if (ExpandUtil.LABEL_URI.equals(elementName)) {
  Object value=val.getValue();

代码示例来源:origin: lucmoreau/ProvToolbox

EX2_PREFIX).getUri());

相关文章