org.openrdf.repository.Repository.getValueFactory()方法的使用及代码示例

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

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

Repository.getValueFactory介绍

暂无

代码示例

代码示例来源:origin: org.openrdf.sesame/sesame-runtime

/**
 * Create an instance capable of federating "user repositories" within the
 * given {@link org.openrdf.repository.manager.RepositoryManager}.
 * 
 * @param manager
 *        must manage the repositories to be added to new federations, and
 *        becomes the manager of any created federations
 */
public RepositoryManagerFederator(RepositoryManager manager) {
  this.manager = manager;
  this.valueFactory = manager.getSystemRepository().getValueFactory();
}

代码示例来源:origin: org.apache.marmotta/ldpath-backend-sesame

/**
 * Create a literal node with the content passed as argument
 *
 * @param content string content to represent inside the literal
 * @return a literal node in using the model used by this backend
 */
@Override
public Literal createLiteral(String content) {
  return createLiteralInternal(repository.getValueFactory(), content);
}

代码示例来源:origin: org.apache.marmotta/ldpath-backend-sesame

/**
 * Create a literal node with the content passed as argument
 *
 * @param content string content to represent inside the literal
 * @return a literal node in using the model used by this backend
 */
@Override
public Literal createLiteral(String content, Locale language, URI type) {
  return createLiteralInternal(repository.getValueFactory(), content, language, type);
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-impl

@Override
public Literal createLiteral(final String languageLiteralString, final String language)
{
  return this.repository.getValueFactory().createLiteral(languageLiteralString, language);
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-impl

@Override
public URI createURI(final String uri)
{
  return this.repository.getValueFactory().createURI(uri);
}

代码示例来源:origin: org.apache.polygene.extensions/org.apache.polygene.extension.indexing-rdf

private ValueFactory getValueFactory()
{
  if( valueFactory == null )
  {
    valueFactory = repository.get().getValueFactory();
  }
  return valueFactory;
}

代码示例来源:origin: org.openrdf.sesame/sesame-http-server-spring

private IRI createURIOrNull(Repository repository, String graphURI) {
  if ("null".equals(graphURI))
    return null;
  return repository.getValueFactory().createIRI(graphURI);
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-impl

@Override
public Literal createLiteral(final String typedLiteralString, final URI datatypeUri)
{
  return this.repository.getValueFactory().createLiteral(typedLiteralString, datatypeUri);
}

代码示例来源:origin: org.qi4j.extension/org.qi4j.extension.indexing-rdf

private ValueFactory getValueFactory()
{
  if( valueFactory == null )
  {
    valueFactory = repository.get().getValueFactory();
  }
  return valueFactory;
}

代码示例来源:origin: com.github.ansell.restlet-utils/restlet-utils

public void setRepository(final Repository repository)
{
  this.repository = repository;
  if(this.repository != null)
  {
    this.vf = this.repository.getValueFactory();
  }
  else
  {
    this.vf = ValueFactoryImpl.getInstance();
  }
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-impl

@Override
public BNode createBlankNode()
{
  return this.repository.getValueFactory().createBNode();
}

代码示例来源:origin: com.github.ansell.oas/oas-webservice-impl

@Override
public Literal createLiteral(final String plainLiteralString)
{
  return this.repository.getValueFactory().createLiteral(plainLiteralString);
}

代码示例来源:origin: org.semweb4j/rdf2go.impl.sesame

@Override
public boolean containsModel(URI contextURI) {
  try {
    return this.connection.hasStatement(null, null, null, false,
        ConversionUtil.toOpenRDF(contextURI, this.repository.getValueFactory()));
  } catch(RepositoryException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: org.semweb4j/rdf2go.impl.sesame20

private void init() {
  valueFactory = repository.getValueFactory();
  if (context == null) {
    context = new URIImpl(DEFAULT_CONTEXT, false);
    openRdfContext = DEFAULT_OPENRDF_CONTEXT;
  }
  else {
    openRdfContext = valueFactory.createURI(context.toString());
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

private static void create_sample_triples(Repository rep, ArrayList<URI> contributors, ArrayList<URI> docs,
    ArrayList<Literal> journals) {
  ValueFactory f = rep.getValueFactory();
  for (int i = 1; i <= NUM_OF_TRIPLES; i++) {
    contributors.add(f.createURI(RelConstants.NS_PERSON + Integer.toString(i)));
    docs.add(f.createURI(RelConstants.NS_DOCUMENT + Integer.toString(i)));
    if (i % 2 == 1)
      journals.add(f.createLiteral("journal1"));
    else
      journals.add(f.createLiteral("journal2"));
  }
}

代码示例来源:origin: org.openrdf.elmo/elmo-sesame

private URI getMemberPredicate(int index) {
  RepositoryConnection conn = manager.getConnection();
  Repository repository;
  repository = conn.getRepository();
  String uri = RDF.NAMESPACE + '_' + (index + 1);
  return repository.getValueFactory().createURI(uri);
}

代码示例来源:origin: org.openrdf.alibaba/alibaba-repository-object

private URI getMemberPredicate(int index) {
  ObjectConnection conn = getObjectConnection();
  Repository repository;
  repository = conn.getRepository();
  String uri = RDF.NAMESPACE + '_' + (index + 1);
  return repository.getValueFactory().createURI(uri);
}

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

private void initializeTripleStore() throws RepositoryException {
  /** Initialize an in-memory sesame triple store **/
  myRepository = new SailRepository(new MemoryStore());
  myRepository.initialize();
  con = myRepository.getConnection();
  f = myRepository.getValueFactory();
}

代码示例来源:origin: edu.stanford.protege/rdf-library

public OwlTripleStoreImpl(Repository repository, OWLDataFactory factory) {
  this.repository = repository;
  ValueFactory rdfFactory = repository.getValueFactory();
  hashCodeProperty        = rdfFactory.createURI(HASH_CODE);
  sourceOntologyProperty  = rdfFactory.createURI(SOURCE_ONTOLOGY);
  ontologyIdProperty      = rdfFactory.createURI(ONTOLOGY_ID);
  ontologyVersionProperty = rdfFactory.createURI(ONTOLOGY_VERSION);
  anonymousHandler = new AnonymousResourceHandler(factory);
}

代码示例来源:origin: fr.lirmm.graphik/graal-store-openrdf

public SailStore() throws AtomSetException {
  Repository repo = new SailRepository(new MemoryStore());
  try {
    repo.initialize();
    this.connection = repo.getConnection();
  } catch (RepositoryException e) {
    throw new AtomSetException("Error while creating SailStore", e);
  }
  this.valueFactory = repo.getValueFactory();
}

相关文章