Package org.openrdf.model

Examples of org.openrdf.model.Value


      @Override
      public double getCardinality(StatementPattern sp) {
        Resource subj = (Resource)getConstantValue(sp.getSubjectVar());
        URI pred = (URI)getConstantValue(sp.getPredicateVar());
        Value obj = getConstantValue(sp.getObjectVar());
        Resource context = (Resource)getConstantValue(sp.getContextVar());

        // Perform look-ups for value-equivalents of the specified values
        MemResource memSubj = vf.getMemResource(subj);
        MemURI memPred = vf.getMemURI(pred);
View Full Code Here


    if (stmt instanceof RdbmsStatement) {
      return (RdbmsStatement)stmt;
    }
    Resource s = stmt.getSubject();
    URI p = stmt.getPredicate();
    Value o = stmt.getObject();
    Resource c = stmt.getContext();
    return createStatement(s, p, o, c);
  }
View Full Code Here

    int c2 = peek();

    if (c == '<' || TurtleUtil.isPrefixStartChar(c) || (c == ':' && c2 != '-') || (c == '_' && c2 == ':')) {
      unread(c);

      Value value = parseValue();

      if (value instanceof Resource) {
        context = (Resource)value;
      }
      else {
View Full Code Here

      throw new RuntimeException("Document writing has not yet been started");
    }

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

    try {
      if (!headerWritten) {
        header();
      }
      // can only be about baseURI subject
      // can't have nested BNodes in header
      if (inHeader && isAbout(subj)) {
        if (obj instanceof URI) {
          String relativize = relativize(obj.stringValue());
          writer.handleMetaLink(pred, relativize);
          return;
        }
        else if (obj instanceof Literal) {
          writer.handleMetaAttribute(pred, (Literal)obj);
View Full Code Here

      openStartTag(0, topNode.getValue(), topNode.getTypes());
      endTag(0, topNode.getValue(), topNode.getTypes());
    }
    else {
      URI topPredicate = predicateStack.pop();
      Value obj = topNode.getValue();
      int indent = nodeStack.size() * 2 - 1;
      if (obj instanceof URI) {
        String relativize = relativize(obj.stringValue());
        assert topNode.getTypes().isEmpty();
        writer.handleURI(indent, topPredicate, relativize);
      }
      else if (obj instanceof BNode && topNode.getTypes().isEmpty()) {
        writer.handleBlankNode(indent, topPredicate, (BNode)obj);
View Full Code Here

            BindingSet bindingSet = tupleQueryResult.next();
            resultCount++;

            sb.setLength(0);
            for (String bindingName : bindingNames) {
              Value value = bindingSet.getValue(bindingName);
              String valueStr = getStringRepForValue(value, namespaces);

              sb.append("| ").append(valueStr);
              StringUtil.appendN(' ', columnWidth - valueStr.length(), sb);
            }
View Full Code Here

  public void meet(StatementPattern node)
    throws StoreException
  {
    Resource subj = (Resource)node.getSubjectVar().getValue();
    URI pred = (URI)node.getPredicateVar().getValue();
    Value obj = node.getObjectVar().getValue();
    Resource[] ctx = getContexts(node.getContextVar());
    for (RepositoryConnection member : members) {
      if (member.hasMatch(subj, pred, obj, true, ctx)) {
        return;
      }
View Full Code Here

    compiled = null;
    super.setArg(idx, arg);
    ValueExpr patternArg = getPatternArg();
    ValueExpr flagsArg = getFlagsArg();
    if (patternArg instanceof ValueConstant && (flagsArg instanceof ValueConstant || flagsArg == null)) {
      Value pvalue = ((ValueConstant)patternArg).getValue();
      Value fvalue = null;
      if (flagsArg != null) {
        fvalue = ((ValueConstant)flagsArg).getValue();
      }
      compiled = compile(pvalue, fvalue);
    }
View Full Code Here

      int predID = ByteArrayUtil.getInt(nextValue, TripleStore.PRED_IDX);
      URI pred = (URI)valueStore.getValue(predID);

      int objID = ByteArrayUtil.getInt(nextValue, TripleStore.OBJ_IDX);
      Value obj = valueStore.getValue(objID);

      Resource context = null;
      int contextID = ByteArrayUtil.getInt(nextValue, TripleStore.CONTEXT_IDX);
      if (contextID != 0) {
        context = (Resource)valueStore.getValue(contextID);
View Full Code Here

          return;
        }

        Resource subj;
        URI pred;
        Value obj;

        try {
          subj = (Resource)valueList.get(0);
        }
        catch (ClassCastException e) {
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.