Package org.openrdf.model

Examples of org.openrdf.model.Value


    return result;
  }

  private static boolean bindingSetsMatch(BindingSet bs1, BindingSet bs2, Map<BNode, BNode> bNodeMapping) {
    for (Binding binding1 : bs1) {
      Value value1 = binding1.getValue();
      Value value2 = bs2.getValue(binding1.getName());

      if (value1 instanceof BNode && value2 instanceof BNode) {
        BNode mappedBNode = bNodeMapping.get(value1);

        if (mappedBNode != null) {
          // bNode 'value1' was already mapped to some other bNode
          if (!value2.equals(mappedBNode)) {
            // 'value1' and 'value2' do not match
            return false;
          }
        }
        else {
View Full Code Here


  public static boolean bindingSetsCompatible(BindingSet bs1, BindingSet bs2) {
    Set<String> sharedBindings = new HashSet<String>(bs1.getBindingNames());
    sharedBindings.retainAll(bs2.getBindingNames());

    for (String bindingName : sharedBindings) {
      Value value1 = bs1.getValue(bindingName);
      Value value2 = bs2.getValue(bindingName);

      if (!value1.equals(value2)) {
        return false;
      }
    }
View Full Code Here

    throws StoreConfigException
  {
    super.parse(model, implNode);

    try {
      Value server = model.filter(implNode, SERVERURL, null).objectValue();
      Literal id = model.filter(implNode, REPOSITORYID, null).objectLiteral();
      if (server != null && id != null) {
        setURL(server.stringValue() + "/repositories/" + id.stringValue());
      }
      URI uri = model.filter(implNode, REPOSITORYURL, null).objectURI();
      if (uri != null) {
        setURL(uri.toString());
      }
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 (subj.equals(lastWrittenSubject)) {
        if (pred.equals(lastWrittenPredicate)) {
          // Identical subject and predicate
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) {
        writeHeader();
      }
View Full Code Here

   * writeEmptySubject.
   */
  private void writeNodeStartOfStartTag(Node node)
    throws IOException
  {
    Value value = node.getValue();

    if (node.hasType()) {
      // We can use abbreviated syntax
      writeStartOfStartTag(node.getType().getNamespace(), node.getType().getLocalName());
    }
View Full Code Here

    }
    else if (c == '[') {
      subject = parseImplicitBlank();
    }
    else {
      Value value = parseValue();

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

      unread(c2);
    }
    unread(c1);

    // Predicate is a normal resource
    Value predicate = parseValue();
    if (predicate instanceof URI) {
      return (URI)predicate;
    }
    else {
      reportFatalError("Illegal predicate value: " + predicate);
View Full Code Here

      // next character should be another '^'
      verifyCharacter(read(), "^");

      // Read datatype
      Value datatype = parseValue();
      if (datatype instanceof URI) {
        return createLiteral(label, null, (URI)datatype);
      }
      else {
        reportFatalError("Illegal datatype value: " + datatype);
View Full Code Here

    TupleResult contextIDs = client.contexts().list();
    try {
      while (contextIDs.hasNext()) {
        BindingSet bindingSet = contextIDs.next();
        Value context = bindingSet.getValue("contextID");

        if (context instanceof Resource) {
          contextList.add((Resource)context);
        }
      }
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.