Package org.openrdf.model

Examples of org.openrdf.model.Resource


    if (title != null) {
      model.add(repositoryNode, REPOSITORYTITLE, vf.createLiteral(title));
      model.add(repositoryNode, RDFS.LABEL, vf.createLiteral(title));
    }
    if (implConfig != null) {
      Resource implNode = implConfig.export(model);
      model.add(repositoryNode, REPOSITORYIMPL, implNode);
    }
  }
View Full Code Here


      titleLit = model.filter(repositoryNode, REPOSITORYTITLE, null).objectLiteral();
      if (titleLit != null) {
        setTitle(titleLit.getLabel());
      }

      Resource implNode = model.filter(repositoryNode, REPOSITORYIMPL, null).objectResource();
      if (implNode != null) {
        setRepositoryImplConfig(RepositoryImplConfigBase.create(model, implNode));
      }
    }
    catch (ModelException e) {
View Full Code Here

    }
    else if (repositoryNodes.size() > 1) {
      throw new StoreConfigException("Found multiple resources of type " + REPOSITORY);
    }
    else {
      Resource repositoryNode = repositoryNodes.iterator().next();
      return create(model, repositoryNode);
    }
  }
View Full Code Here

  @Override
  public void handleStatement(Statement st)
    throws RDFHandlerException
  {
    Resource subj = st.getSubject();
    URI pred = st.getPredicate();
    Value obj = st.getObject();
    Resource ctxt = st.getContext();

    if (!preserveBNodeIDs) {
      if (subj instanceof BNode) {
        subj = mapBNode((BNode)subj);
      }
View Full Code Here

    this.syncDelay = syncDelay;
  }

  @Override
  public Resource export(Model model) {
    Resource implNode = super.export(model);

    ValueFactoryImpl vf = ValueFactoryImpl.getInstance();

    if (persist) {
      model.add(implNode, PERSIST, vf.createLiteral(persist));
View Full Code Here

          try {
            while (continueRunning) {
              Cursor<? extends Resource> contextIter = connection.getContextIDs();
              try {
                int contextCount = 0;
                Resource context;
                while ((context = contextIter.next()) != null) {
                  assertNotNull(context);
                  contextCount++;
                }
                // System.out.println("Found " + contextCount + "
View Full Code Here

  {
    if (!writingStarted) {
      throw new RuntimeException("Document writing has not yet been started");
    }

    Resource subj = st.getSubject();
    URI pred = st.getPredicate();
    Value obj = st.getObject();

    try {
      // SUBJECT
View Full Code Here

    if (resultSetNodes.size() != 1) {
      throw new RDFHandlerException("Expected 1 subject of type ResultSet, found: "
          + resultSetNodes.size());
    }

    Resource resultSetNode = resultSetNodes.iterator().next();

    Set<Value> resultValues = model.filter(resultSetNode, BOOLEAN, null).objects();
    if (resultValues.size() != 1) {
      throw new RDFHandlerException("Expected 1 boolean result value, found: " + resultValues.size());
    }
View Full Code Here

    if (resultSetNodes.size() != 1) {
      throw new RDFHandlerException("Expected 1 subject of type ResultSet, found: "
          + resultSetNodes.size());
    }

    Resource resultSetNode = resultSetNodes.iterator().next();

    try {
      List<String> bindingNames = getBindingNames(resultSetNode);
      tqrHandler.startQueryResult(bindingNames);
View Full Code Here

    public long getCardinality(StatementPattern sp)
      throws StoreException
    {
      await();
      Resource subj = (Resource)getConstantValue(sp.getSubjectVar());
      URI pred = (URI)getConstantValue(sp.getPredicateVar());
      Value obj = getConstantValue(sp.getObjectVar());
      Resource context = (Resource)getConstantValue(sp.getContextVar());
      List<Value> key = Arrays.asList(subj, pred, obj, context);
      return cardinalities.get(key).longValue();
    }
View Full Code Here

TOP

Related Classes of org.openrdf.model.Resource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.