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

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

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

Model.withDefaultMappings介绍

暂无

代码示例

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

/**
 * {@inheritDoc}
 */
@Override
public PrefixMapping withDefaultMappings(PrefixMapping map) {
  return super.object.withDefaultMappings(map);
}

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

public PrefixMapping withDefaultMappings(PrefixMapping map) {
  return model.withDefaultMappings(map);
}

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

public CompleteContext include(Model m) {
  model.add(m);
  model.withDefaultMappings( m );
  return this;
}

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

private Resource createMetadata(UriInfo ui, String pathStub, String formatName, SpecRecord rec) {
    Bindings cc = Bindings.createContext( Bindings.uplift( rec.getBindings() ), JerseyUtils.convert( ui.getQueryParameters() ) );
    Model metadata = ModelFactory.createDefaultModel();
    Resource meta = rec.getAPIEndpoint().getMetadata( cc, ui.getRequestUri(), formatName, metadata);
  //
    for (APIEndpointSpec s: rec.getAPIEndpoint().getSpec().getAPISpec().getEndpoints()) {
      String ut = s.getURITemplate().replaceFirst( "^/", "" );
      if (!ut.equals(pathStub)) {
        String sib = ui
          .getRequestUri()
          .toString()
          .replace( pathStub, ut )
          .replace( "%7B", "{" )
          .replace( "%7D", "}" )
          ;
        meta.addProperty( SIBLING, metadata.createResource( sib ) );
      }
    }
  // Extract the endpoint specification
    Model spec = rec.getSpecModel();
    Resource endpointSpec = rec.getAPIEndpoint().getSpec().getResource().inModel(spec);
    metadata.setNsPrefixes( spec );
    metadata.add( ResourceUtils.reachableClosure( endpointSpec ) );
    meta.getModel().withDefaultMappings( PrefixMapping.Extended );
    meta.addProperty( API.endpoint, endpointSpec );
    return meta;
  }
}

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

@Test public void testX() {
  m.withDefaultMappings(pm);
  Resource a = m.createResource( RDF.getURI() + "intruder" );
  Resource b = m.createResource( RDFS.getURI() + "stranger" );
  List<Resource> both = Arrays.asList( a, b );
  State s = new State(both, m, null, null, null);
  String q = View.createDescribeQueryForItems( s, both );
  if (!q.equals( expectA ) && !q.equals( expectB )) 
    fail( "wrong describe query created:\n" + q ); 
}

相关文章

Model类方法