com.hp.hpl.jena.rdf.model.Model.shortForm()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(136)

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

Model.shortForm介绍

暂无

代码示例

代码示例来源:origin: fr.inria.eventcloud/eventcloud-api

/**
 * {@inheritDoc}
 */
@Override
public String shortForm(String uri) {
  return super.object.shortForm(uri);
}

代码示例来源:origin: bio2rdf/bio2rdf-scripts

public String shortForm(String uri) {
  return model.shortForm(uri);
}

代码示例来源:origin: stackoverflow.com

final Model m = // TODO
final String shortForm = m.shortForm(winery.asResource().getURI());

代码示例来源:origin: com.hp.hpl.jena/arq

public static String fmtURI(Resource r)
{ return r.getModel().shortForm(r.getURI()) ;  }

代码示例来源:origin: org.apache.clerezza.ext/org.apache.jena.jena-arq

public static String fmtURI(Resource r)
{ return r.getModel().shortForm(r.getURI()) ;  }

代码示例来源:origin: usc-isi-i2/Web-Karma

if (stmt.getPredicate().getURI().equals(Uris.RR_CLASS_URI)) {
  if (stmt.getObject().isURIResource()) {
    String shortForm = model.shortForm(stmt.getObject().toString());
    String fullURI = stmt.getObject().toString();
    if (!shortForm.equals(fullURI)) {
      Statement s = node.asResource().getProperty(dataTypeProp);
      if (s != null) {
        dataType = model.shortForm(s.getObject().toString());
    String shortForm = model.shortForm(stmt.getObject().toString());
    String fullURI = stmt.getObject().toString();
    if (!shortForm.equals(fullURI)) {

代码示例来源:origin: epimorphics/elda

/**
 * Determine an appropriate name for a property resource, creating a new
 * context entry if required. 
 */
private String findNameForProperty(Resource r) {
  String uri = r.getURI();
  String name = getNameForURI( uri );
  
  if (name == null) {         
    // Try just using localname
    String localname = r.getLocalName(); 
    if ( nameUpdateOK(localname, uri) ) return localname; 
    // See if we can generate a prefix form
    name = r.getModel().shortForm(uri);
    if (! name.equals(uri)) {
      name = name.replace(':', '_');
      if ( nameUpdateOK(name, uri) ) return name;
    }
    
    // Start making ones up as a last resort
    while (true) {
      name = localname + nameCount++;
      if ( nameUpdateOK(name, uri) ) return name;
    }
  } else {
    return name;
  }
}

代码示例来源:origin: epimorphics/elda

Resource root = se.getRoot();
PrefixMapping pm = se.getSpec().getPrefixMap();
String shortName = root.getModel().shortForm( root.getURI() );
String label = getLabelled( root, shortName );

代码示例来源:origin: epimorphics/elda

@Test public void testTermbindsIncludesMetaproperties() throws URISyntaxException {
  Integer totalResults = null;
  Resource thisMetaPage = createMetadata(false, totalResults);
  
  for (Property p: expectedTermboundProperties) {
    Model model = thisMetaPage.getModel();
    if (!model.contains(null, API.property, p)) {
      fail("term bindings should include " + model.shortForm(p.getURI()));
    }
  }
}

相关文章

Model类方法