Package org.openrdf.model

Examples of org.openrdf.model.Value


    }

    public String objectString()
      throws ModelException
    {
      Value obj = objectValue();
      if (obj == null) {
        return null;
      }
      return obj.stringValue();
    }
View Full Code Here


  public Value getValue(String bindingName) {
    return bindings.get(bindingName);
  }

  public Binding getBinding(String bindingName) {
    Value value = getValue(bindingName);

    if (value != null) {
      return new BindingImpl(bindingName, value);
    }
View Full Code Here

    else if (other instanceof BindingSet) {
      int otherSize = 0;

      // Compare other's bindings to own
      for (Binding binding : (BindingSet)other) {
        Value ownValue = getValue(binding.getName());

        if (!binding.getValue().equals(ownValue)) {
          // Unequal bindings for this name
          return false;
        }
View Full Code Here

      getDelegate().removeMatch(subj, pred, obj, ctx);
      for (RepositoryConnectionListener listener : listeners) {
        for (Statement stmt : list) {
          Resource s = stmt.getSubject();
          URI p = stmt.getPredicate();
          Value o = stmt.getObject();
          Resource c = stmt.getContext();
          listener.remove(this, s, p, o, c);
        }
      }
    }
View Full Code Here

    @Override
    public void handleStatement(Statement st) {
      Resource s = st.getSubject();
      URI p = st.getPredicate();
      Value o = st.getObject();
      super.handleStatement(new StatementImpl(s, p, o, graph));
    }
View Full Code Here

        if (skipSystemRepo && id.equals(SystemRepository.ID)) {
          continue;
        }

        Value uri = bindingSet.getValue("uri");
        String description = LiteralUtil.getLabel(bindingSet.getValue("title"), null);

        if (uri instanceof URI) {
          try {
            repInfo.setLocation(new URL(uri.toString()));
          }
          catch (MalformedURLException e) {
            logger.warn("Server reported malformed repository URL: {}", uri);
          }
        }
View Full Code Here

    // Filters out all partial and invalid matches
    bindingsIter = new FilteringCursor<BindingSet>(bindingsIter) {

      @Override
      protected boolean accept(BindingSet bindingSet) {
        Value context = bindingSet.getValue("context");

        return bindingSet.getValue("subject") instanceof Resource
            && bindingSet.getValue("predicate") instanceof URI
            && bindingSet.getValue("object") instanceof Value
            && (context == null || context instanceof Resource);
      }

      @Override
      public String getName() {
        return "FilterOutPartialMatches";
      }
    };

    // Convert the BindingSet objects to actual RDF statements
    final ValueFactory vf = getConnection().getValueFactory();
    Cursor<Statement> stIter;
    stIter = new ConvertingCursor<BindingSet, Statement>(bindingsIter) {

      @Override
      protected Statement convert(BindingSet bindingSet) {
        Resource subject = (Resource)bindingSet.getValue("subject");
        URI predicate = (URI)bindingSet.getValue("predicate");
        Value object = bindingSet.getValue("object");
        Resource context = (Resource)bindingSet.getValue("context");

        if (context == null) {
          return vf.createStatement(subject, predicate, object);
        }
View Full Code Here

    for (Entry entry : entries) {
      QueryBindingSet sol = new QueryBindingSet(parentBindings);

      for (String name : group.getGroupBindingNames()) {
        Value value = entry.getPrototype().getValue(name);
        if (value != null) {
          // Potentially overwrites bindings from super
          sol.setBinding(name, value);
        }
      }

      for (GroupElem ge : group.getGroupElements()) {
        Value value = processAggregate(strategy, entry.getSolutions(), ge.getOperator());
        if (value != null) {
          // Potentially overwrites bindings from super
          sol.setBinding(ge.getName(), value);
        }
      }
View Full Code Here

    throws StoreException
  {
    Set<Value> valueSet = new HashSet<Value>();

    for (BindingSet s : bindingSets) {
      Value value = strategy.evaluate(arg, s);
      if (value != null) {
        valueSet.add(value);
      }
    }
View Full Code Here

    public Key(Group group, BindingSet bindingSet) {
      this.group = group;
      this.bindingSet = bindingSet;

      for (String name : group.getGroupBindingNames()) {
        Value value = bindingSet.getValue(name);
        if (value != null) {
          this.hash ^= value.hashCode();
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.openrdf.model.Value

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.